XMLambda: A functional language for constructing and manipulating XML documents

Erik Meijer and Mark Shields. Unpublished. Dec 1999. [letter ps] [bibtex]

Abstract

XML has been widely adopted as a standard language for describing static documents and data. However, many application domains require XML, and it's cousin HTML, to be filtered and generated dynamically, and each such domain has adopted a language for the tasks at hand. These languages are often ill-suited, unsafe, and interact poorly with each other.

In this paper we present XMLambda, a small functional language which has XML documents as its basic data types. It is expressly designed for the task of generating and filtering XML fragments. The language is statically typed, which guarantees every document it generates at run-time will conform to its DTD, but also uses type inference to avoid the need for many tedious type annotations. The language is also higher-order and polymorphic, which allows many common programming patterns to be captured in a small highly reusable library. Furthermore, the language uses pattern-matching so that XML fragments may be deconstructed into their components just as easily as they are constructed.

We present the language by a series of worked examples. A formal definition and an implementation are in preparation.

Note

We didn't have any luck publishing this paper at the time. The ideas here flowed into my thesis, and Erik's later work with COmega and the upcomming XML support in Microsoft Visual Basic (described here).