Section 20.4.  Document type DTD and markup declarations

Prev don't be afraid of buying books Next

20.4. Document type, DTD, and markup declarations

A document type is a class of similar documents, like telephone books, technical manuals, or (when they are marked up as XML) inventory records.

A document type definition (DTD) is the set of rules for using XML to represent documents of a particular type. These rules might exist only in your mind as you create a document, or they may be written out.

Markup declarations, such as those in Example 20-1, are XML's way of writing out DTDs.

Example 20-1. Markup declarations in the file greeting.dtd.
 <!ELEMENT greeting (salutation, addressee) > <!ELEMENT salutation (#PCDATA) > <!ELEMENT addressee  (#PCDATA) > 

It is easy to mix up these three constructs: a document type, XML's markup rules for documents of that type (the DTD), and the expression of those rules (the markup declarations). It is necessary to keep the constructs separate if you are dealing with two or more of them at the same time, as when discussing alternative ways to express a DTD. But most of the time, even in this book, "DTD" will suffice for referring to any of the three.

Amazon


XML in Office 2003. Information Sharing with Desktop XML
XML in Office 2003: Information Sharing with Desktop XML
ISBN: 013142193X
EAN: 2147483647
Year: 2003
Pages: 176

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net