我有一个 xml,我想从中选择一个节点,这里是 xml:
<?xml version="1.0" encoding="utf-8" ?>
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<InResponse xmlns="https://ww.ggg.com">
<InResult>Error </InResult>
</InResponse>
</soap:Body>
</soap:Envelope>
我正在使用XmlDocument
's加载它LoadXML
并尝试获取InResult
节点,但我得到 null 请参见下文:
xml.SelectSingleNode("//InResult").InnerText;