Re: [xsl] how to include nodes inside CData tags

Subject: Re: [xsl] how to include nodes inside CData tags
From: Andrew Welch <andrew.j.welch@xxxxxxxxx>
Date: Tue, 30 Apr 2013 14:21:53 +0100
On 30 April 2013 14:16, Terry Ofner <tdofner@xxxxxxxxx> wrote:
> I need to generate the following format:
>
> <question>
> <![CDATA[The city council passed the new <strong>regulation</strong>.]]>
> </question>
>
> from this input:
>
> <question>The city council passed the new <strong>regulation</strong>.></question>
>
> when I add cdata-section-elements="question" to my xsl:output statement, I get this results:
>
> <question><![CDATA[6. The city council passed the new ]]><strong>regulation</strong><![CDATA[.]]></question>
>
>
> Is there a way to include the <strong> element in the CDATA?

You will need use the serialize() function in XSLT 3.0 on the
<question> contents, or the equivalent extension in 2.0.


-- 
Andrew Welch
http://andrewjwelch.com

Current Thread