0

我是安卓新手。你能帮我解析这个包含 HTML 内容的 XML,比如,

<title>Jeff Mayweather: Floyd Sr showed a Sign of finally letting go of his Son, Passing Torch to Roger</title>

<summary type="html">
                        &lt;p&gt;By Shawn Craddick&lt;/p&gt;&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Boxingsocialist had a chance to catch up with Floyd Mayweather&#039;s other uncle Jeff Mayweather. While Jeff stays busy at the gym he gave us some updates on his fighters as well as his thoughts on Brandon Rios, Gamboa, Floyd Mayweather Sr and Floyd Jr. meeting back together. Also he talked to us about a surprise boxing veteran he might be working with. Check out the interview below.&lt;/p&gt;
&lt;p&gt;&lt;br&gt;&lt;/br&gt; &lt;span style=&quot;color: #ff6600;&quot;&gt;BoxingSocialist&lt;/span&gt;- What did you…&amp;lt;/p&gt;                    </summary>

我可以解析标题字段,为了解析摘要字段,我在 RSS 处理程序中给出命令--localname.equals ("summary") 。我无法解析摘要字段中的内容。有人帮我吗?

4

3 回答 3

0

试试这个

android.text.Html.fromHtml(text).toString();
于 2012-04-17T08:54:40.253 回答
0

一旦我在标签内有这样的带有 html 数据的提要。我的解决方案是要求数据提供者将 html 与CDATA. 因此,如果您有权访问 xml 的制作方式,请考虑使用此选项。

于 2012-04-17T14:39:55.937 回答
0

您可以使用jsoup来解析 java 中的 html 内容。

教程链接示例

干杯

于 2012-04-17T08:00:06.850 回答