Xml Dcument not loading
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
<script language="Javascript">
var xmlDoc = new ActiveXObject("MICROSOFT.XMLDOM");
Hi folks, I need some helpgetting started.
I have a xml document called test.
I want to load the document and pickoff the node values.
Well, I am having trouble getting started here.
And I don't know if I do not have something a such as a project reference loaded in my project (I am using Visual InteDev Studio)
or just plain missing something. To the best of my knowledge the
document name is test.xml
It is not loading into the xmlDoc variable
when I display it with the alert(xmlDoc), I just have [object]
As I understand it,it should have displayed the document.
So that tells me it isn't loading the document.
The xml document is is using xml verision 1.0
Could someone please tell me what I am doing wrong?
<HTML>
<HEAD><META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
<script language="Javascript">
var xmlDoc = new ActiveXObject("MICROSOFT.XMLDOM");
xmlDoc.async = false;
xmlDoc.loadXML("Test.xml");
alert(xmlDoc);
var EventName = "n/a";
if (xmlDoc.documentElement !=null && xmlDoc.documentElement.FirstChild !=null)
{
var Root = XMLDoc.documentElement;
oNodeList = xmlDoc.documentElement.firstChild.nodeName;
alert(oNodeList.item(1).firstchild.nodevalue);
}
alert(oNodeList.item(1).firstchild.nodevalue);
}
|