xml parsing

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

xml parsing

ahrens
Hello,

I want to write a program which among other should read some xml file.
The xml tags will mostly be custom ones defined by a dtd.

My question is: which parsing library to use?

On
http://en.wikibooks.org/wiki/Haskell/XML
three libraries are mentioned, but a comparison and recommendation of
which one to choose is missing.

As you might imagine, I would like to use a library which is actively
maintained? Has any of these libraries developed into a "standard"
library?

Thanks in advance for your help.
ben
Reply | Threaded
Open this post in threaded view
|

xml parsing

Antoine Latter-2
On Wed, Jun 17, 2009 at 1:05 PM, Benedikt Ahrens<[hidden email]> wrote:

> Hello,
>
> I want to write a program which among other should read some xml file.
> The xml tags will mostly be custom ones defined by a dtd.
>
> My question is: which parsing library to use?
>
> On
> http://en.wikibooks.org/wiki/Haskell/XML
> three libraries are mentioned, but a comparison and recommendation of
> which one to choose is missing.
>
> As you might imagine, I would like to use a library which is actively
> maintained? Has any of these libraries developed into a "standard"
> library?
>
> Thanks in advance for your help.
> ben

One option I've used before which isn't on the list is on hackage here:

http://hackage.haskell.org/cgi-bin/hackage-scripts/package/xml

I have a parser for these XML files:

http://cgit.freedesktop.org/xcb/proto/tree/src

in this Haskell package on hackage:

http://hackage.haskell.org/cgi-bin/hackage-scripts/package/xcb-types

I'm no Haskell guru, and the code may not be the best example - but
the library is pretty easy to get started with.

Antoine
Reply | Threaded
Open this post in threaded view
|

xml parsing

Yitzchak Gale
Benedikt Ahrens wrote:
>> I want to write a program which among other should read some xml file.
>> The xml tags will mostly be custom ones defined by a dtd.
>> My question is: which parsing library to use?

Antoine Latter wrote:
> One option I've used before which isn't on the list is on hackage here:
> http://hackage.haskell.org/cgi-bin/hackage-scripts/package/xml

Yes, that is a great library for quick-and-dirty xml work.
It's very easy to use. And it's very well maintained, because
it was written at Galois and is actively used there.

But if you need to do more serious XML work, including
support and verified compliance for the alphabet soup of XML
specs, you need to use one of the other libraries.

For example, the xml library will work fine with custom tags.
But if you want to verify against the DTD, you'll have to
look elsewhere. It is easy to search an XML tree by hand
with the xml library, but I don't think it will do an XPath
search for you. Etc.

By the way, perhaps the xml library should be added to
that wikibook page.

Hope this helps,
Yitz