[Haskell-cafe] Haskell and XML, need some tips from practioners

Gregory Collins greg at gregorycollins.net
Thu Feb 25 11:17:13 EST 2010

Günther Schmidt <gue.schmidt at web.de> writes:

> My question to those with experience of the Haskell-XML tools: which
> one should I use?

You'll need to evaluate which one fits your needs best; in my mind the
contenders are:

xml: http://hackage.haskell.org/package/xml

Small, simple, comprehensible DOM interface with some simple
search + cursor functions, uses String internally. If performance is not
a concern this one is the "nicest" in my opinion.

hexpat: http://hackage.haskell.org/package/hexpat

A binding to the expat C library; super-fast as a result, most of the
useful functions from xml have been ported over here. Has support for
SAX parsing. This is the one I usually use when I don't need things like
DTD validation or XPath support (i.e. 100% of the time). Not much in the
way of docs (haddock only) but it's small enough to be comprehensible.

HXT: http://hackage.haskell.org/package/hxt

Dauntingly enormous, oodles of features, you need to grok arrows. Uses
String internally. The documentation is pretty iffy -- individual
modules are haddocked pretty well but there are a zillion of them and a
table of contents is sorely needed. Website docs/manuals are of the
"read this wiki page, this paper, and my master's thesis" variety, but
the wiki page is actually pretty good. This is the one I use when I need
a feature hexpat doesn't have, but normally I avoid it if I can because
arrows cause me to "grind the gears".

HaXml: http://hackage.haskell.org/package/HaXml

Lots of modules and features here, uses String internally, has the same
"table of contents" issue as HXT, manual seems to consist of an ICFP
paper from 1999, Haddock is a little terse/spotty.

Hope this helps,

Gregory Collins <greg at gregorycollins.net>

More information about the Haskell-Cafe mailing list