What should be xpath query to select an element where the attribute att not present.
<root>
<elem att='the value' />
<elem att='the value' />
<elem att='the value' />
**<elem />**
<elem att='the value' />
<elem att='the value' />
</root>
I want to update element where attribute att not present.
Thanks
You can use [@att]
to test for the presence of an attribute, so you just need:
//elem[not(@att)]
... to test for the absence of it.
See more on this question at Stackoverflow