Adding CData tags through XSLT

CData tags are usually swallowed up by an XSLT transformation. If they are important to your output document, you can use the following method to include CData tags.

<xsl:text disable-output-escaping="yes">&lt;![CDATA[</xsl:text>

<!-- text between CData tags here -->

<xsl:text disable-output-escaping="yes">]]&gt;</xsl:text>

The output will look like:

<![CDATA[

]]>

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s