I just want to know if my schema file is correct:
XML File:
<?xml version="1.0" encoding="UTF-8"?>
<xs:books xmlns="http://www.w3.com/1999/XML/prjXMLValidation"
xmlns:xs="http://www.w3.org/2001/XMLSchema/prjXMLValidation"
xs:noNamespaceSchemaLocation="collection.xsd">
<xs:book title="A Lesson Before Dying" author="Ernest J. Gaines" version="1">
<xs:stars>
5
</xs:stars>
<xs:description>
This is a story about a young man that was wrongly
accused of killing a white man in the south at a time
when blacks were not given the same rights as whites.
This is the story of how Jefferson becomes a man.
</xs:description>
<xs:thoughts>
Great book!
</xs:thoughts>
</xs:book>
</xs:books>
Here is my XSD File:
<?xml version="1.0" encoding="utf-8"?>
<xs:schema elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://www.w3.org/2001/XMLSchema/prjXMLSchema">
<xs:element name="books">
<xs:complexType>
<xs:element name="book">
<xs:complexType>
<xs:sequence minOccurs="1" maxOccurs="unbounded">
<xs:element name="stars">
<xs:complexType>
<xs:choice minOccurs="0" maxOccurs="1">
<xs:element ref="1" />
<xs:element ref="2" />
<xs:element ref="3" />
<xs:element ref="4" />
<xs:element ref="5" />
</xs:choice>
</xs:complexType>
</xs:element>
<xs:element name="description" type="xs:string" />
<xs:element name="thoughts" type="xs:string" />
</xs:sequence>
<xs:attribute name="title" type="xs:string" use="required" />
<xs:attribute name="author" type="xs:string" use="required" />
<xs:attribute name="version" type="xs:string" />
</xs:complexType>
</xs:element>
</xs:complexType>
</xs:element>
</xs:schema>
collection.xsd
... ;-) \$\endgroup\$ – rolfl Feb 11 '14 at 5:01