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

RE: More efficient way than following-sibling?

Subject: RE: More efficient way than following-sibling?
From: "Oleg Tkachenko" <olegt@xxxxxxxxxxxxx>
Date: Wed, 20 Mar 2002 23:59:11 +0200
g following sibling next sibling
Hello Michael!

> I am trying to find a more efficient way to determine if a node has
> siblings, and then access the next sibling.
> Currently, I am running the following XSLT code:
> <xsl:if test="$TheNode/following-sibling::node()">
>  <xsl:call-template name="GenericTemplate">
>   <xsl:with-param name="TheNode" 
> select="$TheNode/following-sibling::*[1]"/>
>  </xsl:call-template>
> </xsl:if>
> However, this is very expensive, when it comes to large XML documents.
> Does anyone know a more efficient way to do this?

The most efficient way I believe is to eliminate preliminary testing at all:

<xsl:apply-templates select="$TheNode/following-sibling::*[1]" mode="foo"/>

<xsl:template match="node() | @*" mode="foo">
	<xsl:call-template name="GenericTemplate">
		<xsl:with-param name="TheNode" select="."/>

Oleg Tkachenko,
Multiconn International, Israel 

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

Current Thread


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.
First Name
Last Name
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.