對於我的XML文件,我有驗證模式無效字節1個字節的UTF-8序列
<?xml version="1.0" encoding="UTF-8"?>
<forum>
<post>
<description>The Day is coming </description>
<date> Thu, 16 Apr 2009 </date>
<title> cats </title>
</post>
<post>
<description> its raining </description>
<date> Tues, 12 Apr 2010 </date>
<title> dog </title>
</post>
<post>
<description>Game over </description>
<date> Tues, 16 Apr 2009 </date>
<title> frog </title>
</post>
<post>
<description> Watch </description>
<date> wednesday, 12 Apr 2010 </date>
<title> hats </title>
</post>
</forum>
我的XSD文件
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs=」http://www.w3.org/2001/XMLSchema」>
<xs:element name="forum" type="xs:forumtype">
<xs:complexType name = "forumtype">
<xs:sequence>
<xs:element name="post" type ="posttype"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="posttype">
<xs:sequence>
<xs:element name="description" type="xs:string"/>
<xs:element name="date" type="xs:string"/>
<xs:element name="title" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
當我嘗試驗證的架構,我得到無效的字節1的1個字節的UTF-8序列。即使我將編碼設置爲「UTF-8」,爲什麼它仍然不喜歡這個?
我正在使用http://tools.decisionsoft.com/schemaValidate/,它將模式與xml進行比較並驗證它們。我的模式顯然不是「格式良好」,意味着錯誤在於我的模式語法 – Jake
正確的,在嘗試讀取模式定義時可能會出現分析錯誤。但是提到UTF-8的錯誤的確表明了一個低層次的問題,低於正確的形式...... – StaxMan