2017-09-15 2 views
0

XML 문서의 유효성을 검사 할 수 없습니다. The Value Of Attribute "xmlns:xs" Associated With An Element Type "xs:schema" Must Not Contain The '<' Character. 코드에 구문 오류가 없습니다.XML 문서의 유효성을 검사 할 수 없습니다. "xs : schema"에는 '<'문자가 포함되어서는 안됩니다.

이 내 XML 코드 :

<?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>

이는 XSD 문서입니다 :

<?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>

답변

2
이 스키마의

두 번째 줄은

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

당신은 닫는 따옴표가 누락하고, 그것을해야

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