cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Lundquist ...@wrinkledog.com>
Subject Re: Recursive resources...
Date Fri, 13 Feb 2004 21:42:59 GMT

On Feb 13, 2004, at 11:33 AM, Gabriel Egolf wrote:

> Hi all,
>
> I have what I hope is a simple question.  Is it possible to create a 
> resource that calls itself?  Here's an example of what I'm thinking.
>
> <map:resource name="foo">
>  <map:act type="resource-exists">
>    <map:parameter name="src" value="{../path}/foo.xml"/>
>    <map:generate src="{../path}/foo.xml"/>
>    <map:serialize type="xml"/>
>  </map:act>
>  <map:call resource="foo">
>    <map:parameter name="path" value="{path}/../"/>
>  </map:call>
> </map:resource>
> ..
> <map:match pattern="**/foo.xml">
>  <map:call resource="navigation">
>    <map:parameter name="path" value="{1}"/>
>  </map:call>
> </map:match>
>
> What I'm hoping to accomplish is to look for a file "foo.xml" in a 
> given directory passed as the parameter "path".  If the file exists, 
> generate it.  If the file doesn't exist, look in the parent directory 
> for it.
>
> So far, I haven't had any luck with this.  Instead of calling the 
> resource again, I'm getting a 404 - Resource Not Found page.  Yes, the 
> file does exist in the parent directory.  :)

For starters — your resource is named "foo", but you're calling a 
resource named "navigation"...?  And this doesn't look right:

>    <map:parameter name="src" value="{../path}/foo.xml"/>

Where in that pipeline is anything that would use a parameter named 
"src"?

~ml


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


Mime
View raw message