Using the XML Schema Infoset Model APIs and adding on to the schema created in
Exercise 3: Create a list simple type, create
a global complex type called "PurchaseOrderType" with a sequence model
group.
<?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>
<list itemType="po:USState"/>
</simpleType>
<complexType name="PurchaseOrderType">
<sequence/>
</complexType>
</schema>
New constructs created in this exercise:
- <complexType> - Global complex type with
name="PurchaseOrderType"
- <sequence> - Model group with compositor set
to "sequence"
Solution:
Exercise 4 solution