【发布时间】:2013-10-07 11:44:17
【问题描述】:
我创建了一个 SOAP 调用,作为答案,我得到一个 XML 字符串,例如:
<?xml version="1.0" encoding="utf-8"?>
<sopenevelop>
<soapbody>
<ActualAnswer> I want to get whatever is in here </ActualAnswer>
</soapbody>
</sopenevelop>
那么我如何从 android 中的那个 xml 中读出“ActualAnswer”?
我发现例如: XML String parsing in Android? 但它并没有真正说明如何过滤掉答案..并且无法使其正常工作..
在 C# 中我可以做到这一点,其中 xmlanswer 是顶部的 xml,但在 android 中无法计算
XmlDocument xml = new XmlDocument();
xml.LoadXml (xmlanswer);
string loginanswer = (xml.GetElementsByTagName ("ActualAnswer") [0].InnerText);
【问题讨论】: