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

Subject: Re: [xsl] identity transform - include CDATA's, etc
From: David Carlisle <davidc@xxxxxxxxx>
Date: Mon, 7 Jul 2003 18:00:22 +0100

> the reason I wanted the <![CDATA[]]> to come out in the output is that 
> output of the identity transform is supposed to undergo another xslt 
> transform. 

In that case you _definitely_ don't mind.

<![CDATA[ <a>b</a>]]>

and

&lt;a>b&lt;a>

are _identical_ as far as XSLT is concerned. The whole reason why an
XSLT system is always allowed to use either form on output is that
when they are parsed by an XML parser they form the same input.

> it is therefore necessary that the CDATA section beginning and 
> end markers get represented as is, since these sections contain '<' 
> characters.

This is false. An XSLT system will use or not use CDATA markup
as it chooses, but as shown above the output in either case will
form the same input after XML parsing, just as an identity transfom
may output an attribute a="b" as a="b" or a='b' which is a different
linearisation, but with an equivalent XML parse tree.

David



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

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


Current Thread