This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 21568 - Incorrect expected result for FOTS tests function-decl-reserved-function-names-001,function-decl-reserved-function-names-003,...
Summary: Incorrect expected result for FOTS tests function-decl-reserved-function-name...
Status: RESOLVED FIXED
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: XQuery 3 & XPath 3 Test Suite (show other bugs)
Version: Working drafts
Hardware: PC Windows NT
: P2 normal
Target Milestone: ---
Assignee: O'Neil Delpratt
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-04-03 14:03 UTC by Nicolae Brinza
Modified: 2013-06-12 15:03 UTC (History)
4 users (show)

See Also:


Attachments

Description Nicolae Brinza 2013-04-03 14:03:50 UTC
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 "http://www.w3.org/2005/xquery-local-functions";
declare function attribute() { fn:true()};
local:attribute()

expects the result "true()", 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 "attribute" 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
Comment 1 Michael Kay 2013-04-03 15:41:00 UTC
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 "The following names are not allowed as function names in an unprefixed form" 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.
Comment 2 O'Neil Delpratt 2013-05-01 14:32:48 UTC
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.
Comment 3 Tim Mills 2013-05-01 18:44:23 UTC
I think Mike'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'll request tis to be put on a future WG agenda.
Comment 4 Nicolae Brinza 2013-05-01 19:03:18 UTC
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 "attribute", one in XQ10 and the other in XQ30. Yet both specs have "attribute" as a reserved function name. So why do they expect different results?

--
Comment 5 Tim Mills 2013-05-01 21:26:41 UTC
Compare the use of the extra-grammatical constraint in the grammar appendices between the two specifications.  It applies only at FunctionCall in XQ10.
Comment 6 Michael Dyck 2013-05-07 16:21:42 UTC
See Bug 8713.
Comment 7 Michael Kay 2013-05-07 17:47:21 UTC
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...)
Comment 8 Sorin Nasoi 2013-05-07 23:45:54 UTC
(In reply to comment #7)
> 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...)

I have a question related to this comment: 
since the test-cases in question are marked with a dependency to "XQ10" 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't* count for XQuery 3.0 conformance ?

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

Am I missing something here?

Doesn't "XQ10" 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 "XQ10" dependency) are taken into account when generating XQuery 3.0 conformance reports.
Comment 9 Ghislain Fourny 2013-05-08 07:43:33 UTC
> My understanding is that for submitting results for XQuery 3.0 only
> test-cases marked with "XQ10+", "XQ30" and "XQ30+" should matter.

This is also my understanding.
 
> Am I missing something here?
> 
> Doesn't "XQ10" dependency stand for XQuery 1.0 test-cases that *may be*
> incompatible with XQuery 3.0 ?

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

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

I can also see these XQ10 tests displayed in the conformance report. Could there be a bug in the XSLT template?
Comment 10 Michael Kay 2013-05-08 08:35:07 UTC
When a test is marked "XQ10", then an XQuery 3.0 processor should not run this test. There will usually be an alternative test marked "XQ30": perhaps with slightly different test syntax or more usually with different result assertions.

Tests marked "XQ10+" 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.)
Comment 11 Sorin Nasoi 2013-05-08 08:46:40 UTC
(In reply to comment #10)
> When a test is marked "XQ10", then an XQuery 3.0 processor should not run
> this test. There will usually be an alternative test marked "XQ30": perhaps
> with slightly different test syntax or more usually with different result
> assertions.
+1

 
> Tests marked "XQ10+" should be run both by XQuery 1.0 processors and XQuery
> 3.0 processors.
+1

> (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.)
+1
This would mean that an implementation reporting results for XQuery 3.0 should mark all test-cases with a dependency to "XQ10" as "n/a". 

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

Now, it seems that there's an error in the XSL stylesheet that causes test-cases marked with "XQ10" dependency to be taken into account when generating report for XQuery 3.0 ...
Comment 12 Michael Kay 2013-05-14 16:53:11 UTC
This is now a bug against the reporting stylesheet.
Comment 13 O'Neil Delpratt 2013-06-12 15:03:00 UTC
(In reply to comment #12)

Yes indeed it is a bug in the reporting stylesheet. I have now committed the bug fix to cvs.