If you have a namespace prefix set, you could use it, like:
//soap:Body
But since the nodes you are trying to get use a default namespace, without a prefix, using plain XPath, you can only acesss them by the local-name()
and namespace-uri()
attributes. Examples:
//*[local-name()="HelloWorldResult"]/text()
Or:
//*[local-name()="HelloWorldResult" and namespace-uri()='http://tempuri.org/']/text()
Or:
//*[local-name()="HelloWorldResponse" and namespace-uri()='http://tempuri.org/']/*[local-name()="HelloWorldResult"]/text()
To your xml, they will all give the same result, the text 7
.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…