You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Philipp Burkert <ph...@burkert.de> on 2004/05/15 21:16:22 UTC

RE: [SOLVED] String replacement within the sitemap?

Hej,

thankx to Joerg and Jorg for the good hints. Joergs idea finaly helped me to
figure out the solution for my problem. When you want to replace something
within your request URI you can use:

<map:parameter name="haxelbaxel" value="{request:translate(requestURI,'_','
')}"/>

Best regards

PHILIPP BURKERT
philipp@burkert.de


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


Re: [SOLVED] String replacement within the sitemap?

Posted by "Volkm@r" <pl...@arcor.de>.
Joerg Heinicke wrote:
> The solution you need looks probably like
> 
> <map:match pattern="*">
>   <map:generate src="{request:concat(substring-after(requestURI, '/'), 
> 'foobar')}"/>
>   <map:serialize type="xml"/>
> </map:match>

Thanks Joerg, for the hint.

> 
> But for the concatenation you don't need it:

That's true. I chose 'concat' to just have a stupid example.

-- 
Thanks again
volkm@r


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


Re: [SOLVED] String replacement within the sitemap?

Posted by "Volkm@r" <pl...@arcor.de>.
Philipp Burkert wrote:
> Hej,
> 
> 
>>But, how can I access the individual parts of 
>>a pattern="*/*/**" Is there something like
>>src="{?:concat(substring-after(1, '/') ?
> 
> 
> hm, that is exactly the case that is not directly possible. If you read my
> last posting in this thread you see that I used the substring-after and
> substring before to retrieve something like the pattern from the request
> URL. I am affraid you have to do the same and can not use it directy.

Couldn't get the exact point from earlier postings. Now it turns out 
very clear. Thanks for your attention.

-- 
volkm@r


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


RE: [SOLVED] String replacement within the sitemap?

Posted by Philipp Burkert <ph...@burkert.de>.
Hej,

> But, how can I access the individual parts of 
> a pattern="*/*/**" Is there something like
> src="{?:concat(substring-after(1, '/') ?

hm, that is exactly the case that is not directly possible. If you read my
last posting in this thread you see that I used the substring-after and
substring before to retrieve something like the pattern from the request
URL. I am affraid you have to do the same and can not use it directy.

Best Regards

PHILIPP BURKERT
mailings@burkert.de


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


Re: [SOLVED] String replacement within the sitemap?

Posted by "Volkm@r" <pl...@arcor.de>.
Joerg Heinicke wrote:
 > The solution you need looks probably like
 >
 > <map:match pattern="*">
 >   <map:generate src="{request:concat(substring-after(requestURI, '/'),
 > 'foobar')}"/>
 >   <map:serialize type="xml"/>
 > </map:match>

Works fine so far.
But, how can I access the individual parts of a pattern="*/*/**"
Is there something like
         src="{?:concat(substring-after(1, '/') ?
How could I find the right syntax?

-- 
volkm@r


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


Re: [SOLVED] String replacement within the sitemap?

Posted by Joerg Heinicke <jo...@gmx.de>.
On 20.05.2004 13:51, Volkm@r wrote:

> Hi!
> 
> Your solution sounds very interesting, but I can't get it working.
> How do you integrate that line in your sitemap?
> I tried putting it inside <match/> and expected the following snippet to 
> put 'foobar' behind the original request and generate from {1}foobar.
> 
> <map:match pattern="*">
>   <map:parameter name="anyname"
>        value="{request:concat(requestURI,'foobar')}"/>
>   <map:generate src="{1}"/>
>   <map:serialize type="xml"/>
> </map:match>
> 
> Could you please give an example how to use your solution?

You only put the value into a parameter of the matcher - and that does 
not expect it, so nothing happens.

The solution you need looks probably like

<map:match pattern="*">
   <map:generate src="{request:concat(substring-after(requestURI, '/'), 
'foobar')}"/>
   <map:serialize type="xml"/>
</map:match>

But for the concatenation you don't need it:

<map:generate src="{1}foobar"/>

Joerg

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


Re: [SOLVED] String replacement within the sitemap?

Posted by "Volkm@r" <pl...@arcor.de>.
Philipp Burkert wrote:
> [...] When you want to replace something
> within your request URI you can use:
> 
> <map:parameter name="haxelbaxel" value="{request:translate(requestURI,'_','
> ')}"/>

Hi!

Your solution sounds very interesting, but I can't get it working.
How do you integrate that line in your sitemap?
I tried putting it inside <match/> and expected the following snippet to 
put 'foobar' behind the original request and generate from {1}foobar.

<map:match pattern="*">
   <map:parameter name="anyname"
        value="{request:concat(requestURI,'foobar')}"/>
   <map:generate src="{1}"/>
   <map:serialize type="xml"/>
</map:match>

Could you please give an example how to use your solution?

-- 
Kind Regards
volkm@r


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