79 posts
Location
Germany
Posted 05 January 2014 - 10:50 AM
Hello folks,
I got the following situation: I am creating a rednet protocol. .. long story no sense. I send the data with xml. Is there a way to turn xml to a table?
Thank you. You are the best.
758 posts
Location
Budapest, Hungary
Posted 05 January 2014 - 10:57 AM
Sure there is. Anyway. What about using serialized tables instead of XML?
Edited on 05 January 2014 - 09:58 AM
79 posts
Location
Germany
Posted 05 January 2014 - 11:58 AM
The thing is… i want to use it for more than this… Since my tomcat webservice comunicates in xml, i need an api like
var xmlFile = xml.parseFile(file) -- returns table
var docs = xml.getElements(xmlFile, "user") --returns all elements with <user></user> Tag.
--and than i use the docs for like
print(docs[1].name, ", ", docs[1].id)
-> PrinzJuliano, 5
Thanks
758 posts
Location
Budapest, Hungary
Posted 05 January 2014 - 12:14 PM
There are XML parsers out there on the web, but I might end up writing an XML API for CC. If anybody has already written a working one, tell us.
252 posts
Location
The Netherlands
Posted 05 January 2014 - 01:41 PM
I found an XML parser. Haven't tested it myself, but I think it looks good:
https://github.com/Phrogz/SLAXML