[Haskell-cafe] Incremental XML parsing with namespaces?

Henning Thielemann lemming at henning-thielemann.de
Mon Jun 8 18:39:00 EDT 2009


John Millikin schrieb:
> On Mon, Jun 8, 2009 at 1:44 PM, Malcolm
>
> The interface you linked to doesn't seem to have a way to "resume"
> parsing. That is, I can't feed it chunks of text and have it generate
> a (ParserState, [Event]) tuple for each chunk. Perhaps this is
> possible in Haskell without explicit state management? I've tried to
> write a test application to listen on a socket and print events as the
> arrive, but with no luck.
> 
> Manually re-parsing the events isn't attractive, because it would
> require writing at least part of the parser manually. I had hoped to
> re-use an existing XML parser, rather than writing a new one.

I think you could use the parser as it is and do the name parsing later.
Due to lazy evaluation both parsers would run in an interleaved way.


But you may also be interested in:

http://hackage.haskell.org/packages/archive/wraxml/0.4.2/doc/html/Text-XML-WraXML-Tree-Tagchup.html

using
http://hackage.haskell.org/packages/archive/xml-basic/0.1/doc/html/Text-XML-Basic-Name-Qualified.html


More information about the Haskell-Cafe mailing list