2014-04-01 25 views
0

在我.xsd文件我有XSD錯誤 - 限制性標記和命名空間

<meters xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="Meter.xsd"> 

.... 

</meters> 

但是解析器說,我就在該行的末尾有一個致命錯誤。在低於標誌處。錯誤是:

Message: Fatal error encountered during schema scan 

我的下一個錯誤是

<xs:simpleType name="ID.Type"> 
    <restriction base="xs:String"> 
     <xs:enumeration value="space2"/> 
     <xs:enumeration value="space1"/> 
    </xs:restriction> 
</xs:simpleType> 

在閉幕式限制的結束標記,它說有錯誤。錯誤是

Message: Expected end of tag 'restriction' 

雖然我已關閉限制開放限制標記嗎?語法與w3Schools的限制相同。

回答

1

對於第二個錯誤,您的打開標記爲<restriction>,而關閉標記爲</xs:restriction>。這兩個標籤位於不同的namcespace中,因此它們不匹配。

更改開放標籤爲<xs:restriction>應該修復它。