It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Board index Programming JavaScript Forum

strange hasChildNodes issues in IE 7

strange hasChildNodes issues in IE 7

Postby kroyce on Tue Apr 17, 2007 6:22 pm

All,

For some reason the following code does not produce a valid xml document in ie 7 but it works marvelously in ff 2.0. Has anyone run into this before?

if (window.ActiveXObject)
{

var xmlObject=new ActiveXObject("Microsoft.XMLDOM");
xmlObject.async = "false";
xmlObject.load(XMLString);

//Checking to see if I have a #document element -
// Which I do...
alert(xmlObject.tagName);

if(xmlObject.hasChildNodes())
{
//We never enter this if statement
alert(xmlObject.tagName);
}
}
else //ff specific logic
{ var xmlObject = (new DOMParser()).parseFromString(XMLString, "text/xml");

if(xmlObject.hasChildNodes())
{
//We enter this if statement just fine
alert(xmlObject.nodeName);
}
}

example soap message:
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<HelloWorld xmlns="http://kroyce.pugetsound.edu/webservice/">
<name>k</name>
</HelloWorld>
</soap:Body>
</soap:Envelope>

Any help would be very much appreciated.

Thanks,
Kevin
kroyce
 
Posts: 4
Joined: Tue Apr 17, 2007 6:19 pm

Who is online

Users browsing this forum: No registered users and 9 guests