blob: acfb8c08df255b464b218ceb6b8f48cc63f037b4 [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Overview of Apache Cocoon</title>
<link href="http://purl.org/DC/elements/1.0/" rel="schema.DC">
<meta content="Tom Klaasen" name="DC.Creator">
</head>
<body>
<h1>What is Apache Cocoon</h1>
<p>Cocoon is an XML publishing framework. It allows you to define XML
documents and transformations to be applied on it, to eventually generate a
presentation format of your choice (HTML, PDF, SVG, ...).</p>
<p>Cocoon also gives you the possibility to apply logic to your XML files
(so that the XML pipeline can be dynamic).</p>
<p>The <a href="userdocs/index.html">User documentation</a>
and especially <a href="userdocs/concepts/index.html">Concepts</a>
will help to understand Cocoon.
</p>
<a name="samples"></a>
<h1>Examples and demonstration applications</h1>
<p>
There are a whole suite of sample applications to demonstrate the power
of Cocoon. These samples are available from the "welcome" page after
you have downloaded, built, and installed the distribution.
Each example portrays a different aspect of the vast capabilities of
Cocoon ...
<span class="codefrag">http://localhost:8080/cocoon/</span>
</p>
<div class="note">With the 2.1 version,
<span class="codefrag">http://localhost:8080/cocoon/</span> goes directly to the
documentation, while
<span class="codefrag">http://localhost:8080/cocoon/samples/</span> is the Samples.
</div>
<p>
It will greatly assist your understanding of Cocoon to investigate
behind-the-scenes, to find out how each sample is processed. Do this
by looking at the actual XML documents provided in the distribution at
<span class="codefrag">src/webapp/samples/</span> and by consulting each sitemap to see
the processing steps that are defined.
</p>
<h1>Overview of XML document processing</h1>
<p>This section gives a general overview of how an XML document is
handled by Cocoon. See also the document
<a href="userdocs/concepts/index.html">Understanding Cocoon</a> for explanation of
the separation of content, style, logic and management functions.
</p>
<h2>Pipeline</h2>
<p>Cocoon relies on the pipeline model: an XML document is pushed
through a pipeline, that exists in several transformation steps of your
document. Every pipeline begins with a generator, continues with zero or more
transformers, and ends with a serializer. This can be compared to the
"servlet-chaining" concept of a servlet engine. We'll explain the components of
the pipeline now in more detail.</p>
<h3>Generator</h3>
<p>The Generator is the starting point for the pipeline. It is
responsible for delivering SAX events down the pipeline.</p>
<p>The simplest Generator is the FileGenerator: it takes a local XML
document, parses it, and sends the SAX events down the pipeline. </p>
<p>The Generator is constructed to be independent of the concept
"file". If you are able to generate SAX events from another source, you can use
that without having to go via a temporary file.</p>
<h3>Transformer</h3>
<p>A Transformer can be compared to an XSL: it gets an XML document
(or SAX events), and generates another XML document (or SAX events).</p>
<p>The simplest Transformer is the XalanTransformer: it applies an
XSL to the SAX events it receives.</p>
<h3>Serializer</h3>
<p>A Serializer is responsible for transforming SAX events to a
presentation format. For actors looking at the back of the pipeline, it looks
like a static file is delivered. So a browser can receive HTML, and will not be
able to tell the difference with a static file on the filesystem of the server.
</p>
<p>We have Serializers for generating HTML, XML, PDF, VRML, WAP, and
of course you can create your own.</p>
<p>The simplest Serializer is the XMLSerializer: it receives the SAX
events from up the pipeline, and returns a "human-readable" XML file.</p>
</body>
</html>