How do I download XML files?

How do I download XML files and then use their contents? [import]uid: 8517 topic_id: 5668 reply_id: 305668[/import]

Good question, I was wondering the same thing as I want to use them for NEWS items, I think.

Asyncronous HTTP might be the answer [import]uid: 9371 topic_id: 5668 reply_id: 19425[/import]

Yeah I looked at the Asyncronous HTTP examples and they are used to download and read XML files…
Hmm…
But how does one point it to the web address were we put the XML. And then how does it know what from the file goes were? Then how do we update this at the launch of the app?!!!

So many things to do! [import]uid: 8517 topic_id: 5668 reply_id: 19441[/import]

http://developer.anscamobile.com/content/network-0
http://lua-users.org/wiki/LuaXml [import]uid: 12108 topic_id: 5668 reply_id: 19610[/import]

Ok I used the corona example project and I now can receive all the XML code for a web site. Now I need to know how to sort the code based on its type.

Like Title,Date,Description,etc.

Those links are confusing.
Do you personally know how to do this? [import]uid: 8517 topic_id: 5668 reply_id: 19617[/import]

There’s lots of information online, just do a search for “xml.”

Here are good place to start:
http://www.w3schools.com/xml/default.asp
http://www.republicofcode.com/tutorials/flash/as3xml/

Don’t worry that they aren’t about Lua; half the point of XML is that it isn’t language specific.

For what it’s worth…
Do you personally know how to do this?
Yes. I mean, I’ve never done it with Corona, but at work I write code all the time to download and parse XML data. [import]uid: 12108 topic_id: 5668 reply_id: 19622[/import]

Any reason you’re using XML?

Unless you need to pass up document markup and/or validation, use JSON. It’s much more compact, much easier to handle, maps *REALLY* nicely to lua tables, and will allow web based backend to easily work with any data you return.

The dkjson module will parse JSON and return you a table.

JSON > XML for data. [import]uid: 22457 topic_id: 5668 reply_id: 19668[/import]

check this out
http://developer.anscamobile.com/forum/2011/01/04/can-someone-offer-some-insight-how-access-weather-report#comment-19670 [import]uid: 12108 topic_id: 5668 reply_id: 19793[/import]

Ok I tried to modify it a bit and this is the console error I am getting…

If you need the source I can post that…

Runtime error
error loading module ‘uistuff’ from file ‘/Users/…/Desktop/App test of XML/uistuff.lua’:
/Users/…/Desktop/App test of XML/uistuff.lua:39: ‘’ expected near 'end’
stack traceback:
[C]: ?
[C]: ?
[C]: in function ‘require’
/Users/…/Desktop/App test of XML/main.lua:26: in main chunk
Runtime error: error loading module ‘uistuff’ from file ‘/Users/…/Desktop/App test of XML/uistuff.lua’:
/Users/…/Desktop/App test of XML/uistuff.lua:39: ‘’ expected near 'end’
stack traceback:
[C]: ?
[C]: ?
[C]: in function ‘require’
/Users/…/Desktop/App test of XML/main.lua:26: in main chunk
[import]uid: 8517 topic_id: 5668 reply_id: 19852[/import]