cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sylvain Wallez <sylvain.wal...@anyware-tech.com>
Subject Re: [C2] Howto ... IF in sitemap ...
Date Mon, 22 Oct 2001 17:18:37 GMT


Eduardo Godoy Vega a écrit :
> 
> 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.
> 
You can use the "parameter" builtin selector, allowing the following
construct in your sitemap (Count should be a String) :

<map:match pattern="process-unveil">
 <map:act type="unveil-it">
  <map:select type="parameter">
   <map:parameter name="parameter-selector-test" value="{Count}"/>
   <map:when test="0">
     <map:generate src="count0.xml"/>
   </map:when>
   <map:when test="1">
     <map:generate src="count1.xml"/>
   </map:when>
   <map:otherwhise>
    <map:generate src="countMany.xml"/>
   </map:otherwhise>
  </map:select>
  <map:transform ....

Hope this helps.
-- 
Sylvain Wallez
Anyware Technologies - http://www.anyware-tech.com

---------------------------------------------------------------------
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: <cocoon-users-unsubscribe@xml.apache.org>
For additional commands, e-mail: <cocoon-users-help@xml.apache.org>


Mime
View raw message