<?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>20340</bug_id>
          
          <creation_ts>2012-12-11 13:59:00 +0000</creation_ts>
          <short_desc>[XT3TS] element-0306</short_desc>
          <delta_ts>2014-06-10 13:41:59 +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>XSLT 3.0 Test Suite</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>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Tim Mills">tim</reporter>
          <assigned_to name="Abel Braaksma">abel.online</assigned_to>
          <cc>abel.braaksma</cc>
    
    <cc>mike</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>79912</commentid>
    <comment_count>0</comment_count>
    <who name="Tim Mills">tim</who>
    <bug_when>2012-12-11 13:59:00 +0000</bug_when>
    <thetext>I agreed with the previous XML output, but not all the new assertions.  Are they correct?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>79913</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2012-12-11 14:21:41 +0000</bug_when>
    <thetext>I had a lot of trouble with this test because of the problems retaining precise namespace information when you round-trip through serialization and parsing. In the course of conversion I discovered some paths that weren&apos;t being tested, so the new test is actually more extensive than the old. By expressing it as assertions against the result tree, with no serialization and parsing involved, I think we get a much clearer picture of exactly what the result tree is supposed to look like. I spent a lot of time on it and I believe it&apos;s correct, but of course it&apos;s open to challenge. One of the benefits of splitting it into 20 or 30 assertions is that we can have a focused debate on which ones are open to dispute.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>79916</commentid>
    <comment_count>2</comment_count>
    <who name="Tim Mills">tim</who>
    <bug_when>2012-12-11 15:02:49 +0000</bug_when>
    <thetext>Here goes...

&quot;If the newly constructed node is an element node, and if namespaces are inherited, then each namespace node of the newly constructed element (including any produced as a result of the namespace fixup process) is copied to each descendant element of the newly constructed element, unless that element or an intermediate element already has a namespace node with the same name (or absence of a name) or that descendant element or an intermediate element is in no namespace and the namespace node has no name.&quot;

Going inside out, we have

