Re: [xsl] Unescaped CDATA?

Subject: Re: [xsl] Unescaped CDATA?
From: David Carlisle <davidc@xxxxxxxxx>
Date: Sat, 17 Dec 2005 23:29:53 GMT
> This works - but the tags within the CDATA section are escaped to
> literal <p>, <i> etc. So the browser displays 

Note that it isn't the XSLT processor that does that, it's the XML
parser that does it, as that's what CDATA means. There are no tags in a
cdata section as CDATA means character data, and specifically it means
that < stands for < (the same as &lt;) and does not represent the start
of a tag. so XSLT sees the same input whether you go <![CDATA[<br>]]> or &lt;br&gt;
you can not distinguish these cases after the XML parse. (as Ken says
you may be able to use d-o-e to get write either of these input forms as
<br> if your processor supports d-o-e. (it's usually supported if
writing the result to a file or character stream and often not
supported if the result tree is passed on from xslt to some other
process as an in-memory tree such as a DOM node.


This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:

Current Thread