caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] XPath implementation or equivalent
@ 2018-06-05 10:06 Julien Tesson
  2018-06-05 10:40 ` Alain Frisch
  2018-06-07  8:06 ` Richard W.M. Jones
  0 siblings, 2 replies; 5+ messages in thread
From: Julien Tesson @ 2018-06-05 10:06 UTC (permalink / raw)
  To: caml-list

Dear list,

Is anyone aware of an Ocaml implementation of Xpath or any similar tool to query an XML document ?
I found XML parsers via Opam, like pxp, but they don't seem to come with a querying library.
Thank you for any input on this !

Julien


-- 
Caml-list mailing list.  Subscription management and archives:
https://sympa.inria.fr/sympa/arc/caml-list
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Caml-list] XPath implementation or equivalent
  2018-06-05 10:06 [Caml-list] XPath implementation or equivalent Julien Tesson
@ 2018-06-05 10:40 ` Alain Frisch
  2018-06-06 13:59   ` Julien Tesson
  2018-06-07  8:06 ` Richard W.M. Jones
  1 sibling, 1 reply; 5+ messages in thread
From: Alain Frisch @ 2018-06-05 10:40 UTC (permalink / raw)
  To: Julien Tesson, caml-list

You might have a look at http://alain.frisch.fr/soft#xpath , which 
implements a naive XPath evaluator (written 18 years ago, and never used 
for anything serious).

https://www.orcaware.com/pipermail/ocaml-pxp-users/2009-September/000099.html 
also refers to an XPath evaluator in PXP.

Alain

On 05/06/2018 12:06, Julien Tesson wrote:
> Dear list,
> 
> Is anyone aware of an Ocaml implementation of Xpath or any similar tool to query an XML document ?
> I found XML parsers via Opam, like pxp, but they don't seem to come with a querying library.
> Thank you for any input on this !
> 
> Julien
> 
> 

-- 
Caml-list mailing list.  Subscription management and archives:
https://sympa.inria.fr/sympa/arc/caml-list
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Caml-list] XPath implementation or equivalent
  2018-06-05 10:40 ` Alain Frisch
@ 2018-06-06 13:59   ` Julien Tesson
  0 siblings, 0 replies; 5+ messages in thread
From: Julien Tesson @ 2018-06-06 13:59 UTC (permalink / raw)
  To: Alain Frisch, caml-list

Thanks Alain for your input,

part of your XPath evaluator still compile so I might give it a try later, but as the xpath expression lexer use wlex which is no longer available, it's not straight forward. 
Being unfamiliar with the wlex replacement ulex, I don't know if it would be a long work to update the lexer, but it's probably more than what I can afford right now, unfortunately.

pxp-xpath doesn't compile anymore, their is a typing error about a definition of type containing a cycle.

If anyone can think about an other library that would help querying XML documents, I'm interested ;)

regards,
Julien

Le 05/06/2018 à 12:40, Alain Frisch a écrit :
> You might have a look at http://alain.frisch.fr/soft#xpath , which implements a naive XPath evaluator (written 18 years ago, and never used for anything serious).
>
> https://www.orcaware.com/pipermail/ocaml-pxp-users/2009-September/000099.html also refers to an XPath evaluator in PXP.
>
> Alain
>
> On 05/06/2018 12:06, Julien Tesson wrote:
>> Dear list,
>>
>> Is anyone aware of an Ocaml implementation of Xpath or any similar tool to query an XML document ?
>> I found XML parsers via Opam, like pxp, but they don't seem to come with a querying library.
>> Thank you for any input on this !
>>
>> Julien
>>
>>




-- 
Caml-list mailing list.  Subscription management and archives:
https://sympa.inria.fr/sympa/arc/caml-list
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Caml-list] XPath implementation or equivalent
  2018-06-05 10:06 [Caml-list] XPath implementation or equivalent Julien Tesson
  2018-06-05 10:40 ` Alain Frisch
@ 2018-06-07  8:06 ` Richard W.M. Jones
  2018-06-07  9:00   ` Richard W.M. Jones
  1 sibling, 1 reply; 5+ messages in thread
From: Richard W.M. Jones @ 2018-06-07  8:06 UTC (permalink / raw)
  To: Julien Tesson; +Cc: caml-list

On Tue, Jun 05, 2018 at 12:06:06PM +0200, Julien Tesson wrote:
> Dear list,
> 
> Is anyone aware of an Ocaml implementation of Xpath or any similar tool to query an XML document ?

Yes we use libxml2 extensively in virt-v2v through some very simple
bindings (not packaged separately, but they are rather trivial).

Example usage:

https://github.com/libguestfs/libguestfs/blob/a4d5548a4560ba4c548e64bf4a161f1003760e34/v2v/parse_libvirt_xml.ml#L77

Bindings:

https://github.com/libguestfs/libguestfs/tree/master/common/mlxml

I would relicense these as LGPLv2+ if you wanted that (but to save
time don't bother asking me to relicense them as MIT or whatever so
you can steal the work from the commons).

Rich.

-- 
Richard Jones

-- 
Caml-list mailing list.  Subscription management and archives:
https://sympa.inria.fr/sympa/arc/caml-list
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Caml-list] XPath implementation or equivalent
  2018-06-07  8:06 ` Richard W.M. Jones
@ 2018-06-07  9:00   ` Richard W.M. Jones
  0 siblings, 0 replies; 5+ messages in thread
From: Richard W.M. Jones @ 2018-06-07  9:00 UTC (permalink / raw)
  To: Julien Tesson; +Cc: caml-list

On Thu, Jun 07, 2018 at 09:06:12AM +0100, Richard W.M. Jones wrote:
> Bindings:
> 
> https://github.com/libguestfs/libguestfs/tree/master/common/mlxml

Oops, missed out the Xpath_helpers module which is in a
different directory:

https://github.com/libguestfs/libguestfs/blob/master/common/mltools/xpath_helpers.mli
https://github.com/libguestfs/libguestfs/blob/master/common/mltools/xpath_helpers.ml

Rich.

-- 
Richard Jones

-- 
Caml-list mailing list.  Subscription management and archives:
https://sympa.inria.fr/sympa/arc/caml-list
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-06-07  9:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-05 10:06 [Caml-list] XPath implementation or equivalent Julien Tesson
2018-06-05 10:40 ` Alain Frisch
2018-06-06 13:59   ` Julien Tesson
2018-06-07  8:06 ` Richard W.M. Jones
2018-06-07  9:00   ` Richard W.M. Jones

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).