标签: xml xpath nodes
<a> <b /> <c /> </a> <a1> <b /> </a1>
如何选择没有指定子节点的节点?例如,在我的示例 a1 中,我需要所有没有 c 节点的节点。
答案 0 :(得分:4)
假设:
<root> <a> <b /> <c /> </a> <a1> <b /> </a1> </root>
使用:/root/*[not(c)]
/root/*[not(c)]
结果为a1。
a1