lua-users home
lua-l archive

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


Asko Kauppi wrote:

What I mean by 'seamless' is really, truly, that. Like dofile( "mydata.xml" ) and getting a Lua table returned. Hmm.. anyone up for it?

i wrote one in my early lua days, which does about that.
from memory i think it also allowed xpath syntax.

if you want that as-is to see if it suits, i can mail it to you.

(from my earlier post)

<QUOTE>
this one is a sax-type callback parser, which can
1/ parse (but not interpret) embedded DTD's
2/ handle html-type naked and value-less attributes
3/ handle html-type overlapping tags (sort-of)

i ported this because it is block-based, maintaining state between calls, so you can parse an xml stream as a sequence of chunks.
approx 26 kb of source (not production quality, yet)
</QUOTE>

Adrian