]> Wikimedia Canada | Git repositories - eccc_schema.git/blobdiff - bulkschema.xsd
Add missing attributes, allow no day
[eccc_schema.git] / bulkschema.xsd
index bb73eaa48f0cd1492b908b912e4decde4c7a39df..a0326456fb382150c3cd608cd28c4ed96795a8a9 100644 (file)
@@ -1,3 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
 <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
     <xsd:element name="climatedata">
         <xsd:complexType>
                         </xsd:restriction>
                     </xsd:simpleType>
                 </xsd:element>
+                <xsd:element name="stationinformation">
+                    <xsd:complexType>
+                        <xsd:sequence>
+                            <xsd:element name="name" type="xsd:string"/>
+                            <xsd:element name="province" type="xsd:string"/>
+                            <xsd:element name="stationoperator" type="xsd:string" minOccurs="0"/>
+                            <xsd:element name="latitude" type="xsd:float"/>
+                            <xsd:element name="longitude" type="xsd:float"/>
+                            <xsd:element name="elevation">
+                              <xsd:simpleType>
+                                <xsd:union>
+                                  <xsd:simpleType>
+                                    <xsd:restriction base="xsd:float"/>
+                                  </xsd:simpleType>
+                                  <xsd:simpleType>
+                                    <xsd:restriction base="xsd:string">
+                                      <xsd:length value="0"/>
+                                    </xsd:restriction>
+                                  </xsd:simpleType>
+                                </xsd:union>
+                              </xsd:simpleType>
+                            </xsd:element>
+                            <xsd:element name="climate_identifier" type="xsd:string"/>
+                            <xsd:element name="wmo_identifier">
+                              <xsd:simpleType>
+                                <xsd:union>
+                                  <xsd:simpleType>
+                                    <xsd:restriction base="xsd:integer"/>
+                                  </xsd:simpleType>
+                                  <xsd:simpleType>
+                                    <xsd:restriction base="xsd:string">
+                                      <xsd:length value="0"/>
+                                    </xsd:restriction>
+                                  </xsd:simpleType>
+                                </xsd:union>
+                              </xsd:simpleType>
+                            </xsd:element>
+                            <xsd:element name="tc_identifier" type="xsd:string"/>
+                        </xsd:sequence>
+                    </xsd:complexType>
+                </xsd:element>
                 <xsd:element name="legend">
                     <xsd:complexType>
                         <xsd:sequence>
-                            <xsd:element name="flag">
+                          <xsd:element name="flag" maxOccurs="unbounded">
                                 <xsd:complexType>
                                     <xsd:sequence>
                                         <xsd:element name="symbol"/>
                         </xsd:sequence>
                     </xsd:complexType>
                 </xsd:element>
