From: Gerd Stolpmann <gerd@gerd-stolpmann.de>
To: Stefano Zacchiroli <zack@upsilon.cc>
Cc: caml-list@inria.fr, PXP Users ML <ocaml-pxp-users@orcaware.com>
Subject: Re: [Caml-list] xpath or alternatives
Date: Wed, 30 Sep 2009 16:49:37 +0200 [thread overview]
Message-ID: <1254322177.4018.1.camel@flake.lan.gerd-stolpmann.de> (raw)
In-Reply-To: <20090930133957.GA32052@usha.takhisis.invalid>
Am Mittwoch, den 30.09.2009, 15:39 +0200 schrieb Stefano Zacchiroli:
> On Mon, Sep 28, 2009 at 01:17:45PM +0100, Richard Jones wrote:
> > I need to do some relatively simple extraction of fields from an XML
> > document. In Perl I would use xpath, very specifically if $xml was an
> > XML document[1] stored as a string, then:
> >
> > my $p = XML::XPath->new (xml => $xml);
> > my @disks = $p->findnodes ('//devices/disk/source/@dev');
> > push (@disks, $p->findnodes ('//devices/disk/source/@file'));
>
> I've just realized that this thread can look a bit ridiculous, at least
> for people used to other languages where XPath implementations can even
> be found in the language standard library (the best solutions we have
> thus far are: a 40-line xml-light solution, the need to use a modified
> version of the OCaml compiler [yes, I know, it is compatible, but still
> ...], Galax with unreachable homepage, ...).
>
> So, I was wondering, has anybody ever tried to develop an XPath
> implementation on top of, say, PXP? The original announcement page of
> PXP (now archived) mentions "rumors" about people which, back then, were
> developing it. Has anything ever been released?
No. However, there is a little XPath evaluator in SVN:
https://godirepo.camlcity.org/svn/lib-pxp/trunk/src/pxp-engine/pxp_xpath.ml
I have never found the time to complete it, and to add some syntax
extension for painless use. But maybe somebody wants to take this over?
Gerd
> At first glance, it doesn't seem to exist any specific typing problem,
> at least with XPath 1.0, since the PXP node interface is already common
> for all node types. Sure XPath 2.0, when static typing is in use, can be
> better integrated with the language, but that's probably already
> happening in Galax.
>
> [ Cc-ing the PXP mailing list ]
>
> Cheers.
>
--
------------------------------------------------------------
Gerd Stolpmann, Bad Nauheimer Str.3, 64289 Darmstadt,Germany
gerd@gerd-stolpmann.de http://www.gerd-stolpmann.de
Phone: +49-6151-153855 Fax: +49-6151-997714
------------------------------------------------------------
next prev parent reply other threads:[~2009-09-30 14:45 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-09-28 12:17 Richard Jones
2009-09-28 12:48 ` [Caml-list] " Yaron Minsky
2009-09-28 15:06 ` Till Varoquaux
2009-09-29 23:00 ` Mikkel Fahnøe Jørgensen
2009-09-30 10:16 ` Richard Jones
2009-09-30 10:36 ` Sebastien Mondet
2009-09-30 10:49 ` Mikkel Fahnøe Jørgensen
2009-09-30 11:05 ` Dario Teixeira
2009-09-30 11:57 ` Richard Jones
2009-09-30 12:59 ` Richard Jones
2009-09-30 13:33 ` Till Varoquaux
2009-09-30 14:01 ` Richard Jones
2009-09-30 14:28 ` Till Varoquaux
2009-09-30 14:51 ` Alain Frisch
2009-09-30 15:09 ` Richard Jones
2009-09-30 15:18 ` Alain Frisch
2009-10-28 2:22 ` Daniel Bünzli
2009-09-30 13:39 ` Stefano Zacchiroli
2009-09-30 14:49 ` Gerd Stolpmann [this message]
2009-09-30 15:12 ` Stefano Zacchiroli
2009-09-30 15:22 ` Jordan Schatz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1254322177.4018.1.camel@flake.lan.gerd-stolpmann.de \
--to=gerd@gerd-stolpmann.de \
--cc=caml-list@inria.fr \
--cc=ocaml-pxp-users@orcaware.com \
--cc=zack@upsilon.cc \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox