[Bug 29983] [XSLT30] Scanning expressions and function calls

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

Michael Kay <mike@saxonica.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED

--- Comment #3 from Michael Kay <mike@saxonica.com> ---
I was asked to improve the explanation and rationale for scanning expressions.
I have therefore rewritten the relevant Note as follows:

<p>The special rules for scanning expressions are designed to ensure
that expressions such as <code>//section/head</code> are streamable. The
problem
with such an expression is that it is
possible to have two nested sections <var>A</var> and <var>B</var>, where
<var>A</var> is the parent of <var>B</var> and thus precedes <var>B</var> in
document order, but where there are children of <var>A</var> that come
<emph>after</emph> children of <var>B</var> in document order. This means that
a nested-loop strategy for the evaluation of
<code>/descendant::section/child::head</code> is not guaranteed to deliver
nodes in document order without a sort, and is therefore not a viable strategy
for streaming.</p>

<p>However, there is a different strategy for evaluating such an expression,
which is in effect to rewrite the expression as
<code>/descendant::head[parent::section]</code>; specifically, it is possible
to scan all descendants in document order, looking for a <code>head</code>
element that has a <code>section</code> parent. Hence the term <term>scanning
expressions</term>.</p>

<p>The expressions that qualify as scanning expressions are paths that can be
evaluated by scanning all descendants and testing each one (independently) to
see whether the elements on its ancestor axis match the specified path. The
subset of expressions that qualify  as scanning expressions is therefore very
similar to the subset that qualify as motionless patterns.</p>

                     <p>Scanning expressions cannot use positional predicates:
for example <code>//section/head[1]</code> is not recognized as a scanning
expression because this would require information about a streamed node
(specifically, about its preceding siblings) that is not retained during
streaming.
                        </p>

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

Received on Friday, 11 November 2016 00:22:55 UTC