Mark wrote: > Ive got an idea of how to create each one independantly but not sure > how to take the output of 1. and feed it into 2. on the fly.
You can create matchers, in a pipeline, that contain multiple transformers:
<!-- Build aggregatation template from directory structure. -->
<map:match pattern="**/*aggregateCountry.xml">
<map:generate type="xpathdirectory" src="{1}">
<map:parameter name="xpath" value="/riu/@class|/biogs/biogname"/>
<map:parameter name="dateFormat" value="EEE, d MMM yyyy kk:mm:ss z"/>
<map:parameter name="exclude" value="(\.DS_Store|\._.*\..*|CVS)"/>
<map:parameter name="depth" value="3"/>
<map:parameter name="root" value="Content"/>
</map:generate>
<map:transform src="Content/Transforms/aggregationCatalogue.xsl"/>
<map:transform src="Content/Transforms/sortCatalogue.xsl"/>
<map:transform src="Content/Transforms/catalogue2Aggregate.xsl"/>
<map:transform src="Content/Transforms/sortAggregate.xsl"/>
<map:transform type="xinclude"/>
<map:serialize type="xml"/>
</map:match>
This example uses the xpath directory generator to produce a listing of
documents in a set of directories and then applies four consecutive transforms
that convert the original xml directory listing into another xml gramma, then
sorts the list, creates a list of xml include commands for each required
document, they are then sorted again (madness I know) before finally applying
Xinclude processing to aggregate all the documents together into one large xml
document.
You can 'daisy chain' matchers as follows:
<!-- Aggregate and transform country directory as PDF. -->
<map:match pattern="**Aggregate/**.pdf">
<map:generate type="request" src="cocoon:/{1}{2}aggregateCountry.xml"/>
<map:transform src="Interface/Transforms/request2SOAPEnvelope.xsl"/>
<map:transform src="Interface/Transforms/XSL-FO/aggregatePrint.xsl"/>
<map:serialize type="fo2pdf"/>
</map:match>
This example actually makes a cocoon: request (one that is handled within the
cocoon context), and takes the serialized result of the first matcher, wraps it
in an XML wrapper to obtain some other information and finally transforming the
aggregated XML into XSL-FO before serializing it to PDF.
Hope you get some joy out of this.
Regards
Phil Fenenll
________________________________
From: Mark Donnelly [mailto:[EMAIL PROTECTED]
Sent: Thu 06/01/2005 14:02
To: '[email protected]'
Subject: RE: Chaining
Sorry but my question was incorrectly stated.
A standard pipeline with a transform and a serialise will take care of the
problem I originally posted.
What Im wondering is if I need to do multiple transformations, ie transform
an XML doc using two or more different XSLT docs. and then
feed the results into various serialisers, how this is done?
Mark
-----Original Message-----
From: Mark Donnelly [mailto:[EMAIL PROTECTED]
Sent: 06 January 2005 12:54
To: '[email protected]'
Subject: Chaining
Hello,
Im looking to chain a number of 'actions' together:
1. Transform an XML document using XSLT to get XSL:FO
2. Put this XSL:FO into FOP to get pdf.
Im new to Cocoon and whilst Ive read a fair bit of the documentation, I
havent been able to fathom what a pipeline for this would look like.
Ive got an idea of how to create each one independantly but not sure how to
take the output of 1. and feed it into 2. on the fly.
Any pointers would be appreciated.
Mark
---------------------------------------------------------------------
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]
<<winmail.dat>>
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
