【发布时间】:2019-05-22 13:12:39
【问题描述】:
我已经声明了 2 个变量并用选择填充它们。之后我想用 ifs 检查它们,但我只发现了两个错误,而且我不知道它们来自哪里。
我尝试更改 if 语句,但没有任何效果。
<root>
<xsl:choose>
<xsl:when test="Request/Query/Parameter = 'DateiPfad'">
<xsl:variable name="Con1">
2001
</xsl:variable>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="Con1">
2000
</xsl:variable>
</xsl:otherwise>
</xsl:choose>
<xsl:choose>
<xsl:when test="Request/Query/Parameter = 'DateiName'">
<xsl:variable name="Con2">
2001
</xsl:variable>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="Con2">
2000
</xsl:variable>
</xsl:otherwise>
</xsl:choose>
<xsl:if test="$Con1 == 2001 and $Con2 == 2001">
<xsl:processing-instruction name="ConditionState">
2001
</xsl:processing-instruction>
</xsl:if>
<xsl:if test="$Con1 == 2000 and $Con2 == 2000">
<xsl:processing-instruction name="ConditionState">
2000
</xsl:processing-instruction>
</xsl:if>
</root>
我希望 IF 结果会给我 2000 或 2001 作为我在我的过程中需要的条件状态...
【问题讨论】:
标签: xml xslt xslt-1.0 xslt-2.0