Quote:
Originally Posted by ericshliao
As to expat, I never understand the way it works.
|
Expat is easy to use: you define callbacks for the things you are interested in (tags, attributes), and expat calls those while traversing the file. Typically you remember some state in the calbacks (to know where you are in the document). You might even render the document while reading it (which is much more effective if you process large docs: no need to store everything in memory).
Lua Expat also has a simple DOM called LOM (Lua Object Model). This may very well be what you are looking for. See
http://www.keplerproject.org/luaexpat/lom.html for an example.
Besides that, Expat is very fast, quite small, and already avalable on the Iliad...
Edit: I just checked that libxml2 (the so file, not a Lua binding) is also available on a standard Iliad: /usr/lib/libxml2.so.2.6.26. See
http://www.hpelbers.org/iliad/list_of_libraries