<?xml version="1.0" encoding="UTF-8" ?>

<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:element name="extension">
    <xs:complexType>
      <xs:sequence>
        <xs:element type="xs:string" name="id"/>
        <xs:element type="xs:string" name="title"/>
        <xs:element type="xs:string" name="tabinfo" maxOccurs="1" minOccurs="0"/>
        <xs:element type="xs:string" name="desc"/>
        <xs:element type="xs:string" name="icon"/>
        <xs:element name="requirements">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="requirement" maxOccurs="unbounded" minOccurs="0">
                <xs:complexType>
                  <xs:sequence>
                    <xs:element name="key" maxOccurs="unbounded" minOccurs="0">
                      <xs:complexType>
                        <xs:simpleContent>
                          <xs:extension base="xs:string">
                            <xs:attribute type="xs:string" name="path"/>
                          </xs:extension>
                        </xs:simpleContent>
                      </xs:complexType>
                    </xs:element>
                  </xs:sequence>

                  <xs:attribute type="xs:string" name="name" use="required"/>
                  <xs:attribute type="xs:string" name="type" use="required"/>
                  <xs:attribute name="maxOccurs" use="optional">
                    <xs:simpleType>
                      <xs:union memberTypes="xs:unsignedInt unboundedtype" />
                    </xs:simpleType>
                  </xs:attribute>
                  <xs:attribute name="minOccurs" use="optional">
                    <xs:simpleType>
                      <xs:union memberTypes="xs:unsignedInt unboundedtype" />
                    </xs:simpleType>
                  </xs:attribute>
                </xs:complexType>
              </xs:element>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
        <xs:element name="builder" type="xs:string"/>
        <xs:element name="validator" type="xs:string" minOccurs="0" maxOccurs="1" />

        <xs:element name="appConfig">
          <!-- TODO -->
        </xs:element>

      </xs:sequence>
      <xs:attribute type="xs:string" name="implements"/>
    </xs:complexType>

  </xs:element>

  <xs:simpleType name="unboundedtype">
    <xs:restriction base="xs:string">
      <xs:enumeration value="*"/>
    </xs:restriction>
  </xs:simpleType>

</xs:schema>


