<html>
<head>
<title>Parameter Entity References</title>
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div id="Description">
<table cellpadding="0" cellspacing="0" border="0" width="100%" class="main">
<tr>
<td valign="top" class="NAME">Parameter Entity References</td>
<td valign="top" class="COMPATIBILITY">&nbsp;</td>
</tr>
<tr>
<td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"></td>
</tr>
<tr>
<td valign="top" colspan="2" class="description">
<span class="PROGRAMLISTING"><pre><strong class="userinput">%</strong><var class="replaceable">name</var><strong class="userinput">;</strong></pre></span>


<p>
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:</p>

<span class="PROGRAMLISTING"><pre>&lt;!ENTITY % YEAR "2001"&gt;
&lt;!ENTITY COPYRIGHT "&amp;#xa9; %YEAR;"&gt;
. . .
&lt;copyright_notice&gt;&amp;COPYRIGHT;&lt;/copyright_notice&gt;</pre></span>


<p>After the necessary entity replacements are made, the previous
example would yield the following canonical element:</p>

<span class="PROGRAMLISTING"><pre>&lt;copyright_notice&gt;Â© 2001&lt;/copyright_notice&gt;</pre></span>

<warning id="xmlnut3-CHP-21-NOTE-134" role="ora">
<p>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 <span class="LITERAL">Copyright
&amp;#xa9; %YEAR;</span>) 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.</p>
</warning>

<p>Parameter entity references are recognized only within the DTD;
therefore, the <span class="LITERAL">%</span> character has no significance
within character data and does not need to be escaped.</p>
</td></tr>
</table>
</div>
</body>
</html>