Subject: Re: [xsl] Only child test From: David Carlisle <davidc@xxxxxxxxx> Date: Thu, 10 Oct 2013 15:55:14 +0100 |
Wouldn't "last() eq 1" or "last() gt 1" be both the fastest and clearest?
last() depends on the nodes that were selected, so it answers the question of whether 1 node was selected not if there are siblings.
Like most of the constructs whether it is fast or not depends on the system optimiser. Naively evaluating last() eq 1 would require knowing what last() is so if there are 100000 items in the list you would have to hold back evaluating any of them until you had processed that one and knew the number but as with not(*[2]) an optimiser can evaluate the boolean expression last() eq 1" as soon as it has seen two items, even if it does not know what value last() has,
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Only child test, Andre Cusson | Thread | Re: [xsl] Only child test, Liam R E Quin |
Re: [xsl] Only child test, Michael Kay | Date | [xsl] XSL-FO: keep-together.within-, Mario Madunic |
Month |