Testing XSLT Version Level (V1 or V2)

Discussion in 'XML' started by David Blickstein, Sep 13, 2005.

  1. Is there a way to test what Version of XSLT the transformer in use supports?

    I have a key lookup that I think would run way faster using the V2 forms of
    the key() function, but I want my stylesheet to run correctly under V1.

    <xsl:choose>
    <xsl:when test="This is v2">
    .... use v2 features
    </xsl:when>
    <xsl:eek:therwise>
    .... use v1 features
    </xsl:eek:therwise>
    </xsl:choose>
     
    David Blickstein, Sep 13, 2005
    #1
    1. Advertising

  2. David Blickstein wrote:

    > Is there a way to test what Version of XSLT the transformer in use supports?


    Yes, see
    <http://www.w3.org/TR/xslt#function-system-property>
    you want
    system-property('xsl:version')

    --

    Martin Honnen
    http://JavaScript.FAQTs.com/
     
    Martin Honnen, Sep 13, 2005
    #2
    1. Advertising

  3. Thanks.

    I just realized that I'm subject to another limitation that isn't solved
    until V2.

    I want to compute a result set and assign it to a variable in different ways
    based on whether its XSLT V1 or XSLT V2.

    I don't think there's a way to do that in V1.

    That is (in quasi-XSLT):

    <xsl:variable name='nodes' select='system-property(xxx) ? key(x,y) :
    key(x,y,z)'/>

    No way to do this right?

    But that raises another question for me: assuming key(x,y) and key(x,y,z)
    return the
    same result set (that is, y is unique in key x throughout the entire
    document), is one of these any more efficient than the other?
     
    David Blickstein, Sep 13, 2005
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    2
    Views:
    445
  2. pabbu
    Replies:
    8
    Views:
    732
    Marc Boyer
    Nov 7, 2005
  3. V Green
    Replies:
    0
    Views:
    862
    V Green
    Feb 5, 2008
  4. PA Bear [MS MVP]
    Replies:
    0
    Views:
    972
    PA Bear [MS MVP]
    Feb 5, 2008
  5. MowGreen [MVP]
    Replies:
    5
    Views:
    2,023
    PA Bear [MS MVP]
    Feb 9, 2008
Loading...

Share This Page