The latest version is Cocoon 2 and is available for download from:

http://www. xml.apache.org/cocoon/

It is a Web based application and must be run upon a Java Servlet 2.2 compliant engine, and also Jakarta Tomcat 4.0.1

In Cocoon, everything can be perceived as part of a pipeline. A pipeline consists of an input, some processing steps and then an output. Cocoon 2 makes use of the SAX events between each processing step. Parts of the pipeline include a generator and a serializer. The generator is used for input, the serializer produces output and the transformer is used for processing intermediate steps.

These components can be grouped together into several distinct types, depending on the roles they play within a pipeline:

Generators and reader: pipeline inputs

Generators are used for inputing data source and passing it on as a series of SAX events. The simplest generator is therefore a SAX parser. Generally, any data source that can be mapped to a series of SAX events can become the basis for a generator.

Transformers and actions: processing steps

The main processing steps in the pipeline are handled by the transformers (Figure 2-3). They accept SAX events as input, perform a number of useful processing steps, and then the results produced are passed down the pipeline as SAX events. The most common transformer one can find is the XSLT Transformer. Input is fed into an XSLT processor which performs an XSLT transformation. The results of the transform are then fed back into the pipeline as SAX events.

Serializer: pipeline outputs

Serializers render the output from a stream of SAX events produced from a generator or a transformer. The format of the output is dependent on the serializer specified. Serializers are the endpoints in Cocoon pipelines. The most basic serializer is the XML serializer, which simply turns the SAX events back into an XML document, while other serializer produce HTML, PDF documents, and images to name a few. The serializers need to have the SAX events stream to be of a particular XML vocabulary: A HTML Serializer turns XHTML into valid HTML, a PNG images and PDF Serializer: Turns XSL-FO into a PDF document and a SVG Serializer turns SVG into JPEG.

50 The XML Files: Development of XML/XSL Applications Using WebSphere Studio

Page 66
Image 66
IBM Version 5 manual Generators and reader pipeline inputs, Transformers and actions processing steps