English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

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 (15:42)
From: Michael Wohlwend <micha-1@f...>
Subject: Re: [Caml-list] xml tree -- variant type tree
On Tuesday 28 February 2006 16:23, Hendrik Tews wrote:
> Hi,
> An alternative would be to use XML-Light, which produces string
> labelled trees, and to translate these string trees myself.

I found that difficult

> Is there some better solution?

I have used expat to parse my xml. To get more managable code I only use expat 
to fill a queue with the tags found: Start(tag,attr list) and End(tag,text). 
Then I make a stream of the function which reads that queue and can use 
ocaml's streamparsers to parse my xml and build my data structures quite 
easy. It's short, fast and easy changeable. The streamparses can watch only 
for the relevant tags to get the desired information and build the result.