lua-users home
lua-l archive

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


The "Classic Lua-only version" XML parser
(http://lua-users.org/wiki/LuaXml) uses a representation quite similar
to your first suggestion. The only differences are that it uses "label"
instead of "name" (maybe "tag" is the best option), "args" instead of
"attributes" (yes, "attributes" [or "att" for short] is the correct term
in XML parlance), and it starts indices in 1 (as is common in Lua), not
in 0.

If we consider that XML has several other elements that we are ignoring
(processing instructions, external entities, comments, etc.), I think
that a more structured approach (like this) is a better long-term
option.

(BTW, I am currently finishing a complete bind from Lua to Expat (based
on previous work by Jay Carlson). But as it uses a SAX API, it does not
have any standard representation.)

-- Roberto