This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: Dynamic stylesheet selection
- To: xsl-list at lists dot mulberrytech dot com
- Subject: RE: [xsl] Dynamic stylesheet selection
- From: Peter dot FLYNN at syntegra dot com
- Date: Wed, 4 Apr 2001 15:27:03 +0100
- Reply-To: xsl-list at lists dot mulberrytech dot com
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