Java Reference
In-Depth Information
Using Schema Enumerations
Problem
You want your schema to define a limited set of known values usable for an element.
Solution
Use an XML Schema enumeration type.
Here is an example using U.S.:
<xs:simpleType name="USState">
<xs:restriction base="xs:string">
<xs:length value="2" />
<xs:enumeration value="AL" />
<xs:enumeration value="AK" />
<xs:enumeration value="AR" />
<xs:enumeration value="AZ" />
...
</xsd:restriction>
</xsd:simpleType>
Only the characters indicated by the enumeration instances will pass validation in a document
instance.
Search WWH ::




Custom Search