1 <?xml version="1.0" encoding="ISO-8859-1" ?>
   2 <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
   3 
   4 <!-- definition of simple elements -->
   5 <xs:element name="orderperson" type="xs:string"/>
   6 <xs:element name="name" type="xs:string"/>
   7 <xs:element name="address" type="xs:string"/>
   8 <xs:element name="city" type="xs:string"/>
   9 <xs:element name="country" type="xs:string"/>
  10 <xs:element name="title" type="xs:string"/>
  11 <xs:element name="note" type="xs:string"/>
  12 <xs:element name="quantity" type="xs:positiveInteger"/>
  13 <xs:element name="price" type="xs:decimal"/>
  14 
  15 <!-- definition of attributes -->
  16 <xs:attribute name="orderid" type="xs:string"/>
  17 
  18 <!-- definition of complex elements -->
  19 <xs:element name="shipto">
  20 <xs:complexType>
  21 <xs:sequence>
  22 <xs:element ref="name"/>
  23 <xs:element ref="address"/>
  24 <xs:element ref="city"/>
  25 <xs:element ref="country"/>
  26 </xs:sequence>
  27 </xs:complexType>
  28 </xs:element>
  29 <xs:element name="item">
  30 <xs:complexType>
  31 <xs:sequence>
  32 <xs:element ref="title"/>
  33 <xs:element ref="note" minOccurs="0"/>
  34 <xs:element ref="quantity"/>
  35 <xs:element ref="price"/>
  36 </xs:sequence>
  37 </xs:complexType>
  38 </xs:element>
  39 
  40 <xs:element name="shiporder">
  41 <xs:complexType>
  42 <xs:sequence>
  43 <xs:element ref="orderperson"/>
  44 <xs:element ref="shipto"/>
  45 <xs:element ref="item" maxOccurs="unbounded"/>
  46 </xs:sequence>
  47 <xs:attribute ref="orderid" use="required"/>
  48 </xs:complexType>
  49 </xs:element>
  50 
  51 </xs:schema>