Disabled Escaping Example

Figure 24. disable-escaping.xml

<doc>
This document is <copyright>No One In Particular</copyright>.
</doc>

Figure 25. disable-escaping.xsl

<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                version="1.0">

<xsl:output method="xml"/>

<xsl:template match="doc">
  <p><xsl:apply-templates/></p>
</xsl:template>

<xsl:template match="copyright">
  <xsl:text>Copyright </xsl:text>
  <xsl:text disable-output-escaping="yes">&amp;copy;</xsl:text>
  <xsl:text> 1999 </xsl:text>
  <xsl:apply-templates/>
</xsl:template>

</xsl:stylesheet>



Figure 26. disable-escaping.html

<?xml version="1.0" encoding="utf-8"?>
<p>
This document is Copyright &copy; 1999 No One In Particular.
</p>

A better technique for this particular example would be simply to use the numeric character reference for the Copyright symbol (&#xA9;) and allow the serializer to "do the right thing."