xsl-list
[Top] [All Lists]

Re: [xsl] deep copy without attributes

2013-05-21 09:52:03
On 21 May 2013 15:34, David Carlisle <davidc(_at_)nag(_dot_)co(_dot_)uk> 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
http://andrewjwelch.com

--~------------------------------------------------------------------
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>
--~--