SelectSingleNode
expects an XPath expression which starts at the current node.
Since
AddPersonContactInformation
is not a direct child of the root element, your XPath expression won't match anything.
Change your expressions to start with "
//
" to match the element anywhere in the document:
If ((objXMLInputDoc.DocumentElement.SelectSingleNode("//AddPersonContactInformation/PersonAddress") Is Nothing) AndAlso (objXMLInputDoc.DocumentElement.SelectSingleNode("//AddPersonContactInformation/PersonTelephoneNumber") Is Nothing) AndAlso (objXMLInputDoc.DocumentElement.SelectSingleNode("//AddPersonContactInformation/PersonEmailAddress") Is Nothing)) Then
Exit Sub
End If
XPath Tutorial[
^]
XPath Syntax[
^]
(NB: Your XML seems to be invalid - you're missing the soap
namespace declaration.)