You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Davide <da...@aliceposta.it> on 2003/12/31 09:24:23 UTC

How to get the request parameters in a transformer?

Hi!

I'm creating a transformer to modify link elements in an xhtml page (i.e. 
a, img, link....);
I need to transform links from relative to absolute, so i need to know the 
url of the last request to add it to the link...

this is the sitemap:

<map:match pattern="aggregate">
	<map:act type="auth-protect">
		<map:parameter name="handler" value="navigation"/>
		<map:parameter name="use-request-parameters" value="true"/>
		<map:generate type="serverpages" src="xsp/mcnavigator.xsp"/>
		<map:transform type="cinclude"/>
		<!-- adjust the tags position to create an xhtml page -->
		<map:transform type="xslt" src="style/mcnavigator.xsl"/>
		<!-- My Transformer!!! -->
		<map:transform type="AbsoluteLinkTransformer"/>
		<map:serialize type="xml"/>
		</map:act>			
	</map:match>
</map:match>

When i call the aggregate pipeline i pass it a parameter link in wich i put 
the url of the page i want to retreive (e.i. aggregate?link=www.w3.org), 
so... how to get my link parameter in the transformer?

thanks a lot, best regards.



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


Re: How to get the request parameters in a transformer?

Posted by Davide <da...@aliceposta.it>.
i don't think i need that transformer...i read the page but i seem it only 
encodes urls, it doesn't change them...

Best Regards,

Davide

At 09:32 AM 31-12-03, you wrote:
>Davide dijo:
> > Hi!
> >
> > I'm creating a transformer to modify link elements in an xhtml page (i.e.
> > a, img, link....);
> > I need to transform links from relative to absolute, so i need to know the
> > url of the last request to add it to the link...
>
>Can the encodeURL transformer do the work? See:
>
>http://cocoon.apache.org/2.1/userdocs/transformers/encodeurl-transformer.html
>
>Best Regards,
>
>Antonio Gallardo
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>For additional commands, e-mail: users-help@cocoon.apache.org



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


Re: How to get the request parameters in a transformer?

Posted by Antonio Gallardo <ag...@agsoftware.dnsalias.com>.
Davide dijo:
> Hi!
>
> I'm creating a transformer to modify link elements in an xhtml page (i.e.
> a, img, link....);
> I need to transform links from relative to absolute, so i need to know the
> url of the last request to add it to the link...

Can the encodeURL transformer do the work? See:

http://cocoon.apache.org/2.1/userdocs/transformers/encodeurl-transformer.html

Best Regards,

Antonio Gallardo


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