XML.com: XML From the Inside Out
oreilly.comSafari Bookshelf.Conferences.

advertisement
 Resource Guide -> Schema Software, Query Technologies -> HaXml

HaXml

Date: Apr. 19, 2001
Link: http://www.cs.york.ac.uk/fp/HaXml/
Source Author or Organization: Malcolm Wallace, Colin Runciman, Functional Programming Group, Department of Computer Science, Unive

HaXml is a suite of XML utilities for the functional programming language Haskell (named for Haskell Brooks Curry, a mathematician whose work in logic is the foundation for functional programming languages).

Languages such as C and Java are imperative languages, based upon sequences of commands. Functional languages such as Haskell produce a program that is a single expression, executed by evaluation of the expression. Spreadsheet macro languages are a simple example, and SQL queries are another example. Haskell brings the same ideas to general purpose programming.

Adherents say the functional approach accomplishes tasks using fewer lines of code than imperative languages, and that, in addition, the code is more human-understandable. In the paper Haskell and XML: Generic Combinators or Type-Based Translation?, Malcolm Wallace and Colin Runciman examine two approaches to XML document processing in functional languages. Combinators (which are Lego-like high-order functions that combine to make more complex functions) contain content filters for the generic representation of the contents of an XML document, excluding any Document Type Definition (DTD).

A combinator library is extensible like XML itself, and can operate like a language extension focusing on a particular problem area. Type-Based Translation (or translation of DTDs to types) refers to a DTD-directed approach with known DTDs, where validation translates to static type-checking.

HaXml includes XmlLib, a combinator library for generic XML document transformation, editing, and generation. It also contains the DtdToHaskell tool for translating DTDs to equivalent Haskell types, the Xml2Haskell class framework for editing and transforming documents as normal typed values in programs, and a grep-like tool based on XML Query Language (XQL) known as Xtract.

Development of the open source HaXml XML utilities was funded by Canon Research Europe Ltd.