lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

* Matthew Wild:

> On 10 October 2011 09:13, Eike Decker <> wrote:
>> I am not aware of an xml lib that provides a simple access in Lua. What you
>> could consider however is to use Lua Expat [1] and use this to create a dom
>> like access pattern that matches exactly your needs. I think the required
>> code for this would be acceptably short and simple. It would probably come
>> closer to your actual needs than any existing library.
> - I'm not sure it
> can get much simpler (except something like XPath maybe...).

I would use a different encoding: node[0] for the tag, node[1] to
node[#node] for the children, and node[attr] for the value of the
attribute attr (a string).  This works because the order of attributes
does not matter.

However, that is quite distinct from the DOM API. 8-)