From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 29D78BBBB for ; Tue, 28 Feb 2006 16:52:40 +0100 (CET) Received: from [128.93.11.101] (buzet.inria.fr [128.93.11.101]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id k1SFqddw023365 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Tue, 28 Feb 2006 16:52:40 +0100 Message-ID: <440471C0.20605@inria.fr> Date: Tue, 28 Feb 2006 16:52:32 +0100 From: Alain Frisch User-Agent: Debian Thunderbird 1.0.7 (X11/20051017) X-Accept-Language: en-us, en MIME-Version: 1.0 To: caml-list@yquem.inria.fr Subject: Re: [Caml-list] xml tree -- variant type tree References: <17412.27387.963123.675231@ithif59.inf.tu-dresden.de> <200602281643.29063.micha-1@fantasymail.de> In-Reply-To: <200602281643.29063.micha-1@fantasymail.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Miltered: at concorde with ID 440471C7.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; frisch:01 frisch:01 caml-list:01 ocaml's:01 fwiw:01 parsers:01 expat:98 expat:98 wrote:01 short:01 structures:01 simpler:01 data:02 variant:02 tree:02 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.3 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