我有一个从端点返回的长 xml 字符串。
String responseXml = " <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Header>
<ActivityId xmlns="http://schemas.microsoft.com/2004/09/ServiceModel/Diagnostics" CorrelationId="b0cfeb30-eb31-4ff8-91d6-c9f34d69497b">b177c70e-4ab6-448b-a0e6-42478e796167</ActivityId>
</s:Header>
<s:Body>
<IssueDomesticOrderResponse xmlns="http://tempuri.org/">
<IssueDomesticOrderResult><Envelope XMLVersion="02" Direction="Result">
 <Task Code="IssueDomesticOrder">
 <Success>true</Success>
 <DateTime>2018-10-05T07:24:27.035983Z</DateTime>
 <Item>
 <File>&lt;Orders Version="4.00"&gt;&lt;Order No="0NGAOR18100000000603" ProductCd="OR"
ServiceAgreementCd="0"&gt;&lt;Event StateCd="CC" LCLDT="2018-10-05T08:24:27.4891095+01:00" OfficeCd="LOS001" EventOriginCd="S"&gt;&lt;PurchaseInformation Value="30" CurrencyCd="NGN" ValidUntil="2018-10-05" FeeValue="100.000" FeeCurrencyCd="NGN" PayOfficeCode="LOS001" PayOfficeName="---TEST OFFICE----" PurchaseOfficeCode="LOS001" PurchaseOfficeName="---TEST
OFFICE----"&gt;&lt;Sender CustomerID="4224" Title="MR" Last="Choji" First="Shikamaru" PostCode="LOS001" City="Lausanne" CountryCd="NG" Mobile="08124533711" /&gt;&lt;Recipient CustomerID="4225" Title="MS" Last="Jira" First="Amy" PostCode="1200" City="Geneve" CountryCd="NG" Mobile="08124577322"
我试图解析 xml 字符串并检索Order No它具有的属性,该属性是Orders其父级的子级,File其父级是Item
我执行了以下操作,但无法检索 Node.jsFile或ItemNode.js 文件。我希望从此 xml 中检索的主要值是 Order 属性No,如果我无法获取 File 节点,则无法获取 Order No 属性。
}
慕尼黑8549860
慕尼黑5688855
相关分类