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

Re: [xsl] deep copy without attributes

Subject: Re: [xsl] deep copy without attributes
From: Andrew Welch <andrew.j.welch@xxxxxxxxx>
Date: Tue, 21 May 2013 15:52:11 +0100

On 21 May 2013 15:34, David Carlisle <davidc@xxxxxxxxx> wrote:
> On 21/05/2013 12:43, Ihe Onwuka wrote:
>> I think it's cumbersome.
> Given that it's XML how much less cumbersome can you make a single template
> that contains two elements?
> <xsl:template match="node()">
>     <xsl:copy>
>         <xsl:apply-templates/>
>     </xsl:copy>
> </xsl:template>

That is a work of art... with the 3.0 alternative being:

<xsl:mode on-no-match="shallow-copy"/>

<xsl:template match="@*"/>

...which probably means the identity template will go the way of the
dodo  (eaten to extinction by the Dutch apparently)

Andrew Welch

Current Thread