3ddy Posted December 29, 2015 Share Posted December 29, 2015 Hello,I want to read data and properties from xml file in my game. I have already loaded the xml file in preloader using preload: function () { game.load.xml('xml', 'some_xml.xml', false); },I know that I can get it using cache.getXml(); but the question is... how to read data, properties from that xml? Some simple example will be great. Another questions :Is using xml file to store data (lots of text, nodes) a good idea? Would it work when making native app for android/ios using cocoon? I have found some old post that reading xml was not supported in cocoon, didnt find info if it has changed. If using xml is bad, what is the solution then? json? Link to comment Share on other sites More sharing options...
icp Posted December 29, 2015 Share Posted December 29, 2015 Another questions :Is using xml file to store data (lots of text, nodes) a good idea? Would it work when making native app for android/ios using cocoon? I have found some old post that reading xml was not supported in cocoon, didnt find info if it has changed. If using xml is bad, what is the solution then? json?For CocoonJS use JSON. Link to comment Share on other sites More sharing options...
3ddy Posted December 29, 2015 Author Share Posted December 29, 2015 For CocoonJS use JSON.That means CocoonJS still doesn't support XML or it's just inefficient? If I would like to stay with xml what should I choose to make native app that have XML support? PhoneGap? Link to comment Share on other sites More sharing options...
icp Posted December 29, 2015 Share Posted December 29, 2015 CocoonJS still doesn't support XML on Canvas+. I checked yesterday. Link to comment Share on other sites More sharing options...
Gob0 Posted December 29, 2015 Share Posted December 29, 2015 Hi, if you can choose data format, let's go for JSON (aka JavaScript Object Notation). If you have to use XML, well, you can use DOM parser (low-level) or jQuery (for example). Link to comment Share on other sites More sharing options...
Recommended Posts