The PXP user's guide

Gerd Stolpmann

PXP is a validating parser for XML-1.0 which has been written entirely in Objective Caml.

Download PXP:

The free PXP library can be downloaded at http://www.ocaml-programming.de/packages/. This user's guide is included. Newest releases of PXP will be announced in The OCaml Link Database.

License

This document, and the described software, "PXP", are copyright by Gerd Stolpmann.

Permission is hereby granted, free of charge, to any person obtaining a copy of this document and the "PXP" software (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

The Software is provided ``as is'', without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose and noninfringement. In no event shall Gerd Stolpmann be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from, out of or in connection with the Software or the use or other dealings in the software.


Table of Contents
I. User's guide
1. What is XML?
1.1. Introduction
1.1.1. The "hello world" example
1.1.2. XML parsers and processors
1.1.3. Discussion
1.2. Highlights of XML
1.2.1. The DTD and the instance
1.2.2. Reserved characters
1.2.3. Elements and ELEMENT declarations
1.2.4. Attribute lists and ATTLIST declarations
1.2.5. Parsed entities
1.2.6. Notations and unparsed entities
1.3. A complete example: The readme DTD
2. Using PXP
2.1. Validation
2.2. How to parse a document from an application
2.3. Class-based processing of the node tree
2.4. Example: An HTML backend for the readme DTD
2.4.1. Header
2.4.2. Type declarations
2.4.3. Class store
2.4.4. Function escape_html
2.4.5. Virtual class shared
2.4.6. Class only_data
2.4.7. Class readme
2.4.8. Classes section, sect1, sect2, and sect3
2.4.9. Classes map_tag, p, em, ul, li
2.4.10. Class br
2.4.11. Class code
2.4.12. Class a
2.4.13. Class footnote
2.4.14. The specification of the document model
3. The objects representing the document
3.1. The document class
3.2. The class type node
3.2.1. The principal structure of document trees
3.2.2. Optional features
3.2.3. Namespaces
3.2.4. Types
3.2.5. The methods of the class type node
3.2.6. The class element_impl
3.2.7. The class data_impl
3.2.8. The classes super_root_impl, pinstr_impl, and comment_impl
3.2.9. Examples: Creating and accessing nodes
3.2.10. The type spec
3.2.11. Examples: Creating nodes using spec
3.2.12. Iterators
3.2.13. Stripping whitespace
3.2.14. Document order
3.2.15. Functions
3.3. The class type extension
3.3.1. How to define an extension class
3.3.2. How to bind extension classes to element types
3.4. Details of the mapping from XML text to the tree representation
3.4.1. The representation of character-free elements
3.4.2. The representation of character data
3.4.3. The representation of entities within documents
3.4.4. The representation of attributes
3.4.5. The representation of processing instructions
3.4.6. The representation of comments
3.4.7. The attributes xml:lang and xml:space
3.5. Namespaces
3.5.1. Prefix normalization
3.5.2. DTDs
3.5.3. How to enable namespace processing
4. Configuring and calling the parser
4.1. Overview
4.2. Resolvers and sources
4.2.1. Using the built-in resolvers (called sources)
4.2.2. The resolver API
4.2.3. Predefined resolver components
4.3. The DTD classes
4.4. Invoking the parser
4.4.1. Defaults
4.4.2. Parsing functions
4.4.3. Configuration options
4.4.4. Which configuration should I use?