This is the archived PXP page. The new homepage
can be found here!
In October, 1999, I started writing a validating XML parser for O'Caml; the first published versions have been called "Markup" (simply because the package name was "markup"). After this parser had some success, I decided to revise the whole code, and to redesign the parser where it was needed. The result of this work is PXP, the Polymorphic XML Parser. The name reflects an important property of the parser, namely that the type of the XML nodes can be customized; a feature which is missing in most other XML parsers.
Now, one year later, I can announce the first stable version of PXP. "Stable" means mostly that the interface of the parser has become stable, i.e. future changes will extend but not break the current interface. The parser worked relatively well from the very beginning, and during the pre-release phase (several months) users reported only few bugs. I am now relatively sure that PXP is mature enough to be used in applications.
In general, the task of a XML parser is to read XML text, and to represent the text somehow in memory. There are several models for the data structures; for PXP I have chosen the luxury representation as object tree, in which every XML node is stored as two objects. One object contains the set of methods describing the fixed properties of every node; the other object is called the extension object and can be configured by the user of the parser.
The extension object is the polymorphic part of the representation. The type of the class may be arbitrary (except three base methods which connect the object to the tree), and the parser has a mechanism to dynamically select the class of the object depending on the element type of the XML node.
The other features of the parser simply implement the XML standard:
Although the parser is now complete, development does not stop. I have plans to implement namespace support, and there are rumours that other people are programming an XPath extension. The xduce project already uses a pre-release version of PXP for their XML transformation language.
For more details, see the announcement.
I have begun to write a manual but it is still incomplete. It includes a short introduction into XML, and many examples how to use the parser.
There are also Release Notes.
The distribution tarball of the parser contains the full source code. As usual, it is a Caml component, and requires that the Findlib library has been installed first. The parser also needs the Ocamlnet package. Note that PXP works only with O'Caml 3.00.
The distribution contains three working applications which demonstrate how XML can be used: