我在同一范围内定义了一些变量:
<xsl:variable name="disc" select="fn:number(a)"/>
<xsl:variable name="pvTotal" select="fn:number(b)"/>
<xsl:variable name="taxTotal" select="fn:number(c)"/>
然后我在同一范围内定义了另一个变量:
<xsl:variable name="pvUnitario" select="$pvTotal+$taxTotal-$disc"/>
但我收到此错误:
XPST0008: Variable taxTotal- has not been declared (or its declaration is not in scope)
我做错了什么?
最佳答案
改变
<xsl:variable name="pvUnitario" select="$pvTotal+$taxTotal-$disc"/>
至
<xsl:variable name="pvUnitario" select="$pvTotal + $taxTotal - $disc"/>
以便引用 taxTotal
而不是 taxTotal-
。
关于xml - 变量 - 尚未声明(或其声明不在范围内),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50243360/