Jump to content




Xml Parser?

api utility lua

4 replies to this topic

#1 Dahknee

  • Members
  • 1,808 posts
  • Location/home/da

Posted 24 August 2015 - 11:27 AM

Hello,

I was wondering if anyone knows of a good xml parser? I have used a few pure lua ones but they use a lot of io.open:read('*all') and other functions that are not supported by ComputerCraft, so was wondering if someone has made one, I know it sounds easy but I have NEVER used xml until today, so need to get it to come back in an array etc :P So if anyone knows of a good one please tell me, it HAS to work in CC though.

Thanks guys!

#2 MKlegoman357

  • Members
  • 1,170 posts
  • LocationKaunas, Lithuania

Posted 24 August 2015 - 11:33 AM

Here's one: SLAXML

#3 Exerro

  • Members
  • 801 posts

Posted 24 August 2015 - 11:51 AM

If you take a look at Silica's source there's something virtually identical to an XML parser. As well as the normal XML things, it supports attributes not as strings, such as <a b=2 c=something d="hi"/>.

This is probably not quite as accurate as the one MKlegoman posted in all honesty, but maybe simpler to set up.

Edited by awsumben13, 24 August 2015 - 11:52 AM.


#4 Dahknee

  • Members
  • 1,808 posts
  • Location/home/da

Posted 24 August 2015 - 01:47 PM

 MKlegoman357, on 24 August 2015 - 11:33 AM, said:

Here's one: SLAXML

I tried this and it does not work? just errors, do you know how to use it? I did Google it before asking.

#5 MKlegoman357

  • Members
  • 1,170 posts
  • LocationKaunas, Lithuania

Posted 24 August 2015 - 07:39 PM

On which part does it error. You'll have to use dofile() instead of require() because CC doesn't have that. Other than that I've used it and it works perfectly.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users