PDA

View Full Version : Using XmlReader



Diddy433
27 Jan 2011, 9:47 AM
I am trying to use XmlReader to read the response of a server call. See code below. Thanks in advance for any help.

response.getData() returns:



<response success='True'>
<info><number>1</number></info>
<save id='c281a296-6956-4012-82c0-5ec176402efc'/>
</response>



My code to try and read xml:



var Data = Ext.data.Record.create([
{ name: 'number', mapping: 'number' }
]);

var xmlReader = new Ext.data.XmlReader({
record: "info"
}, Data);

var someObject = xmlReader.readRecords(response.getData());



someObject contains no records. :-/