This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: xpath // query


> 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]