<?xml version="1.0" encoding="utf-8"?>
<!--
  
  relax ng schema in compact syntax; this cannot be used within libxml but
  was used to write the schema as it's easier to understand
  
-->
<grammar xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://relaxng.org/ns/structure/1.0">
  <start>
    <ref name="shiporderType"/>
  </start>
  <define name="shiporderType">
    <element name="shiporder">
      <attribute name="orderid"/>
      <attribute name="xsi:noNamespaceSchemaLocation"/>
      <ref name="orderperson"/>
      <ref name="shipto"/>
      <zeroOrMore>
        <ref name="item"/>
      </zeroOrMore>
    </element>
  </define>
  <define name="orderperson">
    <element name="orderperson">
      <text/>
    </element>
  </define>
  <define name="shipto">
    <element name="shipto">
      <ref name="name"/>
      <ref name="address"/>
      <ref name="city"/>
      <ref name="country"/>
    </element>
  </define>
  <define name="name">
    <element name="name">
      <text/>
    </element>
  </define>
  <define name="address">
    <element name="address">
      <text/>
    </element>
  </define>
  <define name="city">
    <element name="city">
      <text/>
    </element>
  </define>
  <define name="country">
    <element name="country">
      <text/>
    </element>
  </define>
  <define name="item">
    <element name="item">
      <ref name="title"/>
      <optional>
        <ref name="note"/>
      </optional>
      <ref name="quantity"/>
      <ref name="price"/>
    </element>
  </define>
  <define name="title">
    <element name="title">
      <text/>
    </element>
  </define>
  <define name="note">
    <element name="note">
      <text/>
    </element>
  </define>
  <define name="quantity">
    <element name="quantity">
      <text/>
    </element>
  </define>
  <define name="price">
    <element name="price">
      <text/>
    </element>
  </define>
</grammar>
