//create an instance of the XML parser
if (window.ActiveXObject)
{
//Checking if the browser is IE
xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
xmlDoc.async="false"; //make sure doc is fully loaded
xmlDoc.load(strPath) //load the file in the parser
if (xmlDoc.parseError.errorCode != 0)
{
alert("Error #: " + xmlDoc.parseError.errorCode;
}
}
//for mozilla based browsers
else if (document.implementation && document.implementation.createDocument)
{
xmlDoc= document.implementation.createDocument("","doc",null);
xmlDoc.async=false; //make sure doc is fully loaded
loaded = xmlDoc.load(strPath);
if(!loaded)
{
alert("Error in XML File");
}
}
//Parse the XML
var root = xmlDoc.documentElement;
level1Nodes = root.children;
for(var index1 = 0; index1 < level1Nodes.length; index1++)
{
//Extract the markup content from XML
var level1Node = level1Nodes[index1];
var strName = level1Node.children[0].textContent;
var strHeader1 = level1Node.children[1].tagName;
var strHeader1Content = level1Node.children[1].textContent;
}
Any ideas? Is the "children" property available in the IE DOM Parser?
Thanks in advance for all your help!