Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
xml tree -- variant type tree
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2006-02-28 (20:56)
From: philip <philip-f@w...>
Subject: Re: [Caml-list] xml tree -- variant type tree

On 02/28/2006 04:23:39 PM, Hendrik Tews wrote:
> Hi,
> I would like to read an XML file into an element of some variant
> type, where each constructor corresponds to precisely one type of
> xml nodes. Of course I would need to define the variant type
> beforehand. But how to proceed then?
> The humps give me the impression that the right library to use is
> Gerd Stolpmanns pxp. However, this library will produce an object
> tree, which I could probably convert into a variant type with
> some effort.
> An alternative would be to use XML-Light, which produces string
> labelled trees, and to translate these string trees myself.
> Is there some better solution?
> Background: I would like to manipulate abstract syntax trees of
> C++ programs. I couldn't find a C++ parser in Ocaml, therefore I
> would like to use Elkhound/Elsa
> (, which can output
> the abstract syntax tree as xml file. Extending Elsa is not an
> option, because for ast manipulations I prefer ocaml pattern
> matching over C++ visitors.
> Bye,
> Hendrik
> _______________________________________________
> Caml-list mailing list. Subscription management:
> Archives:
> Beginner's list:
> Bug reports:

Hi Hendrik,

i parsed some with tom, it is very efficient:


And remember, "For every complex problem, there is a solution that is  
simple, neat, and wrong."