Version française
Home     About     Download     Resources     Contact us    
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: -- (:)
From: Alain Frisch <Alain.Frisch@i...>
Subject: Re: [Caml-list] xml tree -- variant type tree
Michael Wohlwend wrote:
> 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.

FWIW, this would be even simpler with PXP's pull parsers (you call a 
function to get the next event instead of providing call-backs).

-- Alain