Chapter 3. Package hparser

The following chapter describes the package hparser. It contains all modules for parsing XML files and checking the well-formedness constraints of XML. Validation, normalizing attribute values and adding default values is done by the separate package hvalidator.

The parser works internally with filters for reading XML data and processing the constructed XmlTree. The whole parser works with filters of type XmlStateFilter from the module XmlState so that trace-output of the computations can be generated, errors can be reported and some state information can be saved where it is necessary.

3.1. Overview

The package hparser provides five public modules for implementing an XML parser, which builds the generic tree data structure XmlTree from XML documents.

Modules

HdomParser

Basic parser for building the generic tree data structure XmlTree. Bases on XmlParser, XmlInput and DTDProcessing.

XmlParser

Parses XML files. Bases on the free monadic parser combinator library Parsec [WWW29].

XmlInput

Reads XML files, handles different character encodings.

DTDProcessing

Processes the DTD. Substitution of general and parameter entities, merging of the internal and external DTD subset.

XmlOutput

Prints the parsed data by using the XmlStateFilter defined in module XmlState.