This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: position() function problems on xalan
- From: "Florin Dragu" <florin dot dragu at memiq dot ro>
- To: <xsl-list at lists dot mulberrytech dot com>
- Date: Thu, 23 May 2002 10:38:13 +0300
- Subject: RE: [xsl] position() function problems on xalan
- Reply-to: xsl-list at lists dot mulberrytech dot com
Thanks a lot, it works.
Florin
-----Original Message-----
From: owner-xsl-list@lists.mulberrytech.com
[mailto:owner-xsl-list@lists.mulberrytech.com]On Behalf Of David
Carlisle
Sent: 22 May 2002 18:56
To: xsl-list@lists.mulberrytech.com
Subject: Re: [xsl] 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