cancel
Showing results for 
Search instead for 
Did you mean: 

xmlns problem in XML manipulation

Former Member
0 Kudos

Hi

I notice that if a xml (element having xmlns), and each time you assign, append or replace the child element you will always get xmlns in your child. For ex

 
<a xmlns="http://www.w3.org/1999/xhtml">
<b/>
</a>

new element:

<c> test </c>

Appending <c> test </c> to </b > in A (<b>) will result


<a xmlns="http://www.w3.org/1999/xhtml">
<b>
<c xmlns=""> test </c>
</b>
</a>

Why does the element <c xmlns=""> test </c> having xmlns?? Could it be a bug of MII ?

Edited by: Seng Kiang Hoe on Jun 30, 2011 5:00 PM

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

You are trying to insert a node of xml inside other xml node which is using namespace http://www.w3.org/1999/xhtml.

Node C is not containing the same namespace.

if the parse will not add xmlns="" then it will use the namespace as a node which is not correct.

it your c node will also using the same namespace as


<c xmlns="http://www.w3.org/1999/xhtml"> test </c>

then you will find output


<a xmlns="http://www.w3.org/1999/xhtml">
<b>
<c> test </c>
</b>
</a>

Thanks

Anshul

Former Member
0 Kudos

Thanks Anshul

Answers (0)