[Haskell-cafe] Incremental XML parsing with namespaces?

Henning Thielemann lemming at henning-thielemann.de
Tue Jun 9 10:16:58 EDT 2009


John Millikin wrote:
> On Mon, Jun 8, 2009 at 3:39 PM, Henning
> Thielemann<lemming at henning-thielemann.de> wrote:
>> 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.
>>
> I've been trying to figure out how to get this to work with lazy
> evaluation, but haven't made much headway. Tips? The only way I can
> think of to get incremental parsing working is to maintain explicit
> state, but I also can't figure out how to achieve this with the
> parsers I've tested (HaXml, HXT, hexpat).

Can you please look at
    http://code.haskell.org/~thielema/tagchup/example/Escape.hs
    http://code.haskell.org/~thielema/tagchup/example/Strip.hs

You just have to replace Text.XML.Basic.Name.LowerCase by 
Text.XML.Basic.Name.Qualified for use of qualified names.

-- 
Mit freundlichen Gruessen
Henning Thielemann

Viele Gruesse
Henning

Martin-Luther-Universitaet Halle-Wittenberg, Institut fuer Informatik

Tel. +49 - 345 - 55 24773
Fax  +49 - 345 - 55 27333


More information about the Haskell-Cafe mailing list