Eduardo,
Actions work within a block structure. If the action itself returns NULL,
then the action fails and the tags within the action block are not
processed. You can use this to create a type of IF logic such that IF the
action fails (returns NULL) then the code within the block structure
execute. Here is your modified example (note that the <map:serialize/> is
moved to within the action block):
<map:match pattern="process-unveil">
<map:act type="unveil-it">
<!--unveil-it returned a value-->
<map:generate type="serverpages" src="do_unveil.xsp">
<map:parameter name="unveil_result" value="{Count}"/>
<map:parameter name="use-request-parameters" value="true"/>
</map:generate>
<map:transform src="stylesheets/llbean-html.xsl">
<map:parameter name="use-request-parameters" value="true"/>
</map:transform>
<map:serialize/>
</map:act>
<!--unveil-it returned NULL-->
<!-- generate some other stuff or redirect-->
</map:match>
HTH,
Aaron
-----Original Message-----
From: Eduardo Godoy Vega [mailto:[EMAIL PROTECTED]]
Sent: Monday, October 22, 2001 11:20 AM
To: Cocoon-Users
Subject: [C2] Howto ... IF in sitemap ...
Hi,
I want to use some kind of "IF-ELSE" into sitemap...
right now, I have this code ...
<map:match pattern="process-unveil">
<map:act type="unveil-it">
<map:generate type="serverpages" src="do_unveil.xsp">
<map:parameter name="unveil_result" value="{Count}"/>
<map:parameter name="use-request-parameters" value="true"/>
</map:generate>
<map:transform src="stylesheets/llbean-html.xsl">
<map:parameter name="use-request-parameters" value="true"/>
</map:transform>
</map:act>
<map:serialize/>
</map:match>
"unveil_result" is a number returned by my action, and I want to choose a
different XSP page if unveil_result is zero or if unveil_result equal one or
if unveil_result is bigger than one ...
I don't want to use java inside XSP pages ... so ... Is it possible to do in
sitemap ??
Thanks
Eduardo.
---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
To unsubscribe, e-mail: <[EMAIL PROTECTED]>
For additional commands, e-mail: <[EMAIL PROTECTED]>
---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
To unsubscribe, e-mail: <[EMAIL PROTECTED]>
For additional commands, e-mail: <[EMAIL PROTECTED]>