Haskell XML Toolbox 8.3.2

Contents


Introduction

The Haskell XML Toolbox is a collection of tools for processing XML with Haskell. It is purely written in Haskell. The Haskell XML Toolbox is a project of the University of Applied Sciences Wedel,

The main design goal of the Haskell XML Toolbox is the support of various XML standards including Extensible Markup Language (XML) 1.0 (Second Edition) with DTD processing and Validation, Namespaces in XML 1.0 (Second Edition), XML Path Language (XPath), XSL Transformations (XSLT), RELAX NG Specification, as well as HTML/XHTML processing.

Description

The Haskell XML Toolbox bases on the ideas of HaXml and HXML, but introduces a more general and flexible approach for processing XML with Haskell. The Haskell XML Toolbox uses a generic data model for representing XML documents, including the DTD subset and the document subset, in Haskell. This data model makes it possible to use filter functions as a uniform design of XML processing applications. The processing filters are implemented as arrows. This is more flexible than the filter approach from HXML and HaXml, but all filter applications can easily be transformed into arrows.

Since version 5.2 HXT works with arrows instead of filters. The filter part has been separated from this library and is available in an extra package (see HXT with Filters) There is a cookbook for using this arrow interface to build (nontrivial) applications. Manuel Ohlendorf has developed examples for processing RDF and has documented the development in his master thesis: A Cookbook for the Haskell XML Toolbox with Examples for Processing RDF Documents (the thesis as PDF)

Features:

Documentation

The HXT API Documentation generated with Haddock.

A (somewhat) gentle introduction to HXT is avalable in the Haskell Wiki. There's also a page about HXT: Conversion of Haskell data from/to XML with picklers.

The XSLT transformer has been developed by Tim Walkenhorst in this master thesis: Implementing an XSLT processor for the Haskell XML Toolbox. It's a rather complete implementation, but it's of course not a substitute for Xalan or other advanced XSLT systems. The XSLT module consists of less than 2000 lines of code. Compared with the more than 300,000 lines of Java for Xalan, this Haskell code can be viewed as one of the first formal specifications for XSLT.

Manuel Ohlendorfs master thesis, describing the arrow interface of the toolbox: A Cookbook for the Haskell XML Toolbox with Examples for Processing RDF Documents (the thesis as PDF). The source code of the example application is included in the doc/cookbook directory of the distribution.

The master's thesis "Design and Implementation of a validating XML parser in Haskell" by Martin Schmidt describes the design and motivation of the Haskell XML Toolbox (the thesis as HTML or PDF) and the development of the DTD validator module. The documentation in the thesis is a bit out of date, the modules and module names and some function names have been changed. For details the online haddock documentation should be used.

The description of the development of the XPath modules is described (in german) in Konzeption und Implementierung eines XPath-Moduls für die Haskell XML Toolbox (PDF-document).

The description of the internals of the Relax NG validator modules is described (in german) in Design und Entwicklung eines Relax NG Schema Validators auf Basis der Haskell XML Toolbox (PDF-document).

Requirements

It is recommended to install the versions available from Hackage.

Downloads

Haskell XML Toolbox 8.3.2, released 2009-10-29:

A darcs repository is available under http://darcs2.fh-wedel.de/repos/hxt, the web interface is http://darcs2.fh-wedel.de/cgi-bin/darcsweb.cgi.

Installation

Before installing this version, install the curl and tagsoup modules. For a quick install with Cabal execute the following commands in .../HXT-8.3.2

    cabal configure
    cabal build
    sudo cabal install --global
    

A quick test of the example programs:

    cd examples
    make all
    make test
    

Installation without Cabal with GNU make:

    make all
    make install               # with root privileges
    

Change History

Known problems and limitations

The parser has been tested with the XML Validation Suite form the W3C. The following problems have been encountered:

Portability

Portability to Windows based systems has not been tested very intensively, but did work on an XP system with the Cygwin tools installed. Development was done under Linux with GHC 6.10 with the -Wall flag. No warnings were issued, when compiling the toolbox sources.

HXT with Filters

For older applications using the filter functionality, there is an extra package hxt-filter. This package must be installed on top of hxt. The filter package will not be actively developed any more. Please move to the arrow version for long term projects. Installation works with cabal in the usual way. Download archive is hxt-filter-8.3.0.tar.gz, HXT Filter API Documentation with source links is availabe as well as a darcs repository under http://darcs2.fh-wedel.de/repos/hxt-filter.

Related work

Feedback

We are interested in hearing your feedback on our Haskell XML Toolbox, suggestions for improvements, comments and criticisms.

Mail address is hxmltoolbox@fh-wedel.de


The Haskell XML Toolbox is distributed under the MIT License. Valid HTML 4.01!
Last modified: 2009-10-29