Original Post
I've been researching XML on the web, and everyone does seem to have examples of how to get mozilla to work -but i cant get it to work! On IE my code works. for instance, i do a getElementByTagName.length, and get 1, while on mozilla, i get 0. moz doesnt have any problem drawing the xml file, so it seems valid. I really need to get xml to work for mozilla! This is my mozilla code: this is the xml file: anyone know what is up, and how to parse xml on mozilla?
//xmldoc is a global in the html/javascript header
xmldoc = document.implementation.createDocument("", "", null);
xmldoc.onload = readXML; // i tried null here too, readXML is an empty function
xmldoc.load( xmlfile );
//... in body/javascript
var numFiles = xmldoc.getElementsByTagName( "files" ).length;
//this sets numFiles= 0, when it should be 1
<?xml version="1.0" ?>
<files>
<file id="001">file1</file>
<file id="002">file2</file>
<file id="003">file3</file>
</files>