A document has been updated:
http://cocoon.zones.apache.org/daisy/documentation/1290.html
Document ID: 1290
Branch: main
Language: default
Name: Your first XML pipeline (publishing) (unchanged)
Document Type: Cocoon Document (unchanged)
Updated on: 5/6/07 5:10:38 PM
Updated by: Reinhard Pötz
A new version has been created, state: publish
Parts
=====
Content
-------
This part has been updated.
Mime type: text/xml (unchanged)
File name: (unchanged)
Size: 8239 bytes (previous version: 8304 bytes)
Content diff:
<html>
<body>
--- <p class="fixme">The archetype has to use Maven deployer by default.</p>
+++ <p>This tutorial is based on the <a href="daisy:1159">"Your first Cocoon
+++ application using Maven 2"</a> guide which shows how to bootstrap a Cocoon
+++ project.</p>
--- <p class="fixme">The first tutorial should be split into two parts: one that
--- only creates a block and a second one, that creates a war. That tutorial
should
--- be stand alone because it is too much to introduce this concept there too
IMHO
--- (rpoetz).</p>
+++ <p>In this tutorial you will</p>
--- <p class="fixme">The first tutorial should introduce into cocoon:rcl so that
--- Cocoon becomes useable right away.</p>
+++ <ol>
+++ <li>get an overview of what a Cocoon pipelines and sitemaps are</li>
+++ <li>create your first pipeline that emits XML</li>
+++ <li>enhance this first pipeline by adding an XML transformation step based
on
+++ XSLT that produces HTML as output</li>
+++ <li>write a pipeline that creates a PDF document</li>
+++ </ol>
--- <p class="fixme">The first tutorial should be renamed.</p>
---
--- <p>This tutorial is based on the <a href="daisy:1159">"Your first Cocoon
--- application using Maven 2" guide</a> which shows how to bootstrap a Cocoon
--- project.</p>
---
<h1>Overview</h1>
<p>Cocoon is based around the concept of pipelines:</p>
<p><img src="daisy:367"/></p>
--- <p>If a request comes in, a <strong>generator</strong> produces SAX events
(~
--- XML), <strong>tranformers</strong> can alter the stream of SAX events and a
+++ <p>If a request comes in, a <strong>generator</strong> produces
+++ <a href="http://www.saxproject.org/">SAX events</a> that represent the XML,
+++ <strong>tranformers</strong> can alter the stream of SAX events and a
<strong>serialize</strong>r finally creates an output stream which is sent
to
the client.</p>
(5 equal lines skipped)
<li>HTML serializer</li>
</ul>
--- <p>Sitemaps connect requests with those sitemaps by definining rules. When a
--- rule matches, the pipeline is executed.</p>
+++ <p><strong>Sitemaps</strong> are used to define those pipelines and connect
them
+++ with requests. This connections are defined by some kind of rules. In the
+++ context of Cocoon those rules are named matchers. Whenever one of those
rules
+++ (matcher) matches, a pipeline is executed.</p>
<h1>Create a pipeline in the sitemap</h1>
(53 equal lines skipped)
xmlns:map="http://apache.org/cocoon/sitemap/1.0">
<map:pipelines>
--- <map:pipeline><strong>
--- </strong> <map:match pattern="myFirstPipeline">
+++ <map:pipeline> <map:match pattern="myFirstPipeline">
<map:generate src="myXmlFile.xml" type="file"/>
<map:serialize type="xml"/>
--- </map:match><strong>
--- </strong><strong><strong><strong> <map:match
pattern="mySecondPipeline">
+++ </map:match> <strong><strong><strong> <map:match
pattern="mySecondPipeline">
<map:generate src="myXmlFile.xml" type="file"/>
</strong></strong><strong><strong><strong><strong> <map:transform
src="myXsltFile.xslt" type="xslt"/></strong></strong></strong></strong>
<strong><strong> <map:serialize type="html"/>
(38 equal lines skipped)
xmlns:map="http://apache.org/cocoon/sitemap/1.0">
<map:pipelines>
--- <map:pipeline><strong>
--- </strong> <map:match pattern="myFirstPipeline">
+++ <map:pipeline> <map:match pattern="myFirstPipeline">
<map:generate src="myXmlFile.xml" type="file"/>
<map:serialize type="xml"/>
--- </map:match><strong>
--- </strong> <map:match pattern="mySecondPipeline">
+++ </map:match> <map:match pattern="mySecondPipeline">
<map:generate src="myXmlFile.xml" type="file"/>
<map:transform src="myXsltFile.xslt" type="xslt"/>
<map:serialize type="html"/>
--- </map:match><strong><strong><strong>
--- </strong></strong></strong><strong><strong><strong> <map:match
pattern="myThirdPipeline">
+++ </map:match> <strong><strong><strong> <map:match
pattern="myThirdPipeline">
<map:generate src="myXmlFile.xml" type="file"/>
</strong></strong><strong><strong><strong><strong> <map:transform
src="myXml2PdfFile.xslt" type="xslt"/></strong></strong></strong></strong>
<strong><strong> <map:serialize type="fop"/>
(36 equal lines skipped)