问题如标题所述,请各位大虾指点一二,兄弟我现在搞得一头雾水的以下是 book.xsd文件
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://example.books.com/bookstore" xmlns="http://example.books.com/bookstore" targetNamespace="http://example.books.com/bookstore" elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:element name="bookstore" type="bookstoreType"/>
<xs:complexType name="bookstoreType">
<xs:sequence maxOccurs="unbounded">
<xs:element name="book" type="bookType"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="bookType">
<xs:sequence>
<xs:element name="title" type="xs:string"/>
<xs:element name="author" type="authorName"/>
<xs:element name="price" type="xs:decimal"/>
</xs:sequence>
<xs:attribute name="genre" type="xs:string"/>
<xs:attribute name="publicationdate" type="xs:string"/>
<xs:attribute name="ISBN" type="xs:string"/>
</xs:complexType>
<xs:complexType name="authorName">
<xs:sequence>
<xs:element name="first-name" type="xs:string"/>
<xs:element name="last-name" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:schema>以下是book.xml文件
<?xml version="1.0" encoding="UTF-8"?>
<!-- This file is a part of a book store inventory database -->
<bookstore xmlns="http://example.books.com/bookstore" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://example.books.com/bookstore
C:\DOCUME~1\yaolei\桌面\INTERF~2\book.xsd">
<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>
<price>8.99</price>
</book>
<book genre="novel" publicationdate="1991" ISBN="0-201-63361-2">
<title>The Confidence Man</title>
<author>
<first-name>Herman</first-name>
<last-name>Meliville</last-name>
</author>
<price>11.99</price>
</book>
<book genre="philosophy" publicationdate="1991" ISBN="1-861001-57-6">
<title>The Gorgias</title>
<author>
<first-name>Sidas</first-name>
<last-name>Plato</last-name>
</author>
<price>9.99</price>
</book>
</bookstore>