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.9 required=5.0 tests=AWL,SPF_FAIL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by yquem.inria.fr (Postfix) with ESMTP id 3CD36BC37 for ; Wed, 30 Sep 2009 17:13:16 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEAJcSw0pDz4He/2dsb2JhbADZM4QnBIFN X-IronPort-AV: E=Sophos;i="4.44,480,1249250400"; d="scan'208";a="47610140" Received: from fettunta.fettunta.org ([67.207.129.222]) by mail4-smtp-sop.national.inria.fr with ESMTP; 30 Sep 2009 17:13:15 +0200 Received: from usha.takhisis.invalid (unknown [10.17.0.10]) by fettunta.fettunta.org (Postfix) with ESMTPS id F205618371; Wed, 30 Sep 2009 15:13:13 +0000 (UTC) Received: by usha.takhisis.invalid (Postfix, from userid 1000) id 611D26119; Wed, 30 Sep 2009 17:12:59 +0200 (CEST) Date: Wed, 30 Sep 2009 17:12:59 +0200 From: Stefano Zacchiroli To: caml-list@inria.fr, PXP Users ML Subject: Re: [Caml-list] xpath or alternatives Message-ID: <20090930151259.GA3931@usha.takhisis.invalid> Mail-Followup-To: caml-list@inria.fr, PXP Users ML References: <20090928121745.GA19803@annexia.org> <20090930133957.GA32052@usha.takhisis.invalid> <1254322177.4018.1.camel@flake.lan.gerd-stolpmann.de> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1254322177.4018.1.camel@flake.lan.gerd-stolpmann.de> User-Agent: Mutt/1.5.20 (2009-06-14) X-Spam: no; 0.00; zacchiroli:01 zack:01 0200,:01 gerd:01 stolpmann:01 pxp-engine:01 pxp:01 syntax:01 syntax:01 parser:01 nodes:01 foo:01 baz:01 nodes:01 expr:01 On Wed, Sep 30, 2009 at 04:49:37PM +0200, Gerd Stolpmann wrote: > No. However, there is a little XPath evaluator in SVN: > https://godirepo.camlcity.org/svn/lib-pxp/trunk/src/pxp-engine/pxp_xpath.ml Cool, and you have even already implemented all of the XPath 1.0 standard library! > 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? If I'm not mistaken, more than a syntax extension that evaluator needs a parser from concrete syntax to the abstract syntax you've already implemented. Once you have that, I don't think there is really a need of any syntax extension, what would be wrong in using it as follows: let nodes = xpath_eval ~xpath:(xpath "/foo/bar[2]/@baz") tree in let nodes2 = xpath_eval ~expr:"/foo/bar[2]/@baz" in ... we already use regexps this way and is more than handy. Or am I missing something here? I don't have energy to volunteer myself, but I duly note that Alain's old XPath implementation already contains a parser that can be reused (whereas the lexer should be changed, as already observed; most likely the lexer should be ported to Ulex). All in all, it is probably just a matter of integration work (modulo the limitations of the current evaluator, of course). Any volunteer? :-) Cheers. -- Stefano Zacchiroli -o- PhD in Computer Science \ PostDoc @ Univ. Paris 7 zack@{upsilon.cc,pps.jussieu.fr,debian.org} -<>- http://upsilon.cc/zack/ Dietro un grande uomo c'è ..| . |. Et ne m'en veux pas si je te tutoie sempre uno zaino ...........| ..: |.... Je dis tu à tous ceux que j'aime