<xsl:when> on more than one selection

Discussion in 'XML' started by Kniffel, May 18, 2007.

  1. Kniffel

    Kniffel Guest

    Hi

    Is there a possibility to make an <xsl:when> on more than one
    Selection?

    Not that way:
    <xsl:choose>
    <xsl:when a=test>
    Do this
    <xsl:when a=test2>
    Do this
    <xsl:when a=test3>
    Do this
    <xsl:eek:therwise>
    Do something else

    More this way:
    <xsl:choose>
    <xsl:when a=test or a=test2 or a=test3>
    Do this
    <xsl:eek:therwise>
    Do something else


    Part of my xsl-file:
    <xsl:variable name="attr" select="name()" />
    <xsl:variable name="attrwert" select="." />
    <xsl:choose>
    ***************************************************************
    <xsl:when test="$attr='Aktiv'">
    Do this
    ***************************************************************
    </xsl:when>
    ....
    </xsl:choose>
    </xsl:choose>

    In regards
    Kniffel
     
    Kniffel, May 18, 2007
    #1
    1. Advertising

  2. Kniffel

    Pavel Lepin Guest

    Kniffel <> wrote in
    <>:
    > Is there a possibility to make an <xsl:when> on more than
    > one Selection?


    [...]

    > <xsl:choose>
    > <xsl:when a=test or a=test2 or a=test3>
    > Do this


    XPath does have logical operators. For details refer to
    your, well, XPath reference.

    http://www.catb.org/~esr/faqs/smart-questions.html

    --
    Pavel Lepin
     
    Pavel Lepin, May 18, 2007
    #2
    1. Advertising

  3. "Kniffel" <> wrote in message
    news:...
    > Hi
    >
    > Is there a possibility to make an <xsl:when> on more than one
    > Selection?


    Yes


    >
    > Not that way:
    > <xsl:choose>
    > <xsl:when a=test>
    > Do this
    > <xsl:when a=test2>
    > Do this
    > <xsl:when a=test3>
    > Do this
    > <xsl:eek:therwise>
    > Do something else
    >
    > More this way:
    > <xsl:choose>
    > <xsl:when a=test or a=test2 or a=test3>
    > Do this
    > <xsl:eek:therwise>
    > Do something else
    >
    >
    > Part of my xsl-file:
    > <xsl:variable name="attr" select="name()" />
    > <xsl:variable name="attrwert" select="." />
    > <xsl:choose>
    > ***************************************************************
    > <xsl:when test="$attr='Aktiv'">
    > Do this
    > ***************************************************************
    > </xsl:when>
    > ....
    > </xsl:choose>
    > </xsl:choose>
    >
    > In regards
    > Kniffel
    >
     
    Dimitre Novatchev, May 19, 2007
    #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. Michael Hamm
    Replies:
    0
    Views:
    436
    Michael Hamm
    Nov 15, 2006
  2. Merciadri Luca
    Replies:
    4
    Views:
    836
  3. Bob Rashkin
    Replies:
    5
    Views:
    85
    Dennis Lee Bieber
    Dec 23, 2013
  4. Steven D'Aprano
    Replies:
    0
    Views:
    117
    Steven D'Aprano
    Dec 23, 2013
  5. Replies:
    3
    Views:
    98
    Gary Herron
    Dec 23, 2013
Loading...

Share This Page