<xs:schema
  xmlns='uri:colorer:custom'
  targetNamespace='uri:colorer:custom'
  xmlns:xs='http://www.w3.org/2001/XMLSchema'
  xmlns:hrc="http://colorer.sf.net/2003/hrc">

 <xs:annotation>
  <xs:documentation>
    This is the XML Schema for custom description format of
    xsd2hrc.xsl transformer. It simply defines few elements and
    imports Colorer HRC language namespace to make life better
    Cail Lomecb (cail@nm.ru)
  </xs:documentation>
 </xs:annotation>

  <xs:import namespace="http://colorer.sf.net/2003/hrc" schemaLocation="../../../doc/2003/hrc.xsd"/>

  <xs:element name="custom">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="custom-type" type="custom-type-Type" minOccurs="0" maxOccurs="unbounded"/>
<!--        <xs:element name="re-patterns" type="patterns-Type"/>
        <xs:element name="enum-patterns" type="patterns-Type"/>-->
      </xs:sequence>
    </xs:complexType>
  </xs:element>

  <xs:complexType name="custom-type-Type">
    <xs:sequence>
      <xs:element name="prefix" type="xs:NCName" minOccurs="0" maxOccurs="unbounded"/>
      <xs:element name="empty-prefix" minOccurs="0">
        <xs:complexType/>
      </xs:element>
      <xs:element name="any-prefix" minOccurs="0">
        <xs:complexType/>
      </xs:element>
      <xs:element name="contributors" type="xs:string"/>
      <xs:element name="top-level" minOccurs="0">
        <xs:complexType>
          <xs:choice maxOccurs="unbounded">
            <xs:element name="element" type="xs:NCName"/>
            <xs:element name="group" type="xs:NCName"/>
          </xs:choice>
        </xs:complexType>
      </xs:element>
      <xs:element name="outline" minOccurs="0">
        <xs:complexType>
          <xs:sequence maxOccurs="unbounded">
            <xs:element name="element">
              <xs:complexType>
                <xs:attribute name='name' type='xs:NCName'/>
                <xs:attribute name='extract'>
                  <xs:simpleType>
                    <xs:restriction base='xs:string'>
                      <xs:enumeration value='attributeValue'/>
                      <xs:enumeration value='withAttribute'/>
                      <xs:enumeration value='fullElement'/>
                      <xs:enumeration value='tillNext'/>
                    </xs:restriction>
                  </xs:simpleType>
                </xs:attribute>
                <xs:attribute name='description' type='xs:string'/>
              </xs:complexType>
            </xs:element>
          </xs:sequence>
        </xs:complexType>
      </xs:element>
      <xs:element name="type" type="hrc:type"/>
    </xs:sequence>
    <xs:attribute name="targetNamespace" type="xs:anyURI"/>
  </xs:complexType>

  <xs:complexType name="patterns-Type">
    <xs:sequence minOccurs="0" maxOccurs="unbounded">
      <xs:element name="match">
        <xs:complexType>
          <xs:attribute name="token" type="xs:token"/>
          <xs:attribute name="subst" type="xs:string"/>
        </xs:complexType>
      </xs:element>
    </xs:sequence>
  </xs:complexType>

</xs:schema>
