Re: [xsl] unefficiate xpaths

Subject: Re: [xsl] unefficiate xpaths
From: David Carlisle <davidc@xxxxxxxxx>
Date: Mon, 9 Jun 2003 23:00:09 +0100
// is always expensive, especially using // inside a predicate.
Unless your XSLT engine is optimising things greatly it means to search
_every_ node in teh tree, and tehn while testing each node to search
_every_ node again, so it will grow as the square of the number of nodes
in the input tree.

<xsl:for-each select="//clients/client[count(commissions/commission[earnerId
= //earners/earner[type = $rptType]/id]) = 0 and <website=$prodClass)]">

I assume the < before website is a typo.
probably you want to use keys here and get rid of both // (and you can
always replace count(foo)=0 in a test by foo, there is no need to select
them all, count them, and then test if that is 0, you just want to test
if there are any.

I don't think I can quite guess the required key structure from the
amount of infor you posted, but someone may, and if not looking at the
faq and jeni's pages on keys may help...

David

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


Current Thread