cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robin Green" <gree...@hotmail.com>
Subject Re: XML conversion to WML, HTML using Cocoon
Date Mon, 23 Oct 2000 21:36:37 GMT
"Virdi,T.J." <TVIRDI@cerner.com> wrote:
>Is there a way to convert an XML string in a servlet to serve WML? I have a
>servlet where I apply xsl stylesheet on a xml string (genererated using
>xerces parser) using Xalan to produce html page. I would like to use the
>same xml string in a servlet to serve WML file for PDA if the request
>originated from wireless devices. Cocoon is available on this apache web
>server but I am not sure how would I serve WML page for wireless devices. I
>looked at the WAP example that comes with Cocoon but not sure how I could
>apply stylesheet for WML on xml string generated in a servlet using cocoon
>functionality. Any help or idea is highly appreciated.

What Cocoon actually does for you in this case is very very simple. You 
could do it yourself without bothering to learn Cocoon. Just check the 
request.getHeader ("user-agent") to see if it is coming from a WML device, 
and if so, use a WML stylesheet instead of a HTML stylesheet.

But if you want to join the wave of the future and learn Cocoon - sure, no 
problem - you'll reap dividends later on! This FAQ explains how to call a 
servlet to get XML in Cocoon - but remember it may be more efficient to 
rewrite your servlet as an XSP page:

http://xml.apache.org/cocoon/faqs.html#faq-servletchaining



_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

Share information about yourself, create your own public profile at 
http://profiles.msn.com.


Mime
View raw message