-                <xsd:element name="stationinformation">
-                    <xsd:complexType>
-                        <xsd:sequence>
-                            <xsd:element name="name" type="xsd:string"/>
-                            <xsd:element name="province" type="xsd:string"/>
-                            <xsd:element name="latitude" type="xsd:integer"/>
-                            <xsd:element name="longitude" type="xsd:integer"/>
-                            <xsd:element name="elevation" type="xsd:integer"/>
-                            <xsd:element name="climate_identifier" type="xsd:integer"/>
-                            <xsd:element name="wmo_identifier" type="xsd:integer"/>
-                            <xsd:element name="tc_identifier" type="xsd:string"/>
-                        </xsd:sequence>
-                    </xsd:complexType>
-                </xsd:element>
-                <xsd:element name="stationdata">
+                <xsd:choice>
+                  <xsd:element name="stationdata" maxOccurs="unbounded">
+                      <xsd:complexType>
+                          <xsd:sequence>
+                            <xsd:element name="meanmaxtemp">
+                              <xsd:complexType>
+                                <xsd:simpleContent>
+                                  <xsd:extension base="xsd:string">
+                                    <xsd:attribute name="description" type="xsd:string" use="optional"/>
+                                    <xsd:attribute name="units" type="xsd:string" use="optional"/>
+                                    <xsd:attribute name="flag" type="xsd:string" use="optional"/>
+                                  </xsd:extension>
+                                </xsd:simpleContent>
+                              </xsd:complexType>
+                            </xsd:element>
+                            <xsd:element name="meanmintemp">
+                              <xsd:complexType>
+                                <xsd:simpleContent>
+                                  <xsd:extension base="xsd:string">
+                                    <xsd:attribute name="description" type="xsd:string" use="optional"/>
+                                    <xsd:attribute name="units" type="xsd:string" use="optional"/>
+                                    <xsd:attribute name="flag" type="xsd:string" use="optional"/>
+                                  </xsd:extension>
+                                </xsd:simpleContent>
+                              </xsd:complexType>
+                            </xsd:element>
+                            <xsd:element name="meanmonthtemp">
+                              <xsd:complexType>
+                                <xsd:simpleContent>
+                                  <xsd:extension base="xsd:string">
+                                    <xsd:attribute name="description" type="xsd:string" use="optional"/>
+                                    <xsd:attribute name="units" type="xsd:string" use="optional"/>
+                                    <xsd:attribute name="flag" type="xsd:string" use="optional"/>
+                                  </xsd:extension>
+                                </xsd:simpleContent>
+                              </xsd:complexType>
+                            </xsd:element>
+                            <xsd:element name="extrmaxtemp">
+                              <xsd:complexType>
+                                <xsd:simpleContent>
+                                  <xsd:extension base="xsd:string">
+                                    <xsd:attribute name="description" type="xsd:string" use="optional"/>
+                                    <xsd:attribute name="units" type="xsd:string" use="optional"/>
+                                    <xsd:attribute name="flag" type="xsd:string" use="optional"/>
+                                  </xsd:extension>
+                                </xsd:simpleContent>
+                              </xsd:complexType>
+                            </xsd:element>
+                            <xsd:element name="extrmintemp">
+                              <xsd:complexType>
+                                <xsd:simpleContent>
+                                  <xsd:extension base="xsd:string">
+                                    <xsd:attribute name="description" type="xsd:string" use="optional"/>
+                                    <xsd:attribute name="units" type="xsd:string" use="optional"/>
+                                    <xsd:attribute name="flag" type="xsd:string" use="optional"/>
+                                  </xsd:extension>
+                                </xsd:simpleContent>
+                              </xsd:complexType>
+                            </xsd:element>
+                            <xsd:element name="totrain">
+                              <xsd:complexType>
+                                <xsd:simpleContent>
+                                  <xsd:extension base="xsd:string">
+                                    <xsd:attribute name="description" type="xsd:string" use="optional"/>
+                                    <xsd:attribute name="units" type="xsd:string" use="optional"/>
+                                    <xsd:attribute name="flag" type="xsd:string" use="optional"/>
+                                  </xsd:extension>
+                                </xsd:simpleContent>
+                              </xsd:complexType>
+                            </xsd:element>
+                            <xsd:element name="totsnow">
+                              <xsd:complexType>
+                                <xsd:simpleContent>
+                                  <xsd:extension base="xsd:string">
+                                    <xsd:attribute name="description" type="xsd:string" use="optional"/>
+                                    <xsd:attribute name="units" type="xsd:string" use="optional"/>
+                                    <xsd:attribute name="flag" type="xsd:string" use="optional"/>
+                                  </xsd:extension>
+                                </xsd:simpleContent>
+                              </xsd:complexType>
+                            </xsd:element>
+                            <xsd:element name="snowonground" minOccurs="0">
+                              <xsd:complexType>
+                                <xsd:simpleContent>
+                                  <xsd:extension base="xsd:string">
+                                    <xsd:attribute name="description" type="xsd:string" use="optional"/>
+                                    <xsd:attribute name="units" type="xsd:string" use="optional"/>
+                                    <xsd:attribute name="flag" type="xsd:string" use="optional"/>
+                                  </xsd:extension>
+                                </xsd:simpleContent>
+                              </xsd:complexType>
+                            </xsd:element>
+                            <xsd:element name="totprecip">
+                              <xsd:complexType>
+                                <xsd:simpleContent>
+                                  <xsd:extension base="xsd:string">
+                                    <xsd:attribute name="description" type="xsd:string" use="optional"/>
+                                    <xsd:attribute name="units" type="xsd:string" use="optional"/>
+                                    <xsd:attribute name="flag" type="xsd:string" use="optional"/>
+                                  </xsd:extension>
+                                </xsd:simpleContent>
+                              </xsd:complexType>
+                            </xsd:element>
+                            <xsd:element name="grndsnowlastday">
+                              <xsd:complexType>
+                                <xsd:simpleContent>
+                                  <xsd:extension base="xsd:string">
+                                    <xsd:attribute name="description" type="xsd:string" use="optional"/>
+                                    <xsd:attribute name="units" type="xsd:string" use="optional"/>
+                                    <xsd:attribute name="flag" type="xsd:string" use="optional"/>
+                                  </xsd:extension>
+                                </xsd:simpleContent>
+                              </xsd:complexType>
+                            </xsd:element>
+                            <xsd:element name="dirmaxgust">
+                              <xsd:complexType>
+                                <xsd:simpleContent>
+                                  <xsd:extension base="xsd:string">
+                                    <xsd:attribute name="description" type="xsd:string" use="optional"/>
+                                    <xsd:attribute name="units" type="xsd:string" use="optional"/>
+                                    <xsd:attribute name="flag" type="xsd:string" use="optional"/>
+                                  </xsd:extension>
+                                </xsd:simpleContent>
+                              </xsd:complexType>
+                            </xsd:element>
+                            <xsd:element name="speedmaxgust">
+                              <xsd:complexType>
+                                <xsd:simpleContent>
+                                  <xsd:extension base="xsd:string">
+                                    <xsd:attribute name="description" type="xsd:string" use="optional"/>
+                                    <xsd:attribute name="units" type="xsd:string" use="optional"/>
+                                    <xsd:attribute name="flag" type="xsd:string" use="optional"/>
+                                  </xsd:extension>
+                                </xsd:simpleContent>
+                              </xsd:complexType>
+                            </xsd:element>
+                          </xsd:sequence>
+                          <xsd:attribute name="day" type="xsd:string" use="optional"/>
+                          <xsd:attribute name="month" type="xsd:string" use="required"/>
+                          <xsd:attribute name="year" type="xsd:string" use="required"/>
+                      </xsd:complexType>
+                  </xsd:element>
+                  <xsd:element name="month" maxOccurs="unbounded">
                     <xsd:complexType>
