Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Downloading XML into Netscape

Status
Not open for further replies.

Guyon

Programmer
Jan 27, 2003
6
0
0
GB
I'm trying to download an XML document into a Netscape browser (6 or higher) but I am having trouble getting at the data.

The code I am using is similar to this...

function loadDoc(caller, url)
{
xDoc = document.implementation.createDocument("", "", null);
xDoc.onload = function() { caller.onload(xDoc, url); }
xDoc.onerror = caller.onerror;
xDoc.load(url);
}

function caller_onload(xDoc, url)
{
var nodes = xDoc.getElementsByTagName("nodes");
}

trouble is, nodes is coming back empty. If I look at xDoc itself, it's an empty document.

I have tried setting "Content-type:" to "text/xml" at the server but this seems to have no effect

can anyone help?
 
Ha!

found my problem. In my ASP code I was going Response.SetHeader("Content-type","text/xml") instead of Response.ContentType = "text/xml"

now my tree works like a charm!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top