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

Re: Re: a nicer total sibling count than this

Subject: Re: Re: a nicer total sibling count than this
From: Dimitre Novatchev <dnovatchev@xxxxxxxxx>
Date: Wed, 18 Sep 2002 21:49:07 -0700 (PDT)
access total expression
--- scruss at sympatico dot ca  wrote:

 
> Jeni Tennison wrote:
> > 
> >   <xsl:if test="../def[2]">
> >     ...
> >   </xsl:if>
> 
> How elegant! Thank you.
> 
> Think I'll be off to Chapters.ca now to buy your book
> (and DaveP's too, since I'll have to print this thing eventually.)
> 
>  Stewart

While this is indeed ellegant, the reason Jeni put first the other
solution:

preceding-sibling::def or following-sibling::def

I think, is because three nodes must be visited in order to evaluate
../def[2], while the "or" expression above can be evaluated visiting
two nodes (worse case) or even only a single node (best case).

This means that the "or" expression above can be evaluated from 1.5 to
three times faster.

Of course, the absolute time difference will be very small, but if such
expressions are evaluated many times there could be some greater time
savings.



=====
Cheers,

Dimitre Novatchev.
http://fxsl.sourceforge.net/ -- the home of FXSL

__________________________________________________
Do you Yahoo!?
New DSL Internet Access from SBC & Yahoo!
http://sbc.yahoo.com

 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.