XML Serializer

Warning
Note that this is a change from all versions prior to 1.13.0.

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"> <map:property name="doctype-public" value="-//W3C//DTD XHTML 1.0 Strict//EN"/> <map:property name="doctype-system" value="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"/> <map:property name="encoding" value="UTF-8"/> </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 – 2023 Hugh Field-Richards. All Rights Reserved.