You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by James 7 <js...@scilearn.com> on 2008/04/24 00:49:16 UTC

How do I use multiple custom generators for a single page?

Hi,
I have two working pages that there is now a requirement to merge into a
single page.  The information in each is obtained through custom generators
that use java code and xmlbeans to create the xml output.  My problem is
that I don't want to create a new xsd that combines them as they are
unrelated pieces of information and I do not know how to merge the two xml
documents otherwise.
The xml is not written to file so I cannot simply include them as parts of
an aggregate, at least as far as I know.
Is there a good way for me to call each generator and merge the two xml
files returned?  I am open to suggestions of other ways to accomplish this.

Thanks,
James
-- 
View this message in context: http://www.nabble.com/How-do-I-use-multiple-custom-generators-for-a-single-page--tp16834860p16834860.html
Sent from the Cocoon - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: How do I use multiple custom generators for a single page?

Posted by Joerg Heinicke <jo...@gmx.de>.
On 23.04.2008 18:49, James 7 wrote:

> The xml is not written to file so I cannot simply include them as parts of
> an aggregate, at least as far as I know.

You can, using the cocoon:/ pseudo protocol in map:aggregate causing a 
sub request in the same sitemap:

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

<map:match pattern="book-*">
  <map:generate src="generator1"/>
  <map:serialize type="xml"/>
</map:match>

<map:match pattern="body-*">
  <map:generate src="generator2"/>
  <map:serialize type="xml"/>
</map:match>

This is documented at [1], section "Aggregating".

Joerg

[1] http://cocoon.apache.org/2.1/userdocs/concepts/sitemap.html

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org