lua-users home
lua-l archive

Re: Simple XHTML (XML) parser/printer

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


Some time ago I wrote a tiny XML parser, based on Lua pattern matching (the core is ~50 lines). It's quite limited (it does not currently support comments and CDATA) and it's far from conformant to the whole XML standard, but it's enough to parse OpenOffice files. I wrote it to do just that, even if the project was then shelved (so I had no opportunity to perform extensive testing). It creates a simple tree and calls user functions at tag entry/exit and data content while parsing, so the caller can build a dedicated data structure. It's not in publishable shape and it's only documented in the comments and test data, but should somebody be interested...
 Enrico

AltStyle によって変換されたページ (->オリジナル) /