Loading XML file with FireFox

Hi there,

I need to load an XML document in order to fill a selectbox with several options. I have created (ok... i pulled it from the net) a piece of code that loads the XML file and then fills the selectbox quite nice. Only problem here is that the script works fine in IE but not in Firefox or any other NON IE browser.

my script:

function importXML(filename, elm_id)
{
if (document.implementation && document.implementation.createDocument)
{
//NON IE Code
xmlDoc = document.implementation.createDocument("", "", null);
var isLoaded = xmlDoc.load("http://" + document.domain + "/xml/pagelist.xml");

if (isLoaded == true)
{
createTable(elm_id);
}

}
else if (window.ActiveXObject)
{
//IE Code
xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
xmlDoc.onreadystatechange = function () {
if (xmlDoc.readyState == 4) createTable(elm_id)
};
xmlDoc.load("http://" + document.domain + "/xml/pagelist.xml");
}
else
{
alert('Your browser can\'t handle this script');
return;
}
}

Then i try to load the XML it seems it just can't find the corect file because it does not contain any data. Is this a path issue or something with rights? It doesn't work either on localhost or on the internet.

Anyone here that can tackle this problem? Your help is kindly appreciated.

Kind regards,

Eric Mulder
[1569 byte] By [ericmul1] at [2007-11-20 0:37:55]
# 1 Re: Loading XML file with FireFox
I don't think FireFox is aware of the MSXML library... and if it is, surely it won't use it anyway.

Even the most basic XSL pattern will fail in FireFox, so just keep the error message and provide a link to download IE6. ;)
Andrex at 2007-11-10 3:27:00 >