Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[Caml-list] Manipulating xml files withing ocaml

185 views
Skip to first unread message

Jean Krivine

unread,
Nov 23, 2008, 12:13:37 PM11/23/08
to caml users
Just a quick question, I would like to open and access easily an xml
file within my ocaml program. Does someone have a small library that
would help me doing that? All the things I found for now are
libraries that help me construct xml and check for consistency which
is not what I want.

Thanks!
Jean

_______________________________________________
Caml-list mailing list. Subscription management:
http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
Archives: http://caml.inria.fr
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs

Romain Beauxis

unread,
Nov 23, 2008, 12:18:48 PM11/23/08
to Jean Krivine, caml...@inria.fr

Hi Jean !

On Sun, 23 Nov 2008 10:13:27 -0700, "Jean Krivine" <jean.k...@gmail.com>

wrote:

> Just a quick question, I would like to open and access easily an xml

> file within my ocaml program. Does someone have a small library that

> would help me doing that? All the things I found for now are

> libraries that help me construct xml and check for consistency which

> is not what I want.

If the xml you intend to parse is not too broken (like html for instance),

you can try to use xml-light, whose APIis very simple.

The link:

http://tech.motion-twin.com/xmllight.html

Romain

Jean Krivine

unread,
Nov 23, 2008, 12:29:45 PM11/23/08
to Romain Beauxis, caml...@inria.fr
Superb that seems to be what I needed thanks!
J

Adrien

unread,
Nov 23, 2008, 12:35:55 PM11/23/08
to Jean Krivine, Romain Beauxis, caml...@inria.fr
PXP may be a better choice. It's harder at first, but not much and
could be worth the five additionnal minutes required to learn it. It
handles unicode and is still maintained (among others).


---

Adrien Nader

Dario Teixeira

unread,
Nov 23, 2008, 12:55:41 PM11/23/08
to Jean Krivine, Adrien, Romain Beauxis, caml...@inria.fr
> PXP may be a better choice. It's harder at first, but
> not much and
> could be worth the five additionnal minutes required to
> learn it. It
> handles unicode and is still maintained (among others).

Indeed. If you find yourself routinely having to deal with XML,
and if you need more advanced features such as validating very
complex DTDs, than learning PXP is well worth it (Xml-light
will choke on all but the simplest DTDs).

If you are doing heavy manipulation of XML and wished for a
more "native" support in the language, then take a look at
Cduce/Ocamlduce.

Finally, if you just need to parse a simple XML file and this
is a one-off event, then Xml-light is indeed the simplest option.

Cheers,
Dario Teixeira

Jean Krivine

unread,
Nov 23, 2008, 2:03:13 PM11/23/08
to Dario Teixeira, caml...@inria.fr, Romain Beauxis
In my case I just want to parse a small xml file and I don't need to
check for consistency so I think xml-light is fine enough. Thank you
for the references though
J

Jake Donham

unread,
Nov 23, 2008, 5:45:42 PM11/23/08
to caml...@inria.fr
One more choice is Xmlm:

http://erratique.ch/software/xmlm

It is simpler than pxp and more complete/correct than xml-light.

Jean-Baptiste Rouquier

unread,
Nov 26, 2008, 6:28:04 AM11/26/08
to caml...@inria.fr
For these topics about comparing libraries, there is an attempt at
collaborative work to build quick but comprehensive overview :
http://wiki.cocan.org/comparisons/

About the current question (XML), you can find there the names of a few
other tools.
HTH,
Jean-Baptiste Rouquier

0 new messages