I am trying to write xsd file for below the xml file.
<?xml version="1.0" ?>
<booklist xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="p5_09_final.xsd">
<book kind="novel"> Purpose-Driven Life
<price>9000</price>
</book>
<book kind="computer"> XML and Ontology
<price>5000</price>
</book>
</booklist>
I tried to write xsd file for this xml file. But I can't handle the book element including string type and child element price. How can I write validate xsd file for this xml file?? This is the xsd file that i wrote. It's invalid
<?xml version="1.0" ?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<!--
-->
<xsd:element name="booklist">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="book" type="ctBook" minOccurs="0" maxOccurs="unbounded" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:complexType name="ctBook" >
<xsd:sequence>
<xsd:element name="price" type="xsd:int" />
</xsd:sequence>
<xsd:attribute name="kind" type="ctKind" />
</xsd:complexType>
<xsd:simpleType name="ctKind">
<xsd:restriction base="xsd:string">
<xsd:enumeration value="computer" />
<xsd:enumeration value="novel" />
</xsd:restriction>
</xsd:simpleType>
</xsd:schema>