Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/design-patterns/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 获取带有前缀的XML命名空间_C#_Xml - Fatal编程技术网

C# 获取带有前缀的XML命名空间

C# 获取带有前缀的XML命名空间,c#,xml,C#,Xml,以下是我的XML代码: <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/".....> <soapenv:Header /> <soapenv:Body> <p297:wsvitaneteResponse xmlns:p297="http://names-space.fr"> <wsvitaneteReturn>

以下是我的XML代码:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/".....>
  <soapenv:Header />
  <soapenv:Body>
    <p297:wsvitaneteResponse xmlns:p297="http://names-space.fr">
      <wsvitaneteReturn>
        <o_ERREUR />
        <o_TARIFS>
          <TARIFV1>115.49</TARIFV1>
          <TARIFV1A>123.49</TARIFV1A>
          <TARIFV1B>123.49</TARIFV1B>
          <TARIFV1AB>131.49</TARIFV1AB>
          <TARIFV2>144.05</TARIFV2>
          <TARIFV2A>152.05</TARIFV2A>
          <TARIFV2B>152.05</TARIFV2B>
          <TARIFV2AB>160.05</TARIFV2AB>
        </o_TARIFS>
      </wsvitaneteReturn>
    </p297:wsvitaneteResponse>
  </soapenv:Body>
</soapenv:Envelope>

我必须添加一些内容?

为什么不使用以下代码:

var TARIF = doc.Descendants("TARIFV1").Select(x => x.Value).ToList();
var TARIF = doc.Descendants("TARIFV1").Select(x => x.Value).ToList();