-
2 Mar 2012 2:50 AM #1
Unanswered: XML parsing
Unanswered: XML parsing
Hello,
I have data from a web server in XML format and would like to parse this directly, without a store. Just like the JSON decode command.
The reason I don't want to use a store is because I have lots of different xml formats and I prefer not to have to create all these different stores in my application.
Is there any command or workaround in sencha touch 2.0 for parsing XML directly at a given rootProperty?
Thanks in advance,
Beo Lutz
-
2 Mar 2012 3:40 AM #2
make a new class and as a static you can set up functions to hit like data proxy class
then you can have an example likeCode:getChartData:function(uarehell,callback,scope,filters){ Ext.Ajax.request({ url:uarehell, success: function(response, opts) { var data=[]; var xml=response.responseXML; var elements=Ext.DomQuery.select('point',xml); for (var i = 0; i < elements.length; i++) { var point = elements[i]; var price=Ext.DomQuery.select('price',point); data.push(price[0].firstChild.nodeValue); } callback(data,scope); } }) }
-
5 Mar 2012 12:56 AM #3


Reply With Quote