DTD construction features

Analysis of element and attribute declarations may be hindered if the way that DTDs use entities and marked sections is not understood.

Entities

Just as XML document authors may use general entities to aid construction of a document, DTD authors may use parameter entities to assist with the construction of a DTD. Whenever a set of attributes or a particular element model is needed in more than one place, the DTD author may use an entity to store the information in a single place, and an entity reference at each point where the information is relevant.

For example, if the Title and Para elements have the same attributes, the following may appear (the four attributes appearing in both elements):

<!ENTITY % standardAttributes ...

Get XSL companion, The 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.