Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在我的 xslt 中,我正在调用外部代码以将节点集分配给 xslt 变量。我现在想在这个节点集上应用模板。
<xsl:variable name="var1" select="ExtObject:GetNodeSet()"/>
到目前为止,我已经看到模板可以应用于输入 xml 文档。但是我可以解析分配给var1应用模板的 xml 并将结果反映在输出文档中吗?
var1
是的,只需使用
<xsl:variable name="$var1" select="ExtObject:GetNodeSet()"/>
和
<xsl:apply templates select="$var1"/>
这是可行的,因为变量保留了所有类型信息,因此可以找到正确的模板。