This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: position() function problems on xalan
- From: David Carlisle <davidc at nag dot co dot uk>
- To: xsl-list at lists dot mulberrytech dot com
- Date: Wed, 22 May 2002 16:56:16 +0100
- Subject: Re: [xsl] position() function problems on xalan
- References: <GKEJIPAHKADCNCOHLAKLKEBGCFAA.florin.dragu@memiq.ro>
- Reply-to: xsl-list at lists dot mulberrytech dot com
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