You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by "Arun.N" <ar...@eximsoft.com> on 2001/11/17 13:06:15 UTC

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

Re: newbie Question abt number of xsls

Posted by Adam A R <aa...@sybase.co.jp>.
Hi Arun,

I havent found any standard XSL to convert to HTML/HDML/WML/CHTML! :-(
Just in case if you find them.... please forward them to me.  Thanks in
advance.

I personally think that a single XSL for sinlge ML should suffice. Though I
am not a very good XSL author, I managed to write XSLs to write forms in
HTML/HDML from single XML file. But, I dont have XSLs which cover the
complete list of tags in HTML/HDML/CHTML

I am attaching a sample xml, to-html.xsl and to-hdml.xsl file with this
email. The to-hdml.xsl is a live example of  bad xsl authoring. Because it
uses the <![CDATA[.................]]> tag. But couldnt help it since I dont
have a HDMLFormatter and HTMLFormatter puts the DOCTYPE declaration at the
top!!  eeeks!!!

Hope the files help you. If you find anything incorrect/wrong(or just dont
like the template) please feel free to change the XSL. But, also give the
changes to me so that I will incorporate them  ;-)

Note:- The XSL can only convert only process the following elements from
HTML.
1. form,
2. input type(only one submit per form. and cannot use cancel/clear input
types)
3. select... / option
4. checkbox
5. anchor

I know, one requires much more ... but one can only write to the Lowest
Common Denominator(LCD) to the various formats, in which the data must be
presented. Find workarounds if possible Or dont support them!!

Cheers,

Adam



----- Original Message -----
From: "Arun.N" <ar...@eximsoft.com>
To: <co...@xml.apache.org>
Sent: Monday, November 19, 2001 6:25 PM
Subject: Re: newbie Question abt number of xsls


> Hi,
>             Thankx Adam !!! for your reply.
>       I checked what you said .. sounds good.
> but all the examples i found with the cocoon 1.8.2 .... was using a
separate
> stylesheet.
>
> in the code snippet you have shown here, is the to-chtml.xsl and
to-html.xsl
> enough for all the pages. if i am going to support two MLs HTML and CHTML
> .... is a single generic xsl for each ML sufficient??
>
> If so . building  that generic xsl depends on the XML tags i define in my
> application......  or is there any stylesheets which are freely available
so
> that i will follow the protocol defined for the XML tags decided by the
> provider of the xsl.
> I feel if there are any predefined xsl i would prefer and follow the tags
> defined by that ... because as i am not too good in writing xsls,
following
> the protocol will save lot of my development time.
>
> if there are any links for stylesheets to convert from XML to any ML in a
> generic way, please can you give me some links. It will be very helpful
for
> me
>
> Thankz in advance,
> regards,
> Arun.N
>
>
> ----- Original Message -----
> From: "Adam A R" <aa...@sybase.co.jp>
> To: <co...@xml.apache.org>
> Sent: Monday, November 19, 2001 11:48 AM
> Subject: Re: newbie Question abt number of xsls
>
>
> > 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: cocoon-users@xml.apache.org
> > 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
o
> f
> > 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: <co...@xml.apache.org>
> > For additional commands, e-mail: <co...@xml.apache.org>
>
>
> ---------------------------------------------------------------------
> 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: <co...@xml.apache.org>
> For additional commands, e-mail: <co...@xml.apache.org>
>
>

Re: newbie Question abt number of xsls

Posted by "Arun.N" <ar...@eximsoft.com>.
Hi,
            Thankx Adam !!! for your reply.
      I checked what you said .. sounds good.
but all the examples i found with the cocoon 1.8.2 .... was using a separate
stylesheet.

in the code snippet you have shown here, is the to-chtml.xsl and to-html.xsl
enough for all the pages. if i am going to support two MLs HTML and CHTML
.... is a single generic xsl for each ML sufficient??

If so . building  that generic xsl depends on the XML tags i define in my
application......  or is there any stylesheets which are freely available so
that i will follow the protocol defined for the XML tags decided by the
provider of the xsl.
I feel if there are any predefined xsl i would prefer and follow the tags
defined by that ... because as i am not too good in writing xsls, following
the protocol will save lot of my development time.

if there are any links for stylesheets to convert from XML to any ML in a
generic way, please can you give me some links. It will be very helpful for
me

Thankz in advance,
regards,
Arun.N


----- Original Message -----
From: "Adam A R" <aa...@sybase.co.jp>
To: <co...@xml.apache.org>
Sent: Monday, November 19, 2001 11:48 AM
Subject: Re: newbie Question abt number of xsls


> 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: cocoon-users@xml.apache.org
> 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 o
f
> 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: <co...@xml.apache.org>
> For additional commands, e-mail: <co...@xml.apache.org>


---------------------------------------------------------------------
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: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


Re: newbie Question abt number of xsls

Posted by Adam A R <aa...@sybase.co.jp>.
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: cocoon-users@xml.apache.org
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: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>