Meie XML Schema

From ICO wiki
Revision as of 21:12, 3 April 2012 by Rkalamee (talk | contribs) (Created page with '<source lang="xml"> <?xml version="1.0" encoding="utf-8"?> <xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema…')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search
<?xml version="1.0" encoding="utf-8"?>
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:element name="jaamad">
    <xs:complexType>
      <xs:sequence>
        <xs:element maxOccurs="unbounded" name="jaam">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="nimi" type="xs:string" />
              <xs:element name="asukoht">
                <xs:complexType>
                  <xs:sequence>
                    <xs:element name="laius">
                      <xs:complexType>
                        <xs:attribute name="kraad"  use="required" >
                          <xs:simpleType>
                            <!-- siia võiks panna Eesti laiuskraadide vahemiku, kuid paneme siiski kogu laiuskraadide vahemiku 0-89-->
                          <xs:restriction base="xs:integer">
                            <xs:minInclusive value="0"/>
                            <xs:maxInclusive value="89"/>
                          </xs:restriction>
                          </xs:simpleType>
                        </xs:attribute>
                        <xs:attribute name="minut" >
                        <xs:simpleType>
                          <!-- minutid 0-60 (igaks juhuks +1)-->
                          <xs:restriction base="xs:integer">
                            <xs:minInclusive value="0"/>
                            <xs:maxInclusive value="60"/>
                          </xs:restriction>
                        </xs:simpleType>
                        </xs:attribute>
                        <xs:attribute name="sekund">
                          <xs:simpleType>
                            <!-- sekundid 0-60 (igaks juhuks +1)-->
                            <xs:restriction base="xs:integer">
                              <xs:minInclusive value="0"/>
                              <xs:maxInclusive value="60"/>
                            </xs:restriction>
                          </xs:simpleType>
                        </xs:attribute>
                      </xs:complexType>
                    </xs:element>
                    <xs:element name="pikkus">
                      <xs:complexType>
                        <xs:attribute name="kraad"  use="required" >
                          <xs:simpleType>
                            <!-- siia võiks panna Eesti pikkuskraadide vahemiku, kuid paneme siiski kogu pikkuskraadide vahemiku 0-179-->
                            <xs:restriction base="xs:integer">
                              <xs:minInclusive value="0"/>
                              <xs:maxInclusive value="179"/>
                            </xs:restriction>
                          </xs:simpleType>
                        </xs:attribute>
                        <xs:attribute name="minut" >
                          <xs:simpleType>
                            <!-- minutid 0-60 (igaks juhuks +1)-->
                            <xs:restriction base="xs:integer">
                              <xs:minInclusive value="0"/>
                              <xs:maxInclusive value="60"/>
                            </xs:restriction>
                          </xs:simpleType>
                        </xs:attribute>
                        <xs:attribute name="sekund">
                          <xs:simpleType>
                            <!-- sekundid 0-60 (igaks juhuks +1)-->
                            <xs:restriction base="xs:integer">
                              <xs:minInclusive value="0"/>
                              <xs:maxInclusive value="60"/>
                            </xs:restriction>
                          </xs:simpleType>
                        </xs:attribute>
                      </xs:complexType>
                    </xs:element>
                  </xs:sequence>
                </xs:complexType>
              </xs:element>
              <xs:element name="ilm">
                <xs:complexType>
                  <xs:sequence>
                    <!-- xs:string, sest väärtus võib olla puudu -->
                    <xs:element name="temperatuur" type="xs:string" />
                    <xs:element name="niiskus" type="xs:string" />
                    <xs:element name="tuulekiirus" type="xs:string" />
                    <xs:element name="maxtuulekiirus" type="xs:string" />
                  </xs:sequence>
                </xs:complexType>
              </xs:element>
            </xs:sequence>
            <xs:attribute name="wmocode" type="xs:unsignedInt" />
          </xs:complexType>
        </xs:element>
      </xs:sequence>
      <xs:attribute name="aeg" type="xs:unsignedInt" use="required" />
    </xs:complexType>
  </xs:element>
</xs:schema>