Re: [xsl] identity transform - include CDATA's, etc

Subject: Re: [xsl] identity transform - include CDATA's, etc
From: David Carlisle <davidc@xxxxxxxxx>
Date: Tue, 8 Jul 2003 22:50:48 +0100

 
  ok, but these 2 lines are not identical to
  <a>b</a>

quite.

  so this would be good if this is the way '<' signs in CDATA sections are 
  always handled, and if this behavior is reliable and predictable.  but is 
  it, in fact, reliable across the multitude of xslt processors and other 
  circumstances?  Is it part of the xslt spec?  I had understood that other 
  behaviors similar to this one are not reliable.

there are no CDATA section nodes in Xpath data model, the _only_ thing
<![CDATA[ does is make < and & act like &lt; and &amp; respectively.
The parser in either case will just report a single character, and so
XSLT engine doesn't know whether you did <![CDATA[<]]> or &lt; or
& # 60;. So it is an XML parse issue rather than an XSLT one.

conversely when the serialiser is outputting the content of an element
that contains the character , it needs to do it in such a way that an
XML parser reports a < it can do it how it likes
&lt; &#60; <![CDATA[<]]> they are all equivalent, and the system usually
chooses the same one irrespective of how the character was entered.

If you can't rely on your XSLT system getting this right you can't rely
on it at all.

David

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread