]> Wikimedia Canada | Git repositories - eccc_schema.git/commitdiff
Fix the schema to validate all the monthly files
authorPierre Choffet <peuc@wanadoo.fr>
Wed, 23 Oct 2019 23:48:15 +0000 (19:48 -0400)
committerPierre Choffet <peuc@wanadoo.fr>
Thu, 24 Oct 2019 01:50:56 +0000 (21:50 -0400)
The monthly files however have wrong namespace declaration at its root. Fixing this is beyond the scope of this repo. See eccc_to_commons for this.

bulkschema.xsd

index bb73eaa48f0cd1492b908b912e4decde4c7a39df..ccc463335650e268b3eaac8b5197270153390298 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:element name="stationdata" 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: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="required"/>
+                        <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:sequence>
         </xsd:complexType>
     </xsd:element>
-</xsd:schema>
\ No newline at end of file
+</xsd:schema>