无法验证XML文档。 " XS:模式"不得包含'<'字符

时间:2017-09-15 10:30:46

标签: xml xsd

我无法验证我的XML文档。我收到错误消息The Value Of Attribute "xmlns:xs" Associated With An Element Type "xs:schema" Must Not Contain The '<' Character.我在代码中找不到任何语法错误。

这是我的XML代码:

&#13;
&#13;
<?xml version="1.0" encoding="utf-8"?>
<bookstore>
 <book>
  <title>The Hunger Games</title>
  <author>Suzzanne Collins</author>
  <price>299</price>
 </book>
 <book>
  <title>Divergent</title>
  <author>Veronica Roth</author>
  <price>399</price>
 </book>
 <book>
  <title>Me Before you</title>
  <author>JoJoMoyes</author>
  <price>299</price>
 </book>
</bookstore>
&#13;
&#13;
&#13;

这是XSD文档:

&#13;
&#13;
<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema>
 <xs:element name="bookstore">
  <xs:complexType>
   <xs:sequence>
    <xs:element name="book" maxOccurs="unbounded">
     <xs:complexType>
      <xs:sequence>  
        <xs:element name="title" type="xs:string"/>
        <xs:element name="author" type="xs:string"/>
        <xs:element name="price" type="xs:integer"/>
      </xs:sequence>
     </xs:complexType>
    </xs:element>
  </xs:sequence>
</xs:complexType>
  </xs:element>
 </xs:schema>
&#13;
&#13;
&#13;

1 个答案:

答案 0 :(得分:2)

架构的第二行是

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">

你错过了结束语,应该是

$( document ).ajaxStart(function() {
  $( ".log" ).text( "Triggered ajaxStart handler." );
});