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

RE: position() function problems on xalan

Subject: RE: position() function problems on xalan
From: "Florin Dragu" <florin.dragu@xxxxxxxx>
Date: Thu, 23 May 2002 10:38:13 +0300
position function
Thanks a lot, it works.
Florin

-----Original Message-----
From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx
[mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx]On Behalf Of David
Carlisle
Sent: 22 May 2002 18:56
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: Re:  position() function problems on xalan



number one rule to speed up stylesheets: don't use //

//call

causes a search of the entire document (in particular, inside every call
element to see if there are any descendent calls.

/telcoCallList/calls/call

is likely to be much better.

//call[(count(preceding::call

has n^2 performance as for each call you're going back over all the
preceding ones. You just want to select the n'th one out of teh current
list so:

(/telcoCallList/calls/call)[position() = $current_call]


> I get 3 call elements, the first from each calls sub-tree
That's what you are supposed to get, so it looks like they fixed a bug
you shouldn't rely on teh old behaviour. If you want the predicate to
count over the whole expression not just the final step you need () as
above.

David

_____________________________________________________________________
This message has been checked for all known viruses by Star Internet
delivered through the MessageLabs Virus Scanning Service. For further
information visit http://www.star.net.uk/stats.asp or alternatively call
Star Internet for details on the Virus Scanning Service.

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


 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.