Check out this chapter of the yesod book for good examples:
http://www.yesodweb.com/blog/2011/10/xml-enumerator
On Tue, Nov 8, 2011 at 8:38 AM, Sean Hess
I cannot seem to find a working example of xml-enumerator. It doesn't run: the names seem to have changed for some things, and I'm too much of a beginner to figure it out easily. http://hackage.haskell.org/packages/archive/xml-enumerator/0.4.3.1/doc/html/...
On Nov 7, 2011, at 7:59 PM, Felipe Almeida Lessa wrote:
On Tue, Nov 8, 2011 at 12:45 AM, Sean Hess
wrote: I want to parse a large xml file (2GB), without putting the whole thing into
memory. It's pretty simple with a sax parser in most languages, you just
stream bytes to the sax parser, and wait for sax events.
I recommend you taking a look at xml-enumerator [1] and libxml-enumerator [2]. They are the SAX parsers you know from the imperative world but much easier to write =). In particular, you don't need to rely on lazyness.
Cheers,
[1] http://hackage.haskell.org/package/xml-enumerator [2] http://hackage.haskell.org/package/libxml-enumerator
-- Felipe.
_______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners