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.8 required=5.0 tests=AWL,RCVD_IN_BL_SPAMCOP_NET autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by yquem.inria.fr (Postfix) with ESMTP id 91F53BC37 for ; Wed, 30 Sep 2009 17:19:00 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApALAMMTw0rB/Bd4Y2dsb2JhbACadRcICwkPBAO9eYQnBIFN X-IronPort-AV: E=Sophos;i="4.44,480,1249250400"; d="scan'208";a="33878451" Received: from smtp-msa-out01.orange.fr ([193.252.23.120]) by mail2-smtp-roc.national.inria.fr with ESMTP; 30 Sep 2009 17:19:00 +0200 Received: from me-wanadoo.net (localhost [127.0.0.1]) by mwinf5a04.orange.fr (SMTP Server) with ESMTP id E4DFF1C00096; Wed, 30 Sep 2009 17:18:59 +0200 (CEST) Received: from me-wanadoo.net (localhost [127.0.0.1]) by mwinf5a04.orange.fr (SMTP Server) with ESMTP id D52DB1C0009A; Wed, 30 Sep 2009 17:18:59 +0200 (CEST) Received: from [192.168.1.53] (APuteaux-154-1-3-178.w83-199.abo.wanadoo.fr [83.199.64.178]) by mwinf5a04.orange.fr (SMTP Server) with ESMTP id A42781C00096; Wed, 30 Sep 2009 17:18:57 +0200 (CEST) X-ME-UUID: 20090930151859672.A42781C00096@mwinf5a04.orange.fr X-ME-User-Auth: lexifi Message-ID: <4AC376DD.20106@frisch.fr> Date: Wed, 30 Sep 2009 17:18:53 +0200 From: Alain Frisch User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) 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> <4AC37055.70503@frisch.fr> <20090930150918.GC5126@annexia.org> In-Reply-To: <20090930150918.GC5126@annexia.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Spam: no; 0.00; frisch:01 frisch:01 syntax:01 subtyping:01 subtyping:01 subtype:01 interfacing:01 pxp:01 ocamlduce:01 ocaml:01 ocamlduce:01 cheers:01 expat:98 char:01 wrote:01 Richard Jones wrote: > On the other hand, the code is hard to understand. It's not clear to > me what the .( ) syntax means, nor why there is an apparently trailing > / character. From the manual: If the x-expression e evaluates to an x-sequence, the construction e/ will result in a new x-sequence obtained by taking in order all the children of the XML elements from the sequence e. For instance, the x-expression [[ 1 2 3 ] 4 5 [ 6 7 8 ] ]/ evaluates to the x-value [ 1 2 3 6 7 8 ]. If the x-expression e evaluates to an x-sequence, the construction e.(t) (where t is an x-type) will result in a new x-sequence obtained by filtering e to keep only the elements of type t. For instance, the x-expression [[ 1 2 3 ] 4 5 [ 6 7 8 ] ].(Int) evaluates to the x-value [ 4 5 ]. > I have some comments: > > (A) "Subtyping failed" is a very common error, but is only mentioned > briefly in the manual. I have no idea what these errors mean, so they > should have more explanation. Here is a simple one which was caused > by me using a value instead of a list (but that is not at all obvious > from the error message): > > Error: Subtyping failed Latin1 <= [ Latin1* ] > Sample: > [ Latin1Char ] The error tells you that Latin1 is not a subtype of [ Latin1* ]. It probably means that you are trying to use a value of type Latin1 where a value of type [ Latin1* ] is expected. > (B) I think the interfacing code here: > > http://yquem.inria.fr/~frisch/ocamlcduce/samples/expat/ > http://yquem.inria.fr/~frisch/ocamlcduce/samples/pxp/ > http://yquem.inria.fr/~frisch/ocamlcduce/samples/xmllight/ > > should be distributed along with ocamlduce. There was a GODI package that includes them. It would be ok to put these files in the distribution without compiling them (otherwise it would create a dependency on more OCaml packages). It's up to Stéphane Glondu, the new maintainer of OCamlDuce. Cheers, Alain