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 3650 - Error code on element(*, test:unknownType) is ambiguous -- XPST0001/XPTY0004?
Summary: Error code on element(*, test:unknownType) is ambiguous -- XPST0001/XPTY0004?
Status: CLOSED FIXED
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: XQuery 1.0 (show other bugs)
Version: Candidate Recommendation
Hardware: Other Linux
: P2 normal
Target Milestone: ---
Assignee: Don Chamberlin
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 3576
  Show dependency treegraph
 
Reported: 2006-09-04 13:42 UTC by Frans Englich
Modified: 2006-10-16 20:47 UTC (History)
0 users

See Also:


Attachments

Description Frans Englich 2006-09-04 13:42:18 UTC
See this report on the test suite:

http://www.w3.org/Bugs/Public/show_bug.cgi?id=3576

There's a wide agreement that the spec is unclear here, and it would be great to have this fixed while it's possible.

This was also discussed by the task force in July, see(member only):
http://lists.w3.org/Archives/Member/member-query-test/2006Jul/0051.html

I disagree with my own comment in the member-query-test link that the spec should raise XPST0051, because XPST0051 is for unknown schema types or types that are not atomic(and the latter doesn't apply to this case).

I think issuing XTPY0004 is less sensible since it's not a type error. Either XPST0001(unfortunate, since it's very generic) or a new code for unknown schema types in element(). Adding a new code for that would be by the same thinking to why XPST0051 exists.

2.5.4.4 Schema Element Test explicitly mentions what to do when "the SchemaElementTest is not found in the in-scope element declarations". It could be sensible to do the same in 2.5.4.3 Element Test.


Frans
Comment 1 Andrew Eisenberg 2006-09-15 18:26:09 UTC
The XSL and XML Query WGs considered this issue at their Sept. 12 meeting.

The WGs agree that the spec is unclear in this area, but feel that this will always be true for some of our error behavior. Lacking a specific proposal for change, we agreed to close this bug report with no action.

Please close this bug report if you agree with our resolution. We will, of course, consider a specific solution if you chose to reopen this bug and povide one to us.
Comment 2 Frans Englich 2006-09-25 20:55:49 UTC
Here's a specific proposal. All references to sections are to XML Path Language (XPath) 2.0, but I believe they apply to the corresponding sections in XQuery 1.0 as well.

In 2.5.4.3 Element Test add to the end of both bullet point 5 and 6:

"If the TypeName is not found in the in-scope schema types, a static error is raised [XPSTNewCode]."

Add the same sentence to the end of bullet point 3 and 4 in 2.5.4.5 Attribute Test.

In G Error Conditions add:

err:XPSTNewCode:
	It is a static error if the TypeName in an ElementTest or AttributeTest is not found in the in-scope schema types.


Link the terms TypeName, ElementTest, AttributeTest, "in-scope schema types" and "static error" to the targets as currently done.

In bug #3576, comment #3, Jerome writes "checking whether the type 'test:unkonwnType' is in the context, should occur before type matching is applied. A corrolary of that is that I think bullet '1 ET is an unknown type' should actually never be used." If the WGs are supportive of Jerome's implied change, I am too. If the WGs has no opinion, I suggest to leave 2.5.4 as is, because I don't think I can understand the implications of such a change.

Regarding what "XPSTNewCode" should be, I suggest XPST0018 if the WGs has no opinion(I have no idea of the implications of that choice, I simply picked the next in line).
Comment 3 Frans Englich 2006-09-27 09:58:17 UTC
http://www.w3.org/Bugs/Public/show_bug.cgi?id=3576 needs to be reopened when this report is resolved.
Comment 4 Don Chamberlin 2006-10-11 19:16:42 UTC
On October 3, 2006, the Query and XSLT Working Groups decided to resolve this bug report by making the following changes to the XPath and XQuery documents:
(1) In Section 2.5.4.3 (Element Test), after "TypeName must be present in the in-scope schema types", insert a reference to error [XPTY0008]. Similarly, in Section 2.5.4.5 (Attribute Test), after "TypeName must be present in the in-scope schema types", insert a reference to error [XPTY0008]. In the message for error XPTY0008, change the final phrase as follows: "... except for an ElementName in an ElementTest or an AttributeName in an AttributeTest."

The working groups believe that these changes address the issue you have raised. If you agree, please change the status of this bug to "Closed."

Regards,
Don Chamberlin (for the joint working groups)
Comment 5 Frans Englich 2006-10-16 11:52:58 UTC
XPTY0008 doesn't exist, I think. I presume XPST0008 was intended?
Comment 6 Don Chamberlin 2006-10-16 16:40:18 UTC
Frans,
You are right. XPST0008 was intended. 
Thanks,
Don Chamberlin