0
我是新來的XML和XSD,我一直在試圖驗證這個xsd代碼到一個xml文件,但沒有任何成功。我在下面看到一個錯誤,我看不出有什麼問題。任何幫助將不勝感激。錯誤驗證xsd到#AnonType
s4s-elt-invalid-content.1: '#AnonType_endangered_species'的內容無效。元素「元素」爲 無效,錯位或發生頻率過高。
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:element name="endangered_species">
<xsd:complexType>
<xsd:element name="animal" type="xsd:string" minOccurs="1" maxOccurs="unbounded">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="name" minOccurs="2" maxOccurs="2" type="xs:string">
<xsd:complexType>
<xsd:all>
</xsd:all>
<xsd:attribute ref="language">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:enumeration value="English"/>
<xsd:enumeration value="Latin"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:attribute>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:complexType>
</xsd:element>
</xsd:schema>
非常感謝!這解決了我的問題! – user3517759