<?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>11443</bug_id>
          
          <creation_ts>2010-11-30 18:57:54 +0000</creation_ts>
          <short_desc>Expected results have an erroneous namespace declaration</short_desc>
          <delta_ts>2014-11-19 17:12:02 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>XML Query Test Suite</product>
          <component>XML Query Test Suite</component>
          <version>1.0.3</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Windows 3.1</op_sys>
          <bug_status>RESOLVED</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="Benjamin Nguyen">benjie.nguyen</assigned_to>
          <cc>mike</cc>
    
    <cc>oneil</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>42918</commentid>
    <comment_count>0</comment_count>
    <who name="Josh Spiegel">josh.spiegel</who>
    <bug_when>2010-11-30 18:57:54 +0000</bug_when>
    <thetext>The following tests:
    K2-NameTest-30
    K2-NameTest-31
    K2-InScopePrefixesFunc-25

have an erroneous namespace declaration.  For example, consider test K2-NameTest-31:

   declare namespace a = &quot;http://example.com/1&quot;;
   declare namespace b = &quot;http://example.com/2&quot;;
   let $e := &lt;e a:n1=&quot;content&quot; b:n1=&quot;content&quot;&gt;
                &lt;a:n1/&gt;
                &lt;b:n1/&gt;
                &lt;?n1 ?&gt;
                &lt;n1/&gt;
            &lt;/e&gt;
   return $e/a:*

The current expected result is:
   &lt;a:n1 xmlns:b=&quot;http://example.com/2&quot; xmlns:a=&quot;http://example.com/1&quot;/&gt;

However, we think the expected result should be:
   &lt;a:n1 xmlns:a=&quot;http://example.com/1&quot;/&gt;

See section 3.7.4 (http://www.w3.org/TR/2009/PER-xquery-20090421/#id-ns-nodes-on-elements). 
Bullet 1: doesn&apos;t apply as &lt;a:n1&gt; has no namespace declaration attributes
Bullet 2: doesn&apos;t apply as the enclosing &lt;e&gt; has no namespace declaration attributes
Bullet 3: &quot;xml&quot; is always added
Bullet 4: causes &quot;a&quot; to be added as it is used in the element name of &lt;a:n1&gt;.  

Therefore, we think the declaration for &quot;b&quot; should not be part of the in-scope namespaces of &lt;a:n1&gt;


Note, K2-InScopePrefixesFunc-25 only returns the prefix but the essential problem is the same.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>42931</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2010-11-30 21:55:05 +0000</bug_when>
    <thetext>For the &lt;e&gt; element, bullet 4 of 3.7.4 causes the element to have a namespace declaration for b on the grounds that the element has an attribute whose name uses the prefix b.

The question is whether the child &lt;a:n1/&gt; element inherits this namespace. Assuming construction mode includes inherit, then if the &lt;a:n1/&gt; were part of an enclosed expression, it would inherit the namespace under 3.7.1.3 clause 1.e.ii.D.II. However, it isn&apos;t in an enclosed expression, so it seems namespace inheritance doesn&apos;t happen - which means that if the &lt;e&gt; element were returned and serialized, it&apos;s &lt;a:n1/&gt; child should in principle contain a namespace undeclaration for b.

To me the spec seems wrong. I&apos;ve never understood why &lt;e&gt;&lt;a/&gt;&lt;/e&gt; is treated differently from &lt;e&gt;{&lt;a/&gt;}&lt;/e&gt; from the point of view of namespace inheritance. My memory was that we had fixed this - but I can&apos;t see any evidence of it.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>115133</commentid>
    <comment_count>2</comment_count>
    <who name="Josh Spiegel">josh.spiegel</who>
    <bug_when>2014-11-19 17:12:02 +0000</bug_when>
    <thetext>This appears to be fixed now.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>