[Bug 26513] New: [XSLT30] Access to context item within streamed xsl:for-each-group

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

[Bug 26513] New: [XSLT30] Access to context item within streamed xsl:for-each-group

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

            Bug ID: 26513
           Summary: [XSLT30] Access to context item within streamed
                    xsl:for-each-group
           Product: XPath / XQuery / XSLT
           Version: Working drafts
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: XSLT 3.0
          Assignee: [hidden email]
          Reporter: [hidden email]
        QA Contact: [hidden email]

Consider

<xsl:for-each-group select="x" group-by="@y">
  <a b="{@b}"/>
  <xsl:copy-of select="current-group()"/>
  <a b="{@b}"/>
</xsl:for-each-group>

This is streamable according to current rules.

During evaluation of xsl:for-each-group, the context item is the FIRST item in
the group. So both references to @b access the b attribute of the FIRST x
element. Clearly, after processing current-group(), we are no longer positioned
on the first x element so we can only achieve this by remembering details of
the x element (or perhaps by evaluating the post-descent instructions before we
process the group, and remembering the result). So it can't be done without
buffering.

I think we should (somehow) ban inspection access to the context item in the
post-descent phase of a streaming xsl:for-each-group.

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

Reply | Threaded
Open this post in threaded view
|

[Bug 26513] [XSLT30] Access to context item within streamed xsl:for-each-group

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

Michael Kay <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |WORKSFORME

--- Comment #1 from Michael Kay <[hidden email]> ---
I should of course have used group-adjacent rather than group-by.

I added a test case si-group-027, and rather to my surprise, Saxon passes it.
It seems that it does so by retaining enough information about the context item
to evaluate inspection expressions for the duration of the group: that it it
retains the context-item's start tag and ancestor stack. This seems acceptable
within the definition of streaming. I'm therefore withdrawing the bug.

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