Copyright 1999-2004 The Apache Software Foundation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!DOCTYPE faqs PUBLIC "-//APACHE//DTD FAQ V1.0//EN" "faq-v10.dtd">
<faqs title="Aggregator FAQs">
<faq>
<question>
What is an Aggregator?
</question>
<answer>
<p>
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.
</p>
<p>
In the example below,the XML content of pipelines matching <code>book-*.xml</code> and <code>body-*.xml</code> are aggregated, having a root element called site.
</p>
<source><![CDATA[
<map:match pattern="*.html">
<map:aggregate element="site">
<map:part src="cocoon:/book-{1}.xml"/>
<map:part src="cocoon:/body-{1}.xml"/>
</map:aggregate>
...
]]></source>
<p>
The aggregated XML content could look like this:
</p>
<source><![CDATA[
<site>
<menu>
<!-- content of book XML -->
...
</menu>
<document>
<!-- content of body XML -->
...
</document>
</site>
]]></source>
</answer>
</faq>
<faq>
<question>
Where can I learn more about content aggregation?
</question>
<answer>
<p>
Learn more about content aggregation by downloading the free chapter, <link href="http://www.newriders.com/books/product.asp?product_id={C3C05052-BE3B-4E06-A60A-13FB40AF58F6}" >A User's Look at the Cocoon architecture,</link> from Langham and Ziegeler's <em>Cocoon: Building XML Applications</em> available at the New Riders web site.