RE: [xsl] How to efficiently remove "a" nodes with no "b" descend ants

Subject: RE: [xsl] How to efficiently remove "a" nodes with no "b" descend ants
From: "FINLEY, Mike" <Mike.FINLEY@xxxxxxxxxx>
Date: Fri, 9 Mar 2001 11:35:58 -0000
thanks! Its useful to know what we can realistically expect an optimiser to
do, and how to help one along.

mike

-----Original Message-----
From: Michael Kay [mailto:mhkay@xxxxxxxxxxxx]
Sent: 09 March 2001 10:33
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: RE: [xsl] How to efficiently remove "a" nodes with no "b"
descend ants


> If I say
>
> > <xsl:template match="a[not(.//b)]"/>
>
> then all the descendants of "a" are checked for "b" elements. Let's
> have a closer look at the input structure.

> This presupposes that the XSLT processor you are using does
> no optimisation, which may or may not be true.
>

Optimizers look for "quick wins", constructs that are used sufficiently
often to be worth treating specially, and I suspect this isn't one of them.

Generally, it's bad news to put a complex test like this into a match
pattern, because there is little alternative to testing each node selected
by <apply-templates> against this pattern; there is more scope to optimise a
node-set expression than a pattern.

...

Mike Kay


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


___________________________________________________________________________
This email is confidential and intended solely for the use of the 
individual to whom it is addressed. Any views or opinions presented are 
solely those of the author and do not necessarily represent those of 
Sema. 
If you are not the intended recipient, be advised that you have received this
email in error and that any use, dissemination, forwarding, printing, or 
copying of this email is strictly prohibited.

If you have received this email in error please notify the Sema UK
Helpdesk by telephone on +44 (0) 121 627 5600.
___________________________________________________________________________

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


Current Thread