2 <xsd:schema xmlns:
xsd=
"http://www.w3.org/2001/XMLSchema"
3 xmlns:
po=
"http://www.example.com/PO1"
4 targetNamespace=
"http://www.example.com/PO1"
5 elementFormDefault=
"unqualified"
6 attributeFormDefault=
"unqualified">
8 <xsd:documentation xml:
lang=
"en">
9 Purchase order schema for Example.com.
10 Copyright
2000 Example.com. All rights reserved.
13 <xsd:element name=
"purchaseOrder" type=
"po:PurchaseOrderType"/>
14 <xsd:element name=
"comment" type=
"xsd:string"/>
15 <xsd:complexType name=
"PurchaseOrderType">
17 <xsd:element name=
"shipTo" type=
"po:USAddress"/>
18 <xsd:element name=
"billTo" type=
"po:USAddress"/>
19 <xsd:element ref=
"po:comment" minOccurs=
"0"/>
20 <xsd:element name=
"items" type=
"po:Items"/>
22 <xsd:attribute name=
"orderDate" type=
"xsd:date"/>
24 <xsd:complexType name=
"USAddress">
26 <xsd:element name=
"name" type=
"xsd:string"/>
27 <xsd:element name=
"street" type=
"xsd:string"/>
28 <xsd:element name=
"city" type=
"xsd:string"/>
29 <xsd:element name=
"state" type=
"xsd:string"/>
30 <xsd:element name=
"zip" type=
"xsd:decimal"/>
32 <xsd:attribute name=
"country" type=
"xsd:NMTOKEN" fixed=
"US"/>
34 <xsd:complexType name=
"Items">
36 <xsd:element name=
"item" minOccurs=
"0" maxOccurs=
"unbounded">
39 <xsd:element name=
"productName" type=
"xsd:string"/>
40 <xsd:element name=
"quantity">
42 <xsd:restriction base=
"xsd:positiveInteger">
43 <xsd:maxExclusive value=
"100"/>
47 <xsd:element name=
"USPrice" type=
"xsd:decimal"/>
48 <xsd:element ref=
"po:comment" minOccurs=
"0"/>
49 <xsd:element name=
"shipDate" type=
"xsd:date" minOccurs=
"0"/>
51 <xsd:attribute name=
"partNum" type=
"po:SKU" use=
"required"/>
56 <!-- Stock Keeping Unit, a code for identifying products -->
57 <xsd:simpleType name=
"SKU">
58 <xsd:restriction base=
"xsd:string">
59 <xsd:pattern value=
"\d{3}-[A-Z]{2}"/>