PDA

View Full Version : responseXML is always null



pgdavid
15 Feb 2011, 3:16 AM
Hi all,

I'm trying to get a pretty simple XmlReader example to work on my box and I always hit the same sencha-touch.js (1.0.1a) exception.

The example can be found here:
http://dev.sencha.com/deploy/touch/docs/?class=Ext.data.XmlReader

Code is in place, users.xml is in place and as soon as I do store.load() the following exception is triggered from sencha-touch.js:14953



//inherit docs
getResponseData: function(response) {
var xml = response.responseXML;

if (!xml) {
throw {message: 'Ext.data.XmlReader.read: XML data not found'}; // THIS ONE
}
return xml;
},


No error within my code. In the inspector I can see how the XML is properly loaded, with its proper contents on response.responseText, but response.responseXML is *always* null.

Am I missing something? Any help would be much appreciated... thank you!

atomatom
12 Jul 2011, 9:59 AM
From the docs, I think this is your problem (I hit this too.)

Note: in order for the browser to parse a returned XML document, the Content-Type header in the HTTP response must be set to "text/xml" or "application/xml". This is very important - the XmlReader will not work correctly otherwise.