cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oscar Picasso <>
Subject Functional programming (kind of)
Date Sat, 17 Jul 2004 04:35:13 GMT

Is it possible to do some kind of functional programming with Cocoon.

May be it's not the right term, so let me try to explain.

I have the following pseudo sitemap:

<!-- example http://localhost/copy?src=mysource&dest=my-destination -->
<map:match pattern="copy">
  <map:action type="copy-action" src="{request-param:src}">
    <map:parameter name="dest" value="{request-param:dest}"/>
    <map:generate src="copy-was-a-success-or-failure"/>

<-- example http://http://localhost/pic.jpg?src=my-svg-source -->
<map:match pattern="*.jpg">
  <map:generate src="{request-param:src}"/>
  <map:serialize type="svg2jpeg"/>

<!-- Replace place-holders in a 'template' svg file with actual values -->
<!-- example
<map:match pattern="merge">
  <map:generate type="merge" src="{request-param:svg-src}"/>
    <map:parameter data-src="{request-param:data-src}"/>

1- I would like to do something like:

2- I would like also to do this in a cinclude transformation:


Obviously it's not possible this way.

I have tried different approaches mainly focused on playing with the urls.

For example to avoid parameter names collision (ex: src) I have tried something
like the following kind of syntax:

cocoon:/copy(my-pic2.jpg, cocoon:/merge(my-svg-template, second),

and enclosed the pipelines with an action that decodes the "url".

It almost works but it's not very clean and there is surely a better way.


Do you Yahoo!?
Vote for the stars of Yahoo!'s next ad campaign!

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message