cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Martijn C. Vos" <>
Subject RE: LinkRewriterTransformer question
Date Thu, 02 Mar 2006 14:58:11 GMT

Bruno Dumon [] wrote:
>  I would like to use the LinkRewriterTransformer to transform 
>  links like
>  this:
>  myscheme:somevalue
>  to something like
>  http://someserver/some/path/somevalue
>  Thus, the 'somevalue' should simply be prefixed with a static string.
>  This seems like a pretty basic use case but I couldn't figure out how
>  one of the standard input modules of Cocoon could do this. 
>  Does anyone
>  know if this is possible?

Sounds like a pretty standard use for the linkrewriter. The way I use it
is this:

The input module (cocoon.xconf):

  <component-instance name="linkmap"

    <file src="site://linkmap.xml"/>

Linkrewriter (sitemap.xmap):

  <map:transformer logger="sitemap.transformer.linkrewriter" name="linkrewriter"
        pool-grow="2" pool-max="32" pool-min="2"
    <link-attrs>href action value src</link-attrs>

And a linkmap that contains stuff like:

  <match pattern="/content/foo/**.xml">
    <location src="/bar/{1}.html"/>

Or something like that. I may be forgetting something, and I give no guarantees
that this is correct, but this is what my code looks like, and it seems to work.

In the end, links like 
should be rewritten as


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

View raw message