Loading ...
Sorry, an error occurred while loading the content.
 

Re: Selecting browser specific elements with XSLT

Expand Messages
  • Helder Magalhães
    Hi Manfred, ... If you are trying to do this within the XSLT environment, you can apparently do something like (found in an article by Holger Will [1]):
    Message 1 of 13 , Mar 2, 2009
      Hi Manfred,

      > I've written a small program to select mark-up elements
      > specifically for the browser in use.
      > It's done client-side by XSLT in a preprocessing stage

      If you are trying to do this within the XSLT environment, you can
      apparently do something like (found in an article by Holger Will [1]):

      <xsl:if test="system-property('xsl:vendor')='Microsoft'">
      (insert stuff for IE and such)
      </xsl:if>

      Hope this helps,
      Helder Magalhães

      [1] http://www.treebuilder.de/default.asp?file=749340.xml
    • Manfred Staudinger
      Hi Helder, Thanks for answering to my primary topic. ... Yes, in my demo [2] I use the system-property( xsl:vendor ). But if you have a look at the named
      Message 2 of 13 , Mar 5, 2009
        Hi Helder,

        Thanks for answering to my primary topic.

        >> I've written a small program to select mark-up elements
        >> specifically for the browser in use.
        >> It's done client-side by XSLT in a preprocessing stage
        >
        > If you are trying to do this within the XSLT environment, you can
        > apparently do something like (found in an article by Holger Will [1]):
        >
        > <xsl:if test="system-property('xsl:vendor')='Microsoft'">
        > (insert stuff for IE and such)
        > </xsl:if>
        >
        > [1] http://www.treebuilder.de/default.asp?file=749340.xml
        >
        Yes, in my demo [2] I use the system-property('xsl:vendor'). But if you
        have a look at the named template for differentiating by browser, version
        and release [3] you will see that in _addition_ I use:
        - function-available('exsl:node-set')
        - function-available('name')
        - element-available('xsl:fallback')
        - the UA-string
        which makes it much more powerfull.

        The only browser specific selection mentioned in the article by Holger Will
        is in the head element. This can be done easily by using
        <head dr:select="IE">
        <title>test</title>
        <object id="AdobeSVG" classid="clsid:78156a80-c6a1-4bbf-8e6a-
        3cd390eeb4e2"></object>
        <?import namespace="svg" implementation="#AdobeSVG"?>
        </head>
        <head dr:select="not IE">
        <title>test</title>
        </head>

        As I see browser detection on the server to be complicated ("sessions")
        or unreliable, I would assume that many fallback solutions for SVG are
        implemented with JavaScript (please correct me).

        Could client-side, PI-triggered element selection with XSLT provide
        a better alternative?

        Regards,
        Manfred Staudinger

        [2] http://documenta.rudolphina.org/cond-elem-demo.xml
        [3] http://documenta.rudolphina.org/b-get-tokens.xsl
      • Helder Magalhães
        Hi Manfred, ... If you are mixing SVG within XHTML, then I m also not familiar with better alternatives, at least for now. Ideas and/or pointers, anyone? By
        Message 3 of 13 , Mar 5, 2009
          Hi Manfred,

          > I would assume that many fallback solutions for SVG are
          > implemented with JavaScript (please correct me).

          If you are mixing SVG within XHTML, then I'm also not familiar with better alternatives, at least for now. Ideas and/or pointers, anyone? By the way, I've noticed a recent related thread [1] at the www-svg mailing list. ;-)


          While using SVG content in separate containers, than you can statically specify a fallback. For example (pseudo-markup, not a functional sample):

          ...(X)HTML markup...
          <object type="image/svg+xml" ...>
          alternate content such as an image and/or (textual) instructions on how to install a plug-in (or switch browser), link to page with more details, etc.
          </object>
          ...(X)HTML markup...

          This will degrade gracefully, at least in most (all?) know browsers. More information available in a previous post [1] (and in several ones scattered around the mailing list).

          Hope this helps,
          Helder Magalhães


          [1] http://tech.groups.yahoo.com/group/svg-developers/message/60763
        Your message has been successfully submitted and would be delivered to recipients shortly.