This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: XSL support detection


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@lists.mulberrytech.com
> [mailto:owner-xsl-list@lists.mulberrytech.com]On Behalf Of Wesley W.
> Terpstra
> Sent: 18 August 2002 13:38
> To: xsl-list@lists.mulberrytech.com
> Subject: Re: [xsl] 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@terpstra.ca>
>
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]