<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema"
  targetNamespace="schema:Pos_0710_identity_constraint_definition_schema_components_003"
  xmlns:ns="schema:Pos_0710_identity_constraint_definition_schema_components_003">
  <complexType name="unitInventory">
    <sequence>
      <element name="item" minOccurs="0" maxOccurs="unbounded">
        <complexType>
          <attribute name="itemId" type="integer"/>
        </complexType>
      </element>
    </sequence>
    <attribute name="unitRef" type="integer"/>
  </complexType>

  <complexType name="unitDescription">
    <sequence>
      <element name="desc" type="string" />
    </sequence>
    <attribute name="unitId" type="integer"/>
  </complexType>

  <element name="MyType">
    <complexType>
      <sequence>
        <element name="unitInventory" type="ns:unitInventory" minOccurs="0" maxOccurs="unbounded" />
        <element name="unitDesc" type="ns:unitDescription" minOccurs="0" maxOccurs="unbounded"/>
      </sequence>
    </complexType>
    <key name="unitKey">
      <selector xpath="ns:unitDesc"/>
      <field xpath="@unitId"/>
    </key>
    <keyref name="myKeyRef" refer="ns:unitKey">
      <selector xpath="ns:unitInventory"/>
      <field xpath="@unitRef"/>
    </keyref>
  </element>  
</schema>
