Generated: Monday, November 14, 2011, 09:25:19Copyright © 2006, Kurt NørmarkThe local LAML software home page

An XML-in-LAML Soccer Example

This example takes as a starting point a couple of XSLT programs found in the short paper What kind of language is XSLT? written by Michael Kay, Software AG.

Briefly stated, we develop an XML DTD for soccer results, and we generate the mirror in Scheme of this DTD. After this we have developed two diffent transformations of soccer results, exactly as shown in the paper referred above. Throughout we use the XML-in-LAML framework of LAML.

ExampleDTDSchemeLAMLHTML
The soccer XML DTDsoccer.dtd
Download it. Your browser will probably not let you see it
---
The DTD parsing script--parse.laml-
The XML-in-LAML mirroring script--make-mirror.laml-
The auto-generated Scheme mirror of the soccer DTD-soccer-mirror.scm--
The example XML-in-LAML soccer document - basis-basic-soccer-style.scmbasic-example-doc.lamlbasic-example-doc.html
The example XML-in-LAML soccer document - elaborate-new-elaborate-soccer-style.scmelaborate-example-doc.lamlelaborate-example-doc.html

Notice that the two example documents (basic and elaborate) are identical, except for the loading of different Scheme transformation programs.

The XSLT example in the referred paper uses a declarative, functional approach based on pattern matching and replacement. XSLT is a special purpose (application oriented) language. The LAML solution uses a general purpose functional programming language (Scheme), the derived mirror functions (of the Soccer elements) and of XHTML, and a few AST access functions from the XML-in-LAML library. To avoid duplicated code, and in order to raise the level of abstraction, a number of small functions are defined as part of the transformation programs.

For a tutorial discussion of XML-in-LAML (and all the stuff illustrated above) please have a look at the appropriate part of the LAML tutorial.

If your browser will not present files with 'laml', 'scm', or 'dtd' extensions you should disable any special handling of these extensions on your system. In that way they are treated as pure text files.

Transformation example index. 

 

Generated: November 14, 2011, 09:25:19