English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
xpath or alternatives
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2009-09-30 (10:36)
From: Sebastien Mondet <sebastien.mondet@g...>
Subject: Re: [Caml-list] xpath or alternatives
> The discussion here has got quite theoretical, but it's not helping
> me to write the original 3 lines of Perl in OCaml.
>
>    my $p = XML::XPath->new (xml => $xml);
>    my @disks = $p->findnodes ('//devices/disk/source/@dev');
>    push (@disks, $p->findnodes ('//devices/disk/source/@file'));
>
> My best effort, using xml-light, is around 40 lines:
>
> http://git.et.redhat.com/?p=libguestfs.git;a=blob;f=ocaml/examples/viewer.ml;h=ef6627b1b92a4fff7d4fa1fa4aca63eeffc05ece;hb=HEAD#l322
>

Galax is (or was ??) an XQuery implementation in ocaml
and XPath 2.0 is included in XQuery... so maybe you can use it...

the site does not seem to respond now:
http://www.galaxquery.org/

but there is a debian package:
http://upsilon.cc/~zack/blog/posts/2008/02/galax_in_debian/


> Rich.
>
> --
> Richard Jones
> Red Hat
>
> _______________________________________________
> 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