
148 • XML & Related Technologies
4.2.2 Specifying the Frequency: minOccurs and maxOccurs
Let us consider that we want to represent information about a book. The XML document depicting this
information along with its corresponding schema is shown in Figure 4.9.
XML document (book.xml)
<?xml version = “1.0” ?>
<BOOK xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance”
xsi:noNamespaceSchemaLocation=”book.xsd”>
<TITLE> Cryptography and Network Security </TITLE>
<AUTHOR> Atul Kahate </AUTHOR>
<PUBLISHER> TMH </PUBLISHER>
<PRICE> 250 </PRICE>
</BOOK>
XML schema (book.xsd)
<?xml version = “1.0”?>
<xsd:schema xmlns:xsd = “http://www.w3org/2001/XMLSchema”> ...