Using the XML Schema Model APIs and adding on to the schema created in Exercise 2: Create an atomic simple type with enumeration facets, create
a user-defined simple type called "USStateList" that has a item type "USState",
which was
created in the previous exercise.
<?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>
<simpleType name="USStateList">
<list itemType="po:USState"/>
</simpleType>
</schema>
New constructs created in this exercise:
- <simpleType> - global list simple type with
name="USStateList" and itemType="po:USState"
Solution:
Exercise 3 solution