XML on Mozilla

admin

Administrator
Staff member
My xml code doesnt work on Mozilla. Doesnt show error message either.

Im using Javascript to navigate the nodes of the xml file. It works pretty fine on IE, but on Mozilla it just doesnt work. I made a parser for IE and another for Mozilla, so its loading right. But the navigation doesnt work.

//the parser
var xmlDoc
function loadXML() {//load xml file
//code for IE
if (window.ActiveXObject)
{
xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
xmlDoc.async=false;
xmlDoc.load("consultores-financieros.xml");
createPage()
}
// code for Mozilla, etc.
else if (document.implementation && document.implementation.createDocument)
{
xmlDoc= document.implementation.createDocument("","",null);
xmlDoc.load("consultores-financieros.xml");
xmlDoc.onload=createPage
}
else { alert('Your browser cannot handle this script'); }
}

//the node navigation

function createPage() //called from inside the loadXML()
{
var x=xmlDoc.getElementsByTagName("CF")
for (k=0;k<x.length;k+=1) //reads all CF
{
switch (x.item(k).getAttribute("region"))

//...and so on
 
Back
Top