У меня большие трудности, когда я пытаюсь проверить xml на соответствие моей схеме.Возникает следующая ошибка:
Element 'date': This element is not expected. Expected is ( race ).
Element 'date': This element is not expected. Expected is ( race ).
Element 'date': This element is not expected. Expected is ( race ).
Element 'date': This element is not expected. Expected is ( race ).
Ниже приведена моя схема
<!-- Structure definition -->
<xs:element name="history">
<xs:complexType>
<xs:sequence>
<xs:element ref="period" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="period">
<xs:complexType>
<xs:sequence>
<xs:element ref="date" minOccurs="1" maxOccurs="unbounded"/>
<xs:element ref="track" minOccurs="1" maxOccurs="unbounded"/>
<xs:element ref="race" minOccurs="1" maxOccurs="unbounded"/>
</xs:sequence>
<xs:attribute name="year" type="Tyear"/>
</xs:complexType>
</xs:element>
<xs:element name="date">
<xs:simpleType>
<xs:restriction base="xs:string"/>
</xs:simpleType>
</xs:element>
<xs:element name="track">
<xs:simpleType>
<xs:restriction base="xs:string"/>
</xs:simpleType>
</xs:element>
<xs:element name="race">
<xs:complexType>
<xs:sequence>
<xs:element ref="rider" maxOccurs="unbounded"/>
</xs:sequence>
<xs:attribute name="nr" type="Tracenr"/>
</xs:complexType>
</xs:element>
<xs:element name="rider">
<xs:complexType>
<xs:sequence>
<xs:element ref="place" maxOccurs="1"/>
<xs:element ref="first_name" maxOccurs="1"/>
<xs:element ref="last_name" maxOccurs="1"/>
<xs:element ref="manufacturer" maxOccurs="1"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="place">
<xs:simpleType>
<xs:restriction base="xs:string"/>
</xs:simpleType>
</xs:element>
<xs:element name="first_name">
<xs:simpleType>
<xs:restriction base="xs:string"/>
</xs:simpleType>
</xs:element>
<xs:element name="last_name">
<xs:simpleType>
<xs:restriction base="xs:string"/>
</xs:simpleType>
</xs:element>
<xs:element name="manufacturer">
<xs:simpleType>
<xs:restriction base="xs:string"/>
</xs:simpleType>
</xs:element>
</xs:schema>
И это небольшой снимок моего xml
<history>
<period year="2011">
<date>10/16/2011</date>
<track>Portimao</track>
<race nr="1">
<rider>
<place>1</place>
<first_name>Marco</first_name>
<last_name>Melandri</last_name>
<manufacturer>Yamaha</manufacturer>
</rider>
<rider>
<place>2</place>
<first_name>Eugene</first_name>
<last_name>Laverty</last_name>
<manufacturer>Yamaha</manufacturer>
</rider>
[...]
<rider>
<place>DNF</place>
<first_name>Tom</first_name>
<last_name>Sykes</last_name>
<manufacturer>Kawasaki</manufacturer>
</rider>
</race>
<date>10/16/2011</date>
<track>Portimao</track>
<race nr="2">
<rider>
<place>1</place>
<first_name>Carlos</first_name>
<last_name>Checa</last_name>
<manufacturer>Ducati</manufacturer>
</rider>
<rider>
<place>2</place>
<first_name>Sylvain</first_name>
<last_name>Guintoli</last_name>
<manufacturer>Ducati</manufacturer>
</rider>
[...]
<rider>
<place>15</place>
<first_name>Noriyuki</first_name>
<last_name>Haga</last_name>
<manufacturer>Aprilia</manufacturer>
</rider>
</race>
<date>10/02/2011</date>
<track>Magny-Cours</track>
<race nr="1">
<rider>
<place>1</place>
<first_name>Carlos</first_name>
<last_name>Checa</last_name>
<manufacturer>Ducati</manufacturer>
</rider>
[...]
«Период»повторяется еще 3 раза за предыдущие годы.Спасибо, любезно