Hi Guys:

  I'm using following code to analyse the atom xml content.
  But when run to "syndFeedInput.build(tmp);", an exception occured.
It seems that the format of the xml is not right.(but the xml file is
from google reader)
  Also there are some chinese words in the xml file, but I think it's
not the problem is.
  Please help me to find the real problem.

   Thanks a lot.

--------------------------------------------------------
        public static SyndFeed getAtomFeed(String xmlContent)
                        throws GoogleReaderException {

                try {
                        StringReader tmp = new StringReader
(xmlContent);
                        SyndFeedInput syndFeedInput = new SyndFeedInput
();
                        return syndFeedInput.build(tmp);
                } catch (IllegalArgumentException e) {
                        throw new GoogleReaderException(
                                        "The provided xml content is
not a valid Atom feed!", e);
                } catch (FeedException e) {
                        throw new GoogleReaderException(
                                        "The provided xml content is
not a valid Atom feed!", e);
                }
        }
------------------------------------------------------------------------------------------------


<?xml version="1.0" ?>
<feed xmlns:idx="urn:atom-extension:indexing" xmlns:gr="http://
www.google.com/schemas/reader/atom/" xmlns:media="http://
search.yahoo.com/mrss/" xmlns="http://www.w3.org/2005/Atom";
idx:index="no">
- <!-- Content-type: Preventing XSRF in IE.


  -->
  <generator uri="http://www.google.com/reader";>Google Reader</
generator>
  <id>tag:google.com,2005:reader/user/11079533016622235900/label/时事新闻</
id>
  <title>Google 阅读器中通过 xiao 指定的“时事新闻”</title>
  <gr:continuation>COnNhcjkrpoC</gr:continuation>
  <link rel="self" href="http://www.google.com/reader/atom/user/-/
label/%E6%97%B6%E4%BA%8B%E6%96%B0%E9%97%BB" />
 <author>
  <name>xiao</name>
  </author>
  <updated>2009-05-09T10:20:20Z</updated>
<entry gr:crawl-timestamp-msec="1241864420611">
  <id gr:original-id="http://go.rss.sina.com.cn/redirect.php?
url=http://news.sina.com.cn/c/
2009-05-09/180617780236.shtml">tag:google.com,2005:reader/item/
64a9952927aad22f</id>
  <category term="user/11079533016622235900/state/com.google/reading-
list" scheme="http://www.google.com/reader/"; label="reading-list" />
  <category term="user/11079533016622235900/label/时事新闻" scheme="http://
www.google.com/reader/" label="时事新闻" />
  <category term="user/11079533016622235900/state/com.google/fresh"
scheme="http://www.google.com/reader/"; label="fresh" />
  <category term="国内要闻" />
  <title type="html">四川旅游局副局长吴勉:四川景点依旧美丽</title>
  <published>2009-05-09T10:06:30Z</published>
  <updated>2009-05-09T10:06:30Z</updated>
  <link rel="alternate" href="http://go.rss.sina.com.cn/redirect.php?
url=http://news.sina.com.cn/c/2009-05-09/180617780236.shtml";
type="text/html" />
  <summary xml:base="http://news.sina.com.cn/491/2008/0827/1.html";
type="html">  2009年“5・12”汶川特大地震一周年纪念前夕,《三联生活周刊》邀请四川文化名人,深入探讨“四川精神”与“家园重
建”。以下为四川省旅游局副局长吴勉的发言:   吴勉:四川依然美丽,四川人依然乐观  震后旅游口号是“四川依然美丽”,2009年“天下四川有
爱”,....</summary>
- <author>
  <name>WWW.SINA.COM.CN</name>
  </author>
- <source gr:stream-id="feed/http://rss.sina.com.cn/news/china/
focus15.xml">
  <id>tag:google.com,2005:reader/feed/http://rss.sina.com.cn/news/
china/focus15.xml</id>
  <title type="html">国内要闻-新浪新闻</title>
  <link rel="alternate" href="http://news.sina.com.cn/
491/2008/0827/1.html" type="text/html" />
  </source>
  </entry>
<entry gr:crawl-timestamp-msec="1241864420611">
  <id gr:original-id="http://go.rss.sina.com.cn/redirect.php?
url=http://news.sina.com.cn/w/
2009-05-09/174517780234.shtml">tag:google.com,2005:reader/item/
4b19e4c45ea8c7d8</id>
  <category term="user/11079533016622235900/state/com.google/reading-
list" scheme="http://www.google.com/reader/"; label="reading-list" />
  <category term="user/11079533016622235900/label/时事新闻" scheme="http://
www.google.com/reader/" label="时事新闻" />
  <category term="user/11079533016622235900/state/com.google/fresh"
scheme="http://www.google.com/reader/"; label="fresh" />
  <category term="国内要闻" />
  <title type="html">委内瑞拉首都警察局查获大批武器</title>
  <published>2009-05-09T09:45:00Z</published>
  <updated>2009-05-09T09:45:00Z</updated>
  <link rel="alternate" href="http://go.rss.sina.com.cn/redirect.php?
url=http://news.sina.com.cn/w/2009-05-09/174517780234.shtml";
type="text/html" />
  <summary xml:base="http://news.sina.com.cn/491/2008/0827/1.html";
type="html">  人民网5月9日讯据来自加拉加斯的消息,委内瑞拉首都警察局局长梅萨宣布,昨天警方在首都的一次行动中查获大批武器,包括
大口径枪支和大量弹药。这些武器弹药属于一个名为 “国际的”犯罪团伙。   警方在行动中逮捕了该团伙的成员3名多米尼加人(两男一女)和法国人弗里
德....</summary>
<author>
  <name>WWW.SINA.COM.CN</name>
  </author>
<source gr:stream-id="feed/http://rss.sina.com.cn/news/china/
focus15.xml">
  <id>tag:google.com,2005:reader/feed/http://rss.sina.com.cn/news/
china/focus15.xml</id>
  <title type="html">国内要闻-新浪新闻</title>
  <link rel="alternate" href="http://news.sina.com.cn/
491/2008/0827/1.html" type="text/html" />
  </source>
  </entry>
  </feed>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to