lua-users home
lua-l archive

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

"Paul Chakravarti" <> writes:

> I have been tinkering with a native XML parser in Lua for a
> while but ended up leaving it in a 'not-quite completed' state
> over the last couple of months - the recent flurry of XML
> related activity on Lua-L has prompted me to get this working
> and put together an initial release at least to save any
> possible duplication. This is a bit rushed and not as well
> documented as I would like but is relatively robust/compliant
> and certainly usable.

Well, one of my friends keeps on shouting


We still don't know how serious he is about this, but it would make a great

> Jay's expat based parser would probably be a better choice
> when available however this seems to be pretty reasonable both
> in speed & compliance. It would be good to come up with a
> common event & tree based API which would allow these to
> be used interchangably however.

Yes, absolutely.  I see no reason to lock into a single implementation,
especially when it's so avoidable.

It will be harder to get agreement on the tree API, so I'd suggest we work
on the event-based one first---"Lua SAX"?

expat sets an upper bound on how much functionality we can expect.  For
instance, expat won't distinguish <foo></foo> from <foo/>.

I really like interfaces where you set up callbacks with function
o.callback() end, as you can probably tell from Lua FLTK and Lxp :-)

> Interesting I also had a go at an XML-RPC marshaller &
> unmarshaller and got this to the point of working as a CGI
> server but this implementation isnt as complete as Jay's
> (and quite a lot uglier from looking at the code).

I've implemented a bunch of RPC systems, so this is old hat for me now....

> Hopefully this might be useful - I am happy to take
> suggestions/comments on how to merge this with Jay's
> work if anyone is interested.

I'd rather take *your* suggestions on the merge.  The last serious work I
did with XML was like 2-3 years ago, and I don't use it enough day-to-day to
understand what people need these days to get things done.  At this point,
all I can do is try to offer clever (well, at least I think they're clever)
suggestions on tricks to make the API more Lua-friendly.

BTW, I don't feel particularly possessive of Lxp---other people are welcome
to pick it up, take it over, etc.  XMLRPC I feel possessive of until it's
correct.  :-)