My problem is related to this thread. I wrote an XML DOM parser. It parses the complete tree on IE, but it stops after the first downstream on FireFox, SeaMonkey and Opera. This is a simplified code that reproduces the issue:
So, why is this working in IE only? Maybe you can point me to some JScript/JavaScript difference. (A JavaScript/C++ comparison would also help.)
nb. I've already found a solution that works on all browsers:
Code:
function PrintNode(node)
{
AddText("<b>"+node.nodeName+"</b>="+node.nodeValue+" ("+node.childNodes.length+" children)");
if (!node.hasChildNodes) return;
AddText("<ul>");
var child=node.firstChild;
do
{
if (ShowMsg && !confirm(Text)) return;
AddText("<li>");
PrintNode(child);
AddText("</li>");
}
while (child=child.nextSibling);
AddText("</ul>");
}
nb. I've already found a solution that works on all browsers:
Code:
for (var child=node.firstChild;child;child=child.nextSibling)
Comment