Forum Moderators: open
Design a DTD that describes a library patron who has checked out a set of books. Each book has an ID number, an author, and a title. The patron has a name and telephone number.
Looking at the textbook and at other books and sources, I think this is right, though I am not sure.
<!ELEMENT library-patron (set-of-books, name, telephone-number)>
<!ELEMENT set-of-books (book+)>
<!ELEMENT book (ID-Number, author, title)>
<!ELEMENT ID-Number (#PCDATA)>
<!ELEMENT author (#PCDATA)>
<!ELEMENT title (#PCDATA)>
<!ELEMENT name (#PCDATA)>
<!ELEMENT telephone-number (#PCDATA)>
I figure the XML for this would be something like this:
<?xml version="1.0" encoding="iso-8859-1"?>
<library-patron>
<set-of-books>
<book>
<ID-Number>56564</ID-Number>
<author>Charles Dickens</author>
<title>A Tale of Two Cities</title>
</book>
<book>
<ID-Number>56564</ID-Number>
<author>Charles Dickens</author>
<title>A Tale of Two Cities</title>
</book>
<book>
<ID-Number>56564</ID-Number>
<author>Charles Dickens</author>
<title>A Tale of Two Cities</title>
</book>
</set-of-books>
<name>John Smith</name>
<telephone-number>212-555-6565</telephone-number>
</library-patron>
Am I correct? Thanks