lua-users home
lua-l archive

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



On 16-08-21 07:45 AM, Marc Balmer wrote:
> I am working on code to easily create XML trees from Lua tables.  What would,
> in your opinion, be a comfortable Lua table notation of XML trees, expressed
> as Lua tables?
> 
For me for structure like

<data>
  <el attr1="value1", attr2="value2">
    el_data
  </el>
  <el attr1="value1", attr2="value2">
    el_data
  </el>
</data>

expressions "xml.data.el[1].value" or
"xml.data.el[#xml.data.el].attrs['attr2']" looks convenient.