In the first case, the xmlns="" attribute is added to the new replaced child to undeclare the parent's namespace which is in scope.
Anurag Chakravarti <[EMAIL PROTECTED]> wrote on 11/11/2005 08:13:30 AM:
> Hi,
> In xerces-2 jdk 1.5
>
> I am using replaceChild method. For some strange reason a
> xmlns="" attribute is added to the new child if it originally did not
> have a namespace. Otherwise if originally namespace was there of the
> parent context then no such attribute is added.
>
> CASE 1
> =======
> NODE TO BE UPDATED
> ---------------------
> <?xml version="1.0" encoding="UTF-8"?>
> <list xmlns="urn:ietf:params:xml:ns:resource-lists" name="mfriends">
> <entry uri="sip:[EMAIL PROTECTED]">
> <display-name>Bob Jones</display-name>
> </entry>
> </list>
>
>
> NEW NODE
> ---------
> <?xml version="1.0" encoding="UTF-8"?>
> <list name="mfriends">
> <entry uri="sip:[EMAIL PROTECTED]">
> <display-name>Bob Jones</display-name>
> </entry>
> </list>
>
>
> FINAL DOCUMENT
> ---------------
> <?xml version="1.0" encoding="UTF-8"?>
> <resource-lists xmlns="urn:ietf:params:xml:ns:resource-lists">
> <list xmlns="" name="mfriends">
> <entry uri="sip:[EMAIL PROTECTED]">
> <display-name>Bob Jones</display-name>
> </entry>
> </list>
> </resource-lists>
>
>
> CASE 2
> =======
> NODE TO BE UPDATED
> ---------------------
> <?xml version="1.0" encoding="UTF-8"?>
> <list xmlns="urn:ietf:params:xml:ns:resource-lists" name="mfriends">
> <entry uri="sip:[EMAIL PROTECTED]">
> <display-name>Bob Jones</display-name>
> </entry>
> </list>
>
> NEW NODE
> ---------
> <?xml version="1.0" encoding="UTF-8"?>
> <list xmlns="urn:ietf:params:xml:ns:resource-lists" name="mfriends">
> <entry uri="sip:[EMAIL PROTECTED]">
> <display-name>Bob Jones</display-name>
> </entry>
> </list>
>
> FINAL DOCUMENT
> ---------------
> <?xml version="1.0" encoding="UTF-8"?>
> <resource-lists xmlns="urn:ietf:params:xml:ns:resource-lists">
> <list name="mfriends">
> <entry uri="sip:[EMAIL PROTECTED]">
> <display-name>Bob Jones</display-name>
> </entry>
> </list>
> </resource-lists>
>
>
> Notice the difference in list element (xmlns="") in both the cases in
> the FINAL DOCUMENT SECTION.
>
> What am I doing wrong?? I think this is a bug in xerces-2.
>
> -Anurag
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
- replaceChild namespace possible bug Anurag Chakravarti
- Re: replaceChild namespace possible bug Neil Delima