e4x duplicate xmlns attributes

View: New views
2 Messages — Rating Filter:   Alert me  

e4x duplicate xmlns attributes

by Kael-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello,

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


Version: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.0.6)
Gecko/2009020911 Ubuntu/8.10 (intrepid) Firefox/3.0.6

Is this a bug ?

--
kael
_______________________________________________
dev-tech-xml mailing list
dev-tech-xml@...
https://lists.mozilla.org/listinfo/dev-tech-xml

Re: e4x duplicate xmlns attributes

by Martin Honnen-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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/
_______________________________________________
dev-tech-xml mailing list
dev-tech-xml@...
https://lists.mozilla.org/listinfo/dev-tech-xml