This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: xpath // query
- From: "Michael Kay" <michael dot h dot kay at ntlworld dot com>
- To: <xsl-list at lists dot mulberrytech dot com>
- Date: Wed, 24 Apr 2002 14:32:47 +0100
- Subject: RE: [xsl] xpath // query
- Reply-to: xsl-list at lists dot mulberrytech dot com
> For example, is:
>
> select="A//C"
>
> any different to:
>
> select="A//B//C"
>
> when I know that <B> is *guranteed* to be there (both select the same
> nodes). By adding the test for <B>, will it make the
> selection any faster?
>
No, it's likely to make it slower. The second expression will search all the
descendants of A looking for a B, and all the descendants of each B looking
for a C. So the descendants of a B will actually be visited (and usually
rejected) twice.
Of course the usual caveats apply - some processors may be doing
optimizations that I'm not aware of.
Michael Kay
Software AG
home: Michael.H.Kay@ntlworld.com
work: Michael.Kay@softwareag.com
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list