Skip to Content
Special Edition Using XML, Second Edition
book

Special Edition Using XML, Second Edition

by - et al. David Gulbransen
July 2002
Intermediate to advanced
864 pages
22h 32m
English
Que
Content preview from Special Edition Using XML, Second Edition

Element Declarations in DTDs

With an understanding of what valid XML is, and why we might want to take advantage of it, it's time to take a look at the physical constructs that make up a DTD. Let's go back to our first simple DTD example:

<!-- A Simple DTD --> 
<!ELEMENT inventory (item+)>
<!ELEMENT item (description, sku)>
<!ELEMENT description (#PCDATA)>
<!ELEMENT sku (#PCDATA)>

This example is actually a complete and valid DTD. You will notice that unlike with XML, there is no prolog or any formal structure that identifies this as a DTD. We have added a comment line that identifies it, but there are no formal requirements or headers for DTDs.

The DTD itself will consist of a series of declarations, and the first declaration we're going to ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

XML Pocket Reference, 3rd Edition

XML Pocket Reference, 3rd Edition

Simon St. Laurent, Michael Fitzgerald
Essential XML: Beyond Markup

Essential XML: Beyond Markup

Don Box, Aaron Skonnard, John Lam

Publisher Resources

ISBN: 078972748XPurchase book