I am getting crazy. Can't access XML contents in Firefox.

[email protected]
Newsgroups gmane.comp.mozilla.devel.xml
Organization http://groups.google.com
Message-ID <[email protected]>

Hello sirs,


I am trying to send a POST request to a webservice on the click of a
button. This will return me an XML document with a list of combo box
items.


The problem: in FIREFOX, when the get the XmlDocument from the
XmlHttpRequest object, I can't access its contents. I keep getting
empty strings and "null".


This is my code:


---


function GetComboBoxItems(p_strType, p_strCode)
{
        var objParameters = new Array();
        objParameters[0] = p_strType;
        objParameters[1] = p_strCode;


        var objHttpRequest =

SendRequest("/MeuWebService/MyWebService.asmx/GetComboBoxIte­ms",
objParameters);


        alert(objHttpRequest.responseT­ext);   // alerts the XML doc
(see below)


        /*


        this is the XML document:


        <?xml version="1.0" enconding="utf-8"?>
        <ReturnDocument>
          <ComboItem>
             <Key>1</Key>
             <Description>My first item</Description>
          </ComboItem>
          <ComboItem>
             <Key>2</Key>
             <Description>My second item</Description>
          </ComboItem>
        </ReturnDocument>


        */


        alert(objHttpRequest.responseX­ML);  // alerts '[object
XMLDocument]'


        var XmlDoc = objHttpRequest.responseXML;


        var arrTemp =
XmlDoc.documentElement.getElem­entsByTagName("ComboItem");


        alert(arrTemp.length); // alerts '2'


        // show contents (Firefox)
        for(var i = 0; i < arrTemp.length; i++)
        {
           alert(arrTemp[i].childNodes[0]­.nodeValue); // alerts empty
string
           alert(arrTemp[i].childNodes[1]­.nodeValue); // alerts
'null'
        }


        /*
        // show contents (IE) - works perfectly
        for(var i = 0; i < arrTemp.length; i++)
        {
           alert(arrTemp[i].childNodes[0]­.text);
           alert(arrTemp[i].childNodes[1]­.text);
           alert(arrTemp[i].childNodes[2]­.text);
        }  */



}


---

I searched everywhere for a logic explanation, but couldn't find any.


In IE it works perfectly. What am I doing wrong? 


TIA, 
Leonardo
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.