mod_xsl -- An inets module to tranform XML documents generated by mod_esi

mod_xsl is an inets module that allows XSL transformations on XML documents generated by mod_esi. The stylesheet selection is based on the document type and the environment of the http query (user agent, accept, query string, etc.). The module uses an XSL Engine, for instance sablotron_adapter, to carry out the actual XSL transformation.

 Original version of this documentation at LFCIA lab, University of A Coruña, Spain
SourceForge Logo  Mirror at SourceForge

Motivation

When developing monet, a flexible monitoring tool for the VoDka project, we needed a way of generating monet output to different devices: standard browsers, text-only browsers, wap-enabled terminals, and so on. Generating monet output as XML documents and then transforming them using an XSL engine with rules to choose the appropriate XSL style became an elegant and effective solution.

How does it work?

For each document type (as stated in the XML Document's DOCTYPE declaration), mod_xsl requires a set of possible transformations. Each of these transformations, among other things, consists of a predicate that checks whether the XSL stylesheet is valid given the current http environment. mod_xsl is in charge of choosing the appropriate stylesheet from both the document type and the environment and replacing the response by transforming it using the chosen XSL and an XSL Engine (i.e., sablotron_adapter).

Downloading

In addition, you will need the following software:

Installation

Configuration

To properly use mod_xsl you have the following directives that can be included in the inets configuration file:

Known Limitations

Even though inets' responses can be arbitrarily deep lists (perhaps including binaries in the middle), the mod_xsl scanner will only succeed if the xml document prologue is a plain list of chars. Thus, try to create responses like this:
     "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n" ++
     "<!DOCTYPE employees>" ++ 
     TheRestOfTheXmlDocument
Ya, I could flatten the whole response and convert the binaries to lists, but that is quite expensive if documents are large   8-{

You should see also...

Related tools: Some examples of mod_xsl at work:
Víctor M. Gulías
Last modified: Fri May 18 15:14:46 CEST 2001

This page served from SourceForge Logo