Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/xslt/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在XSLT测试子句中使用Xpath_Xslt_Xpath_Xslt 1.0_Xslt 2.0_Xslt 3.0 - Fatal编程技术网

在XSLT测试子句中使用Xpath

在XSLT测试子句中使用Xpath,xslt,xpath,xslt-1.0,xslt-2.0,xslt-3.0,Xslt,Xpath,Xslt 1.0,Xslt 2.0,Xslt 3.0,我试图将xpath表达式作为变量放入xslt测试子句中,如下所示: <xsl:choose> <xsl:when test="../v:node[@InputName='{v:HeaderValue}']"> </xsl:when> <xsl:otherwise> </xsl:otherwise> </xsl:choose> 但是,它不起作用,并且总是计算为false。有人知道为什么吗?你应该能够做到这一点 <x

我试图将xpath表达式作为变量放入xslt测试子句中,如下所示:

<xsl:choose>
<xsl:when test="../v:node[@InputName='{v:HeaderValue}']">
</xsl:when>
<xsl:otherwise>
</xsl:otherwise>
</xsl:choose>


但是,它不起作用,并且总是计算为false。有人知道为什么吗?

你应该能够做到这一点

<xsl:when test="../v:node[@InputName=v:HeaderValue]">


{}表示法用于属性值模板,在创建属性时使用,您希望表达式的结果作为属性值。

动态XPath求值在XSLT 1.0或XSLT 2.0中不可用


它可能在中提供,如(当前提议的)指令TimC:我认为OP需要动态XPath评估。