i m generating a xml file through jsp file using AJAX.
my response header in jsp file is like this ..
<%@ page contentType = "text/xml;charset = WINDOWS-1252"%>
when i do XmlHttpRequest.responseText the xml content is displayed but when i do the same thing with XmlHttpRequest.responseXML.
what's the problem with XmlHttpRequest.responseXML..
Plz explain XmlHttpRequest.responseXML..
Plz help.
Regards.
Yes,if u want to view the XML content of the response object u have to call
XmlHttpRequest.responseText.
If u alert the XmlHttpRequest.responseXML it shows an [object].
Use XmlHttpRequest.responseXML method to handle the XML file on the browser side.Use XmlHttpRequest.responseXML.documentElement to get the root node of the XML file.By using this u can go thru' whatever the nodes and attributes of the nodes u want to display.There r several DOM methods available like.... XmlHttpRequest.responseXML.documentElement.getElem entsBytagName
XmlHttpRequest.responseXML.documentElement.childNo des.length
XmlHttpRequest.responseXML.documentElement.childNo des[4].firstChild.text
So XmlHttpRequest.responseXML is used to handle the XML file on the browser.