QUESTION

Hello,

I am trying to parse a simple XML document with DOM in an HTML file using 
javascript. My HTML code looks like this:

<HTML>
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
   <!---Hide from non-JavaScript Browsers

    var xmlDoc = new ActiveXObject ("Microsoft.XMLDOM");
    xmlDoc.async="false";
    xmlDoc.load("test.xml");
    document.write("The first XML element in the file contains: <BR>");
    document.write("xmlDoc.documentElement.firstChild.text);

//Stop Hiding >
</SCRIPT>

<TITLE>DOM Testing</TITLE>
</HEAD>

<BODY>
     HELLO
</BODY>
</HTML>

When I try to view this page in my browser, I get a blank page. My XML file 
is not empty and it should give me the results that I want. What could be 
the problem?

Thank You and waiting for a quick reply.

Sincerely Yours,
Salman Mazhar.

Received on Monday, 4 April 2005 17:29:18 UTC