[Bug 24651] New: Streamability rules of accumulator-before/after do not help with dependency on current node

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

[Bug 24651] New: Streamability rules of accumulator-before/after do not help with dependency on current node

Bugzilla from bugzilla@jessica.w3.org
https://www.w3.org/Bugs/Public/show_bug.cgi?id=24651

            Bug ID: 24651
           Summary: Streamability rules of accumulator-before/after do not
                    help with dependency on current node
           Product: XPath / XQuery / XSLT
           Version: Last Call drafts
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P2
         Component: XSLT 3.0
          Assignee: [hidden email]
          Reporter: [hidden email]
        QA Contact: [hidden email]

Related to bug 24650 and bug 24649.

The operand usage of the only argument of the functions fn:accumulator-before
and fn:accumulator-after is Navigation[1]. The text says this is to make it
independent of the current node.

Hence we cannot write this:

<xsl:value-of select="accumulator-after(@foo)" />

because a climbing posture in a navigation context is disallowed. However, we
can write this:

<xsl:value-of select="accumulator-after(string(@foo))" />

which removes the problem with Navigation (the result of string() is grounded,
not climbing), but does not remove the dependency on the current node.

Considering that the type of the first argument is xs:string (and provided that
the resolution to bug 24560 is not equal to changing this), the argument will
be atomized, hence there is no need for setting the operand usage to
Navigation, because there is no way to navigate away from it.

[1] http://www.w3.org/TR/xslt-30/#streamability-fn-accumulator-after

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

Reply | Threaded
Open this post in threaded view
|

[Bug 24651] Streamability rules of accumulator-before/after do not help with dependency on current node

Bugzilla from bugzilla@jessica.w3.org
https://www.w3.org/Bugs/Public/show_bug.cgi?id=24651

Michael Kay <[hidden email]> changed:

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

--- Comment #1 from Michael Kay <[hidden email]> ---
The WG examined this problem on 2014-03-20.

Section 18.2.7 establishes that accumulator-before can only be called in a
pre-descent instruction, and accumulator-after can only be called in a
post-descent instruction. This rule has the consequence that the argument to
these two functions cannot be consuming. However, there is no intrinsic reason
why it should not be climbing.

I propose therefore to:

(a) reclassify the argument as having usage absorption

(b) point out in 19.8.8.1 and 19.8.8.2 that it is a consequence of 18.2.7 that
the argument cannot be consuming

(c) fix the error in 18.2.7 which suggests that accumulator-before and
accumulator-after can only be called in streamable template rules. They can
also be called within xsl:stream, and in fact I see no reason to disallow their
use within xsl:for-each or xsl:iterate.

Specifically, in 18.2.7

(i) Delete the paragraph

The pre-descent accumulator function accumulator-before can only be invoked in
the course of evaluating a pre-descent instruction in a template rule that
matches the context item, and the post-descent accumulator function
accumulator-after can only be invoked in the course of evaluating a
post-descent instruction in such a template rule. The concepts "pre-descent
instruction" and "post-descent instruction" are defined in 19.8.3 Classifying
Sequence Constructors.

(ii) delete the paragraph (and sub-paras)

If a call on accumulator-before or accumulator-after is evaluated for a
streamable accumulator then:

The evaluation must occur in the course of evaluating a pre-descent or
post-descent instruction in some streamed template rule T, respectively
The context item at the point of invocation of the accumulator function must be
the same as the context node for T.

and replace the first of these with:

It is a dynamic error if accumulator-before or accumulator-after is evaluated
when the context item is not a node.

When accumulator-before or accumulator-after is evaluated, at least one of the
following conditions must be true, otherwise a dynamic error [TBA] is signaled:

* The context node is grounded

* The accumulator is declared with streamable=yes, and one of the following is
true:

** The function is accumulator-before and the call is evaluated in the course
of evaluating a *pre-descent instruction* whose context item is the same as the
context node for evaluation of the function

** The function is accumulator-after and the call is evaluated in the course of
evaluating a *post-descent instruction* whose context item is the same as the
context node for evaluation of the function

Change the definitions of pre-descent and post-descent instructions slightly in
19.8.3 so that an instruction is classified as pre-descent or post-descent only
if it is a descendant of an xsl:template element with streamable=yes, or an
xsl:stream instruction.

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

Reply | Threaded
Open this post in threaded view
|

[Bug 24651] Streamability rules of accumulator-before/after do not help with dependency on current node

Bugzilla from bugzilla@jessica.w3.org
In reply to this post by Bugzilla from bugzilla@jessica.w3.org
https://www.w3.org/Bugs/Public/show_bug.cgi?id=24651

--- Comment #2 from Michael Kay <[hidden email]> ---
Correction, we don't need to say this:

It is a dynamic error if accumulator-before or accumulator-after is evaluated
when the context item is not a node.

because we already say it (error [XTTE3360]).

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

Reply | Threaded
Open this post in threaded view
|

[Bug 24651] Streamability rules of accumulator-before/after do not help with dependency on current node

Bugzilla from bugzilla@jessica.w3.org
In reply to this post by Bugzilla from bugzilla@jessica.w3.org
https://www.w3.org/Bugs/Public/show_bug.cgi?id=24651

--- Comment #3 from Michael Kay <[hidden email]> ---
Noted that the above rules don't seem to generate a streamability problem if
they conclude that accumulator-before or accumulator-after are consuming. We
need to state that accumulator-before(child::element) isn't allowed.

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

Reply | Threaded
Open this post in threaded view
|

[Bug 24651] Streamability rules of accumulator-before/after do not help with dependency on current node

Bugzilla from bugzilla@jessica.w3.org
In reply to this post by Bugzilla from bugzilla@jessica.w3.org
https://www.w3.org/Bugs/Public/show_bug.cgi?id=24651

Michael Kay <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED

--- Comment #4 from Michael Kay <[hidden email]> ---
The WG accepted the proposal in

https://lists.w3.org/Archives/Member/w3c-xsl-wg/2014Jul/0006.html

(member only)

To summarise:


1. If the argument to accumulator-after/before is motionless, the function call
is grounded and motionless.

2. Otherwise, the function call is roaming and free-ranging.

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