Recent Articles:About Me
I love making stuff and solving puzzles. I am mak...
Here are some Lua libraries that I have used or fi...
Intro :Trying to learn and standardize the Foreig...
This section contains links to everything related ...
Some notes on the C code of the Lua Compiler Lua ...
LuaXML is a XML API for Lua supplied with Lua for Windows although it is available for Linux also. It is written partly in C as a DLL and partly in Lua.
require("LuaXML") local xfile = xml.load("xmlfile.xml")
key 0 contains string for the name of the element
key 1 contains the 1st child
key 2 contains the second child and so on
For simple elements with just a value the Key 1 is the Text element i.e. the first child.
Table also contains alphanumeric keys if the element has attributes
key is the name of the attribute and its value is the value of the attribute.
LuaXML routines by a metatable that is associated with each XML object.
A simple table in the LuaXML syntax can be made an XML object by associating the same metatable:
setmetatable(mytable,getmetatable(LuaXMLObject))or by using the API function:
mytable = xml.new(mytable)