DITA coding practices for DTDs rely heavily on entities to implement specialization and constraints. As such, an understanding of entities is critical when working with DTD document-type shells, vocabulary modules, or constraint modules.
Entities can be defined multiple times within a single document type, but only the first definition is effective. How entities work shapes DTD coding practices. The following list describes a few of the more important entities that are used in DITA DTDs:
%ph;
usually just means "the ph element", but can be
(pre)defined in a document-type shell to mean "ph plus several elements from the highlighting
domain". Because the document-type shell places that entity definition before the usual
definition, every element that included %ph;
in its content model now includes
<ph>
plus every phrase specialization in the highlighting domain.<ph>
, that element sets its
content model to %ph.content;
; that entity defines the actual content model.
This is done to enable constraints; a constraint module can (pre)define the
%ph.content;
model to remove selected elements.<ph>
, that element sets its attributes
using the %ph.attributes;
entity; that entity defines the actual attributes.
As above, this is done to enable constraints; a constraint module can (pre)define the
%ph.attributes;
model to remove selected attributes.