cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ovidiu Predescu <>
Subject Re: AW: Support for URL rewriting
Date Wed, 22 Nov 2000 21:50:10 GMT
On Wed, 22 Nov 2000 14:49:38 +0100, "Matthew Langham" <> 

> >>
> I am already using encodeURL methode which does
> exactly what you need ... rewrite URL with session
> info in case the browser (eg. your WAP handy) does not
> support the cookies.
> <<
> Yes - we know encodeURL does the job - our question is whether we can get
> Cocoon to do this - instead of doing it ourselves - which I guess is what
> you are doing. Ideal would be some parameter which can be set to choose
> either cookies or encodeURL.
> The solution would need to be inside the serializer component(s).

Where is this serializer component? Are you talking about C1 or C2?

The solution I proposed is to have the code that invokes encodeURL in your
stylesheet. Something like this:

<xsl:stylesheet xmlns:xsl="..."

 <xsl:param name="response"/>

 <xsl:template match="link">
  <a href="utils:encodeURL($response, {@href})"><xsl:value-of select="."></a>


You could then use in your XML/XSP pages the <link> element to specify URLs and
have them encoded automatically.

utils:encodeURL() is an extension function, a method of the Utils class, that
invokes the encodeURL() method on the response object. We need the response
object to be passed as argument to the XSLT stylesheet, otherwise there's no
way to invoke the encodeURL method. This requires a little modification in the to pass the response object as argument to the stylesheets,
but its easy to do.

Ovidiu Predescu <> (inside HP's firewall only)

View raw message