<?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>9312</bug_id>
          
          <creation_ts>2010-03-24 23:23:14 +0000</creation_ts>
          <short_desc>id-rename-expr-035 should expect error XUDY0023</short_desc>
          <delta_ts>2010-05-24 21:01:17 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>XQuery Update Facility Test Suite</product>
          <component>XQuery Update Facility Test Suite</component>
          <version>unspecified</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>VERIFIED</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="Josh Spiegel">josh.spiegel</reporter>
          <assigned_to name="Michael Kay">mike</assigned_to>
          <cc>andrew.eisenberg</cc>
    
    <cc>dmitry.lychagin</cc>
    
    <cc>josh.spiegel</cc>
    
    <cc>mike</cc>
    
    <cc>zhen.liu</cc>
          
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>33883</commentid>
    <comment_count>0</comment_count>
    <who name="Josh Spiegel">josh.spiegel</who>
    <bug_when>2010-03-24 23:23:14 +0000</bug_when>
    <thetext>As test id-rename-expr-035 renames an element, bullet 2. a. of section 2.4.4 applies:

&quot;If the namespace binding of $QName conflicts with any namespace binding in the namespaces property of $target, a dynamic error is raised [err:XUDY0023].&quot;

In this case, $QName has an implied binding of &quot;&quot;=&quot;http://www.gym.com&quot; which conflicts with the the default namespace.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>34317</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2010-04-01 08:29:09 +0000</bug_when>
    <thetext>I think the test is correct as written.

I think the objection appears to be based on a notion that the element being renamed has an existing namespace binding (&quot;&quot;=&quot;&quot;), that is, binding the null prefix to the null namespace. There is no such binding in the data model: a prefix is either bound to an actual namespace, or it is not bound at all.

See XDM section 3.3.3: For every element node whose name has no prefix, the element must have a a binding for the empty prefix to the namespace URI of the element name, or must have no binding for the empty prefix in the case where the name of the element has no namespace URI.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>34416</commentid>
    <comment_count>2</comment_count>
    <who name="Josh Spiegel">josh.spiegel</who>
    <bug_when>2010-04-02 13:56:01 +0000</bug_when>
    <thetext>You are right, I did not know that &quot;&quot;=&quot;&quot; is not in the namespaces property.   id-rename-expr-035 is correct.  

However, then it seems namespace-errors-q16 is incorrect.  The test creates a similar situation but instead expects error XUDY0023.  

Also, I believe there may be a problem in the definition of upd:propagateNamespaces when propagating a default namespace.  Consider the following example:

declare copy-namespaces preserve, inherit;
copy $a := &lt;a&gt;&lt;b/&gt;&lt;/a&gt;
modify rename node $a as QName(&quot;foo&quot;, &quot;a&quot;)
return $a

