[英]The element type "tag" must be terminated by the matching end-tag "</tag>"
[英]"xs:element" must be terminated by the matching end-tag "</xs:element>" i can´t find error
XML 通過 xsd 驗證給我這個錯誤,但我無法找到我的標簽錯誤在哪里。 我已經通過 xsd 並且所有標簽對我來說看起來都不錯。 所有實體似乎都已關閉,所以我不明白為什么序列的結束標簽會出錯。
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="pokemon">
<xs:complexType>
<xs:attribute name="id" type="xs:integer"/>
<xs:sequence>
<xs:element name="nombre">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="10"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="codigo">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:pattern value="[PK\-] [000-151]"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="foto" type="anyURI"/>
<xs:element name="color" type="xs:string"/>
<xs:element name="tipo">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="Planta/Veneno"/>
<xs:enumeration value="Fuego"/>
<xs:enumeration value="Fuego/Volador"/>
<xs:enumeration vaule="Agua"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="fuerza">
<xs:simpleType>
<xs:restriction base="xs:integer">
<xs:pattern value="[0-1000]{4}"/>
</xs:restriction>
</xs:simpleType>
<xs:element name="comentario">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="50"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
碰巧的是,StackOverflow 上突出顯示的語法會立即顯示錯誤所在。
嗯,確實如此。 我已經刷新了頁面,但不再是這種情況了...
大多數體面的 XML 編輯器也會使這些問題很容易發現,至少對於短文件而言。 始終使用好的 XML 編輯器,以節省您和我們的時間。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.