<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">

  <!-- These assume 'xlink' is used as the namespace for "http://www.w3.org/1999/xlink" -->
  <!-- These assume 'event' is used as the namespace for "http://www.w3.org/2001/xml-events" -->

  <xsd:attributeGroup name="extendedLinkAttributes">
    <xsd:attribute name="xlink:type"  use="required" fixed="xlink:extended"/>
    <xsd:attribute name="xlink:role"  use="optional" type="xsd:string"/>
    <xsd:attribute name="xlink:title" use="optional" type="xsd:string"/>
  </xsd:attributeGroup>

  <xsd:attributeGroup name="locatorAttributes">
    <xsd:attribute name="xlink:type"  use="required" fixed="xlink:locator"/>
    <xsd:attribute name="xlink:label" use="required" type="xsd:string"/>
    <xsd:attribute name="xlink:href"  use="required" type="xsd:anyURI"/>
    <xsd:attribute name="xlink:role"  use="optional" type="xsd:string"/>
    <xsd:attribute name="xlink:title" use="optional" type="xsd:string"/>
  </xsd:attributeGroup>

  <xsd:attributeGroup name="arcAttributes">
    <xsd:attribute name="xlink:type"     use="required" fixed="xlink:arc"/>
    <xsd:attribute name="xlink:from"     use="required" type="xsd:string"/>
    <xsd:attribute name="xlink:to"       use="required" type="xsd:anyURI"/>
    <xsd:attribute name="xlink:title"    use="optional" type="xsd:string"/>
    <xsd:attribute name="xlink:arcrole"  use="optional" type="xsd:string"/>
  </xsd:attributeGroup>

  <simpleType name="FromToEnumeration">
    <restriction base="string">
      <enumeration value="xlink:to"/>
      <enumeration value="xlink:from"/>
    </restriction>
  </simpleType>

  <element name="arc">
    <complexType>
      <complexContent>
        <sequence>
          <element name="event:listener" minOccurs="0" maxOccurs="unbounded">
            <xsd:attribute name="event"     use="required" type="xsd:string"/>
            <xsd:attribute name="observer"  use="required" type="FromToEnumeration"/>
            <xsd:attribute name="handler"   use="required" type="xsd:string"/>
            <xsd:attribute name="type"      use="required" type="xsd:string"/>
          </element>
        </sequence>
      </complexContent>
    </complexType>
    <attributeGroup ref="arcAttributes"/>
  </element>

  <element name="BinderLinks">
    <all>
      <element name="locator" maxOccurs="unbounded">
        <attributeGroup ref="locatorAttributes"/>
      </element>
      <element ref="arc" maxOccurs="unbounded"/>
    </all>
    <xsd:attribute name="xmlns:event" use="required" fixed="http://www.w3.org/2001/xml-events"/>
    <xsd:attribute name="xmlns:xlink" use="required" fixed="http://www.w3.org/1999/xlink"/>
    <attributeGroup ref="extendedLinkAttributes"/>
  </element>

</schema>


