【发布时间】:2013-07-22 12:26:25
【问题描述】:
我想知道在 Android 中写入和解析 XML 文件的最简单方法是什么。我的要求很简单。示例文件类似于:
<HTML>
<HEAD>
<TITLE>Network Error</TITLE>
</HEAD>
</HTML>
【问题讨论】:
-
httpPost.setEntity(new StringEntity(requestEnvelope)); HttpResponse httpResponse = httpClient.execute(httpPost); HttpEntity httpEntity = httpResponse.getEntity(); line = EntityUtils.toString(httpEntity);
-
Hi goody line is string
-
如果您在字符串中有该行,那么您不能只查看字符串
containsTITLE 标记,然后查看它后面的内容,在下一个 '>' 和 ' -
你不能使用 stripHtml(line) 吗? public String stripHtml(String html) { return Html.fromHtml(html).toString(); }
标签: android html parsing xml-parsing response