命名空间前缀&#ns; ns0'未定义

时间:2016-04-29 09:44:04

标签: c# xml

我收到错误"命名空间前缀&#ns; ns0'未定义" 。 我的XML是



<?xml version="1.0" ?>
<ns0:AuthResponseSchema xmlns:ns0="http://services.test.com/Auths/">
  <ns0:AuthResponseResult submittertraceid="b715337b-4b75-41ef-b617-e33d728f913c" transactionid="1020374" type="HI-IREQ">
    <ns0:PayerResponseXML type="ReviewResponse">
      <ns0:UtilizationMgmtOrg>
        <ns0:Name type="PR">
          <ns0:LastOrgName>TEST</ns0:LastOrgName>
          <ns0:Identifier type="PI">XXX</ns0:Identifier>
        </ns0:Name>
      </ns0:UtilizationMgmtOrg>
    </ns0:PayerResponseXML>
  </ns0:AuthResponseResult>
</ns0:AuthResponseSchema>
&#13;
&#13;
&#13;

我的代码是:

            XmlDocument results = new XmlDocument();
            results.Load(@"C:\WebApp\WebApp\auth.xml");
            var nsmgr = new XmlNamespaceManager(results.NameTable);
            nsmgr.AddNamespace("xsl", "http://www.w3.org/1999/XSL/Transform");
            XmlNodeList xnList = results.SelectNodes("ns0:AuthResponseSchema", nsmgr);

我的代码正在破解

XmlNodeList xnList = results.SelectNodes(&#34; ns0:AuthResponseSchema&#34;,nsmgr);

由于

0 个答案:

没有答案