Which XML parser for Haskell? Which XML parser for Haskell? xml xml

Which XML parser for Haskell?


If you're willing to assume that your inputs are valid, consider looking at TagSoup or Text.XML.Light from the Galois folks.

These take strings as input, so you can (indirectly) feed them anything Data.Encoding understands, namely

  • ASCII
  • UTF8
  • UTF16
  • UTF32
  • KOI8R
  • KOI8U
  • ISO88591
  • GB18030
  • BootString
  • ISO88592
  • ISO88593
  • ISO88594
  • ISO88595
  • ISO88596
  • ISO88597
  • ISO88598
  • ISO88599
  • ISO885910
  • ISO885911
  • ISO885913
  • ISO885914
  • ISO885915
  • ISO885916
  • CP1250
  • CP1251
  • CP1252
  • CP1253
  • CP1254
  • CP1255
  • CP1256
  • CP1257
  • CP1258
  • MacOSRoman
  • JISX0201
  • JISX0208
  • ISO2022JP
  • JISX0212


I'm no Haskell expert, but what you're running into sounds like a classic space-leak (i.e., a situation in which Haskell's lazy evaluation is causing it to reserve more memory than necessary). You may be able to solve it by forcing strictness on your saxParse output.

There's also a good chapter on profiling and optimization in Real World Haskell.

EDIT: Found another good resource on profiling/finding bottlenecks here.