-                        <xsd:sequence>
-                            <xsd:element name="meanmaxtemp" type="xsd:string"/>
-                            <xsd:element name="meanmintemp" type="xsd:string"/>
-                            <xsd:element name="meanmonthtemp" type="xsd:string"/>
-                            <xsd:element name="extrmaxtemp" type="xsd:string"/>
-                            <xsd:element name="extrmintemp" type="xsd:string"/>
-                            <xsd:element name="totrain" type="xsd:string"/>
-                            <xsd:element name="totsnow" type="xsd:string"/>
-                            <xsd:element name="snowonground" type="xsd:string"/>
-                            <xsd:element name="totprecip" type="xsd:string"/>
-                            <xsd:element name="grndsnowlastday" type="xsd:string"/>
-                            <xsd:element name="dirmaxgust" type="xsd:string"/>
-                            <xsd:element name="speedmaxgust" type="xsd:string"/>
-                        </xsd:sequence>
-                        <xsd:attribute name="day" type="xsd:string" use="required"/>
-                        <xsd:attribute name="month" type="xsd:string" use="required"/>
-                        <xsd:attribute name="year" type="xsd:string" use="required"/>
+                      <xsd:sequence>
+                        <xsd:element name="day" minOccurs="0" maxOccurs="unbounded">
+                          <xsd:complexType>
+                            <xsd:sequence>
+                              <xsd:element name="temperature" maxOccurs="unbounded">
+                                <xsd:complexType>
+                                  <xsd:simpleContent>
+                                    <xsd:extension base="xsd:string">
+                                      <xsd:attribute name="class" type="xsd:string" use="optional"/>
+                                      <xsd:attribute name="units" type="xsd:string" use="optional"/>
+                                      <xsd:attribute name="unitType" type="xsd:string" use="optional"/>
+                                      <xsd:attribute name="year" type="xsd:string" use="optional"/>
+                                      <xsd:attribute name="period" type="xsd:string" use="optional"/>
+                                      <xsd:attribute name="quality" type="xsd:string" use="optional"/>
+                                    </xsd:extension>
+                                  </xsd:simpleContent>
+                                </xsd:complexType>
+                              </xsd:element>
+                              <xsd:element name="precipitation" maxOccurs="unbounded">
+                                <xsd:complexType>
+                                  <xsd:simpleContent>
+                                    <xsd:extension base="xsd:string">
+                                      <xsd:attribute name="class" type="xsd:string" use="optional"/>
+                                      <xsd:attribute name="units" type="xsd:string" use="optional"/>
+                                      <xsd:attribute name="unitType" type="xsd:string" use="optional"/>
+                                      <xsd:attribute name="year" type="xsd:string" use="optional"/>
+                                      <xsd:attribute name="period" type="xsd:string" use="optional"/>
+                                      <xsd:attribute name="quality" type="xsd:string" use="optional"/>
+                                    </xsd:extension>
+                                  </xsd:simpleContent>
+                                </xsd:complexType>
+                              </xsd:element>
+                              <xsd:element name="pop">
+                                <xsd:complexType>
+                                  <xsd:simpleContent>
+                                    <xsd:extension base="xsd:string">
+                                      <xsd:attribute name="units" type="xsd:string" use="optional"/>
+                                    </xsd:extension>
+                                  </xsd:simpleContent>
+                                </xsd:complexType>
+                              </xsd:element>
+                            </xsd:sequence>
+                            <xsd:attribute name="index" type="xsd:integer" use="required"/>
+                          </xsd:complexType>
+                        </xsd:element>
+                      </xsd:sequence>
+                      <xsd:attribute name="index" type="xsd:integer" use="required"/>
                     </xsd:complexType>
-                </xsd:element>
+                  </xsd:element>
+                </xsd:choice>
             </xsd:sequence>
         </xsd:complexType>
     </xsd:element>
-</xsd:schema>
\ No newline at end of file
+</xsd:schema>