Aggregation Example

The example takes three documents aggr-1.xml, aggr-2.xml and aggr-3.xml (pretty printed). The three XML files are aggregated into a single file, which after aggregation gives this aggregated XML.

Note that the XML from part 2 does not have the root element removed by using the strip-root attribute set to true. The aggregate attribute element defines the enclosing element for all the parts. The relevant aggregation pipeline entry is

<map:aggregate element="root" > <!-- all part requests go to this sitemap --> <map:part src="cocoon:/{1}-1.xml" element="aggr-1" strip-root="true"/> <map:part src="cocoon:/{1}-2.xml" element="aggr-2" /> <map:part src="cocoon:/{1}-3.xml" element="aggr-3" strip-root="true"/> </map:aggregate>

Note the use of the pseudo-protocol which indicates that the src should be resubmitted to the current sitemap. there are match entries in the same sitemap to deliver the correct XML files. See the sub-sitemap for this level: sitemap.xmap. Note also that there are some extra attribute, "__file" and "__status" which may appear as part of the caching mechanism — they may be safely ignored

Copyright 2006 — 2010 Hugh Field-Richards. All Rights Reserved.