
182 • XML & Related Technologies
Let us now put our exercise into action by providing the full schema and the corresponding XML
document. Figure 4.44 shows the schema declaration for a book, including its price and the corresponding
XML document.
Schema (bookprice.xsd)
<?xml version=”1.0”?>
<xsd:schema xmlns:xsd=”http://www.w3.org/2001/XMLSchema”>
<xsd:element name=”BOOK” type=”BookType”/>
<xsd:simpleType name=”BookPriceType”>
<xsd:restriction base=”xsd:string”>
<xsd:pattern value=”\p{Sc}\p{Nd}\p{Nd}\.\p{Nd}\p{Nd}”/>
</xsd:restriction>
</xsd:simpleType>
<xsd:complexType name=”BookType”>
<xsd:sequence>
<xsd:element name=”BOOK_NAME” ...