<?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>3808</bug_id>
          
          <creation_ts>2006-10-05 23:22:46 +0000</creation_ts>
          <short_desc>Constr-namespace-13.xml seems to missing namespace undeclaration</short_desc>
          <delta_ts>2007-01-11 23:59:41 +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>unspecified</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>INVALID</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="Per Bothner">per</reporter>
          <assigned_to name="Andrew Eisenberg">andrew.eisenberg</assigned_to>
          
          
          <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>12326</commentid>
    <comment_count>0</comment_count>
    <who name="Per Bothner">per</who>
    <bug_when>2006-10-05 23:22:46 +0000</bug_when>
    <thetext>Test Constr-namespace-13 results in either err:XQST0085 if XML Names 1.1 is not supported or Constr-namespace-13.xml is XML Names 1.1 is supported.
The latter file consists of:
&lt;foo:elem xmlns:foo=&quot;http://www.example.com/parent&quot;&gt;&lt;child/&gt;&lt;/foo:elem&gt;
Shouldn&apos;t the child include the namespace unclaratation attribute as in:
&lt;foo:elem xmlns:foo=&quot;http://www.example.com/parent&quot;&gt;&lt;child xmlns:foo=&quot;&quot;/&gt;&lt;/foo:elem&gt;

I&apos;m not sure if this is required by a literal reading of the Spec, but it seems implied by &quot;A namespace binding is created for each namespace that is declared in a namespace declaration attribute of an enclosing direct element constructor and not overridden by the current element constructor or an intermediate constructor&quot;.

This does lead to the question of the behavior of fn:in-scope-prefixes and fn:namespace-uri-for-prefix for the child node.  I would assume the former should return (&quot;foo&quot;, &quot;xml&quot;) and the latter should map &quot;foo&quot; to &quot;&quot;.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>13453</commentid>
    <comment_count>1</comment_count>
    <who name="Andrew Eisenberg">andrew.eisenberg</who>
    <bug_when>2007-01-11 20:10:12 +0000</bug_when>
    <thetext>I interpret our specifications differently than you have, Per.

The first bullet of section 3.7.1.2, Namespace Declaration Attributes, says:

&quot;If the namespace URI is a zero-length string and the implementation supports [XML Names 1.1], any existing namespace binding for the given prefix is removed from the in-scope namespaces of the constructed element and from the statically known namespaces of the constructor expression.&quot;

So, if XML Names 1.1 is supported, then foo:elem contains a binding for foo and child does not contain a binding for foo.

In section C.3, Serialization Parameters, XQuery says that the value of the undeclare-prefixes serialization parameters is &quot;no&quot;.

In section 5.1.7, XML Output Method: the undeclare-prefixes Parameter, of Serialization, we say:

&quot;If the undeclare-prefixes parameter has the value no and the output method is XML or XHTML, then the undeclaration of prefixes MUST NOT occur.&quot;

For these reasons, I believe that the test case result is correct.


Please close this bug report if you agree with this resolution.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>13456</commentid>
    <comment_count>2</comment_count>
    <who name="Per Bothner">per</who>
    <bug_when>2007-01-11 22:23:22 +0000</bug_when>
    <thetext>I buy your logic.  The problem is: why is Constr-namespace-13 different from Constr-namespace-22, whose result contains &lt;child xmlns=&quot;&quot;/&gt; ?

The test results Constr-inscope-10.xml and Constr-inscope-12.xml also contain undeclare attributes.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>13457</commentid>
    <comment_count>3</comment_count>
    <who name="David Carlisle">davidc</who>
    <bug_when>2007-01-11 22:34:20 +0000</bug_when>
    <thetext>(In reply to comment #2)
&gt; I buy your logic.  The problem is: why is Constr-namespace-13 different from
&gt; Constr-namespace-22, whose result contains &lt;child xmlns=&quot;&quot;/&gt; ?
&gt; 
&gt; The test results Constr-inscope-10.xml and Constr-inscope-12.xml also contain
&gt; undeclare attributes.
&gt; 

that&apos;s different as xmlns=&quot;&quot; is legal Namespace 1.0 syntax and is therefore required to be supported, it&apos;s just undeclaration of prefixes that was added in namespaces 1.1

David</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>13458</commentid>
    <comment_count>4</comment_count>
    <who name="Per Bothner">per</who>
    <bug_when>2007-01-11 22:53:53 +0000</bug_when>
    <thetext>(In reply to comment #3)
&gt; that&apos;s different as xmlns=&quot;&quot; is legal Namespace 1.0 syntax and is therefore
&gt; required to be supported, it&apos;s just undeclaration of prefixes that was added in
&gt; namespaces 1.1

I didn&apos;t realize that.  Thanks for the explanation.
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>13461</commentid>
    <comment_count>5</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2007-01-11 23:59:41 +0000</bug_when>
    <thetext>&gt;why is Constr-namespace-13 different from Constr-namespace-22, whose result contains &lt;child xmlns=&quot;&quot;/&gt; ?

Because undeclaring of the default namespace is possible in XML 1.0, and therefore happens whether or not you enable undeclare-prefixes in the serializer. We&apos;ve made the assumption that undeclaring of non-default prefixes is something that should only happen if you really need it, it shouldn&apos;t happen by accident because for most people it&apos;s just unnecessary clutter.

(Apart from the history, there&apos;s also a semantic difference between xmlns=&quot;&quot; and xmlns:p=&quot;&quot;. Writing xmlns=&quot;&quot; doesn&apos;t just undeclare the binding of prefix &quot;&quot; to some namespace, it also establishes a new binding of prefix &quot;&quot; to the non-namespace. So it has a positive effect, not just a negative effect. By contrast, the only real effect of writing xmlns:p=&quot;&quot; is to make any reference to p an error.)</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>