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.1 required=5.0 tests=AWL 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 25C43BC37 for ; Wed, 30 Sep 2009 16:51:07 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AjIKAKwNw0pQDPKRbWdsb2JhbACafw0KCQkSBL1+hCcEgU0 X-IronPort-AV: E=Sophos;i="4.44,480,1249250400"; d="scan'208";a="37184970" Received: from smtp2b.orange.fr ([80.12.242.145]) by mail1-smtp-roc.national.inria.fr with ESMTP; 30 Sep 2009 16:51:06 +0200 Received: from me-wanadoo.net (localhost [127.0.0.1]) by mwinf2b12.orange.fr (SMTP Server) with ESMTP id B1D507000092; Wed, 30 Sep 2009 16:51:06 +0200 (CEST) Received: from me-wanadoo.net (localhost [127.0.0.1]) by mwinf2b12.orange.fr (SMTP Server) with ESMTP id A3CB17000090; Wed, 30 Sep 2009 16:51:06 +0200 (CEST) Received: from [10.0.2.15] (APuteaux-154-1-3-178.w83-199.abo.wanadoo.fr [83.199.64.178]) by mwinf2b12.orange.fr (SMTP Server) with ESMTP id 647187000092; Wed, 30 Sep 2009 16:51:06 +0200 (CEST) X-ME-UUID: 20090930145106411.647187000092@mwinf2b12.orange.fr Message-ID: <4AC37055.70503@frisch.fr> Date: Wed, 30 Sep 2009 16:51:01 +0200 From: Alain Frisch User-Agent: Thunderbird 2.0.0.12 (X11/20080213) MIME-Version: 1.0 To: Richard Jones Cc: caml-list@inria.fr Subject: Re: [Caml-list] xpath or alternatives References: <20090930101622.GA15517@annexia.org> <245077.49646.qm@web111516.mail.gq1.yahoo.com> <20090930115723.GL1104@annexia.org> <20090930125904.GA5126@annexia.org> <9d3ec8300909300633t51db9ed9jf3ad15e6b0551c1e@mail.gmail.com> <20090930140107.GB5126@annexia.org> In-Reply-To: <20090930140107.GB5126@annexia.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam: no; 0.00; frisch:01 frisch:01 ocamlduce:01 cheers:01 wrote:01 caml-list:01 alain:01 alain:01 seems:03 let:03 let:03 xpath:04 dev:04 dev:04 manual:06 Richard Jones wrote: > let devs = {{ map [xml] with > | [[[_]]] > | [[[_]]] -> [s] > | _ -> [] }} in The following should work: let l = {{ [xml] }} in let l = {{ map l with l -> l | _ -> [] }} in let l = {{ map l with l -> l | _ -> [] }} in let l = {{ map l with l -> l | _ -> [] }} in let l = {{ map l with _ | _-> s | _ -> [] }} in ... let () = let l = {{ [xml] }} in let l = {{ (((l.(_)) / .(_)) / .(_)) / }} in let l = {{ map l with _ | _ -> s | _ -> [] }} in .. This uses the constructions e/ and e.(t) as described in the manual. That said, using OCamlDuce for this kind of XML data-extraction seems just crazy to me. Cheers, Alain