473,387 Members | 1,863 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

responseText, responseXML parsing

My XML HTTP Request sends results in responseText. The result is an
XML file I will need to parse. After research I determined that a
cross browser XML parser will look like this:

responseXML.getElementsByTagName("to")[0].firstChild.nodeValue;

However, I receive responseText, not responseXML. Does anyone know of
the cross browser way to handle this problem?

Thank you.

Apr 10 '07 #1
1 10784
vu******@gmail.com wrote:
My XML HTTP Request sends results in responseText. The result is an
XML file I will need to parse. After research I determined that a
cross browser XML parser will look like this:

responseXML.getElementsByTagName("to")[0].firstChild.nodeValue;

However, I receive responseText, not responseXML. Does anyone know of
the cross browser way to handle this problem?
Make sure the server sends its response with the HTTP response header
Content-Type: application/xml
or
Content-Type: text/xml
That way XMLHttpRequest/XMLHTTP knows it is receiving XML and then
populates responseXML.

--

Martin Honnen
http://JavaScript.FAQTs.com/
Apr 10 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Alexander Mikhailian | last post by:
I have an http = new XMLHttpRequest(); that provides me with an http.responseXML. Somewhere deep in the http.responseXML there is a fragment called e.g. mydom that I want to copy with all its...
5
by: furby | last post by:
I have this little bit of code : var request = false; var divid = 0; var fforie; try { request = new XMLHttpRequest(); fforie = "FF"; } catch (trymicrosoft) { try { //request = new...
1
by: Pugi! | last post by:
Currently I am using a responsexml for an xmlhttprequest. The information is then processed by javascript : elements are created with attributes incl events using setAttribute; in other words I...
6
by: mihirnmehta | last post by:
This is my code function getDetails() { var name = document.getElementById("movie_name").value; if (window.XMLHttpRequest) //For Mozilla Browsers { XMLHttp=new XMLHttpRequest() }
1
by: KAS | last post by:
First of all, I am very much a newbie... From what I have read, it seems to me that both of these should be filled in all the time. The responseXML being a DOM representation and the responseText...
5
by: marcus6 | last post by:
Howto access xmlHttp.responseText as document.getElementByTagName ? If I access a .html page through the xmlHttp, how can I use the functions .getElementsByTagName and .getElementById on the data...
0
by: rsoler | last post by:
Since i can not use cross domain in httpget i use GM and i get the text in responsetext but i need to use the request.responseXML.documentElement documentchild there is some javascript to convert it...
1
by: Dheeraj Gupta | last post by:
Hi all, actully i made one jsp and from there i have sended request in Ajax object for getting an XML file, that file i can see it by responseText property of Ajax but whenever i use responseXML...
4
by: crc294 | last post by:
Hi all, in order to experiment with AJAX, I created a site called Rob's Easy Budget Tool (http://budget.edgerob.net). Check it out if ya like. I found its functionality useful so I made it available...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.