[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] The identity transform and attributes


Subject: Re: [xsl] The identity transform and attributes
From: Abel Braaksma <abel.online@xxxxxxxxx>
Date: Mon, 21 Jan 2008 17:37:34 +0100

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


Current Thread
Keywords