[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Does the count() function require access to the wh
On 13/01/2014 12:53, Michael Kay wrote:
No. Counter-example: count(following-sibling::x) is not streamable. To clarify (or muddy) the situation a little more ..... whilst: 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). Of course clever understanding of the deeper semantics could cause a rewrite, such as count(//*[self::h|self::j]) to have grounded posture and be streamable on its own, but that requires knowledge of a distribution rule for count() and + and rewrites for (//h|//j). Actually that's a pretty simple case, so perhaps we need machines to at least help check.... I hope to have something we can show at XMLPrague. John -- *John Lumley* MA PhD CEng FIEE john@xxxxxxxxxxxx <mailto:john@xxxxxxxxxxxx> on behalf of Saxonica Ltd
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|