The normal xpath statement '//NODE' will give me:
NODE, ELEMENT (with Element 2), ELEMENT (With Element 3)Actually, no, it only gives you one element: NODE. You can reach all the other nodes from there, but they are not selected by the XPath expression. Your development environment might choose to display NODE by showing it along with its children, but that's not part of the action of the XPath expression itself.
I'm experimenting with some inverted statements:
For instance: /*[!//NODE] or //*[!//NODE]Please don't experiment with syntax. You'll never work out how XPath works by a suck-it-and-see approach. Read the spec, or a good book.
It keeps giving me the NODE data as well.Both the above are syntax errors and should give you nothing but an error message.
The inverted selection *should* produce:
ROOT, ELEMENT (With Element 1)
Any advice on how to put the statement together?Since you've explained the effect of the correct statement incorrectly, I'm really not sure what you actually want to select.
Michael Kay