Android从ASPX URL解析RSS提要

时间:2013-05-17 16:57:14

标签: android asp.net rss httpclient

我正在尝试从以.aspx结尾的网址解析RSS提要。我不能不幸地修改.aspx文件。 问题是文件的第一行崩溃了整个应用程序。

    <rss xmlns:a10="http://www.w3.org/2005/Atom" version="2.0">
        <channel>
        ...
        </channel>
    </rss>

当我在没有rss标签的情况下尝试使用自己的RSS Feed时,它的效果非常好。 我正在使用下面的这个小代码解析信息:

    DefaultHttpClient httpClient = new DefaultHttpClient();
    HttpPost httpPost = new HttpPost("http://www.url.com/rssfeed.aspx");

    HttpResponse httpResponse = httpClient.execute(httpPost);
    HttpEntity httpEntity = httpResponse.getEntity();
    line = EntityUtils.toString(httpEntity);

有没有办法让Java忽略.aspx文件的第一行和最后一行? 谢谢!

1 个答案:

答案 0 :(得分:0)

尝试使用它:

https://github.com/matshofman/Android-RSS-Reader-Library

或类似的东西。对RSS阅读器库进行一些研究。这是一件很常见的事情。

相关问题