From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by yquem.inria.fr (Postfix) with ESMTP id 48144BC37 for ; Wed, 30 Sep 2009 16:45:08 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AqgBAFQLw0rU436xkWdsb2JhbACBUJkvAQEBAQkLCgcTA74KAoQlBA X-IronPort-AV: E=Sophos;i="4.44,480,1249250400"; d="scan'208";a="37184498" Received: from moutng.kundenserver.de ([212.227.126.177]) by mail1-smtp-roc.national.inria.fr with ESMTP; 30 Sep 2009 16:45:07 +0200 Received: from office1.lan.sumadev.de (dslb-084-059-075-203.pools.arcor-ip.net [84.59.75.203]) by mrelayeu.kundenserver.de (node=mreu1) with ESMTP (Nemesis) id 0MfV79-1Mh7Vj2nJD-00OayI; Wed, 30 Sep 2009 16:44:57 +0200 Received: from [192.168.5.104] (dslb-084-059-075-203.pools.arcor-ip.net [84.59.75.203]) by office1.lan.sumadev.de (Postfix) with ESMTPSA id 6B885C0EA0; Wed, 30 Sep 2009 16:44:56 +0200 (CEST) Subject: Re: [Caml-list] xpath or alternatives From: Gerd Stolpmann To: Stefano Zacchiroli Cc: caml-list@inria.fr, PXP Users ML In-Reply-To: <20090930133957.GA32052@usha.takhisis.invalid> References: <20090928121745.GA19803@annexia.org> <20090930133957.GA32052@usha.takhisis.invalid> Content-Type: text/plain Date: Wed, 30 Sep 2009 16:49:37 +0200 Message-Id: <1254322177.4018.1.camel@flake.lan.gerd-stolpmann.de> Mime-Version: 1.0 X-Mailer: Evolution 2.12.1 Content-Transfer-Encoding: 7bit X-Provags-ID: V01U2FsdGVkX180Yu5zxsbjL/Spfo0TGG40ss3VRj9gQZntZWy RMLRb+un8qwBWaPdLq+uyOYURbZn1tUr37CtFjByyOyM4vmeVv bMTKyhIuTjhyjoDYvYopQ== X-Spam: no; 0.00; gerd:01 stolpmann:01 gerd:01 zacchiroli:01 0100,:01 ocaml:01 compiler:01 pxp:01 pxp:01 pxp-engine:01 syntax:01 node:01 node:01 cheers:01 stolpmann:01 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 ------------------------------------------------------------