This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: XSL support detection
- From: Antonio Fiol Bonnín <fiol at w3ping dot com>
- To: xsl-list at lists dot mulberrytech dot com
- Date: Sun, 18 Aug 2002 10:53:22 +0200
- Subject: Re: [xsl] XSL support detection
- References: <20020818041710.GB5676@maul.vpn>
- Reply-to: xsl-list at lists dot mulberrytech dot com
What about server-side browser detection based on the User-Agent string?
Mozilla/5.0 and higher should be considered XSLT-aware, and IE6.0 and
higher are also XSLT-capable. Others (to my knowledge) are not.
Of course, you will have to add other browsers (e.g. Opera), as soon as
they bring in XSLT support, but nothing will actualy break if you do
not. Your server will be a bit more loaded, but...
Good luck!
Antonio Fiol
Wesley W. Terpstra wrote:
Ok, another question I can't find a good answer too.
My application supports server-side xslt or client-side.
The browser can access .html or .xml.
However, I would like the front-page to somehow check for xslt and redirect
the browser to the right location.
First I thought: simple! Make an xhtml index file which references an xsl
stylesheet. Then have the stylesheet rewrite the meta http-equiv refresh.
If the browser doesn't support xsl, it will look at the xhtml and follow the
refresh that is there. If the browser does, it will apply the stylesheet and
have a new refresh location.
However, after much banging of my head against the wall, I finally realized
that it doesn't matter a damn what content-type the webserver says it is,
IE6 _will not_ apply xslt unless the file is called *.xml!
So, an alternative is to call the index .xml, but have the content-type be
xhtml. However, this would simply die on older browsers! This defeats the
whole point of the detection.
If anyone has an idea how to make this trick work, let me know!
Round 2: javascript!
I am not a javascript wizard, but I know that there is at least a microsoft
extension that deals with XSL. Is there a (non microsoft-only) way to detect
the capability to render with xsl? I don't really want to play the game of
browser detection since there are so many out there.
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list