<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE message PUBLIC
  "-//MLarc//DTD MLarc output files//EN"
  "../../mlarc.dtd"[
  <!ATTLIST message
    listname CDATA #REQUIRED
    title CDATA #REQUIRED
  >
]>

  <?xml-stylesheet href="../../mlarc.xsl" type="text/xsl"?>


<message 
  url="2006/02/6af59d175cbc1504e985c3969a204017"
  from="philip &lt;philip-f@w...&gt;"
  author="philip"
  date="2006-02-28T20:56:48"
  subject="Re: [Caml-list] xml tree -- variant type tree"
  prev="2006/02/406082980351bed8ed58171fa77ef569"
  next="2006/03/1ce72b8391a955381e724a587ed637d4"
  prev-in-thread="2006/02/406082980351bed8ed58171fa77ef569"
  prev-thread="2006/02/14a9c4cad7029f82e8818777b3f1896f"
  next-thread="2006/03/fc201eb3f71302cddcd6cdeba8f38433"
  root="../../"
  period="month"
  listname="caml-list"
  title="Archives of the Caml mailing list">

<thread subject="xml tree -- variant type tree">
<msg 
  url="2006/02/5a06bc8279f4c19275cafe9ac3e9a815"
  from="Hendrik Tews &lt;tews@t...&gt;"
  author="Hendrik Tews"
  date="2006-02-28T15:23:41"
  subject="xml tree -- variant type tree">
<msg 
  url="2006/02/e04c8ab1b293d8f49f5190b5f9c16d87"
  from="Michael Wohlwend &lt;micha-1@f...&gt;"
  author="Michael Wohlwend"
  date="2006-02-28T15:42:54"
  subject="Re: [Caml-list] xml tree -- variant type tree">
<msg 
  url="2006/02/9be4a9513b06eceb470e19b33ee11f97"
  from="Alain Frisch &lt;Alain.Frisch@i...&gt;"
  author="Alain Frisch"
  date="2006-02-28T15:52:40"
  subject="Re: [Caml-list] xml tree -- variant type tree">
</msg>
</msg>
<msg 
  url="2006/02/810a676239033685940f34f8c4924ab8"
  from="Richard Jones &lt;rich@a...&gt;"
  author="Richard Jones"
  date="2006-02-28T15:47:56"
  subject="Re: [Caml-list] xml tree -- variant type tree">
<msg 
  url="2006/02/54236ddfa0181dd7019024f192ea7fdd"
  from="Michael Wohlwend &lt;micha-1@f...&gt;"
  author="Michael Wohlwend"
  date="2006-02-28T15:56:56"
  subject="Re: [Caml-list] xml tree -- variant type tree">
<msg 
  url="2006/02/b7334ae50cf879e74b8b9faf0252e31b"
  from="Alain Frisch &lt;Alain.Frisch@i...&gt;"
  author="Alain Frisch"
  date="2006-02-28T16:24:49"
  subject="Re: [Caml-list] xml tree -- variant type tree">
<msg 
  url="2006/02/406082980351bed8ed58171fa77ef569"
  from="Michael Wohlwend &lt;micha-1@f...&gt;"
  author="Michael Wohlwend"
  date="2006-02-28T18:11:18"
  subject="Re: [Caml-list] xml tree -- variant type tree">
</msg>
</msg>
</msg>
</msg>
<msg 
  url="2006/02/6af59d175cbc1504e985c3969a204017"
  from="philip &lt;philip-f@w...&gt;"
  author="philip"
  date="2006-02-28T20:56:48"
  subject="Re: [Caml-list] xml tree -- variant type tree">
</msg>
</msg>
</thread>

<contents>

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

Hi Hendrik,

i parsed some with tom, it is very efficient:
http://tom.loria.fr/index.php

-Philip

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

</contents>

</message>

