小编R.C*_*.C.的帖子

您可以在 XSLT 中模拟布尔标志吗?

我想在 xslt 脚本中模拟一个标志。这个想法是为模板 foo 设置一个标志(或计数器变量,或任何东西),以便可以从模板 bar 访问它。Bar 不是从 foo 调用的,而是从公共父模板调用的(否则我会向它传递一个参数)。结构是这样的:

<xsl:template match="bla">
  <xsl:apply-templates select="foo"/> <!-- depending on the contents of foo... -->
  <xsl:apply-templates select="bar"/> <!-- ... different things should happen in bar -->
</xsl:template>
Run Code Online (Sandbox Code Playgroud)

任何技巧都非常感激。

xslt

1
推荐指数
1
解决办法
4973
查看次数

标签 统计

xslt ×1