I have a new xml(B) that needs to merge into another XML(A).
I am using documentElement.childNodes for merging. The weird thing is that It does not merge properly.
I have the correct number of nodes in B xml. but when it iterates and appends to B xml, for some reason it does not append all nodes from A xml to B xml.
the B xml has 6 nodes and A has 1 node. so in total it is supposed to be 7 nodes. but it shows only 4 nodes.
here is my code.
---------------------------------------------------------
var msgs = datasrc.documentElement.childNodes;
alert("length: "+ msgs.length);
for (var i=0; i<msgs.length; i++)
{
var msg = msgs.item(i);
original.documentElement.appendChild(msg);
}
alert("total xml\n" + original.xml);
does anybody know why or know any site that I can look up?
Please help.
I am using documentElement.childNodes for merging. The weird thing is that It does not merge properly.
I have the correct number of nodes in B xml. but when it iterates and appends to B xml, for some reason it does not append all nodes from A xml to B xml.
the B xml has 6 nodes and A has 1 node. so in total it is supposed to be 7 nodes. but it shows only 4 nodes.
here is my code.
---------------------------------------------------------
var msgs = datasrc.documentElement.childNodes;
alert("length: "+ msgs.length);
for (var i=0; i<msgs.length; i++)
{
var msg = msgs.item(i);
original.documentElement.appendChild(msg);
}
alert("total xml\n" + original.xml);
does anybody know why or know any site that I can look up?
Please help.