I can make a query that returns a result set of nodes with their id set to a value I know. But I can't figure out how to get a result set of all nodes that have an id explicitly set.
I can't figure out how to get a result set of all nodes that have an id explicitly set.
*[@id] will select all nodes with an [id] attribute:
The catch is that it will pick up nodes where id is present but is empty (i.e. id="")
If you want to ignore nodes with empty [id] attributes, use: *[@id!=""]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With