| <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" |
| xmlns:tns="http://tempuri.org/PurchaseOrderSchema.xsd" |
| targetNamespace="http://tempuri.org/PurchaseOrderSchema.xsd" |
| elementFormDefault="qualified"> |
| |
| <!-- example of global simple type element --> |
| <xsd:element name='comment' type='xsd:string'/> |
| |
| <!-- example of complex type with ONLY attributes --> |
| <xsd:element name='infoType'> |
| <xsd:complexType> |
| <xsd:attribute name="kind"> |
| <xsd:simpleType> |
| <xsd:restriction base="xsd:token"> |
| <xsd:enumeration value="byte"/> |
| <xsd:enumeration value="bit"/> |
| </xsd:restriction> |
| </xsd:simpleType> |
| </xsd:attribute> |
| </xsd:complexType> |
| </xsd:element> |
| |
| <xsd:element name='purchaseOrder' type='tns:PurchaseOrderType'/> |
| |
| <!-- global attribute and attributeGroups are ignored unless referenced from within |
| an element declaration --> |
| |
| <xsd:attribute name="aGlobalAttribute" type="xsd:string"/> |
| |
| <xsd:complexType name='USAddress'> |
| <xsd:annotation> |
| <xsd:documentation> |
| Purchase order schema for Example.Microsoft.com. |
| </xsd:documentation> |
| </xsd:annotation> |
| <xsd:sequence> |
| <xsd:element name='name' type='xsd:string'/> |
| <xsd:element name='street' type='xsd:string'/> |
| <xsd:element name='city' type='xsd:string'/> |
| <xsd:element name='state' type='xsd:string'/> |
| <xsd:element name='zip' type='xsd:decimal'/> |
| </xsd:sequence> |
| <xsd:attribute name='country' type='xsd:NMTOKEN' fixed='US'/> |
| </xsd:complexType> |
| |
| <xsd:simpleType name='SKU'> |
| <xsd:restriction base='xsd:string'> |
| <xsd:pattern value='\d{3}\w{3}'/> |
| </xsd:restriction> |
| </xsd:simpleType> |
| |
| <xsd:complexType name='Items'> |
| <xsd:sequence> |
| <xsd:element name='item' minOccurs='0' maxOccurs='unbounded'> |
| <xsd:complexType> |
| <xsd:sequence> |
| <xsd:element name='productName' type='xsd:string'/> |
| <xsd:element name='quantity'> |
| <xsd:simpleType> |
| <xsd:restriction base='xsd:positiveInteger'> |
| <xsd:minInclusive value='1'/> |
| <xsd:maxExclusive value='100'/> |
| </xsd:restriction> |
| </xsd:simpleType> |
| </xsd:element> |
| <xsd:element name='USPrice' type='xsd:decimal'/> |
| <xsd:element ref='tns:comment'/> |
| <xsd:element name='shipDate' type='xsd:date' minOccurs='0'/> |
| </xsd:sequence> |
| <xsd:attribute name='partNum' type='tns:SKU'/> |
| </xsd:complexType> |
| </xsd:element> |
| </xsd:sequence> |
| </xsd:complexType> |
| |
| <xsd:complexType name='PurchaseOrderType'> |
| <xsd:sequence> |
| <xsd:element name='shipTo' type='tns:USAddress'/> |
| <xsd:element name='billTo' type='tns:USAddress'/> |
| <xsd:element ref='tns:comment' minOccurs='0'/> |
| <xsd:element name='items' type='tns:Items'/> |
| </xsd:sequence> |
| <xsd:attributeGroup ref="tns:dates"/> |
| </xsd:complexType> |
| |
| <xsd:attributeGroup name="dates"> |
| <xsd:attribute name='orderDate' type='xsd:date'/> |
| <xsd:attribute name='confirmDate' type='xsd:date' use='required'/> |
| </xsd:attributeGroup> |
| </xsd:schema> |