xxxxxxxxxx
<?xml version="1.0"?> <Book xmlns:lib="http://www.library.com"> <lib:Title>Sherlock Holmes</lib:Title> <lib:Author>Arthur Conan Doyle</lib:Author> </Book>
xxxxxxxxxx
<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://www.my.com/books"
xmlns:cs="http://www.my.com/book"
elementFormDefault="qualified">
<xs:import namespace="http://www.my.com/book"
schemaLocation="book.xsd"/>
<xs:element name="books">
<xs:complexType>
<xs:sequence>
<xs:element ref="cs:book"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
xxxxxxxxxx
Invalid) <http://www.library.com:Book /> Valid) <lib:Book xmlns:lib="http://www.library.com" />
xxxxxxxxxx
<?xml version="1.0"?> <Book xmlns:lib="http://www.library.com"> <lib:Title>Sherlock Holmes - I</lib:Title> <lib:Author>Arthur Conan Doyle</lib:Author> <purchase xmlns:lib="http://www.otherlibrary.com"> <lib:Title>Sherlock Holmes - II</lib:Title> <lib:Author>Arthur Conan Doyle</lib:Author> </purchase> <lib:Title>Sherlock Holmes - III</lib:Title> <lib:Author>Arthur Conan Doyle</lib:Author> </Book>