473,396 Members | 2,020 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,396 software developers and data experts.

problem with XmlHttpRequest.responseXML

dmjpro
2,476 2GB
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 11149
acoder
16,027 Expert Mod 8TB
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 2GB
ok i got my answer....

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

okk thanxxxx.
Reagards.
May 9 '07 #3
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.
May 9 '07 #4
dmjpro
2,476 2GB
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
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_Applications_with_AJAX
May 12 '07 #6
dmjpro
2,476 2GB
thanx ........ thanx a lot ...

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

kind regards.
dmjpro.
May 12 '07 #7
dmjpro
2,476 2GB
so getElementsByTagName .... 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
so getElementsByTagName .... 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.com/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
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 =...
4
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...
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...
12
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...
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...
7
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 ?????? ...
14
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...
3
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: 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
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
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
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,...
0
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...
0
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...

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.