caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Alain Frisch <alain@frisch.fr>
To: Richard Jones <rich@annexia.org>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] xpath or alternatives
Date: Wed, 30 Sep 2009 17:18:53 +0200	[thread overview]
Message-ID: <4AC376DD.20106@frisch.fr> (raw)
In-Reply-To: <20090930150918.GC5126@annexia.org>

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 [<a>[ 1 2 3 ] 4 5 <b>[ 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 [<a>[ 1 2 3 ] 4 5 <b>[ 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



  reply	other threads:[~2009-09-30 15:19 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 [this message]
2009-10-28  2:22         ` Daniel Bünzli
2009-09-30 13:39 ` Stefano Zacchiroli
2009-09-30 14:49   ` Gerd Stolpmann
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=4AC376DD.20106@frisch.fr \
    --to=alain@frisch.fr \
    --cc=caml-list@inria.fr \
    --cc=rich@annexia.org \
    /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;
as well as URLs for NNTP newsgroup(s).