Subject: Re: [xsl] Does the count() function require access to the whole subtree? From: John Lumley <john@xxxxxxxxxxxx> Date: Mon, 13 Jan 2014 18:19:08 +0000 |
No. Counter-example: count(following-sibling::x) is not streamable.
More specifically, count(X) is streamable (more specifically, its posture is grounded) if the posture of X is grounded, climbing, striding, or crawling, but not if it is roaming.
Sorry - I know that's a lot of new jargon to absorb on a Monday morning!
count(//h) on its own would be streamable (it has grounded posture, and returns NO nodes from the context subtree),
count(//h) + count(//j) is not streamable, since though each separately is grounded, BOTH have consuming sweep, i.e. they each consume the entirety of the context subtree and the posture becomes roaming - there has to be some form of buffering to be able to satisfy the second operand's sweep over its data.
If both were members of a choice group (i.e. only one of them can actually operate in any execution) then streamability may be restored - such a case would be if($h) then count(//h) else count(//j).
-- *John Lumley* MA PhD CEng FIEE john@xxxxxxxxxxxx <mailto:john@xxxxxxxxxxxx> on behalf of Saxonica Ltd
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Does the count() function, Dimitre Novatchev | Thread | [no subject], Unknown |
Re: [xsl] Does the count() function, Dimitre Novatchev | Date | [no subject], Unknown |
Month |