xsl-list
[Top] [All Lists]

Re: [xsl] The identity transform and attributes

2008-01-21 09:37:48
Jesper Tverskov wrote:
The short version is also nice because it works both in XSLT
1.0 and XSLT 2.0.

Here's the/a long version that works in both XSLT 1.0 and 2.0:

   <xsl:template match="child::*">
       <xsl:copy>
           <xsl:apply-templates select="attribute::*|node()"/>
       </xsl:copy>
   </xsl:template>
<xsl:template match="attribute::*|text()|comment()|processing-instruction()">
       <xsl:copy/>
   </xsl:template>


Cheers,
-- Abel Braaksma

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--