Or you can use the Include Transformer. Create a skeleton XML file that
references the XML fragments/transformation results you want to piece
together. E.g. myXML.xml:

<doc>
<include:include src="cocoon://block1"/>
<include:include src="cocoon://block2"/>
</doc>

Pulls in the XML generated from the following block fragments:

<map:match pattern="block1">
<map:generate src="block1.xml" />
<map:transform src="block1.xsl" />
<map:serialize type="xml" />
</map:match>

<map:match pattern="block2">
<map:generate src="block2.xml" />
<map:transform src="block2.xsl" />
<map:serialize type="xml" />
</map:match>

And your main pipeline/match that outputs the assembled XML:

<map:match pattern="*">
<map:generate src="myXML.xml"/>
<map:serialize type="xml"/>
</map:match>


-----Original Message-----
From: Alessandro Vincelli [mailto:[EMAIL PROTECTED] 
Sent: 14 July 2008 07:46
To: users@cocoon.apache.org
Subject: Re: Re: block communication and page fragment

Very simple code, may be it can help you.

<map:match pattern="aggregate">
      <map:aggregate element="root">
        <map:part src="cocoon:/block1 />
        <map:part src="cocoon:/block2" />
      </map:aggregate>
      <map:serialize type="xhtml" />
</map:match>

<map:match pattern="block1">
        <map:generate src="block1.xml" />
        <map:transform src="block1.xsl" />
        <map:serialize type="xml" />
</map:match>

<map:match pattern="block2">
        <map:generate src="block2.xml" />
        <map:transform src="block2.xsl" />
        <map:serialize type="xml" />
</map:match>
> Thank you for your reply. I need to aggregate fragments after the 
> transformation. The examples are very useful but they show how to 
> aggregate the xml docs into one then transforming them. For example, 
> if I have two separate blocks, each of them generates html page, I 
> need to put them in one single page after the html is generated. Is 
> this possible?
>
>
> Alessandro Vincelli wrote:
>> You can use <map:aggregate>[1] there are some example on 
>> cocoon.zones.apache.org[2] Bye Alessandro
>>
>> [1] http://cocoon.apache.org/2.1/userdocs/concepts/sitemap.html
>> [2] 
>> http://cocoon.zones.apache.org/demos/trunk/samples/core/aggregation/
>>> Hello:
>>> I am wondering if there's a tutorial or example that shows how to 
>>> aggregate multiple fragments into one page. I have few blocks, each 
>>> of them generates part of the web page. I need to put the results 
>>> into one single page. is this possible ? How? is there any tutorials

>>> or examples ?
>>>
>>>
>>>
>>> --------------------------------------------------------------------
>>> - To unsubscribe, e-mail: [EMAIL PROTECTED]
>>> For additional commands, e-mail: [EMAIL PROTECTED]
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


http://www.bbc.co.uk/
This e-mail (and any attachments) is confidential and may contain personal 
views which are not the views of the BBC unless specifically stated.
If you have received it in error, please delete it from your system.
Do not use, copy or disclose the information in any way nor act in reliance on 
it and notify the sender immediately.
Please note that the BBC monitors e-mails sent or received.
Further communication will signify your consent to this.
                                        

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to