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

identity transform - include CDATA's, etc

Subject: identity transform - include CDATA's, etc
From: "Abie Hamaoui" <ahama5@xxxxxxxxxxx>
Date: Thu, 26 Jun 2003 19:58:36 +0000
identity transform cdata
I saw an identity transform on msdn online that goes like this:

<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >


 <xsl:template match="/ | @* | node()">
   <xsl:copy>
     <xsl:apply-templates select="@* | node()"/>
   </xsl:copy>
 </xsl:template>

</xsl:stylesheet>

however this is not a true identity transform since CDATA sections enclosed in the original xml document in <![CDATA[ ]]> is output as regular characters. I don't know if there are other elements besides CDATA elements that also don't get translated truthfully.
can someone suggest a new identity template that will render the output based on the input exactly as if one were to issue a 'copy' command at a dos prompt, or at least get closer to it than the template above?
eg:
<?xml version="1.0"?>
<docroot>
<element id="a"/>
<![CDATA[ this is cdata ]]>
<element id="b"/>
</docroot>


should become:
<?xml version="1.0"?>
<docroot>
  <element id="a"/>
  <![CDATA[ this is cdata ]]>
  <element id="b"/>
</docroot>

_________________________________________________________________
The new MSN 8: smart spam protection and 2 months FREE* http://join.msn.com/?page=features/junkmail



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.