2017-09-15 3 views
0

Ich kann mein XML-Dokument nicht validieren. Ich erhalte einen Fehler, der sagt The Value Of Attribute "xmlns:xs" Associated With An Element Type "xs:schema" Must Not Contain The '<' Character. Ich finde keine Syntaxfehler im Code.Nicht in der Lage, ein XML-Dokument zu validieren. "xs: schema" darf das '<' Zeichen nicht enthalten

Das ist mein XML-Code:

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

und das ist das XSD-Dokument:

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

Antwort

2

Zweite Zeile Ihres Schemas ist

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

Sie den Schlusskurs fehlt, sollte es sein

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