EXSLT Tokenizer for-each循环中的当前节点上下文是什么?我似乎无法查询文档中的任何节点。示例:
<xsl:for-each select="str:tokenize($renderList,',')">
<xsl:variable name ="tag" select="."/>
<xsl:value-of select = "//tag[@name = $tag]"/>
</xsl:for-each>
如果我在for-each循环之外硬编码<xsl:value-of select = "//tag[@name = 'A']"/>
,查询就能正常工作。
循环中的上下文节点是什么?
发布于 2012-08-14 10:16:52
问题在于,在XML xsl:for-each
中,当前文档不是原始的源文档。
这应该是可行的:
<xsl:variable name="vDoc" select="/"/>
<xsl:for-each select="str:tokenize($renderList,',')">
<xsl:variable name ="tag" select="."/>
<xsl:value-of select = "$vDoc//tag[@name = $tag]"/>
</xsl:for-each>
https://stackoverflow.com/questions/11944734
复制相似问题