[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Demexp-dev] Fwd: [Caml-list] ANNOUNCE: Xmlm

From: David MENTRE
Subject: [Demexp-dev] Fwd: [Caml-list] ANNOUNCE: Xmlm
Date: Tue, 27 Feb 2007 08:48:04 +0100


If one day we want to replace CDuce which is too heavy weight for our
use (albeit quite useful with its static checking), this library could
be useful.

Best wishes,

---------- Forwarded message ----------
From: Daniel Bünzli <address@hidden>
Date: 27 févr. 2007 02:16
Subject: [Caml-list] ANNOUNCE: Xmlm
To: address@hidden
Cc: address@hidden

Xmlm is an OCaml module providing sequential XML input/output and
a persistent cursor. It aims at making non valid XML processing
robust and painless.

The sequential interface can be used to process documents without
building an in-memory representation. It also lets the programmer
translate its own data structures to an XML representation and

The cursor allows to navigate and update a simple in-memory tree
representation of XML documents. Updates performed by the cursor
are persistent (non destructive).

To facilitate direct integration into projects, Xmlm is made of a
single module and distributed under a BSD license.

Project home page : <>

Your feedback is welcome,



Why another XML parser ?

Dissatisfaction about existing solutions either too complete and
complex or too britlle and restrictive. Besides it seems all
existing parsers force you to read the whole document in
memory. Here are some points that motivated the design of Xmlm.

1. Easy to integrate into projects without introducing external
   dependencies. A single module provides everything including
   documentation (ocamldoc) and the license.

2. Well documented. Features and limitations of the parser are precisely

3. Easy to use yet flexible api.
  - Choice between sequential (SAX-like) or tree (DOM-like) processing.
  - Construction/deconstruction of user data structures from/to xml
  - Tree processing with persistent cursor (zipper).
  - Simple white space handling options for character data.
  - Character encodings are translated to UTF-8.
    UTF-8 is the only encoding the programmer needs to handle.
  - Character references and predefined entities are resolved.
    Other entity references can be resolved via a user provided
  - Early access to data to allow parse time data transformations.
  - Parse time element pruning.

4. Robust parsing. Does not assume an xml subset.
  - Supports major encodings :  ASCII, UTF-8, UTF-16 (LE and BE),
  - Parses qualified names (namespaces).
  - Tail-recursive.

5. Limitations. If you need one of these things use PXP.
  - Comments, processing instructions and standalone declaration are
    dropped by the parser (it is a feature).
  - No DTD support (but it can be extracted and written as a raw
  - No validity support.

Caml-list mailing list. Subscription management:
Beginner's list:
Bug reports:

reply via email to

[Prev in Thread] Current Thread [Next in Thread]