cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alan Tibbetts" <>
Subject RE: Applying diferente stylesheets to diferent wap browsers
Date Thu, 22 Mar 2001 14:42:31 GMT
:>here are 3 lines from
:>browser.8 = wap=Nokia
:>browser.9 = wap=UP
:>browser.10 = wap=Wapalizer
:>the last word in the line is the name which the browser identify.
:>the word before is that what you can type in the "media"-attribute.
:>So you can differentiate this with "wapNokia", "wapUP", and so on.

We have taken a slightly different approach.  In order to separate the
stylesheets for
the different mobile devices (mainly for configuration management reasons),
we have a directory called 'xsl' in our web context and under that we have
one directory for each device: Nokia7110, MotorolaP7389, etc.  These names
correspond to the user-agent in the Http Header

In our xml sheets (which are obviously XSPs) we dynamically assign
stylesheet references based on the user-agent:

	String stylesheet = (String) session.getAttribute("XSL");

<xsp:pi target="xml-stylesheet">

The attribute 'XSL' is created previously by a JSP Tag that combines the
required stylesheet with the location of that stylesheet, based on the
user-agent, e.g. where the xml page requires the stylesheet: menu.xsl for a
Nokia7110, the generated reference would be:


Alan Tibbetts
Zishi Ltd

Tel: +44 (0) 20 7262 5566 (ext 291)

Fax: +44 (0) 20 7262 6389
Mob: +44 (0) 7989 434 790

Please check that your question has not already been answered in the
FAQ before posting. <>

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

View raw message