Discussion:
XMLHTTP returns ResponseText but not ResponseXML
(too old to reply)
bambou51 xav
2006-07-13 14:59:47 UTC
Permalink
Did you manage to get responseXML from a IE browser ?
I am exactely in the same situation, and nothing seems to work.
My header 'content-type' is 'text/html' even when I specify
req.setRequestHeader("Content-type", "application/xml"); or
req.setRequestHeader("Content-type", "text/xml");
before sending the XMLHttpRequest.
I also tried it under IE7Beta3 which support XMLHttpRequest (no activeX
need), but responseXML remains empty.
responseText is OK and display the content of my xml.

Xav



*** Sent via Developersdex http://www.developersdex.com ***
Martin Honnen
2006-07-13 16:48:18 UTC
Permalink
Post by bambou51 xav
Did you manage to get responseXML from a IE browser ?
I am exactely in the same situation, and nothing seems to work.
My header 'content-type' is 'text/html' even when I specify
req.setRequestHeader("Content-type", "application/xml"); or
req.setRequestHeader("Content-type", "text/xml");
before sending the XMLHttpRequest.
The server has to send a _response_ header
Content-Type: application/xml
or
Content-Type: text/xml
so that MSXML populates responseXML.

Setting the Content-Type _request_ header does not help for that.
--
Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
softengine
2006-07-28 22:26:01 UTC
Permalink
Martin,
How would I send a _response_ header:

Content-Type: application/xml
or
Content-Type: text/xml
so that MSXML populates responseXML.

How would I do this in Javascript/ASP?
--
Post by Martin Honnen
Post by bambou51 xav
Did you manage to get responseXML from a IE browser ?
I am exactely in the same situation, and nothing seems to work.
My header 'content-type' is 'text/html' even when I specify
req.setRequestHeader("Content-type", "application/xml"); or
req.setRequestHeader("Content-type", "text/xml");
before sending the XMLHttpRequest.
The server has to send a _response_ header
Content-Type: application/xml
or
Content-Type: text/xml
so that MSXML populates responseXML.
Setting the Content-Type _request_ header does not help for that.
--
Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
Joe Fawcett
2006-07-29 10:37:45 UTC
Permalink
It needs to be set server-side, in ASP:
Response.ContentType = "text/xml"

before sending the response to the client.
--
Joe Fawcett - XML MVP


http://joe.fawcett.name
Post by softengine
Martin,
Content-Type: application/xml
or
Content-Type: text/xml
so that MSXML populates responseXML.
How would I do this in Javascript/ASP?
--
Post by Martin Honnen
Post by bambou51 xav
Did you manage to get responseXML from a IE browser ?
I am exactely in the same situation, and nothing seems to work.
My header 'content-type' is 'text/html' even when I specify
req.setRequestHeader("Content-type", "application/xml"); or
req.setRequestHeader("Content-type", "text/xml");
before sending the XMLHttpRequest.
The server has to send a _response_ header
Content-Type: application/xml
or
Content-Type: text/xml
so that MSXML populates responseXML.
Setting the Content-Type _request_ header does not help for that.
--
Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
Loading...