[Bug 26328] [XSLT30] Streamable and non-streamable accumulators in grounded postures

https://www.w3.org/Bugs/Public/show_bug.cgi?id=26328

--- Comment #4 from Michael Kay <mike@saxonica.com> ---
I'm applying changes to give effect to this decision but I think it needs a
little more work.

Abel asks whether a streamable accumulator should apply to a non-streamed
document. I think that it should, in the same way that a streamable template
can be applied to a non-streamed document. "Streamable" means that it can be
streamed, not that it must be streamed. Using a non-streamable accumulator on a
streamed document should be an error, but using a streamable accumulator on a
non-streamed document should be fine; it should behave just as if it were a
non-streamable accumulator.

I am trying to rationalize the rules that control when you can call accumulator
functions on streamed nodes. If we ignore for the moment the problem of
templates (etc) that choose not to consume the streamed input, then the rule
appears to be more simple than we are making it: in the case of
accumulator-before, you must be "in the course of" evaluating an instruction
whose context item is the same as the context item of the accumulator-before
call, and that has a following-sibling instruction that is consuming. For
accumulator-after, replace following-sibling by preceding-sibling.

This leaves the question of sequence constructors that process a streamed node
without consuming it, for example those that process text nodes. In this case
we classify all the instructions as both pre-descent and post-descent. This
sounds reasonable, but it causes trouble if you call accumulator-after before
calling accumulator-before, especially in the case where you are processing an
element that actually has children (i.e. where the children are skipped) in
which case you need to consume the input stream implicitly before doing the
accumulator-after() call. I'm looking for some way to make accumulator-after
"conditionally consuming" to handle such cases. One crude way would be an
xsl:skip instruction that consumes the input and returns nothing; we could then
require accumulator-before to come before this instruction and
accumulator-after to come after it.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.

Received on Monday, 4 August 2014 09:52:15 UTC