[prev in list] [next in list] [prev in thread] [next in thread] 

List:       xml-cocoon-users
Subject:    Re: Request parameters to specify an input file
From:       Luca Morandini <lmorandini () ieee ! org>
Date:       2009-02-28 20:09:33
Message-ID: goc5lu$f7o$1 () ger ! gmane ! org
[Download RAW message or body]

Wendell Piez wrote:
> 
> <map:aggregate element="goforit">
>   <map:part src="{1}/{request-param:sequence}"/>
>   <map:part src="{1}/{2}"/>
> </map:aggregate>
> 
> Except this gives me an error when the parameter is missing, where I 
> need fallback behavior (for example, just adding nothing would do).

A selector base on request parameter values should do.

Something like this (off the top of my head, so it may contain errors)...

<map:select type="request-parameter">
   <map:parameter name="parameter-name" value="sequence"/>
   <map:when test="">
     <map:aggregate element="goforit">
       <map:part src="{1}/default-sequence.xml"/>
       <map:part src="{1}/{2}"/>
     </map:aggregate>
   </map:when>
   <map:otherwise>
     <map:aggregate element="goforit">
       <map:part src="{1}/{request-param:sequence}"/>
       <map:part src="{1}/{2}"/>
     </map:aggregate>
   </map:otherwise>
</map:select>

--------------------
    Luca Morandini
www.lucamorandini.it
--------------------


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

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic