Re: [xsl] xpath - how to return all nodes but the node matching a value in an arbitrary tree?

Subject: Re: [xsl] xpath - how to return all nodes but the node matching a value in an arbitrary tree?
From: Joerg Heinicke <joerg.heinicke@xxxxxx>
Date: Sat, 04 May 2002 20:24:57 +0200
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


Current Thread