apache > cocoon

Aggregator FAQs

What is an Aggregator?

An aggregator produces XML content. It is composed of one or more parts, each of which defined by an XML source. During pipeline processing, all parts of an aggregator are merged. The name of the parent element which contains the merged XML content from each part is defined by the value of the map:aggregate's attribute called element.

In the example below,the XML content of pipelines matching book-*.xml and body-*.xml are aggregated, having a root element called site.

<map:match pattern="*.html">
 <map:aggregate element="site">
  <map:part src="cocoon:/book-{1}.xml"/>
  <map:part src="cocoon:/body-{1}.xml"/>

The aggregated XML content could look like this:

  <!-- content of book XML --> 
  <!-- content of body XML -->

Where can I learn more about content aggregation?

Learn more about content aggregation by downloading the free chapter, A User's Look at the Cocoon architecture, from Langham and Ziegeler's Cocoon: Building XML Applications available at the New Riders web site.