Skip to content

Instantly share code, notes, and snippets.

@CGA1123
Created March 29, 2016 17:42
Show Gist options
  • Save CGA1123/44712d794dac1cc9f793c417bbe6ee02 to your computer and use it in GitHub Desktop.
Save CGA1123/44712d794dac1cc9f793c417bbe6ee02 to your computer and use it in GitHub Desktop.
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="deliveries">
<xs:complexType>
<xs:sequence>
<xs:element name="customers">
<xs:complexType>
<xs:sequence>
<xs:element name="customer" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="mainAddress">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="100" />
<xs:minLength value="10" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="postCode">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="10" />
<xs:minLength value="6" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="phoneNumber">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="11" />
<xs:minLength value="9" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="email">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="50" />
<xs:minLength value="2" />
</xs:restriction>
</xs:simpleType>
</xs:element>
</xs:sequence>
<xs:attribute type="xs:integer" name="id" use="required"/>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="consumerCustomers">
<xs:complexType>
<xs:sequence>
<xs:element name="consumerCustomer" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="firstName">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="20" />
<xs:minLength value="2" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="lastName">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="20" />
<xs:minLength value="2" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="customerRef" type="xs:integer"></xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="payments">
<xs:complexType>
<xs:sequence>
<xs:element name="payment" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="subTotal">
<xs:simpleType>
<xs:restriction base="xs:decimal">
<xs:fractionDigits value="2" />
<xs:minInclusive value="0" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="tax">
<xs:simpleType>
<xs:restriction base="xs:integer">
<xs:maxInclusive value="100" />
<xs:minInclusive value="0" />
</xs:restriction>
</xs:simpleType>
</xs:element>
</xs:sequence>
<xs:attribute type="xs:string" name="id" use="required"/>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="packages">
<xs:complexType>
<xs:sequence>
<xs:element name="package" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="pickUpAddr">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="100" />
<xs:minLength value="10" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="pickUpPostCode">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="10" />
<xs:minLength value="6" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="deliveryAddr">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="100" />
<xs:minLength value="10" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="deliveryPostCode">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="10" />
<xs:minLength value="6" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="deliveryType">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="Standard"/>
<xs:enumeration value="Express"/>
<xs:enumeration value="Next Day"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="weight">
<xs:simpleType>
<xs:restriction base="xs:decimal">
<xs:fractionDigits value="2" />
<xs:maxInclusive value="100" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="dateTimePickedUp">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:pattern value="\d{1,2}\/\d{1,2}\/\d{4}\s\d{1,2}:\d{1,2}:\d{1,2}"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="dateTimeDelivery">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:pattern value="\d{1,2}\/\d{1,2}\/\d{4}\s\d{1,2}:\d{1,2}:\d{1,2}"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="customerRef" type="xs:int"></xs:element>
<xs:element name="paymentRef" type="xs:string"></xs:element>
</xs:sequence>
<xs:attribute type="xs:string" name="id" use="required"/>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment