You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Josep Riudavets Aguilo <jr...@uoc.edu> on 2003/11/11 18:07:35 UTC

Different treatment

Hi all ... 

I have next pipeline into sitemap:

<map:match pattern="*.html">
		<map:generate type="file" src="XML/{1}.xml"/>
		<map:transform src="XSL/{1}.xsl"/>
		<map:serialize type="html"/>
</map:match>

But what I need is to make an special treatment to "upload.html"
request... that is: if the request is "upload.html", I want to
execute an action, but if the request is another, "xxxxx.html", the
result is the same as the pipeline above.

I have taken a look at wiki, but nothing clear.

Are there any conditional structure in order to implement a
different treatment?

Thanks


Re: Different treatment

Posted by Bruno Dumon <br...@outerthought.org>.
On Tue, 2003-11-11 at 18:07, Josep Riudavets Aguilo wrote:
> Hi all ... 
> 
> I have next pipeline into sitemap:
> 
> <map:match pattern="*.html">
> 		<map:generate type="file" src="XML/{1}.xml"/>
> 		<map:transform src="XSL/{1}.xsl"/>
> 		<map:serialize type="html"/>
> </map:match>
> 
> But what I need is to make an special treatment to "upload.html"
> request... that is: if the request is "upload.html", I want to
> execute an action, but if the request is another, "xxxxx.html", the
> result is the same as the pipeline above.

Just put the matcher for the upload.html before the *.html:

<map:match pattern="upload.html">
   ... do stuff ...
</map:match>
<map:match pattern="*.html">
                <map:generate type="file" src="XML/{1}.xml"/>
                <map:transform src="XSL/{1}.xsl"/>
                <map:serialize type="html"/>
</map:match>

The first encountered matcher counts. Inside the upload.html matcher you
will also have to put a pipeline ending on a serializer (or do a
map:redirect-to or a map:read), otherwise the processing will continue
with the next matcher (*.html).

-- 
Bruno Dumon                             http://outerthought.org/
Outerthought - Open Source, Java & XML Competence Support Center
bruno@outerthought.org                          bruno@apache.org


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