本文介绍了XPath 匹配叶节点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想编写一个 XPath 表达式,如果它是叶节点,则返回 true..

I want to write an XPath expression that returns true if it is a leaf node..

我怎样才能做到这一点..

How can I achieve this..

//a[not(node()]

类似的东西?

谢谢

推荐答案

当且仅当上下文节点没有子节点时返回 true 的表达式是:

An expression that returns true if and only if the context node has no children is:

not(child::node())

这篇关于XPath 匹配叶节点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

05-29 14:27
查看更多