3. Document Object Model (XML) Level 1


3.3 Document Type Definition support overview

A Document Type Definition (DTD) defines three things:

  1. A definition of a grammar for a markup language.
  2. A (possibly empty) set of entity declarations.
  3. A (possibly empty) set of notation declarations.
This specification gives access to all of these, though only in the post-parse form.

From a practical point of view, this means that while all the information contained within a DTD is available, not all of the information about what created it is. Parameter entity references, for example, are assumed to have been already expanded, and hence, their boundaries are lost.