DTD Structures

There are basically four physical constructs that can be used in a DTD to create the rules that are used for an XML document, and there are two pieces that can be used internally in the DTD. Those components are

  • Element Declarations

  • Attribute Declarations

  • Notation Declarations

  • Entity Declarations

  • Parameter Entity Declarations

  • Comments

So, now let's look more closely at each one of these components and what function each one of them serves.

Element Declarations

The element declaration is the mechanism that is used inside a DTD to define the elements that may occur in an XML document. The element declaration can be used to specify that an element may contain other elements, that it may contain anything, or that it must be empty.

The real ...

Get Special Edition Using XML, Second Edition 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.