<?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>21568</bug_id>
          
          <creation_ts>2013-04-03 14:03:50 +0000</creation_ts>
          <short_desc>Incorrect expected result for FOTS tests function-decl-reserved-function-names-001,function-decl-reserved-function-names-003,...</short_desc>
          <delta_ts>2013-06-12 15:03:00 +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>XQuery 3 &amp; XPath 3 Test Suite</component>
          <version>Working drafts</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Windows NT</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</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="Nicolae Brinza">nbrinza</reporter>
          <assigned_to name="O&apos;Neil Delpratt">oneil</assigned_to>
          <cc>g</cc>
    
    <cc>jmdyck</cc>
    
    <cc>mike</cc>
    
    <cc>spungi</cc>
          
          <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>85495</commentid>
    <comment_count>0</comment_count>
    <who name="Nicolae Brinza">nbrinza</who>
    <bug_when>2013-04-03 14:03:50 +0000</bug_when>
    <thetext>A number of tests in the FOTS testsuite in the prod-FunctionDecl set have incorrect results. E.g. the function-decl-reserved-function-names-001:

declare default function namespace &quot;http://www.w3.org/2005/xquery-local-functions&quot;;
declare function attribute() { fn:true()};
local:attribute()

expects the result &quot;true()&quot;, i.e. it considers the query to be syntactically correct with respect to the XQuery 1.0 specification. Yet the XQuery 1.0 specification, just as 3.0, has a list of reserved function names: http://www.w3.org/TR/xquery/#id-reserved-fn-names , and &quot;attribute&quot; is among them.

The lists of tests that have this problem is:
function-decl-reserved-function-names-001
function-decl-reserved-function-names-003
function-decl-reserved-function-names-005
function-decl-reserved-function-names-007
function-decl-reserved-function-names-009
function-decl-reserved-function-names-013
function-decl-reserved-function-names-015
function-decl-reserved-function-names-019
function-decl-reserved-function-names-021
function-decl-reserved-function-names-023
function-decl-reserved-function-names-025
function-decl-reserved-function-names-029
function-decl-reserved-function-names-031</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>85505</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2013-04-03 15:41:00 +0000</bug_when>
    <thetext>The accepted interpretation of the spec is, I believe, that the constraint

/* xgs: reserved-function-names */

applies only to function calls, not to function declarations, and therefore it is legal for an unprefixed function declaration to use a reserved function name.

Personally I think this interpretation is open to challenge, because Appendix A.3 says normatively &quot;The following names are not allowed as function names in an unprefixed form&quot; without qualification; but the consensus appears to be that the constraint was only intended to apply to function calls, and if the intent had been otherwise, the contraint would have been linked from the appropriate place in the grammar.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>87107</commentid>
    <comment_count>2</comment_count>
    <who name="O&apos;Neil Delpratt">oneil</who>
    <bug_when>2013-05-01 14:32:48 +0000</bug_when>
    <thetext>Interesting bug reported by Nicolae and thanks Mike for the clarification. I am assigning this to Tim hoping he can comment and that we can get a ruling on this bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>87117</commentid>
    <comment_count>3</comment_count>
    <who name="Tim Mills">tim</who>
    <bug_when>2013-05-01 18:44:23 +0000</bug_when>
    <thetext>I think Mike&apos;s said it all in Comment #1.  The difference arises from the change in where the extra-grammatical constraint is applied between XQ10 and XQ30.

I&apos;ll request tis to be put on a future WG agenda.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>87118</commentid>
    <comment_count>4</comment_count>
    <who name="Nicolae Brinza">nbrinza</who>
    <bug_when>2013-05-01 19:03:18 +0000</bug_when>
    <thetext>The issue is that the same test cases expect different behavior. E.g. the tests function-decl-reserved-function-names-001 and function-decl-reserved-function-names-002 are exactly the same, testing the function name &quot;attribute&quot;, one in XQ10 and the other in XQ30. Yet both specs have &quot;attribute&quot; as a reserved function name. So why do they expect different results?

--</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>87126</commentid>
    <comment_count>5</comment_count>
    <who name="Tim Mills">tim</who>
    <bug_when>2013-05-01 21:26:41 +0000</bug_when>
    <thetext>Compare the use of the extra-grammatical constraint in the grammar appendices between the two specifications.  It applies only at FunctionCall in XQ10.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>87352</commentid>
    <comment_count>6</comment_count>
    <who name="Michael Dyck">jmdyck</who>
    <bug_when>2013-05-07 16:21:42 +0000</bug_when>
    <thetext>See Bug 8713.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>87363</commentid>
    <comment_count>7</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2013-05-07 17:47:21 +0000</bug_when>
    <thetext>See also bugs 8713 and 20902.

Noted during discussion today that the resolution of bug 20902 represents an official interpretation of the XQuery 1.0 specification, to the effect that the prohibition of reserved function names applies only to their use in function calls, and not to their use in function declarations.

In other words, the WG decided that these test results for XQuery 1.0 are correct. 

