Subject: Re: [xsl] identity transform - include CDATA's, etc From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx> Date: Thu, 26 Jun 2003 18:35:20 -0400 |
Cheers, Wendell
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>
====================================================================== Wendell Piez mailto:wapiez@xxxxxxxxxxxxxxxx Mulberry Technologies, Inc. http://www.mulberrytech.com 17 West Jefferson Street Direct Phone: 301/315-9635 Suite 207 Phone: 301/315-9631 Rockville, MD 20850 Fax: 301/315-8285 ---------------------------------------------------------------------- Mulberry Technologies: A Consultancy Specializing in SGML and XML ======================================================================
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] identity transform - incl, David Carlisle | Thread | RE: [xsl] identity transform - incl, Michael Kay |
Re: [xsl] Re: XSL-List Digest V4 #1, David Carlisle | Date | [xsl] overlapping fo:region-before , Moenig, Dorit |
Month |