[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: XSL support detection

Subject: RE: XSL support detection
From: "James Fuller" <james.fuller@xxxxxxxxxx>
Date: Sun, 18 Aug 2002 14:06:05 +0100
document.location.href
ah...

i see, u could use the following using system-property, which should get u
the XSLT processor also ( using

<xsl:stylesheet version="1.1"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:template match="/">
    <xsl:choose>
      <xsl:when test="system-property('xsl:version') >= 1.1">
        <xsl:exciting-new-1.1-feature/>
      </xsl:when>
      <xsl:otherwise>
        <html>
        <head>
          <title>XSLT 1.1 required</title>
        </head>
        <body>
          <p>Sorry, this stylesheet requires XSLT 1.1.</p>
        </body>
        </html>
      </xsl:otherwise>
    </xsl:choose>
  </xsl:template>
</xsl:stylesheet>

check out here

http://www.vbxml.com/xsl/funcsystem-property.asp

otherwise, we live in a world where there are only 2 browsers handling this,
u may find having an overarching solution of client detection, then just
XSLT processor detection will be more desirable instead of having 2 seperate
systems.


btw if u are worried about keeping the logic in xml/xlst u could modify

> > <script language="JavaScript">
> > <![CDATA[
> > function redirect(){
> > if(is_mac==true ){document.location.href='main_ie.xml';}
> > else if(is_ie4up==true){document.location.href='main_ie.xml';}
> > else if(is_ie4==true){document.location.href='main_ie.xml';}
> > else if(is_aol5==true){document.location.href='main_ie.xml';}
> > else if(is_nav6up==true){document.location.href='main_nn.xml';}
> > else if(is_gecko==true){document.location.href='main_nn.xml';}
> > else if(is_nav4==true){document.location.href='main_nn.xml';}
> > }
> > ]]>
> > </script>

to always go to the same URL ( lets say main.xml ) yet inject a parameter,
then use xsl:param to make the decision...but then u would probably have to
have browser specific code to handle the transform

gl, jim fuller

btw any one else experience IE not respecting Content-Type so rudely ?



> -----Original Message-----
> From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx]On Behalf Of Wesley W.
> Terpstra
> Sent: 18 August 2002 13:38
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: Re:  XSL support detection
>
>
> On Sun, Aug 18, 2002 at 12:20:59PM +0100, James Fuller wrote:
> > > 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.
> >
> > you will need to find an external solution to this problem, in
> other words
> > use one of the many fine javascript browser sniffers that are out
> > there.....this is really not the forum for javascript
> questions...ah heck
> > its a sunday.
>
> Indeed; I know I could do this, but it is a last resort. I don't want to
> have to keep track of 20 browsers and the current state of their xslt
> support. I would much rather check directly.
>
> > > 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!
> >
> > hmmmm, this is because your server httpd.conf file ( e.g. in
> apache ) is set
> > to apply the correct mime type to files that have .xml
> ending....there is
> > nothing stopping you adjusting this...well you will need server access.
>
> No, this is not apache's fault; I changed the types with AddType, and
> checked the output headers directly by connecting. It really is
> IE6's fault;
> it does not respect the Content-Type the server reports.
>
> > <script language="JavaScript">
> > <![CDATA[
> > function redirect(){
> > if(is_mac==true ){document.location.href='main_ie.xml';}
> > else if(is_ie4up==true){document.location.href='main_ie.xml';}
> > else if(is_ie4==true){document.location.href='main_ie.xml';}
> > else if(is_aol5==true){document.location.href='main_ie.xml';}
> > else if(is_nav6up==true){document.location.href='main_nn.xml';}
> > else if(is_gecko==true){document.location.href='main_nn.xml';}
> > else if(is_nav4==true){document.location.href='main_nn.xml';}
> > }
> > ]]>
> > </script>
> >
> > [snip huge attached javascript routine]
>
> Thanks for the code; I will definitely use it if there is no
> other solution!
>
> However, this is exactly what I want to avoid. It is too complex and
> requires that I personally keep track of things.
>
> I would rather check for xslt by doing something that would use xslt if it
> were present---either by trying to use a stylesheet as above, or
> just asking
> javascript directly. Like a if (browser.xslt.version >= 1) or something.
>
> --
> Wesley W. Terpstra <wesley@xxxxxxxxxxx>
>
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.