[xml] =?ISO-8859-1?Q?=22Re=3A=20=5Bxml=5D=20usage=20of=20xmlReconciliateNs=22=27?=



Hi,

Daniel Veillard wrote:

Is this a bug, if the namespaces declared inside the subtree are not 
included to the search for reusable namespaces?


  In general this won't work because the namespace node needs to be "in-scope"
i.e. held by a parent of the node referencing it, and usually if you're missing
a namespace it's because the parent was from the old tree.

   <a>
      <b xmlns:foo="foo">
         <c foo:attr="">
          <d xmlns:bar="foo">
             <foo:e/>
          </d>
       </c>
      </b>
   </a>

  though possible is unlikely. If you detach <c> the namespace used by e
could be remapped to the one held by d, but it won't fix the problem for 
foo:attr on c anyway...
  So no I think it makes little sense to do what you suggest.

I see. Yes, this would not make much sense.
But I'm still not sure if we are talking about the same thing.

Example:

  <a>
    <b xmlns:foo="foo">
      <c foo:attr="">
        <d xmlns:bar="bar" foo:attr="">
         <e xmlns:bar2="bar2">
            <bar:f/>
            <g bar2:attr=""/>
          </e>
        </d>
      </c>
    </b>
    <x/>
  </a>


Detaching <c> and adding it to <x> results in:

<a>
   <b xmlns:foo="foo"/>
   <x>
     <c xmlns:foo="foo" xmlns:bar="bar" xmlns:bar2="bar2" foo:attr="">
       <d xmlns:bar="bar" foo:attr="">
         <e xmlns:bar2="bar2">
           <bar:f/>
           <g bar2:attr=""/>
         </e>
       </d>
     </c>
   </x>
</a>

All the namespaces in the moved subtree are redeclared and remapped. The 
old declarations are still there but no more referenced. Why do "bar" 
and "bar2" need to be remapped if they do already exist?


Thanks,

Kasimier Buchcik




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]