xmlhttp.responseXML parsing

"Jonathan Bond" <[email protected]>
Newsgroups gmane.comp.mozilla.devel.xml
Organization GoldenEye Solutions
Message-ID <[email protected]>
Hi guys,

I am using the following code snippet to parse an xmlhttp request:

if(xmlhttp.responseXML)  {
    var xmlresponce = xmlhttp.responseXML;

     if(xmlresponce.documentElement.tagName == "parsererror"){
                  var parseErrorText =
xmlresponce.documentElement.firstChild.data;
                  parseErrorText += "\n" +
xmlresponce.documentElement.firstChild.nextSibling.firstChild.data;
      alert(parseErrorText);
      return;
    }

    var update_count =
xmlresponce.getElementsByTagName("updates")[0].firstChild.nodeValue;
     var error_count =
xmlresponce.getElementsByTagName("errors")[0].firstChild.nodeValue;
}

Now if I send the following XML (from the server)
<?xml version = "1.0"?>
<responce>
 <errors>0</errors>
 <updates>2</updates>
</responce>

I get a parsing error in firefox (it complains about <?xml version = "1.0"?>
!!??)

So sending the following simple xml works:
<responce>
 <errors>0</errors>
 <updates>2</updates>
</responce>

Could anyone clarify how firefox parses the responseXML ? I don't see why it
should fail parsing the xml tag.. This works well in IE, shouldn't it be
best to allow specifying the xml version and encoding.. ?

I'm using firefox v1.0.6 on windows xp

best,
jon
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.