cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jan Hoskens">
Subject Re: Aggregating Content From Multiple Sources
Date Mon, 19 Apr 2004 06:44:31 GMT
If you want to use aggregation, then do something like:

<map:match pattern="whatever.html">
<map:aggregate element="MyRootElement" prefix="MyPrefix"
    <map:part src="Internal/foo1"/>
    <map:part src="Internal/foo2"/>
    <map:part src="Internal/foo3"/>
<map:transform ...../>

this aggregation alone (without tranforming) results in:

<MyPrefix:MyRootElement xmlns:MyPrefix="myprefixnamespace">

Prefix and ns isn't required.
You may want to embed each part in an element, use map:part src=".."
If you want to exclude the rootelement in the parts, use strip-root="true".
I'm assuming you have an internal pipeline that matches the "Internal/foo1"
and others to provide an xml piece to the aggregator:

<map:match pattern="Internal/foo*">
    <map:generate src="part{1}.xml"/>
    <map:transform src="{1}.xsl"/>
    <map:serialize type="xml"/>

You may have better results/more flexibility by using a page with
inclusions. Use XInclude or CInlude tags in a page so that it includes all
three parts and tranform that page:

<map:generate src="inclusion.xml"/>
<map:transform type="cinclude" /> or xinclude

in the page inclusion.xml:
<mypage ...>
    <cinclude:include src="foo1"/>
(don't forget namespaces for cinclude or xinclude)

Kind Regards,

----- Original Message ----- 
From: "David Swearingen" <>
To: <>
Sent: Monday, April 19, 2004 12:53 AM
Subject: Aggregating Content From Multiple Sources

> I'm looking into a way to generate content from multiple generators at
> once after a user request (web) and then merge them together into one
> output serializer.  I looked into map:aggregate but the documentation
> seems limited and I couldn't find any examples of doing this.
> So, specifically, user requests whatever.html and my sitemap is
> configured to grab the results of multiple sources from disk:
> part1.xml serialized through 1.xsl > becomes foo1.xml
> part2.xml serialized through 2.xsl > becomes foo2.xml
> part3.xml serialized through 3.xsl > becomes foo3.xml
> etc.
> and then concatenates foo1.xml + foo2.xml + foo3.xml and that result
> can be serialized too if necessary into one final output.  Is this
> possible?
> Thanks,
> David
> __________________________________
> Do you Yahoo!?
> Yahoo! Photos: High-quality 4x6 digital prints for 25ยข
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message