Rabbit blowing horn Work the Web

LotusXSL API Overview

Document Author: Scott Boag
Document Date: Thu Jun 24 11:56:08 GMT-0400 (EDT) 1999
Software Version: 0.17.3 [24-June-1999]

1. API Overview

This is meant as a general overview for the LotusXSL API. See the API Documentation for more specific information, or the Version Documentation for use and version information.

LotusXSL takes as primary input a source XML DOM tree and a stylesheet DOM tree. It's output is meant to be mainly SAX-based formatting events, though for the moment the output is first a DOM tree, which then is translated into SAX-based events. The LotusXSL processor is meant to be independent from any given DOM implementation or XML implementation.

Code provides base servlet support to apply XSL stylesheets (retrieved from various sources) to XML (also retrieved from various sources). See the DefaultApplyXSL documentation.

The primary workhorse in LotusXSL is the XSLProcessor class which is responsible for processing an input source tree through a stylesheet. In order for the XSLProcessor class to work it must have an object that implements a XMLParserLiaison interface and normally a Formatter interface.

At this time there are 3 classes that implement the XMLParserLiaison interface and the Formatter interface:

ProcessXSL class
The XMLParserLiaison and Formatter for XML4J 1.1.14.
XML4JLiaison4dom class
The XMLParserLiaison and Formatter for XML4J 2.0.0 Generic DOM.
XML4JLiaison class
The XMLParserLiaison and Formatter for XML4J 2.0.0 TX compatibility classes.

All of these classes derive from the XMLParserLiaisonDefault class, which can be used by itself for any DOM, including programatically created DOMs, as long as XML parser services are not required to handle xsl:include and the like.

The primary methods for processing XML documents through a stylesheet are the various forms of process() in the XSLProcessor class. The various forms of process() allow permutations of DOM Trees, URIs, and output Writers, for the source tree, stylesheet tree, and result tree. The input DOM trees are not normally modified in any way.

You must create a new instance of the XSLProcessor class each time you run a transformation. Fixing this is high on my priority list.

The API Documentation is in the 'apidocs' directory.


2. Examples

The only API example I currently have is an example of calling LotusXSL from a domino servlet in the 'domino' directory.

One other good place to look for an example of the API being used is the main() function in the ProcessXSL class.

I hope to be getting some work done on examples over time. If you come up with something cool that you wouldn't mind sharing, please let me know!


3. Tips


4. Glossary

XSL Instruction
Any tag with an XSL namespace prefix.
XSL Template Instruction
Any tag with an XSL namespace prefix that occurs inside an xsl:template element.
Template Child
Any node that is a child of an xsl:template element.
Source Tree
The tree input to the XSL process.
Result Tree
The tree that is output by the XSL process.
Stylesheet Tree
The stylesheet tree produced from the XSL file.
Pattern List
A parsed query or match pattern.