473,387 Members | 1,573 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.

XmlHttpRequest & responseXml

Hi All,

I am using XmlHttpRequest object within Firefox to get a xml document
from the servlet. The reponseText is set but the responseXml is null.

My Code is:
req = new XMLHttpRequest();
req.open('GET', './transform?resource=xul', false);
req.send(null);

When I print rq.getAllHeaders it says:

Content-type: application/xml

I can create a DOM object by:
var parser = new DOMParser();
var dom = parser.parseFromString(req.responseText, "text/xml");

Anyone got any ideas what can be the problem ? the parseFromString is
very slow for large documents so this is not a good option for me

Kind regards,
Marco Laponder
ml*@interchain.nl
Jul 23 '05 #1
2 2906


Marco Laponder wrote:

I am using XmlHttpRequest object within Firefox to get a xml document
from the servlet. The reponseText is set but the responseXml is null.

My Code is:
req = new XMLHttpRequest();
req.open('GET', './transform?resource=xul', false);
req.send(null);

When I print rq.getAllHeaders it says:

Content-type: application/xml


A bit odd indeed, do you have a public URL where that occurs?
But you write responseXml while the property is named responseXML, so
maybe you have got the property name wrong?
--

Martin Honnen
http://JavaScript.FAQTs.com/
Jul 23 '05 #2
Marco Laponder <ml*@interchain.nl> wrote:
I am using XmlHttpRequest object within Firefox to get a xml document
from the servlet. The reponseText is set but the responseXml is null.
Make sure you're looking for responseXML, not responseXml.
When I print rq.getAllHeaders it says:

Content-type: application/xml


Try sending "text/xml" instead.

--
Jeremy | je****@exit109.com
Jul 23 '05 #3

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

Similar topics

9
by: Chris Smith | last post by:
Been banging my head against this one for some time. I'm attempting to use XmlHTTPRequest to read an XML document from the web server and interact with it using the DOM. So far, I've had less...
4
by: Rich Hephner | last post by:
I'm a rookie to XMLHttpRequest and I'm having a hard time creating an XML object that I can parse using both IE and FireFox. Works great in Firefox, but IE returns "0" for "alert(topics.length)"....
2
by: Adam | last post by:
This is frustrating me. Opening IE displays the following code fine. When I open a new window the code no longer works. All the HTML is overwritten with the first document.write statement. Tried...
3
by: joker | last post by:
Thanks in Advance. I'm trying to find out why my responseXML is empty when the Content-Type for my request is "text/xml". I'm calling into a servlet from a web page on the same domain returning...
0
by: lprisr | last post by:
Hi, With XmlHttpRequest object, using .responseText ALWAYS force the data into utf-8. I am trying to preserve encoding, so I am looking to use .responseXML. Also I am using Atlas, so I can't...
4
by: Jarod | last post by:
Hey I have something like this: var xmlDoc=document.implementation.createDocument("", "", null); but in opera xmlDoc.load(...) won't work, so I use: XMLHttpRequest, and I have all needed...
27
by: ted benedict | last post by:
hi everybody, i hope this is the right place to discuss this weird behaviour. i am getting dynamically generated text or xml from the server side using xmlhttprequest. if the server side data is...
8
dmjpro
by: dmjpro | last post by:
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...
7
RMWChaos
by: RMWChaos | last post by:
Bizarro, that's all I can say. Aren't FF2.0.0.8 and NN9 both Mozilla 2 based browsers? So why would the exact same code work in one and not the other? To add insult to injury, it works just fine in...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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.