lua-users home
lua-l archive

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


On Wed, Dec 16, 2009 at 5:41 PM, Joshua Jensen
<jjensen@workspacewhiz.com> wrote:
> for _, entity in ipairs(xml.Config[1]['#'].EntityList[1]['#'].Entity) do
>    local text = type(entity['#']) == 'string' and entity['#'] or ''
>    print('Entity: value=' .. entity['@'].value .. ' - ' .. text)
> end

Cute, but what purpose does the ['#'] serve? Why not:

xml.Config[1].EntityList[1].....

steve d.

PS. I think we need a generalized XPath-like library for Lua tables

PPS. I still think LuaExpat's LOM to be the canonical representation