Using the XML Schema Model APIs and adding on to the schema document created
in Exercise 1: Create a root schema document, create a user-defined simple type called "USState"
that has a primitive base type "string" and
three enumeration facets called "AK","AL", and "AR".
<?xml version="1.0"?>
<schema
targetNamespace="http://www.eclipse.org/xsd/examples/po"
xmlns="http://www.w3.org/2001/XMLSchema"
xmlns:po="http://www.eclipse.org/xsd/examples/po">
<simpleType name="USState">
<restriction base="string">
<enumeration value="AK"/>
<enumeration value="AL"/>
<enumeration value="AR"/>
</restriction>
</simpleType>
</schema>
New constructs created in this exercise:
- <simpleType> - Global simple type with
name="USState"
- <enumeration> - Enumeration facets ("AK","AL", and "AR")
Solution:
Exercise 2 solution