473,804 Members | 3,649 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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?resou rce=xul', false);
req.send(null);

When I print rq.getAllHeader s it says:

Content-type: application/xml

I can create a DOM object by:
var parser = new DOMParser();
var dom = parser.parseFro mString(req.res ponseText, "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 2932


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?resou rce=xul', false);
req.send(null);

When I print rq.getAllHeader s 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.getAllHeader s 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
13849
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 than perfect luck with IE. What I've established: - In IE, the responseXML property sometimes returns an empty document. - It always does so when testing on local files. - It (sometimes? always?) works fine when pages are served by a web server.
4
1841
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)". What am I doing wrong? Does IE not recognize responseXML? Thanks. Here's my code: function initialize(){ var xmlhttp=false; try { xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
2
2717
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 with window tried without Please help. This code pulls XML from a web site then parses it into a dynamically created table built with javascript. The write table is not working correctly, other methods work fine. This code also locks up Fire Fox...
3
15301
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 a simple xml stream, but it only shows up under responseText? I'm using IE 6.0. function loadXMLDoc() { alert("running loadXMLDoc"); var url2 =
0
1484
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 directly access XmlHttpRequest object. Is there an easy way to make Atlas return data using responseXML? Or do I have to modify stuff in AtlasCore.js, and perhaps write some wrapper to handle how web service accept and return such data?
4
2531
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 code... let's say it works... So I got serviceRequest.responseXML and is there a way to initialize xmlDoc in my case ? I am asking because I have code that uses xmlDoc.load(...) in
27
13076
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 STATIC, i can have whatever size of data i want. but if the data (xml or text) is generated dynamically using php, then there seems to be a size limit! xmlhttprequest's responseText is truncated, and the xml therefore not well fromed. in border...
8
11164
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 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..
7
1781
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 IE7 too. In particular, I'm grabbing a ".txt" file, which you'll see in my code uses innerHTML to display, whereas ".xml" and ".js" files do not. Perhaps not a good way to do it...does NN9 have an issue with innerHTML? So here's my code for all...
0
9704
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9569
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10558
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10318
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10302
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7608
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6844
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5503
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5636
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.