Hi Arun,

Yes. It is possible to use one .xsl for each ML

If you are using Cocoon 1.8 then use the media="xxx" parameter in the
processing instruction to specify the useragent for the xsl.

eg.

<?cocoon-process type="xslt"?>
<?xml-stylesheet href="xsl/to-hdml.xsl" type="text/xsl" media="up"?>
<?xml-stylesheet href="xsl/to-chtml.xsl" type="text/xsl" media="imode"?>
...
...
...
<?xml-stylesheet href="xsl/to-html.xsl" type="text/xsl"?>  <!--  This is the
default. -->


But for this to work, you should configure User-Agents(Browsers) in the
cocoon.properties file.

part of my cocoon.properties looks like this.
##########################################################################
##########################################
# User Agents (Browsers)                 #
##########################################

# NOTE: numbers indicate the search order. This is very important since
# some words may be found in more than one browser description. (MSIE is
# presented as "Mozilla/4.0 (Compatible; MSIE 4.01; ...")
#
# for example, the "explorer=MSIE" tag indicates that the XSL stylesheet
# associated to the media type "explorer" should be mapped to those browsers
# that have the string "MSIE" in their "user-Agent" HTTP header.

browser.0 = up=UP.Browser/
browser.1 = explorer=MSIE
browser.2 = pocketexplorer=MSPIE
browser.3 = handweb=HandHTTP
browser.4 = avantgo=AvantGo
browser.5 = imode=DoCoMo
browser.6 = opera=Opera
browser.7 = lynx=Lynx
browser.8 = java=Java
browser.9 = wap=Nokia
browser.10 = wap=UP
browser.11 = wap=Wapalizer
browser.12 = mozilla5=Mozilla/5
browser.13 = mozilla5=Netscape6/
browser.14 = netscape=Mozilla
##########################################################################


I dont know much of C2. Though I have installed it... lately I am running
short of time.
Someone on the list might be able to explain it for C2.

But, as far as I know.... you will have to use Matchers for using each
stylesheet depending on the user-agent.
Can anybody shed light on how to do this in C2??


cheers
Adam


----- Original Message -----
From: Arun.N
To: [EMAIL PROTECTED]
Sent: Saturday, November 17, 2001 9:06 PM
Subject: newbie Question abt number of xsls


Hi,
        Is it possible to have only one xsl for each type ML ie one for WAP
one for and one for HTML generation and etc.
And all the xml page should use the same stylesheet. according to the
useragent it should pick one of the xsl in all the pages.
I have a senario where there are 200 pages in the application. As far as my
understanding for each page we should write an xsl and one for each type of
ML. Is there any generic approach ? because the application will have lots
of pages if there is one to one.
ie, as of now i have to support html wap and chtml ... that becomes 200 xmls
+ 600 xsl !!!

Please suggest me what to do ??
I also welcome someother sort of implementaion also.
Thankx in advance,
Arun.N


---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <[EMAIL PROTECTED]>
For additional commands, e-mail: <[EMAIL PROTECTED]>

Reply via email to