Parameter Entity References |
    %name;
When an XML parser encounters a parameter entity reference within a document's DTD, it replaces the reference with the entity's text. Whether the replacement text is included as a literal or included from an external entity, the parser continues parsing the replacement text as if it had always been a part of the document. This parsing has interesting implications for nested entity references:
    <!ENTITY % YEAR "2001">
    <!ENTITY COPYRIGHT "&#xa9; %YEAR;">
    . . .
    <copyright_notice>&COPYRIGHT;</copyright_notice>
After the necessary entity replacements are made, the previous example would yield the following canonical element:
    <copyright_notice>Â© 2001</copyright_notice>
XML treats parameter entity references differently depending on where they appear within the DTD. References within the literal value of an entity declaration (such as Copyright &#xa9; %YEAR;) are valid only as part of the external subset. Within the internal subset, parameter entity references may occur only where a complete markup declaration could exist. In other words, within the internal subset, parameter references can be used only to include complete markup declarations. Parameter entity references are recognized only within the DTD; therefore, the % character has no significance within character data and does not need to be escaped.