Defining entities and parameter entities
You can define, or declare frequently used words, phrases, and longer character strings in your source file as entities or parameter entities that represent text in the source file. You declare them within the DOCTYPE statement of your source file. After you have declared them, you refer to the names of the entities in place of the word or phrase in the text. This saves you time when marking up your text, and allows you to globally change the defined words or phrases in one place in the source file.
- To replace single characters in text that are considered special
characters. This can include characters not available on a particular
keyboard, or characters that have special meaning to the compiler,
such as the tag start delimiter (<), that you want to treat as
normal text.
DTL provides you with a set of predefined single-character entities. See Predefined entities for a list of these entities.
- To replace strings of text, such as words, phrases, and longer text strings used frequently in the source file text.
- To embed entire files in a source file. This is useful for breaking up a source file into smaller, more manageable files, and for declaring entities that are shared by different source files.
When you refer to an entity in the text of a source file, you must precede the entity reference with an ampersand (&) and follow it with a semicolon (;) or a blank space. The text defined by the entity replaces the entity reference in the formatted text.