With XPath (.NET), I'm trying to select all nodes that don't contain any text node.
Given this document:
<root>
<node1>
<node1a>Node 1A</node1a>
</node1>
<node2>Node 2</node2>
<node3>
<node3a>Node 3A</node3a>
<node3b></node3b>
</node3>
<node4></node4>
<node5>
<node5A></node5A>
</node5>
</root>
I'm tyring to get the nodes:
<node3b></node3b>
<node4></node4>
<node5>
<node5A></node5A>
</node5>
Note that overlapping subtrees are merged, so node5A should not be returned separately.
I would expect this to pull the trick, but for some reason (which is probably obvious when someone points it out) it doesn't:
//*[count(//text()) = 0]
Note: I'm using XPath tester to try things out.