I'm trying to utilise a web service/method which accepts an XmlDocument and returns an XmlDocument. When I add a reference to this web service to my C# application, the proxy code is defined to use XmlNodes instead of XmlDocuments. This seems fairly well recognised behaviour (but confirmation and/or an explanation would be nice - see SO here).
However, if I take the returned XmlNode object and try and do a simple XPath query to "SelectNodes(XPath)", I get no nodes found - but matching nodes do exist.
If, however, I take the OuterXml of the returned XmlNode, and create myself a new XmlDocument from it, my XPath query finds the nodes I expected.
Why is that ? What is it about the returned XmlDocument/XmlNode (or conversion between) that stops the XPath query from working as expected ?
Thanks.
Edit: The Xml looks like this:
<Results xmlns="">
<Result>
:
<Success>True</Success>
</Result>
<Result>
:
<Success>False</Success>
</Result>
</Results>
...and the XPath looks like this...
Dim xPath As String = "//Result[Success='False']"
If (xmlResults.SelectNodes(xPath).Count > 0) Then
Throw New ApplicationException("Results returned indicate a problem:- " + xmlResults.OuterXml)
End If