[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

RE: [xsl] CDATA in XSLT output


Subject: RE: [xsl] CDATA in XSLT output
From: "Michael Kay" <mhkay@xxxxxxxxxxxx>
Date: Thu, 18 Oct 2001 10:09:49 +0100

> 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:  http://www.mulberrytech.com/xsl/xsl-list



Current Thread
Keywords