是否可以在 XPath 中进行“不"匹配? [英] Is it possible to do 'not' matching in XPath?

查看:32
本文介绍了是否可以在 XPath 中进行“不"匹配?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以创建一个 XPath 表达式来匹配所有不具有特定名称的子节点?例如

Is it possible to create an XPath expression that matches all child nodes that are not of a certain name? E.g.

<a>
 <b />
 <c />
 <d />
 <e />
 <f />
 <g />
</a>

如何选择a"节点的所有不是b"节点的子节点?

How would I select all children of the 'a' node that are not a 'b' node?

推荐答案

/a/*[not(self::b)]

这篇关于是否可以在 XPath 中进行“不"匹配?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