XML Serializer
It is also possible to output the XML within the DOM in the pipeline directly. This is of
use in the aggregation process when a document is made up of several XML parts. As an
example consider this from the Paloose site content sitemap
<map:components>
...
<map:serializers default="xml">
<map:serializer
name="xhtml"
src="resource://lib/serialization/XHTMLSerializer">
<doctype-public>-//W3C//DTD XHTML 1.0 Strict//EN</doctype-public>
<doctype-system>http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd</doctype-system>
<encoding>iso-8859-1</encoding>
</map:serializer>
<map:serializer name="xml" src="resource://lib/serialization/XMLSerializer"/>
</map:serializers>
</map:components>
<map:pipelines>
<map:pipeline>
<map:match pattern="**.html">
<map:aggregate element="root" label="aggr-content">
<map:part src="cocoon:/menus.xml" element="menus" strip-root="true"/>
...
</map:aggregate>
...
<map:serialize type="xhtml" />
</map:match>
<map:match pattern="menus.xml">
<map:generate src="context://content/menus.xml" label="menus-content"/>
<map:transform type="i18n">
<map:parameter name="default-catalogue-id" value="menus"/>
</map:transform>
<map:serialize/>
</map:match>
</map:pipelines>
The output menus matcher would give the following into the aggregator:
<?xml version="1.0"?>
<page:page xmlns:link="http://www.hsfr.org.uk/Schema/Link"
xmlns:list="http://www.hsfr.org.uk/Schema/List"
... >
...
</page:page>
Copyright 2006 – 2017 Hugh Field-Richards. All Rights
Reserved.