Я получаю эту ошибку:
Содержимое 'sequence' должно соответствовать аннотации ?, (элемент | group | choice | sequence | any) *). Проблема была найдена, начиная с: simpleType. В xsd должен быть включен пример с именем simpleType.
Я пытался включить этот пример, но не могу понять, что я делаю неправильно.
Это мой XML:
<?xml version="1.0" encoding="UTF-8"?>
<famous_landmarks>
<landmark>
<name language="English">St Basil's Cathedral</name>
<name language="Russian">собо́р Васи́лия Блаже́нного</name>
<location>Moscow, Russia</location>
<height unit="feet">156</height>
<year_built>1561</year_built>
</landmark>
<landmark>
<name language="English">St Peter's Cathedral</name>
<name language="Latin">Basilica Sancti Petri</name>
<location>Vatican City</location>
<!-- It is an independent city-state enclaved within Rome, Italy -->
<height unit="feet">448</height>
<year_built>1626</year_built>
</landmark>
<landmark>
<name language="English">Christ the Redeemer</name>
<name language="Portuguese">Cristo Redentor</name>
<location>Rio de Janeiro, Brazil</location>
<height unit="feet">125</height>
<year_built>1931</year_built>
</landmark>
<landmark>
<name language="English">Hagia Sophia</name>
<name language="Greek">Αγία Σοφία</name>
<!-- Originally a cathedral, it was converted into a mosque and then a museum -->
<location>Istanbul, Turkey</location>
<height unit="feet">180</height>
<year_built>537</year_built>
<image file="hagiasophia.png"/>
</landmark>
<landmark>
<name language="English">Brandenburg Gate</name>
<name language="German">Brandenburger Tor</name>
<location>Berlin, Germany</location>
<height unit="feet">85</height>
<year_built>1791</year_built>
</landmark>
<landmark>
<name language="English">Neuschwanstein Castle</name>
<name language="German">Schloss Neuschwanstein</name>
<location>Hohenschwangau, Germany</location>
<height unit="feet">213</height>
<year_built>1886</year_built>
</landmark>
<landmark>
<name language="English">Dome of the Rock</name>
<name language="Arabic">Qubbat al-Sakhrahة</name>
<location>Jerusalem, Israel</location>
<height unit="feet">115</height>
<year_built>692</year_built>
</landmark>
<landmark>
<name language="English">Statue of Liberty</name>
<location>New York City, United States</location>
<height unit="feet">305</height>
<year_built>1886</year_built>
</landmark>
<landmark>
<name language="English">Big Ben</name>
<location>London, England</location>
<height unit="feet">315</height>
<year_built>1859</year_built>
</landmark>
<landmark>
<name language="English"> Angel of Independence</name>
<name language="Spanish">Monumento a la Independencia</name>
<location>Mexico City, Mexico</location>
<height unit="feet">148</height>
<year_built>1910</year_built>
</landmark>
</famous_landmarks>
Это мой xsd:
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="www.famouslandmarks.com" targetNamespace="www.famouslandmarks.com">
<xs:element name="famous_landmarks">
<!--feature 2: complex type element containing child elements-->
<xs:complexType>
<xs:sequence>
<xs:element name="name">
<xs:complexType>
<!--feature 6: required attribute-->
<xs:attribute name="language" use="required">
<xs:simpleType>
<xs:restriction base="xs:string">
<!--feature 8: specification of a set of acceptable values-->
<xs:enumeration value="English" />
<xs:enumeration value="Arabic" />
<xs:enumeration value="German" />
<xs:enumeration value="Greek" />
<xs:enumeration value="Latin" />
<xs:enumeration value="Portuguese" />
<xs:enumeration value="Russian" />
<xs:enumeration value="Spanish" />
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:complexType>
</xs:element>
<!--feature 3: named custom simple type-->
<xs:simpleType name="location_type">
<xs:restriction base="xs:string" />
</xs:simpleType>
<xs:element name="location" type="location_type" />
<!--feature 9: specification of minimum and maximum number of occurrences-->
<xs:element name="height" minOccurs="1" maxOccurs="1">
<xs:simpleType>
<!--feature 4: non-string data type-->
<xs:restriction base="xs:integer">
<!--feature 7: range of acceptable values-->
<xs:minInclusive value="0" />
<xs:maxInclusive value="448" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<!--feature 1: simple type element -->
<xs:element name="year_built" type="xs:gYear" />
<!--feature 5: "fixed" attribute-->
<xs:element name="era" type="xs:string" fixed="AD" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
Я в своем уме и буду признателен за любую помощь.