<?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>12649</bug_id>
          
          <creation_ts>2011-05-12 13:09:45 +0000</creation_ts>
          <short_desc>[XQuery30] Namespace constructors: ordering of rules (editorial)</short_desc>
          <delta_ts>2013-06-19 08:21:02 +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.0</component>
          <version>Working drafts</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Windows NT</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>minor</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Michael Kay">mike</reporter>
          <assigned_to name="Jonathan Robie">jonathan.robie</assigned_to>
          <cc>jim.melton</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>48487</commentid>
    <comment_count>0</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2011-05-12 13:09:45 +0000</bug_when>
    <thetext>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 &quot;&quot; we raise an error (because it&apos;s not an invalid NCName) before encountering the rule that says &quot;&quot; is allowed. Furthermore, namespace nodes do not have a &quot;prefix property&quot;. 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].</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>56620</commentid>
    <comment_count>1</comment_count>
    <who name="Jonathan Robie">jonathan.robie</who>
    <bug_when>2011-09-10 20:28:50 +0000</bug_when>
    <thetext>I agree. Changes made as requested.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>