Sunday, March 27, 2005

XML in Scheme

There has been some incredible work on XML in Scheme, with several wonderful languages and libraries available. I'll probably describe some of them in the future, and I'm thinking about writing a tutorial. For now, here's the high-level description.

Abstract: XML is a framework for defining data languages, particularly tree-shaped data.

What do you do with a data language?
  1. Construction: you create data.
  2. Validation: you describe the valid types of data in the language and perform static analysis of data to test for conformance.
  3. Serialization: you write the data in some convenient representation format, and read data back in from that serialized format.
  4. Queries: given a set of data, you mine it for some subset of information.
  5. Transformation: given data in one language, you transform it into data in another language.
All of these are supported by the various Scheme libraries for XML. Some of the most breathtaking examples are the transformation languages of SXSLT and WebIt!, and Neil van Dyke's astonishing permissive HTML parsing library HTMLPrag. There are also some cool query languages, like SXPath and Jim Bender's query library.

With a little taste and some fluency with standard tools of language specification, these authors have managed to describe data manipulation languages that are as powerful as their mainstream counterparts, with specs a fraction the size of the monstrosities produced by the W3C.

No comments: