|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Dynamic stylesheet selection
If you were developing a servlet, you could check the User-Agent and
User-Accept values for the browser. The eMobile example (part 1 and 2) on
java.sun.com is a good example that takes you through Servlets, XML and XSL.
In your servlet code, basically just have:
String userAgent = request.getHeader("User-Agent");
String userAccept = request.getHeader("Accept");
The User-Agent contains the browser type (e.g. Mozilla/4.51)
The Accept value will contain many values about what document types the
browser can accept, for HTML based browsers one of the values will be
text/html.
WAP browsers generally have text/wml.
You can then check what documents your browser can accept, and modify the
java code accordingly to use the correct XSL stylesheet.
Regards,
Peter Flynn
***********************************************************************
Check us out at http://www.syntegra.com
***********************************************************************
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








