If you translate “are not descendants” to “have no ancestor”, you get the expression //*[not(ancestor::X)]
. This will return all nodes in a document, which are not descendants of nodes named “X”.
If you translate “are not descendants” to “have no ancestor”, you get the expression //*[not(ancestor::X)]
. This will return all nodes in a document, which are not descendants of nodes named “X”.