W3C home > Mailing lists > Public > www-dom@w3.org > April to June 2005

QUESTION

From: SALMAN MAZHAR <salmaz8347@hotmail.com>
Date: Mon, 04 Apr 2005 12:19:13 -0400
Message-ID: <BAY101-F20900B117F387F41771FB0CF3B0@phx.gbl>
To: www-dom@w3.org

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 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 22 June 2012 06:13:58 GMT