Re: [xsl] Processing CDATA in input XML

Subject: Re: [xsl] Processing CDATA in input XML
From: David Carlisle <davidc@xxxxxxxxx>
Date: Sat, 7 Feb 2004 00:14:17 GMT
This is a FAQ, The usual advice, if you have any control over your input
is don't start from here. If the xml content wasn't in  cdata section it
would be usable as xml. (You'd have to remove the <?xml (<?xml is only
allowed at the start of a document and <?XML isn't allowed anywhere)

If you can't change your input then if your processor supports
disable-output-escaping then do
<xsl:value-of disable-output-escaping="yes" select="source-string-xml"/>
(You'd still have to get rid of that spurious <?XML though.)

Otherwise if your processor (eg saxon, msxsl) supports an extension to
call an xml parser you can parse the string as an xml document and get a
node set that way.



 XSL-List info and archive:

Current Thread