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

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

--- Comment #2 from Michael Kay <mike@saxonica.com> ---
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.

Received on Friday, 24 October 2014 15:00:36 UTC