<xs:schema 
  xmlns:xs="http://www.w3.org/2001/XMLSchema"
  xmlns:gen="http://xmlns.redhat.com/core/bebop/generator/1.0"
  xmlns="http://xmlns.redhat.com/atoz/1.0"
  elementFormDefault="qualified" 
  targetNamespace="http://xmlns.redhat.com/atoz/1.0">

  <xs:element name="atoz">
    <xs:annotation>
      <xs:documentation xml:lang="en">
        The AtoZ provides a pluggable letter paginated
        listing of topics and optionally items with a
        topic
      </xs:documentation>

      <xs:appinfo>
        <gen:class>com.arsdigita.london.atoz.ui.AtoZPane</gen:class>
      </xs:appinfo>
    </xs:annotation>

    <xs:complexType>
      <xs:sequence>
        <xs:element name="letter" minOccurs="26" maxOccurs="26">
          <xs:complexType>
            <xs:attribute name="isSelected" type="xs:boolean"/>
          </xs:complexType>
        </xs:element>
        <xs:element name="provider" type="provider" minOccurs="0" maxOccurs="unbounded"/>
      </sequence>
    </xs:complexType>
  </xs:element>

  <xs:complexType name="entryList">
    <xs:annotation>
      <xs:documentation xml:lang="en">
        This type is a base for an element containing
        child entries, either topics or items.
      </xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:choice>
        <xs:element name="atomicEntry" type="atomicEntry"/>
        <xs:element name="compoundEntry" type="compoundEntry"/>
      </xs:choice>.
    </xs:sequence>
  </xs:complexType>

  <xs:complexType name="provider">
    <xs:annotation>
      <xs:documentation xml:lang="en">
        A provider is a module which generates A-Z entries.
        A category provider may generate a list of items
        corresponding to navigation categories.
      </xs:documentation>
    </xs:annotation>
    <xs:extension base="entryList">
      <xs:attribute name="title" type="xs:string"/>
      <xs:attribute name="description" type="xs:string" use="optional"/>
    </xs:extension>
  </xs:complexType>

  <xs:complexType name="atomicEntry">
    <xs:annotation>
      <xs:documentation xml:lang="en">
        An atomic entry is a leaf-node in the A-Z, representing
        a single item (or page of content) in the A-Z. As such
        it has a URL pointing to the location of the item.
      </xs:documentation>
    </xs:annotation>
    <xs:attribute name="title" type="xs:string"/>
    <xs:attribute name="description" type="xs:string" use="optional"/>
    <xs:attribute name="url" type="xs:anyURI"/>
    <xs:element name="siteProxyContent" minOccurs="0" maxOccurs="1">
      <xs:complexType>
        <xs:attribute name="title" type="xs:string" use="required"/>
        <xs:attribute name="dataType" type="xs:string"/>
        <xs:attribute name="oid" type="xs:string"/>
        <xs:any processContents="skip"/>
      </xs:complexType>
    </xs:element>
  </xs:complexType>

  <xs:complexType name="compoundEntry">
    <xs:annotation>
      <xs:documentation xml:lang="en">
        A compound entry can be thought of as a topic, 
        with a title and description. It will contain
        a number of child entries, representing either
        sub-topics or items.
      </xs:documentation>
    </xs:annotation>
    <xs:extension base="entryList">
      <xs:attribute name="title" type="xs:string"/>
      <xs:attribute name="description" type="xs:string" use="optional"/>
    </xs:extension>
  </xs:complexType>

</xs:schema>
