Negating Conditionals

Parent Previous Next



Negating conditionals


We may wish to negate a condition to retrieve the opposite. For any conditional in the form:



[<conditional>]



Its negation would be:



[!(<conditional>)]



So, referring to the test tree in the introduction topic, we might want to find all nodes that do not have a child node called X. The path for this would be:



//*[!(./X)]