Thu Aug 17 06:43:03 PDT 2006 [EMAIL PROTECTED]
* new module ShowXmlLazy provided by Eric Webster
Notes from Eric:
I discovered that the implementation of showXml in the stable and
development branch of HaXml doesn't work in a lazy manner and so was
getting out-of-memory errors when processing large datasets. Upon
examining the HaXml code I discovered that the reason this is so, is
somewhere in the Text.PrettyPrint.HughesPJ module rather then in
HaXml. I hacked together a showXmlLazy function which is identical
to your own showXml but I reimplemented the PrettyPrint functions
using only basic string operations. The result is that I can now
consume and convert to XML arbitrarily large datasets. It is also a
little faster than showXml but the output is horribly ugly (but
still valid).
I wonder if it would not be better to separate the serialization of
Xml from the formatting of Xml in the library? Maybe showXml could
also take a formating function as input which defines rules for
formating documents, elements, etc. Or I suppose showXml could just
output a String in the quickest way possible and have a bunch of
other functions that cat prettily format strings containing Xml
documents.
A ./src/Text/XML/HaXml/ShowXmlLazy.hs
_______________________________________________
Cvs-libraries mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/cvs-libraries