This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: xpath - how to return all nodes but the node matching avalue in an arbitrary tree?


Hello Robert,

I don't think that there are significant performance differences.

Your <xsl:copy-of select="@*"/> shell be a bit faster than my 
<xsl:apply-templates select="@*"/>, because the template for the 
attributes must not be searched. I use the apply-templates, because I 
can easily add a new template e.g. for a special attribute.

And <xsl:apply-templates/> is the same as <xsl:apply-templates 
select="node()"/>. I use normally the "special" version with "text()|*", 
because I don't want to copy comments or the xsl-stylesheet 
processing-instruction.

The last difference is the <xsl:if> and my predicate at 
<xsl:apply-templates>. It's maybe the same as with the attributes. 
Normally I would use a simple apply-templates and again a special template:
<xsl:template match="*[@id = $delete_id]"/>
But this is not possible with variables.

Joerg

Robert Koberg schrieb:
> very cool Joerg!
> 
> Does  this have performance benefits (or negatives) over the (modified) 
> standard identity template:
> 
> <xsl:template match="node()|@*">
> 
>    <xsl:if test="not(@id=$id)">
>        <xsl:copy>
>            <xsl:copy-of select="@*"/>
>            <xsl:apply-templates/>
>        </xsl:copy>
>    </xsl:if>
>      </xsl:template>
> 
> best,
> -Rob


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]