我的其中一行xml代码如下所示:
<cf_task_subscription amount="1200.0" code="GBP">£1,200.00</cf_task_subscription>
我想像下面这样设置一个xls: set规则,但我不能这样做,因为XML正在添加up符号:
<xsl:variable name="value" select="/hash/cf_task_subscription"/>
<xsl:choose>
<xsl:when test="$value > 1200.0">John Doe</xsl:when>
<xsl:when test="$value = 1200.0">Jane Doe</xsl:when>
<xsl:otherwise>Unassigned</xsl:otherwise>
</xsl:choose>
所以我的问题是,有没有一种方法可以告诉xsl只考虑cf_task_subscription标记的amount="1200.00“部分?
谢谢,
发布于 2020-12-24 13:50:23
由于信息已经在属性中以结构化形式提供,与文本节点中的“显示表单”分开,因此可以利用它:
<xsl:when test="$value/@amount > 1200.0">John Doe</xsl:when>
https://stackoverflow.com/questions/65437824
复制