.
September 26th, 2005 - Grin with cat attached — LiveJournal

September 26th, 2005

XSL query

I need to insert a bunch of CDATA sections around certain XML tags with XSLT (I want to be able to use a stream parser on the resulting data and treat various parts as CDATA rather than tags & content). However I can't get the CDATA block in there without it stopping XSL processing (unsurprisingly enough) or breaking the XSL

Best attempt is:

<xsl:template match="flashXML|text">
<xsl:copy>
<![CDATA[<![CDATA[]]>
<xsl:apply-templates />
<![CDATA[]]]]><![CDATA[>]]>
</xsl:copy>
</xsl:template>


but then my output is &lt;![CDATA[...

Anyone help with this? I'm really not having a great day after last night's lack of sleep and XSL is far too new to me...
Tags:
17 comments | Leave a comment