开发者

how to check with 2 conditions for test in xsl:when

开发者 https://www.devze.com 2022-12-10 02:30 出处:网络
I would like to check the values of test1 and test 2. If test1 evaluates to Yes then display Yes, if test2 e开发者_如何学JAVAvaluates toYes then display Invalid else display the exact value of test1.

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消