tags:

views:

53

answers:

1

I would like to check the values of test1 and test 2. If test1 evaluates to Yes then display Yes, if test2 evaluates to Yes then display Invalid else display the exact value of test1.

I tried the below

xsl:when test="$test1 = 'Yes' or 'Yes'">
  <td>
                       Yes
  </td>

/xsl:when>

xsl:when test="$test2 = 'Yes' or 'yes'">
  <td>
                       INVALID
  </td>

/xsl:when>

xsl:otherwise> 
  <td>
   <font size="2">
    f<xsl:apply-templates select="../DBE:Object/DBE:Attribute[@name='test1']"/> 
   </font>
  </td>
/xsl:otherwise>
 /xsl:choose>

But it is not evaluating the condition correctly. Please suggest the possible solution.

+2  A: 

I think you may be looking for something like this:

<xsl:when test="$test1 = 'Yes' or $test1 = 'yes'">

You have to repeat the $test1 = for each comparison that you do, otherwise your test condition doesn't mean what you intend.

Greg Hewgill