In XPath 1.0, you could do:
//node[not(@attribute)] //node[concat(@attribute, '') = '' //node[not(boolean(@attribute))]
In XPath 2.0 and above, you could also do:
//node[not(exists(@attribute))]
You can use the count function to count the node you are checking. If it do not exist, then the value of count will be 0:
count(//node-to-check) = 0
or you can call boolean function:
boolean(//node-to-check)
This returns true if "node-to-check" node exist and false if not.
© 2024 Digcode.com