how to check with 2 conditions for test in xsl:when
I would like to check the values of test1 and test 2. If test1 evaluates to Yes then display Yes, if test2 e开发者_如何学JAVAvaluates to Yes then display Invalid else display the exact value of test1.
I tried the below
<xsl:choose>
<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.
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.
精彩评论