1.

Create a DTD for storing book information for a library. The DTD should contain details about each book in terms of title, author (name), number of copies, all of which can store character data. The number of copies should contain two attributes named ‘inhand’ and issued which are both mandatory.

Answer»

<?xml version = "1.0">

<!DOCTYPE LIBRARY [

<!ELEMENT LIBRARY (BOOK +)>

<!ELEMENT BOOK (TITLE, AUTHOR, NOC)>

<!ELEMENT AUTHOR (NAME)>

<!ELEMENT TITLE (# PCDATA)>

<!ELEMENT NAME (# PCDATA)>

<!ELEMENT NOC (# PCDATA)>

<! ATTLIST NOC INHAND ISSUED CDATA # REQUIRED>

]>



Discussion

No Comment Found