This is my first experience working with XML. I'm trying to write code
that will read an XML file. I've found several examples but I can't
get them to work. Am I missing a DLL file? The errors I commonly get
are "object required" (as with the code below) or "permission denied".
Any insight would be helpful and appreciated. Here is what I'm trying:
<script language="JavaScript">
function importXML(file)
{
xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
xmlDoc.onreadystatechange = function () {
if (xmlDoc.readyState == 4) createTable()
};
xmlDoc.loadXML(file);
}
function createTable()
{
var doc=xmlDoc.documentElement;
var x = xmlDoc.getElementsByTagName("Employee");
for (i=0;i<x[0].childNodes.length;i++)
{
alert(i); //enter code to process stuff here
}
}
</script>
<INPUT TYPE=button VALUE="import XML"
onClick="importXML('C:\tmpzip\test1.xml')">