RE: [xsl] Identity Transform

Subject: RE: [xsl] Identity Transform
From: "Passin, Tom" <tpassin@xxxxxxxxxxxx>
Date: Mon, 22 Sep 2003 16:46:19 -0400
[ Abie Hamaoui]
> 
> hello there,
> why does the standard identity transform use copy instead of copy-of?
> ie:
>   <xsl:template match="/ | @* | node()">
>     <xsl:copy>
>       <xsl:apply-templates select="@* | node()"/>
>     </xsl:copy>
>   </xsl:template>
> 
> instead of just
>   <xsl:template match="/">
>     <xsl:copy-pf select="."/>
>   </xsl:template>
> 

One reason is that you often do not __quite__ want an identity transform
- you want to change one or a few things but leave verything else the
same.  With the standard approach you can do that, with the copy-of you
cannot.

Cheers,

Tom P

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread