【发布时间】:2009-05-26 21:52:04
【问题描述】:
我是 XSLT 的新手,我不知道如何获取 xsl:if 在没有子标签时匹配。
我希望这个匹配:
<context>
howdy
</context>
这不是:
<context>
<child>
howdy
</child>
</context>
【问题讨论】:
我是 XSLT 的新手,我不知道如何获取 xsl:if 在没有子标签时匹配。
我希望这个匹配:
<context>
howdy
</context>
这不是:
<context>
<child>
howdy
</child>
</context>
【问题讨论】:
相关的 xpath 表达式应如下所示:
//context[not(./*)]
【讨论】:
您也可以指定count(child::*) = 0 .
【讨论】: