gpt4 book ai didi

xslt - 如何在 xsl :when 中检查 2 个测试条件

转载 作者:行者123 更新时间:2023-12-04 07:02:23 24 4
gpt4 key购买 nike

我想检查 test1 和 test 2 的值。如果 test1 评估为 Yes 则显示 Yes,如果 test2 评估为 Yes 则显示 Invalid 否则显示 test1 的确切值。

我尝试了以下

<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>

但它没有正确评估条件。请提出可能的解决方案。

最佳答案

我想你可能正在寻找这样的东西:

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

你必须重复 $test1 =对于您所做的每次比较,否则您的测试条件并不意味着您的意图。

关于xslt - 如何在 xsl :when 中检查 2 个测试条件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1654082/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com