473,835 Members | 1,711 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

problem with XmlHttpRequest. responseXML

dmjpro
2,476 Top Contributor
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.
May 7 '07 #1
8 11166
acoder
16,027 Recognized Expert Moderator MVP
See thsi link It should answer your question.

responseXML will be empty unless the response is valid XML with the correct headers.
May 8 '07 #2
dmjpro
2,476 Top Contributor
ok i got my answer....

actually i use OPERA so i have to use xmlhttprequest. overrideMIMEtyp e('text/xml') even i do in the server side ..... reponse header --- MIME-TYPE as text/xml.

okk thanxxxx.
Reagards.
May 9 '07 #3
satyanarayana49
8 New Member
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.doc umentElement 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.doc umentElement.ge tElementsBytagN ame
XmlHttpRequest. responseXML.doc umentElement.ch ildNodes.length
XmlHttpRequest. responseXML.doc umentElement.ch ildNodes[4].firstChild.tex t

So XmlHttpRequest. responseXML is used to handle the XML file on the browser.
May 9 '07 #4
dmjpro
2,476 Top Contributor
is the story is true what u tellling ..... a new idea leads me to a new world of web-technology ... today i will implement this .....

can u give me a good link about it in which i can see the details on XML parsing .....

thanxxxxx ... a lot of Thanks.

Kind Regards.
May 9 '07 #5
satyanarayana49
8 New Member
is the story is true what u tellling ..... a new idea leads me to a new world of web-technology ... today i will implement this .....

can u give me a good link about it in which i can see the details on XML parsing .....

thanxxxxx ... a lot of Thanks.

Kind Regards.
You can go to this site http://aspalliance.com/1194_Web_Applic ations_with_AJA X
May 12 '07 #6
dmjpro
2,476 Top Contributor
thanx ........ thanx a lot ...

that's waht i look for... again thanx.

kind regards.
dmjpro.
May 12 '07 #7
dmjpro
2,476 Top Contributor
so getElementsByTa gName .... this is the main thing i have to use frequently ...

that means using this method i can get all the desired values in a XML file.
m i right?

one more thing, requesting for a HTML file using AJAX is nothing but a fool job.....mainly AJAX is for requesting for a XML file then processing the node values using this method.

any suggestion is most welcome.
kind regards.
dmjpro.
May 12 '07 #8
satyanarayana49
8 New Member
so getElementsByTa gName .... this is the main thing i have to use frequently ...

that means using this method i can get all the desired values in a XML file.
m i right?

one more thing, requesting for a HTML file using AJAX is nothing but a fool job.....mainly AJAX is for requesting for a XML file then processing the node values using this method.

any suggestion is most welcome.
kind regards.
dmjpro.
check this link http://www.sitepoint.c om/article/server-side-xml-javascript
May 14 '07 #9

Sign in to post your reply or Sign up for a free account.

Similar topics

0
1636
by: Punit | last post by:
Hi, Could someone please suggest where I am going wrong... Iam using MSXML 3.0 and VC++ but i end up getting blank response XML try { hr = m_PSiebelDocument.CreateInstance(MSXML2::CLSID_DOMDocument); if(SUCCEEDED(hr)) {
4
4588
by: sboles | last post by:
Hello, I am trying to process each node from XMLHttpRequest.responseXML and set the node's 'className' property based on the value of the 'class' attribute. I have written a recursive function to do this. However, after the function completes, the node's className properties are not set. I was under the impression that objects were passed to functions as references. What have I missed? Code:
2
2721
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
15302
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 =
12
5138
by: Joel Byrd | last post by:
I'm having a little problem with using type-ahead functionality for an auto-suggest box. Sometimes, when I start to type something and the type-ahead shows up, the AJAX will send a request query using the value that *includes* the type-ahead value. In other words, say that I type in "ja" and the first listing that comes up is "jack@test.com". The AJAX part is supposed to send "ja" as one of the query string variables when calling the...
0
1487
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?
7
5014
by: KaNos | last post by:
Hello aspx world, I consume a webservice with Javascript functions. But the response is ok and, very strange, document is null. How to resolve this problem thanks ?????? xmlHttpRequest.open("POST", myAddressLocation, false); xmlHttpRequest.setRequestHeader("Content-Type", "text/xml; charset=utf-8"); xmlHttpRequest.send(xmldocumentSoapRequest);
14
6083
by: webEater | last post by:
I downloaded IE7 and tried out the native XMLHttpRequest support. I think there is an object in IE7 called "XMLHttpRequest" but I ask me why it is called "XML"HttpRequest. I made a request to an XML file (correctly sent with text/xml header) but IE7 returns the same shit as IE 5.5/6 when I use responseXML, an XML construct with a node "xml", which contains nothing. Firefox and Opera and Netscape 7.1 (yeah,) do it correctly. What's goin...
3
3465
by: robezy | last post by:
Hi, I'm pulling my hair for some time with this problem today. Will greatly appreciate if some one could provide me a solution. I'm using ajax to get a list of categories to be populated in a dropdown. My main code is below. function makeRequest() {
0
9803
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
9652
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
10811
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...
1
10560
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,...
0
10233
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9345
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7766
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
6966
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
5804
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.