Following is the XML file example using DTD
<?xml version="1.0"?>
<!DOCTYPE SHOWROOM
[
<!ELEMENT SHOWROOM (TV|LAPTOP)+>
<!ELEMENT TV (#PCDATA)>
<!ATTLIST TV count CDATA #REQUIRED>
<!ELEMENT LAPTOP (#PCDATA)>
<!ATTLIST LAPTOP count CDATA #REQUIRED>
]
>
<SHOWROOM> ELECTRONIC GOODS
<TV count="10"> SONY </TV>
<TV count="15"> PANASONIC </TV>
<TV count="5"> PHILIPS </TV>
<TV count="9"> LG </TV>
<TV count="20"> NIKSON </TV>
<LAPTOP count="8"> TOSHIBA </LAPTOP>
<LAPTOP count="12"> HP </LAPTOP>
<LAPTOP count="7"> COMPAC </LAPTOP>
<LAPTOP count="18"> IBM </LAPTOP>
<LAPTOP count="2"> DELL </LAPTOP>
</SHOWROOM>
The picture blow show the result on the browser.
No comments:
Post a Comment