Altova Mailing List Archives

RE: [xsl] CDATA in XSLT output

From: "Michael Kay" <mhkay@------------>
Date: 10/18/2001 2:29:00 AM
> For example, how would I modify XSLT code that looks like this:
> <root>
> 	<node><xsl:value-of select="value" /></node>
> </root>
> to produce an output like this:
> <root>
> 	<node><![CDATA[ This is my value ]]></node>
> </root>

<xsl:output cdata-section-elements="node"/>

But note, this only gives you limited control. The bottom line is, you
shouldn't care whether the output is in CDATA, because

   <node><![CDATA[This is my value & I like it]]></node>

is equivalent, in the data model, to

   <node>This is my value &amp; I like it</node>

Mike Kay

 XSL-List info and archive:


These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.