What a DTD Is

A DTD is a description of the allowed structure of a class of XML documents.

In a DTD, you declare elements, attributes, and so on that are allowed in the structure of a corresponding class of XML documents. Elements and other parts of an XML document are declared in markup declarations.

The following are the types of markup declaration in XML 1.0:

  • Element declarations

  • Attribute list declarations

  • Entity declarations

  • Notation declarations

Markup declarations may be contained in part or entirely within parameter entities.

The DTD Is Not the DOCTYPE Declaration

Earlier, when defining a valid document, this chapter indicated that a valid document complies with the constraints expressed in the DOCTYPE declaration.

It is important to be ...

Get Sams Teach Yourself XML in 10 Minutes now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.