[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: xpath - how to return all nodes but the node match

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

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.