Original Post
Hi, I'm reading a xml file using javascript, eg. When running this page under firefox it doesn't work, so far i've tested it to the second line, which doesn't work. I can't work out what it going wrong, as it works fine in internet explorer. thanks oh and heres the xml file
<html>
<head>
<xml id="dataXML" name="dataXML" SRC="data.xml"></xml>
<script type="text/javascript">
var myXML=document.getElementById("dataXML").XMLDocument; //this works
var textfieldsNode = myXML.documentElement; //so far this line won't work.
var itemNode = textfieldsNode.firstChild;
while(itemNode != null) {
var nameNode = itemNode.firstChild;
var sizeNode = nameNode.nextSibling;
alert(nameNode.firstChild.nodeValue + ", " + sizeNode.firstChild.nodeValue);
itemNode = itemNode.nextSibling
}
alert("test");
</script>
</head>
<body>
hello
</body>
</html>
<?xml version="1.0" ?>
<textfields>
<item>
<name>deptunit</name>
<size>16</size>
</item>
<item>
<name>familyname</name>
<size>14</size>
</item>
<item>
<name>firstname</name>
<size>18</size>
</item>
</textfields>