Hi Sébastien

Sébastien Geindre wrote:
Thanks for your answer.
But is it possible to have 2 generator s in one pipeline ?

<map:generate type="stream">
  <map:parameter name="form-name" value="requestData"/>
</map:generate>
<map:transform src="request2meta.xsl"/>
<map:generate type="directory" src="{meta/validityTime}">
  <map:parameter name="depth" value="2"/>
</map:generate>

I try to be more precise...
First the request hold XML data (requestData POST) contains a date and a delay. the request2meta.xsl compute date+delay=validityTime, it is ok.(meta/validityTime)

and then i need to parse the directory named 'dateOf(validityTime)'
in order to get the earliest file in this repository.

If you want only one file, you can use the (C)IncludeTransformer if you want (based on the result of the generator)

See http://cocoon.apache.org/2.1/userdocs/cinclude-transformer.html for more information.

Otherwise you can do it like this:

<map:match pattern="one">
 <map:generate type="stream">
   <map:parameter name="form-name" value="requestData"/>
 </map:generate>
 <map:transform src="transform2include.xsl"/>
 <map:transform type="include"/>
 <map:serialize type="xml"/>
</map:match>

Where you have the transform2include.xsl looks like:

<xsl:template match="/">
  <include:include src="cocoon:/two/{meta/validityTime}"/>
</xsl:template>

and your pipeline 'two' looks like:

<map:match pattern="two/**">
 <map:generate type="directory" src="{1}">
   <map:parameter name="depth" value="2"/>
 </map:generate>
 <map:serialize type="xml"/>
</map:match>

Kind regards,

Jeroen Reijn




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

Reply via email to