Re: e4x duplicate xmlns attributes

Martin Honnen <[email protected]> Sat, 28 Feb 2009 15:26:49 +0100
Newsgroups gmane.comp.mozilla.devel.xml
Organization Liberty Development
Message-ID <[email protected]>
kael wrote:

> I'm trying to parse an XML content containing multiple namespaces with 
> E4X. Walking through the XML has the side-effect of creating duplicates 
> namespaces :
> 
> 
> var doc = <a xmlns='http://example.org/1'>
>             <b xmlns='http://example.org/2'>
>               <c xml:base="http://example.net/feed" type="html">
>                 Foo <p>Bar</p> Foobar
>               </c>
>             </b>
>           </a>;
> 
> doc[0].*::b[0]
>> <b xmlns="http://example.org/2" xmlns="http://example.org/1">
>>   <c xml:base="http://example.net/feed" type="html">
>>     Foo <p>Bar</p> Foobar
>>   </c>
>> </b>
> 
> doc[0].*::b[0].*::c[0]
>> <c xml:base="http://example.net/feed" type="html" 
>> xmlns="http://example.org/2" xmlns="http://example.org/1">
>>   Foo <p>Bar</p> Foobar
>> </c>
> 
> doc[0].*::b[0].*::c[0].*::*
>> Foo <p xmlns="http://example.org/2" 
>> xmlns="http://example.org/1">Bar</p> Foobar

I have filed https://bugzilla.mozilla.org/show_bug.cgi?id=480711 on this.


-- 

	Martin Honnen
	http://JavaScript.FAQTs.com/