[Bug 27126] New: [XSLT30] allow fn:root in patterns to match parentless nodes

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

[Bug 27126] New: [XSLT30] allow fn:root in patterns to match parentless nodes

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

            Bug ID: 27126
           Summary: [XSLT30] allow fn:root in patterns to match parentless
                    nodes
           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]

This bug report is to track the resolution of
https://lists.w3.org/Archives/Member/w3c-xsl-wg/2014Oct/0018.html (member
only).

This mail was discussed at the telcon of 16 October 2014. Summary of that
discussion and the mail discussion:

Rationale:
* parentless¹ nodes are everywhere (xsl:variable with as="element()" for
instance)
* we (now) have the ability to start stylesheet invocation with any kind of
item, including parentless¹ nodes
* using a leading "/" in patterns won't match as it *must* match a document
node, this often confuses users that consider it to match any root
* matching the root of parentless¹ nodes is tricky and very non-trivial, using
patterns like "foo[not(..)]"
* using fn:root() would make such patterns clearer
* the relevant changes to the spec appear to be minimal

Points against:
* late in the game (2nd LCWD status)
* there is a workaround, "people should read tutorials"

The recorded DECISION at the telcon was to leave the decision of whether or not
to include this change up to the editor.

¹ the term "parentless" here means any nodes without a parent, except for
document-nodes.

--
You are receiving this mail because:
You are the QA Contact for the bug.
Reply | Threaded
Open this post in threaded view
|

[Bug 27126] [XSLT30] allow fn:root in patterns to match parentless nodes

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

Michael Kay <[hidden email]> changed:

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

--- Comment #1 from Michael Kay <[hidden email]> ---
The WG accepted the proposed change and it has been implemented.

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

Reply | Threaded
Open this post in threaded view
|

[Bug 27126] [XSLT30] allow fn:root in patterns to match parentless nodes

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=27126

--- Comment #2 from Michael Kay <[hidden email]> ---
This proved a little more complex than expected.

I decided that it made sense to only allow the zero-arity form of root(),
because I don't want to extend what we allow in the argument list (which is
currently restricted to literals and variable references). We still have to
extend the rules for the argument list to allow it to be empty.

Restricting it to the zero-arity form seems to require an extra-grammatical
rule, which is a little untidy but essentially manageable. The alternative
would be to allow root($var), which is meaningful but not very useful. I don't
particularly want to allow root(.) because that would open the way to things
such as key('k', .)[1] which matches a node that is the first in its group by
key value.

The semantics fofr root#0 seem to work OK: root()/self::E selects a node in the
node-set root()//root()/self::E, which is fine, because root()//root() selects
the same node as root().

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

Reply | Threaded
Open this post in threaded view
|

[Bug 27126] [XSLT30] allow fn:root in patterns to match parentless nodes

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=27126

--- Comment #3 from Michael Kay <[hidden email]> ---
Correction, the grammar does currently allow an empty argument list.

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