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
Fast XML parser
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2007-07-18 (22:48)
From: Till Varoquaux <till.varoquaux@g...>
Subject: Re: [Caml-list] Fast XML parser

I beg to differ, if you want speed and can work stream (linear
top-down left-right exploration of the graph), you want an event based
xml parser. expat is probably one of the fastest (the c library is
known to be a speed demon). PXP does everything including talking
klingon and controlling the kitchen sink. It provides an event based
I have found Xml-light to be the simplest parser. Alas, it is so
simple it is far from implementing the full XML 1.1 specification.
This often isn't an issue since most XML files are written in a very
small subset of what the language.

Ultimately if you are parsing very simple files and are aiming for
pure speed you could write a simple lexer with ocamllex and use that
as base layer.

On 7/19/07, Gabriel Kerneis <> wrote:
> Le Wed, 18 Jul 2007 14:58:35 -0700, "Luca de Alfaro"
> <> a écrit :
> > I am interested in parsing Wiki markup language that has a few tags,
> > like <pre>...</pre>, <math>...,</math>.
> > These tags are sparse, meaning that the ratio of number of tags /
> > number of bytes is low.
> > I would like, given a string (or a stream) with such tags, to parse
> > it as fast as possible.  Efficiency is a primary consideration, and
> > so is simplicity of the implementation.
> > Do you have any advice about the library I should be using?
> You want it simple, you want it light : Xml-light.
> Regards,
> --
> Gabriel
> _______________________________________________
> Caml-list mailing list. Subscription management:
> Archives:
> Beginner's list:
> Bug reports: