
172 • XML & Related Technologies
4.5.2 Facets
A facet allows us to specify more restrictions than what a basic type allows.
For example, to restrict the publishing year so that the books must be published in or after 1970, we can
use a facet called as minInclusive. The minInclusive facet specifies the minimum value that an element can
have. The resulting restriction is shown in Figure 4.33.
<xsd:simpleType name = “publishingYear”>
<xsd:restriction base = “xsd:gYear”>
<xsd:minInclusive value = “1970”/>
</xsd:restriction>
<xsd:simpleType>
Figure 4.33 Example of restriction
Now, 1970, 1971… 2006 are all examples of a legal book publishing year. But ...