(Personal comment: Since XQuery 3.0 introduces an incompatible change, however, it would be understandable if a vendor decides to implement the 3.0 rules in a 1.0 processor...)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>87394</commentid>
    <comment_count>8</comment_count>
    <who name="Sorin Nasoi">spungi</who>
    <bug_when>2013-05-07 23:45:54 +0000</bug_when>
    <thetext>(In reply to comment #7)
&gt; See also bugs 8713 and 20902.
&gt; 
&gt; Noted during discussion today that the resolution of bug 20902 represents an
&gt; official interpretation of the XQuery 1.0 specification, to the effect that
&gt; the prohibition of reserved function names applies only to their use in
&gt; function calls, and not to their use in function declarations.
&gt; 
&gt; In other words, the WG decided that these test results for XQuery 1.0 are
&gt; correct. 
&gt; 
&gt; (Personal comment: Since XQuery 3.0 introduces an incompatible change,
&gt; however, it would be understandable if a vendor decides to implement the 3.0
&gt; rules in a 1.0 processor...)

I have a question related to this comment: 
since the test-cases in question are marked with a dependency to &quot;XQ10&quot; is it correct for a XQuery implementattion submitting results for XQuery 3.0 not to run these test-cases?
Meaning that the results for these test-cases *don&apos;t* count for XQuery 3.0 conformance ?

My understanding is that for submitting results for XQuery 3.0 only test-cases marked with &quot;XQ10+&quot;, &quot;XQ30&quot; and &quot;XQ30+&quot; should matter.

Am I missing something here?

Doesn&apos;t &quot;XQ10&quot; dependency stand for XQuery 1.0 test-cases that *may be* incompatible with XQuery 3.0 ?

Because this is not the case since the test-cases mentioned (although marked with &quot;XQ10&quot; dependency) are taken into account when generating XQuery 3.0 conformance reports.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>87408</commentid>
    <comment_count>9</comment_count>
    <who name="Ghislain Fourny">g</who>
    <bug_when>2013-05-08 07:43:33 +0000</bug_when>
    <thetext>&gt; My understanding is that for submitting results for XQuery 3.0 only
&gt; test-cases marked with &quot;XQ10+&quot;, &quot;XQ30&quot; and &quot;XQ30+&quot; should matter.

This is also my understanding.
 
&gt; Am I missing something here?
&gt; 
&gt; Doesn&apos;t &quot;XQ10&quot; dependency stand for XQuery 1.0 test-cases that *may be*
&gt; incompatible with XQuery 3.0 ?

Yes, XQ10 tests (without the plus), I think, correspond to incompatibilities with XQuery 3.0 (as in this case).

&gt; Because this is not the case since the test-cases mentioned (although marked
&gt; with &quot;XQ10&quot; dependency) are taken into account when generating XQuery 3.0
&gt; conformance reports.

I can also see these XQ10 tests displayed in the conformance report. Could there be a bug in the XSLT template?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>87411</commentid>
    <comment_count>10</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2013-05-08 08:35:07 +0000</bug_when>
    <thetext>When a test is marked &quot;XQ10&quot;, then an XQuery 3.0 processor should not run this test. There will usually be an alternative test marked &quot;XQ30&quot;: perhaps with slightly different test syntax or more usually with different result assertions.

Tests marked &quot;XQ10+&quot; should be run both by XQuery 1.0 processors and XQuery 3.0 processors.

(You also have the option, of course, to use this metadata to decide which processor to run, or to decide how to configure your processor prior to running the test. However, in reporting results to W3C, we expect the test submission to contain results for a single language version only.)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>87413</commentid>
    <comment_count>11</comment_count>
    <who name="Sorin Nasoi">spungi</who>
    <bug_when>2013-05-08 08:46:40 +0000</bug_when>
    <thetext>(In reply to comment #10)
&gt; When a test is marked &quot;XQ10&quot;, then an XQuery 3.0 processor should not run
&gt; this test. There will usually be an alternative test marked &quot;XQ30&quot;: perhaps
&gt; with slightly different test syntax or more usually with different result
&gt; assertions.
+1

 
&gt; Tests marked &quot;XQ10+&quot; should be run both by XQuery 1.0 processors and XQuery
&gt; 3.0 processors.
+1

&gt; (You also have the option, of course, to use this metadata to decide which
&gt; processor to run, or to decide how to configure your processor prior to
&gt; running the test. However, in reporting results to W3C, we expect the test
&gt; submission to contain results for a single language version only.)
+1
This would mean that an implementation reporting results for XQuery 3.0 should mark all test-cases with a dependency to &quot;XQ10&quot; as &quot;n/a&quot;. 

However, no matter if the test-cases with a dependency on &quot;XQ10&quot; are marked as &quot;fail&quot; or &quot;n/a&quot;, the XSL stylesheet should not take them into account when generating results for XQuery 3.0, right?

Now, it seems that there&apos;s an error in the XSL stylesheet that causes test-cases marked with &quot;XQ10&quot; dependency to be taken into account when generating report for XQuery 3.0 ...</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>87665</commentid>
    <comment_count>12</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2013-05-14 16:53:11 +0000</bug_when>
    <thetext>This is now a bug against the reporting stylesheet.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>89165</commentid>
    <comment_count>13</comment_count>
    <who name="O&apos;Neil Delpratt">oneil</who>
    <bug_when>2013-06-12 15:03:00 +0000</bug_when>
    <thetext>(In reply to comment #12)

Yes indeed it is a bug in the reporting stylesheet. I have now committed the bug fix to cvs.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>