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.
我想编写一个 XPath 表达式,如果它是叶节点则返回 true ..
我怎样才能做到这一点..
//a[not(node()]
像这样的东西?
谢谢
当且仅当上下文节点没有子节点时返回 true 的表达式是:
not(child::node())
文本等也是节点,因此您可能想要这个:
not(*)