c# - xpath query to select element where attribute not present -


what should xpath query select element 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 update element attribute att not present.

thanks

you can use [@att] test presence of attribute, need:

//elem[not(@att)] 

... test absence of it.

(tested using xpathtester)


Comments

Popular posts from this blog

database - VFP Grid + SQL server 2008 - grid not showing correctly -

jquery - Set jPicker field to empty value -

.htaccess - htaccess convert request to clean url and add slash at the end of the url -