Michael Kay
Saxonica
mike@xxxxxxxxxxxx
+44 (0118) 946 5893
On 6 Jul 2014, at 20:01, Dimitre Novatchev dnovatchev@xxxxxxxxx
<xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> wrote:
>> <xsl:if test="following-sibling::Book[Title eq $currentAuthor][Genre eq
$currentGenre][1]">
>
> Why not the obviously more-efficient -- especially for a naive
> processor that you describe -- code:
>
> following-sibling::Book[Title eq $currentAuthor and Genre eq
> $currentGenre][1]
I can't see why that's obviously more efficient. They look identical to me.
>
> or probably even better (as a hint to the optimizer):
>
> exists(head(following-sibling::Book[Title eq $currentAuthor and
> Genre eq $currentGenre]))
Again, it's still quadratic performance if your evaluate this for every Book.
>
Michael Kay
Saxonica
|