[Bug 26752] New: [XSLT30] Streamability of QuantifiedExpr is incomplete and fails

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

            Bug ID: 26752
           Summary: [XSLT30] Streamability of QuantifiedExpr is incomplete
                    and fails
           Product: XPath / XQuery / XSLT
           Version: Last Call drafts
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P2
         Component: XSLT 3.0
          Assignee: mike@saxonica.com
          Reporter: abel.braaksma@xs4all.nl
        QA Contact: public-qt-comments@w3.org

This applies to the rules in 19.8.7.2 (Sept 5, 2014, internal WD)

In a QuantifiedExpr you assign a variable to items in a list and subsequently
you can use this variable in an expression:

some $itm in //para satisfies starts-with($itm/../chapter, 'hello')

The current rules are for "some|every $v in S satisfies C":

The posture and sweep are determined by the first of the following that
applies:

  1. If C is not motionless, then roaming and free-ranging.
  2. Otherwise, the posture and sweep of S.


Since a variable reference is always motionless, the above validates as
streamable, with a posture and sweep of S, which is crawling and consuming. But
it is not streamable.

There are a few things wrong in this picture:
1) the result of some..satisfies is true or false, always grounded
2) the variable takes a reference to a node, this is not allowed
3) if we do allow that, similar rules as we researched with functions should
apply, i.e. the variable reference takes the posture of the expression S and in
the case of crawling, expression in C must be motionless. In case of striding,
it can be consuming.

If a variable reference were to be allowed, the expression can be consuming
with respect to the variable reference, but must be motionless and grounded
with respect to anything else (i.e., it cannot reference and consume another
node at the same time.). But this can easily be enforced by doing something
like this:

1. Determine the posture of the expression of S, this is the posture that a
reference to $v returns when C is evaluated. If S is roaming, then roaming and
free-ranging. 
2. Otherwise, apply the GSR with the operand roles as follows: S with usage
absorption and C with usage inspection.

The probable thing to do here is the same as we did with ForExpr: disallow the
use of variables binding to streamed nodes (see the operand roles of 19.8.7.1).
Easiest in rules, but not very flexible with streaming.

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

Received on Monday, 8 September 2014 01:38:45 UTC