The end point of a Pipeline. Its inputs are SAX events. It outputs a presentation of those events. i.e. it performs the function of rendering the results of a request.

The basic Serializer turns a series of SAX events into an XML document.

Declaration

Serializers are configured in the Sitemap

<map:serializers default="html">
<map:serializer name="xml"
                 mime-type="text/xml"
                 src="org.apache.cocoon.serialization.XMLSerializer"/>
<map:serializer name="html"
                 mime-type="text/html"
                 src="org.apache.cocoon.serialization.HTMLSerializer"/>
<map:serializer name="fo2pdf"
                 mime-type="application/pdf"
                 src="org.apache.cocoon.serialization.FOPSerializer"/>
<map:serializer name="vrml"
                 mime-type="model/vrml"
                 src="org.apache.cocoon.serialization.TextSerializer"/>
<map:serializer name="text"
                 mime-type="text/plain"
                 src="org.apache.cocoon.serialization.TextSerializer"/>
...
</map:serializers>

The default attribute on the serializers element indicates the default serializer to use if a pipeline does not explicitly declare one.

Usage

Sample usage:

<map:match pattern="hello.html">
<map:generate src="docs/samples/hello-page.xml"/>
<map:transform src="stylesheets/page/simple-page2html.xsl"/>
<map:serialize type="html"/>
</map:match>

Available Implementations

Serializers are provided to produce HTML, XML, PDF, WAP, VRML, amongst others: