[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

RE: [xsl] xpath // query


Subject: RE: [xsl] xpath // query
From: "Michael Kay" <michael.h.kay@xxxxxxxxxxxx>
Date: Wed, 24 Apr 2002 14:32:47 +0100

> 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@xxxxxxxxxxxx
work: Michael.Kay@xxxxxxxxxxxxxx


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



Current Thread