You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Shane McEneaney <sh...@hotmail.com> on 2003/06/03 16:46:16 UTC

Using Path expression in Map Action type

Hi,
     is there any way to use path expressions in the "map:act" tag in the
sitemap? We'd like the sitemap to choose the appropriate Action class
depending on the matched pattern. See the snippet below with the line
<map:act type="{../1}">.

<map:match pattern="get*">
        <map:act type="locale"/>
        <map:act type="session-validator">
          <map:parameter name="descriptor"
value="descriptors/crs-params.xml"/>
          <map:act type="{../1}">
           ..........

The code above fails and I have found no documentation to suggest if there
is a way of doing it.

Any help is greatly appreciated.

Shane McEneaney
Ireland

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


Re: Using Path expression in Map Action type

Posted by Andreas Hartmann <an...@apache.org>.
Hi Shane,

Shane McEneaney wrote:

> <map:match pattern="get*">
>         <map:act type="locale"/>
>         <map:act type="session-validator">
>           <map:parameter name="descriptor"
> value="descriptors/crs-params.xml"/>
>           <map:act type="{../1}">
>            ..........
> 
> The code above fails and I have found no documentation to suggest if there
> is a way of doing it.

this way it won't work. The sitemap is compiled to a Java
program (tomcat/work/.../sitemap_xmap.java). AFAIK the action
references are created at compile time.

But you could use the ParameterSelector to implement
such sitemap logic:
http://cocoon.apache.org/2.1/userdocs/selectors/parameter-selector.html

Of course, you will have to add a snippet for each possible
{../1} value. But I guess this won't be a problem as you have to
define your action types as well.

HTH,
Andreas



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