[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: identity transform - include CDATA's, etc

Subject: Re: identity transform - include CDATA's, etc
From: "Abie Hamaoui" <ahama5@xxxxxxxxxxx>
Date: Tue, 08 Jul 2003 19:41:31 +0000
msxsl using
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.

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

if my testing is correct. And this is where the problem is.

if the identity transform outputs:
&lt;a>b&lt;a>
this is fine, but if it outputs:
<a>b</a>
this is not, as it could obviously run into problems when the '<' signs aren't xml but something else (eg javascript code). in this case, the source document would be valid xml b/c of the CDATA beginning and end markers, but the output would not be.


I tested saxon and msxsl using the identity transform on jscript.xml:
<?xml version="1.0" encoding="utf-8"?>
<docroot>
  <a>
   <![CDATA[ if( x < y ) alert(); ]]>
  </a>
</docroot>

and it output:
<?xml version="1.0" encoding="utf-8"?>
<docroot>
  <a>
   if( x &lt; y ) alert();
  </a>
</docroot>

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.

_________________________________________________________________
Add photos to your e-mail with MSN 8. Get 2 months FREE*. http://join.msn.com/?page=features/featuredemail



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



Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.