XML in Love

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
User avatar
Centauri Soldier
Prole
Posts: 42
Joined: Mon May 21, 2012 6:38 am

XML in Love

Post by Centauri Soldier »

It sure would be nice to have XML in LOVE...

What about this?

http://xerces.apache.org/xerces-c/
User avatar
Roland_Yonaba
Inner party member
Posts: 1563
Joined: Tue Jun 21, 2011 6:08 pm
Location: Ouagadougou (Burkina Faso)
Contact:

Re: XML in Love

Post by Roland_Yonaba »

Though, there's a lot of Lua libraries for XML manipulation...

Lua XML Parser
LuaXML
LuaExpat
Lpegxmlreader
XML Parser
PureLua XML parser
...

Maybe, given this huge number of Lua XML parsers, it sounds pointless having XML parsing built-in Löve...?
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: XML in Love

Post by Robin »

An important reason for not including an XML parser is the incredibly low demand for it.
Help us help you: attach a .love.
User avatar
kikito
Inner party member
Posts: 3153
Joined: Sat Oct 03, 2009 5:22 pm
Location: Madrid, Spain
Contact:

Re: XML in Love

Post by kikito »

Have you considered using native Lua instead of XML? Lua is Excellent for expressing raw data, just like xml is. And Lua itself is very easy to parse from LÖVE.

For example, if you wanted to parse something like this:

Code: Select all

<map>
<cell>1</cell>
<cell>2</cell>
</map>
You will have a much easier time if you just encode that data using lua:

Code: Select all

return {
  map = {
    cell = { 1, 2 }
  }
}
You literally need 1 line to parse the second file in LÖVE, and no extra libraries.

If you have a big XML file that you want to parse, consider transforming it using an automated tool to something like JSON. Transforming JSON to Lua shouldn't be very complex.
When I write def I mean function.
User avatar
Centauri Soldier
Prole
Posts: 42
Joined: Mon May 21, 2012 6:38 am

Re: XML in Love

Post by Centauri Soldier »

Well, as much as I love pure lua and despite the fact that my entire current project and all of its modules are using lua tables to store data, I still find a need from time to time to use xml. I just wondered if it had been considered and after viewing your answers I can see your logic regarding the low demand for it.
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Google [Bot] and 143 guests