Subject: RE: ?Could sort+ be quicker than for-each not preceding
From: "Michael Kay" <mhk@xxxxxxxxx>
Date: Fri, 18 Jun 2004 17:08:12 +0100
|
>
> For large <for-each not preceding> would it be quicker to do
> sort list
> when current-node not equal to immediately-preceding-sibling then DO
> otherwise look for the next following-sibling not equal to
> current-node
Yes, this would almost certainly be faster.
> ?
>
> I don't know if internally Saxon already does something
> similar to this. Or is finding immediate siblings costly?
>
If you use <xsl:for-each-group group-by=expression>, Saxon will build a hash
table to group the nodes, which is probably more efficient than anything you
could achieve by hand.
Michael Kay
|