<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>30230</bug_id>
          
          <creation_ts>2018-03-17 22:52:46 +0000</creation_ts>
          <short_desc>[XSLT30] Pattern grammar requires at least one argument for rooted expressions, but root() must be used without any</short_desc>
          <delta_ts>2019-02-15 12:20:12 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>XPath / XQuery / XSLT</product>
          <component>XSLT 3.0</component>
          <version>Recommendation</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Windows NT</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Abel Braaksma">abel.online</reporter>
          <assigned_to name="Michael Kay">mike</assigned_to>
          
          
          <qa_contact name="Mailing list for public feedback on specs from XSL and XML Query WGs">public-qt-comments</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>129089</commentid>
    <comment_count>0</comment_count>
    <who name="Abel Braaksma">abel.online</who>
    <bug_when>2018-03-17 22:52:46 +0000</bug_when>
    <thetext>I&apos;m refactoring parts of the pattern parser, which lead to this and the previous report.

We define a rooted pattern with a function call as:

FunctionCallP     ::= OuterFunctionName ArgumentListP
OuterFunctionName ::= &quot;doc&quot; | &quot;id&quot; | &quot;element-with-id&quot; | &quot;key&quot; | &quot;root&quot; | ...

And arguments as:

ArgumentListP     ::= &quot;(&quot; (ArgumentP (&quot;,&quot; ArgumentP)*)? &quot;)&quot;

But in the text we say:

&quot;In the case of a call to the rootFO30 function, the argument list must be empty: that is, only the zero-arity form of the function is allowed.&quot;

So I think the prose is not in line with the grammar, or vice versa.

Since I was curious where this ArgumentListP grammar came from, I traced the cause of this back to a mail from March 2013 [1], which fixed an ambiguity issue with the grammar parser by requiring at least one argument. This was fine at the time, because the fn:root() function wasn&apos;t allowed yet.

However, after we added the fn:root() function, this fix doesn&apos;t work anymore.

I don&apos;t think there&apos;s a really big issue here, except that a literal interpretation of the grammar (which is what it is supposed to be used for, I think), would make a valid call like match=&quot;root()/x&quot; invalid.

I propose we add a note and a proposed fix to an erratum.


[1] https://lists.w3.org/Archives/Member/w3c-xsl-query/2013Mar/0070.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>129504</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2019-02-15 12:20:12 +0000</bug_when>
    <thetext>I don&apos;t see a bug here. The grammar

ArgumentListP ::= &quot;(&quot; (ArgumentP (&quot;,&quot; ArgumentP)*)? &quot;)&quot;

permits an empty argument list.

(Sadly, I no longer have access to the member-only email archive)</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>