XPath over XML Schema: Examples
Home Downloads
Contents
Sample XSD used in examples
Boilerplate
Examples: 1, 2, 3, 4, 5, 6 (more examples in the download).
The Schema File Used in Examples
<schema elementFormDefault="qualified" 
        targetNamespace="http://delivery" 
        xmlns:impl="http://delivery"
        xmlns="http://www.w3.org/2001/XMLSchema"
        xmlns:xs="http://www.w3.org/2001/XMLSchema"
        xmlns:xsd="http://www.w3.org/2001/XMLSchema">
      
  <element name="Address" type="impl:AddressType"/>
 
  <complexType name="AddressType">
    <sequence>
      <element name="Line1" type="xsd:string"/>
      <element name="Line2" type="xsd:string"/>
      <element name="City" type="xsd:string"/>
      <element name="State" type="xsd:string"/>
      <element name="Zip" type="xsd:string"/>
      <element name="ZipExt" type="xsd:string"/>
    </sequence>
  </complexType>

  <element name="Delivery" type="impl:DeliveryType"/>
  
  <complexType name="DeliveryType">
    <sequence>
      <element name="Date" type="xsd:date"/>
      <element name="Time" type="xsd:time"/>
      <element name="Address" type="impl:AddressType"/>
      <element name="DeliveryID" type="xsd:unsignedInt"/>
    </sequence>
  </complexType>

  <element name="Addresses" type="impl:ArrayOfAddress" />
  
  <complexType name="ArrayOfAddress">
    <sequence>
      <element name="Address" type="impl:AddressType" minOccurs="0" maxOccurs="unbounded" />
    </sequence>
  </complexType>

  <element name="Deliveries" type="impl:ArrayOfDelivery" />
  
  <complexType name="ArrayOfDelivery">
    <sequence>
      <element name="Delivery" type="impl:DeliveryType" minOccurs="0" maxOccurs="unbounded" />
    </sequence>
  </complexType>

  <element name="Collection" type="impl:CollectionType" />
  <complexType name="CollectionType">
    <sequence>
      <element name="Addresses" type="impl:ArrayOfAddress" />
      <element name="Deliveries" type="impl:ArrayOfDelivery" />
    </sequence>
  </complexType>

  <element name="ID" type="xsd:unsignedInt" />

</schema>
  
SourceForge.net Logo Hit Counter