cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Geert Josten <>
Subject Re: Accessing "user agent" within XSLT
Date Fri, 23 Dec 2005 07:41:25 GMT
You will have to pass the user agent information on from the sitemap to your xslt stylesheet,

something like:

<map:transform src="path_to_xsl">
   <map:parameter name="user-agent" value="..." />

and in your xsl:

<xsl:param name="user-agent" select="'msie'" /> <!-- note: 'msie' is the default

How to access the user agent info? I am pretty sure you can get to it using the request input

module. But perhaps someone can confirm?


Joseph Hill wrote:
> Hi,
> Is it possible to access either request headers or the "browser" 
> selector from within an XSLT template?  I want to all pages sent to MSIE 
> to differ slightly from all pages sent to Mozilla/Netscape, and because 
> I'm using a lot of pipelines, using a when/otherwise structure in every 
> pipeline in my sitemap (which is the only way I know how to do it) would 
> be extremely unwieldy.  For example, I would like to do this:
> <xsl:when "$useragent = 'explorer'">
>    Crazy Explorer workaround
> </xsl:when>
> <xsl:otherwise>
>    Code according to W3C standard
> </xsl:otherwise>
> Thanks,
> Joe Hill
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

Drs. G.P.H. Josten

Daidalos BV
Source of Innovation
Hoekeindsehof 1-4
2665  JZ  Bleiswijk
Tel: +31 (0) 10 850 1200
Fax: +31 (0) 10 850 1199

De informatie - verzonden in of met dit emailbericht - is afkomstig van Daidalos BV en is

uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onbedoeld hebt ontvangen,
wij u het te verwijderen. Aan dit bericht kunnen geen rechten worden ontleend.

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

View raw message