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 12649 - [XQuery30] Namespace constructors: ordering of rules (editorial)
Summary: [XQuery30] Namespace constructors: ordering of rules (editorial)
Status: CLOSED FIXED
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: XQuery 3.0 (show other bugs)
Version: Working drafts
Hardware: PC Windows NT
: P2 minor
Target Milestone: ---
Assignee: Jonathan Robie
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-12 13:09 UTC by Michael Kay
Modified: 2013-06-19 08:21 UTC (History)
1 user (show)

See Also:


Attachments

Description Michael Kay 2011-05-12 13:09:45 UTC
Section 3.8.3.7 clause 2 reads:

2. If the result of atomization is a single atomic value of type xs:NCName, xs:string, or xs:untypedAtomic, it is used as the prefix property of the newly constructed namespace node; if it can not be cast to xs:NCName, dynamic error is raised [err:XQDY0074]. If the result is the empty sequence or an empty string, the prefix property of the newly constructed namespace node is empty. For any other result, a type error is raised [err:XPTY0004].

The rules here are in the wrong order; if the name is "" we raise an error (because it's not an invalid NCName) before encountering the rule that says "" is allowed. Furthermore, namespace nodes do not have a "prefix property". I suggest:

2. If the result of atomization is an empty sequence or a single atomic value of type xs:string or xs:untypedAtomic, then the following rules are applied in order:

2a. If the result is castable to xs:NCName, then it is used as the local name of the newly constructed namespace node. (The local name of a namespace node represents the prefix part of the namespace binding.)

2b. If the result is the empty sequence or a zero-length xs:string or xs:untypedAtomic value, the new namespace node has no name (such a namespace node represents a binding for the default namespace).

2c. Otherwise, a dynamic error is raised [err:XQDY0074].  

3. If the result of atomization is not an empty sequence or a single atomic value of type xs:string or xs:untypedAtomic, a type error is raised [err:XPTY0004].
Comment 1 Jonathan Robie 2011-09-10 20:28:50 UTC
I agree. Changes made as requested.