&lt;dogsbody/&gt; [[ fun easy &quot;http://www.dummy_ns.com&quot; xml ]]

This is then copied with namespace inheritance.

&lt;IT_Specialist&gt; [[ &quot;http://www.all.com&quot; xml ]]
  &lt;dogsbody/&gt; [[ fun easy &quot;http://www.dummy_ns.com&quot; xml ]]
&lt;/IT_Specialist&gt;

Then we have:

&lt;IT_Architect /&gt; [[ &quot;http://www.dummy_ns.com&quot; xml ]]

&lt;Business_Analyst /&gt; { xml }

These then get copied when constructing profession without namespace inheritance.

&lt;profession&gt; [[ &quot;http://www.dummy_ns.com&quot; xml ]]
  &lt;IT_Architect /&gt; [[ &quot;http://www.dummy_ns.com&quot; xml ]]
  &lt;IT_Specialist&gt; [[ &quot;http://www.all.com&quot; xml ]]
    &lt;dogsbody /&gt; [[ fun easy &quot;http://www.dummy_ns.com&quot; xml ]]
  &lt;/IT_Specialist&gt;
  &lt;Business_Analyst/&gt; { xml }
&lt;/profession&gt;

Finally, these get copied when constructing out with namespace inheritance.

&lt;out&gt; [[ fun easy xml ]]
  &lt;profession&gt; [[ fun easy &quot;http://www.dummy_ns.com&quot; xml ]]
    &lt;IT_Architect /&gt; [[ fun easy &quot;http://www.dummy_ns.com&quot; xml ]]
    &lt;IT_Specialist&gt; [[ fun easy &quot;http://www.all.com&quot; xml ]]
      &lt;dogsbody /&gt; [[ fun easy &quot;http://www.dummy_ns.com&quot; xml ]]
    &lt;/IT_Specialist&gt;
    &lt;Business_Analyst/&gt; { fun easy xml }
  &lt;/profession&gt;
&lt;/out&gt;
 
Do you agree with the above?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>79955</commentid>
    <comment_count>3</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2012-12-11 20:21:51 +0000</bug_when>
    <thetext>I have sinking feeling that you are right.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>96886</commentid>
    <comment_count>4</comment_count>
    <who name="Abel Braaksma">abel.braaksma</who>
    <bug_when>2013-11-27 22:19:49 +0000</bug_when>
    <thetext>We too were struggling understanding the full depth of this test. Our current output generates the following:

&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;out xmlns:easy=&quot;http://www.easyJobs.com&quot; xmlns:fun=&quot;http://www.funJobs.com&quot;&gt;
    &lt;profession xmlns=&quot;http://www.dummy_ns.com&quot;&gt;
        &lt;IT_Architect/&gt;
        &lt;IT_Specialist xmlns=&quot;http://www.all.com&quot;&gt;
            &lt;dogsbody xmlns=&quot;http://www.dummy_ns.com&quot;/&gt;
        &lt;/IT_Specialist&gt;
        &lt;Business_Analyst xmlns=&quot;&quot;/&gt;
    &lt;/profession&gt;
&lt;/out&gt;

Looking at Jim Mills&apos; comment #2, I belief this is correct, taking into account the following snippet of the spec: &quot;unless that element or an intermediate element already has a namespace node with the same name (or absence of a name)&quot;. In the above output, each element node has, or has not, the namespaces as defined in comment #2. 

If we take all assertions currently in that test and run it against that output, we get the following:

true: /out/namespace::* = &quot;http://www.funJobs.com&quot;
true: /out/namespace::* = &quot;http://www.easyJobs.com&quot;
true: /out/namespace::* = &quot;http://www.w3.org/XML/1998/namespace&quot;
true: count(/out/namespace::*) = 3
true: /out/*:profession/namespace::* = &quot;http://www.funJobs.com&quot;
true: /out/*:profession/namespace::* = &quot;http://www.easyJobs.com&quot;
true: /out/*:profession/namespace::* = &quot;http://www.dummy_ns.com&quot;
true: /out/*:profession/namespace::* = &quot;http://www.w3.org/XML/1998/namespace&quot;
true: count(/out/*:profession/namespace::*) = 4
true: /out/*:profession/*:IT_Architect/namespace::* = &quot;http://www.w3.org/XML/1998/namespace&quot;
true: /out/*:profession/*:IT_Architect/namespace::* = &quot;http://www.dummy_ns.com&quot;
false: count(/out/*:profession/*:IT_Architect/namespace::*) = 2
true: /out/*:profession/*:IT_Specialist/namespace::* = &quot;http://www.w3.org/XML/1998/namespace&quot;
true: /out/*:profession/*:IT_Specialist/namespace::* = &quot;http://www.all.com&quot;
false: count(/out/*:profession/*:IT_Specialist/namespace::*) = 2
true: /out/*:profession/*:IT_Specialist/*:dogsbody/namespace::* = &quot;http://www.w3.org/XML/1998/namespace&quot;
true: /out/*:profession/*:IT_Specialist/*:dogsbody/namespace::* = &quot;http://www.funJobs.com&quot;
true: /out/*:profession/*:IT_Specialist/*:dogsbody/namespace::* = &quot;http://www.easyJobs.com&quot;
true: /out/*:profession/*:IT_Specialist/*:dogsbody/namespace::* = &quot;http://www.dummy_ns.com&quot;
true: count(/out/*:profession/*:IT_Specialist/*:dogsbody/namespace::*) = 4
true: /out/*:profession/Business_Analyst/namespace::* = &quot;http://www.w3.org/XML/1998/namespace&quot;
false: count(/out/*:profession/Business_Analyst/namespace::*) = 1

The three ones failing are:

- false: count(/out/*:profession/*:IT_Architect/namespace::*) = 2
  this seems indeed incorrect. It should be 4 (easy, fun, dummy_ns and xml)

- false: count(/out/*:profession/*:IT_Specialist/namespace::*) = 2
  same as the previous. The count should be 4 here.

- false: count(/out/*:profession/Business_Analyst/namespace::*) = 1
  count should be 3 (easy, fun, xml)


If you agree with my assertions, I&apos;d like to go ahead and push the changes to the repository, so that we can close this bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>97302</commentid>
    <comment_count>5</comment_count>
    <who name="Tim Mills">tim</who>
    <bug_when>2013-12-09 09:35:12 +0000</bug_when>
    <thetext>Thanks - I agree.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>106710</commentid>
    <comment_count>6</comment_count>
    <who name="Abel Braaksma">abel.braaksma</who>
    <bug_when>2014-05-23 15:39:34 +0000</bug_when>
    <thetext>There is consensus.
Rev#441 contains changeset that fixes this bug, marking it as resolved.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>107256</commentid>
    <comment_count>7</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2014-06-04 10:07:45 +0000</bug_when>
    <thetext>The same problem affects test xml-version-026, which reads:

&lt;xsl:template match=&quot;/&quot;&gt;
  &lt;doc xmlns:a=&quot;http://a/&quot;&gt;
    &lt;chap xsl:inherit-namespaces=&quot;no&quot;&gt;
      &lt;para/&gt;
      &lt;para xmlns:a=&quot;&quot;/&gt;
    &lt;/chap&gt;
  &lt;/doc&gt;
&lt;/xsl:template&gt;

The doc element effectively has inherit-namespaces=&quot;yes&quot; and this causes the xmlns:a namespace to be present on both para elements; the inherit-namespaces=&quot;no&quot; on the intermediate level has no effect.

I&apos;m changing the test to add inherit-namespaces=&quot;no&quot; on the doc element.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>107586</commentid>
    <comment_count>8</comment_count>
    <who name="Tim Mills">tim</who>
    <bug_when>2014-06-10 13:41:59 +0000</bug_when>
    <thetext>Thanks.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>