View Single Post
Old 11-03-2009, 06:36 AM   #102
hansel
JSR FFD2
hansel can extract oil from cheesehansel can extract oil from cheesehansel can extract oil from cheesehansel can extract oil from cheesehansel can extract oil from cheesehansel can extract oil from cheesehansel can extract oil from cheesehansel can extract oil from cheese
 
hansel's Avatar
 
Posts: 305
Karma: 1045
Join Date: Aug 2008
Location: Rotterdam, Netherlands, Europe, Sol 3
Device: iliad
Quote:
Originally Posted by ericshliao View Post
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

Last edited by hansel; 11-03-2009 at 06:41 AM.
hansel is offline   Reply With Quote