tags:

views:

159

answers:

2

Im trying to output some XML using XSLT, however I've just come across this:

<description><![CDATA[<p>Using Money &ndash; recognise coins, getting change, paper money etc. A PowerPoint resource containing colour coded levels to suit different abilities &ndash; special needs. Self checking and interactive.</p>]]></description>

How do I output the actual HTML, not the <P>, but as if it was HTML?

A: 

XSLT handles data already parsed by the XML parser. The CDATA tags are parsed as text by the XML parser. You might need to do some pre-processing to remove the CDATA tags before turning over the XML to XSLT.

Jweede
+2  A: 

You can use disable-output-escaping. Beware, though, that if the input value is not well-formed or valid, the output won't be either.

<xsl:value-of select="description" disable-output-escaping="yes"/>
Jukka Matilainen