Verifique se o nó xml existe ou não?
Eu quero verificar determinado nó existe ou não em*.xml
Arquivo. Eu tento:
string language = node.SelectSingleNode("language") != null ? (node.SelectSingleNode("language").Value == "en" ? "en-US" : "en-US") : "en-US";
Mas eu acho que é só verificar o valor do nó.xml
arquivo eu não tenho nó chamadolanguage
Então, isso dá umaNull Reference Ex..
. Como verificar determinado nó existe ou não em*.xml
Arquivo? Obrigado.