Cocoon uses the pipeline to create static and dynamic resources on your web site from xml input using 3 components
1-
Generator (Like XMl and File Generators)
the generator is responsible for reading the input for Cocoon
2-
Transformer an examle of the transformer is the
XSLT transformer
transformers transform the xml generated from the negerator to generate the output
3-
Serializerthe serializer writes the generated transformed output to the client
Cocoon uses a method called sitemap where it defines certain patterns for the resources that the client is going to be generated by cocoon and the generator, transformer and serializer for this resource following is an exmaple fo the sitemap definition and it is an xml file
Code:
<map:pipeline>
<map:match pattern="hello.pdf">
<map:generate src="docs/samples/hello-page.xml"/>
<map:transform src="stylesheets/page/simple-page2fo.xsl"/>
<map:serialize type="fo2pdf"/>
</map:match>
</map:pipeline>
this sitemap tells cocoon that to listen for requests for hello.pdf and to use docs/samples/hello-page.xml as the input file and use the stylesheets/page/simple-page2fo.xsl file to transform it and to write it to the client using FOP as PDF file
This makes the developement of web resources quite easy