In this example, &quot;&quot;=&quot;foo&quot; will be propagated to element &lt;b/&gt; as &lt;b/&gt; does not have a binding for prefix &quot;&quot;.  In this situation, it would be necessary to change the expanded QName of &lt;b/&gt; to have the new uri &quot;foo&quot; during propagation.   For another example, consider test id-rename-expr-035.  The user really only needs to rename the root node to achieve the same effect.  Possibly a default namespace should not be allowed to propagate in such cases.  </thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>34541</commentid>
    <comment_count>3</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2010-04-05 12:54:24 +0000</bug_when>
    <thetext>I agree with Josh (comment #2) on both counts.

(a) it seems namespace-errors-q16 is incorrect

(b) a namespace binding &quot;&quot;=&quot;x&quot; should not be propagated to an element that assumes the &quot;implicit&quot; namespace binding xmlns=&quot;&quot;.

There&apos;s a close analogy here with XSLT bug 5857, whereby we changed the rules so that namespace inheritance in xsl:copy-of does not apply to the default namespace; bug 6517 against XQuery is in the same area, but was found not to be a problem after all.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>34607</commentid>
    <comment_count>4</comment_count>
    <who name="Josh Spiegel">josh.spiegel</who>
    <bug_when>2010-04-06 15:54:43 +0000</bug_when>
    <thetext>I don&apos;t know what the bug etiquette in this system is yet so please correct me if any of this is inappropriate.  Here is what I did:

(1) I left this bug open and assigned it to Andrew to track the issue with test namespace-errors-q16 (I think he is the author).  

(2) I added Michael in the CC list of this bug

(3) I created a new bug 9432 to track the issue with upd:propagateNamespaces.  I updated the CC list of this new bug to be the same as this bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>34636</commentid>
    <comment_count>5</comment_count>
    <who name="zhen hua liu">zhen.liu</who>
    <bug_when>2010-04-07 21:45:55 +0000</bug_when>
    <thetext>yes, namespace-errors-q16 is incorrect, it should go through without errors.
id-rename-expr-035 is correct. This is how my implementation result is.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>34665</commentid>
    <comment_count>6</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2010-04-08 18:17:45 +0000</bug_when>
    <thetext>I have corrected test namespace-errors-q16.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>34668</commentid>
    <comment_count>7</comment_count>
    <who name="zhen hua liu">zhen.liu</who>
    <bug_when>2010-04-08 22:42:08 +0000</bug_when>
    <thetext>i have &apos;cvs synch&apos; your latest change of namespace-errors-q16 and tested my
implementation. It seems to be fine except one thing, in the
result file namespace-errors-q16.xml

there is xmlns=&quot;&quot; for &lt;PhD&gt; element as shown below:

 &lt;PhD xmlns=&quot;&quot; name=&quot;Julia&quot; advisor=&quot;r1&quot;/&gt; 

Why there is this extra xmlns=&quot;&quot; here ?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>34669</commentid>
    <comment_count>8</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2010-04-08 22:55:17 +0000</bug_when>
    <thetext>&gt;Why there is this extra xmlns=&quot;&quot; here ?

Because the PhD element has not been renamed; it is still in no namespace, as it was in the original document. The serializer needs to add this namespace undeclaration to ensure that the element is not moved into the namespace http://www.example.com/test which is now the default.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>34795</commentid>
    <comment_count>9</comment_count>
    <who name="Josh Spiegel">josh.spiegel</who>
    <bug_when>2010-04-12 19:54:35 +0000</bug_when>
    <thetext>Could you please add an XQueryX version for &quot;namespace-errors-q16-test.xq&quot;?  I would do it for you but I don&apos;t have CVS powers.  Thanks.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>34947</commentid>
    <comment_count>10</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2010-04-13 14:52:32 +0000</bug_when>
    <thetext>Re comment #9, I believe Andrew Eisenberg generates the XQueryX version of the tests.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>34960</commentid>
    <comment_count>11</comment_count>
    <who name="Andrew Eisenberg">andrew.eisenberg</who>
    <bug_when>2010-04-13 20:27:58 +0000</bug_when>
    <thetext>I&apos;ve just added namespace-errors-q16-test.xq to CVS.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>35036</commentid>
    <comment_count>12</comment_count>
    <who name="Josh Spiegel">josh.spiegel</who>
    <bug_when>2010-04-14 22:07:58 +0000</bug_when>
    <thetext>Thanks!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>35815</commentid>
    <comment_count>13</comment_count>
    <who name="Andrew Eisenberg">andrew.eisenberg</who>
    <bug_when>2010-05-24 21:01:17 +0000</bug_when>
    <thetext>Comment #6 reported a change to the result of test case namespace-errors-q16. The WG discussed this change at its meeting on May 18 and agreed with it.

To clarify the issue that was raised by this test case, the WG will add both an example and a note to section 2.4.4, Rename, as follows:


Example:

o Rename the root element of bib.xml. 

rename node fn:doc(&quot;bib.xml&quot;)/books
as fn:QName(&apos;http://www.example.com/bib&apos;, &apos;books&apos;)


Note:

A rename expression may replace the name of element node that is in no namespace with a QName that has a namespace URI and local name, but no prefix (as shown in one of the examples above). No conflcit in namespace bindings arises during the execution of this expression. The namespaces property of such an element node does not contain a namespace binding with a prefix that is the empty string.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>