我是XMl和XSD的初学者。我已经开发了XML和XSD文件。我使用Liquid在线xml验证程序针对XSD验证了XML文件。当我尝试验证XML时出现错误“ cvc-elt.1.a:找不到元素'bookstore'的声明。”。我该如何解决这个问题?
这是我的XML
<bookstore xmlns="http://www.contoso.com/books">
<book genre="autobiography" publicationdate="1981" ISBN="1-861003-11-0">
<title>The Autobiography of Benjamin Franklin</title>
<author>
<first-name>Benjamin</first-name>
<last-name>Franklin</last-name>
</author>
<p>
<price>10</price>
<price>10</price>
<price>20</price>
</p>
</book>
</bookstore>
这是XSD
<xs:schema attributeFormDefault="unqualified" targetNamespace="http://www.contoso.com/books" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:vc="http://www.w3.org/2007/XMLSchema-versioning" vc:minVersion="1.1">
<xs:element name="bookstore">
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="unbounded" name="book">
<xs:complexType>
<xs:sequence>
<xs:element name="title" type="xs:string" />
<xs:element name="author">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="name" type="xs:string" />
<xs:element minOccurs="0" name="first-name" type="xs:string" />
<xs:element minOccurs="0" name="last-name" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="p">
<xs:complexType>
<xs:sequence>
<xs:element name="price" type="xs:decimal" />
<xs:element name="price1" type="xs:decimal" />
<xs:element name="price2" type="xs:decimal" />
</xs:sequence>
<xs:assert test="price = price1 + price2"/>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="genre" type="xs:string" use="required" />
<xs:attribute name="publicationdate" type="xs:unsignedShort" use="required" />
<xs:attribute name="ISBN" type="xs:string" use="required" />
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>