<?xml version="1.0" encoding="UTF-8"?>
<schema
    xmlns="http://www.w3.org/2001/XMLSchema"
    targetNamespace="urn:oasis:names:tc:BTP:1.0:node_state_information"
    xmlns:btst="urn:oasis:names:tc:BTP:1.0:node_state_information"
    xmlns:btpq="urn:oasis:names:tc:BTP:1.0:qualifiers"
    xmlns:btp="urn:oasis:names:tc:BTP:1.0:core"
    elementFormDefault="qualified">

<import namespace="urn:oasis:names:tc:BTP:1.0:qualifiers"/>
<import namespace="urn:oasis:names:tc:BTP:1.0:core"/>


<!--  Main node - information element definition  -->

<element name="node-information">
  <complexType>
   <sequence>

 <element name="date-time" type="dateTime" minOccurs="0"/>

 <element name="role" minOccurs="0">
  <simpleType>
   <restriction base="string">
    <enumeration value="composer"/>
    <enumeration value="coordinator"/>
    <enumeration value="sub-Composer"/>
    <enumeration value="sub-Coordinator"/>
    <enumeration value="participant"/>
   </restriction>
  </simpleType>
 </element>

<element name="own-information">
  <complexType>
   <sequence>
    <element ref="btst:trx-type"/>
    <element name="own-identifier" type="btp:identifier"/>
    <element name="own-address" type="btp:address" minOccurs="1" maxOccurs="unbounded"/>
   </sequence>
  </complexType>
 </element>

 <element name="information-as-inferior" minOccurs="0">
  <complexType>
   <sequence>
    <element ref="btst:trx-type"/>
    <element name="I_state">
     <simpleType>
      <restriction base="string">
       <pattern value="[a-z][0-9]"/>
      </restriction>
     </simpleType>
    </element>
    <element name="superiors-identifier" type="btp:identifier"/>
    <element name="superiors-address" type="btp:address" minOccurs="1" maxOccurs="unbounded"/>
    <element ref="btp:qualifiers" minOccurs="0"/>
   </sequence>
  </complexType>
 </element>

 <element name="information-as-superior" minOccurs="0" maxOccurs="unbounded">
  <complexType>
   <sequence>
    <element name="S_state">
     <simpleType>
      <restriction base="string">
       <pattern value="[A-Z][0-9]"/>
      </restriction>
     </simpleType>
    </element>
    <element name="inferiors-identifier" type="btp:identifier"/>
    <element name="inferiors-address" type="btp:address" minOccurs="1" maxOccurs="unbounded"/>
    <element ref="btp:qualifiers" minOccurs="0"/>
   </sequence>
  </complexType>
 </element>

  </sequence>
 </complexType>
</element>

<!--  Common elements and datatypes  -->

    <element name="trx-type">
     <simpleType>
      <restriction base="string">
       <enumeration value="atom"/>
       <enumeration value="cohesion"/>
      </restriction>
     </simpleType>
    </element>

</schema>

