Sorry for the late reply.
On Wed, Sep 30, 2009 at 01:00:15AM +0200, Mikkel Fahnøe Jørgensen wrote:
Otherwise there is xmlm which is self-contained in single xml file,
and as I recall, has some sort of zipper navigator. (I initially
intended to use it before deciding on the json format):
The
On Wed, Sep 30, 2009 at 01:00:15AM +0200, Mikkel Fahnøe Jørgensen wrote:
In line with what Yaron suggests, you can use a combinator parser.
I do this to parse json, and this parser could be adapted to xml by
focusing on basic syntax and ignoring the details, or you could
prefilter xml and
The discussion here has got quite theoretical, but it's not helping
me to write the original 3 lines of Perl in OCaml.
my $p = XML::XPath-new (xml = $xml);
my @disks = $p-findnodes ('//devices/disk/source/@dev');
push (@disks, $p-findnodes ('//devices/disk/source/@file'));
My best
2009/9/30 Richard Jones r...@annexia.org:
On Wed, Sep 30, 2009 at 01:00:15AM +0200, Mikkel Fahnøe Jørgensen wrote:
In line with what Yaron suggests, you can use a combinator parser.
It's interesting you mention xmlm, because I couldn't write
the code using xmlm at all.
If you can manage to
Hi,
Ocamlduce has been mentioned before in this thread, but I didn't catch
the reason why it has been discarded as a solution. Is it because you
don't want to carry the extra (large) dependency, or is there some other
reason?
And on the subject of simple XML parsers for Ocaml, there's also the
On Wed, Sep 30, 2009 at 04:05:03AM -0700, Dario Teixeira wrote:
Hi,
Ocamlduce has been mentioned before in this thread, but I didn't catch
the reason why it has been discarded as a solution. Is it because you
don't want to carry the extra (large) dependency, or is there some other
reason?
On Wed, Sep 30, 2009 at 12:57:23PM +0100, Richard Jones wrote:
On Wed, Sep 30, 2009 at 04:05:03AM -0700, Dario Teixeira wrote:
Hi,
Ocamlduce has been mentioned before in this thread, but I didn't catch
the reason why it has been discarded as a solution. Is it because you
don't want to
OCamlduce (Alain correct me if I am wrong) basically maintains two
separate type systems side by side (the Xduce one and the Ocaml one).
This is done in order to make Ocamlduce maintainable by keeping a
clear separation. As a result you have to explicitly convert values
between type systems using
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);
On Wed, Sep 30, 2009 at 09:33:07AM -0400, Till Varoquaux wrote:
OCamlduce (Alain correct me if I am wrong) basically maintains two
separate type systems side by side (the Xduce one and the Ocaml one).
This is done in order to make Ocamlduce maintainable by keeping a
clear separation. As a
If I am not mistaken you are selecting a domain whose first child is a
device node whose only child is disk node ...
instead of:
domain..[devices..[disk..[source dev=(Latin1 s) .._]]]
you should aim for something in the vein of:
domain .. [_* (devices.. (disk..(source dev=(Latin1 s)|
souce
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]
Richard Jones wrote:
let devs = {{ map [xml] with
| domain..[devices..[disk..[source dev=(Latin1 s) .._]]]
| domain..[devices..[disk..[source file=(Latin1 s) .._]]] - [s]
| _ - [] }} in
The following should work:
let l = {{ [xml] }} in
let l = {{ map l with domain..l - l |
On Wed, Sep 30, 2009 at 04:51:01PM +0200, Alain Frisch wrote:
Richard Jones wrote:
let devs = {{ map [xml] with
| domain..[devices..[disk..[source dev=(Latin1 s) .._]]]
| domain..[devices..[disk..[source file=(Latin1 s) .._]]] -
[s]
| _ - [] }} in
The following should
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
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
I hope this is germane, I am very new to Ocaml.
Do these help at all?
http://packages.debian.org/sid/libxml-light-ocaml-dev
http://tech.motion-twin.com/xmllight.html
I expect it wouldn't be to difficult to write a wrapper around libxml
http://xmlsoft.org/index.html
-Jordan
In line with what Yaron suggests, you can use a combinator parser.
I do this to parse json, and this parser could be adapted to xml by
focusing on basic syntax and ignoring the details, or you could
prefilter xml and use the json parser directly.
See the Fleece parser embedded here:
There is
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
I don't have the code in front of me, but I've done something like
this using the list monad. i.e., using bind (= concat-map) and map
chained together, along with a couple operators I wrote for lifting
bits of XML documents into lists, by say returning the subnodes of the
present node as a
There are a few projects out here:
xtisp
http://www.xtisp.org
xstream
http://yquem.inria.fr/~frisch/xstream/
and of course the good old cduce/xduce/ocamlduce. All in all naive
querying is not hard and tree automata:
(e.g.) http://www.grappa.univ-lille3.fr/~filiot/tata/
can provide a good
21 matches
Mail list logo