Looping trough feed entries with rome

Posted by Gandalf StormCrow on Stack Overflow See other posts from Stack Overflow or by Gandalf StormCrow
Published on 2010-05-13T09:18:04Z Indexed on 2010/05/13 9:24 UTC
Read the original article Hit count: 305

Filed under:
|

I'm trying to loop trough Atom feed entries, and get the title attribute lets say, I found this article, I tried this snipped of code :

for (final Iterator iter = feeds.getEntries.iterator();
     iter.hasNext(); )
{
    element = (Element)iter.next();
    key = element.getAttributeValue("href");
    if ((key != null) &&
        (key.length() > 0))
    {
        marks.put(key, key);
    }
}

But I get exception saying :

java.lang.ClassCastException: com.sun.syndication.feed.synd.SyndEntryImpl cannot be cast to org.jdom.Element at com.emir.altantbh.FeedReader.main(FeedReader.java:47)

What did I do wrong? can anyone direct me towards better tutorial or show me where did I make mistake, I need to loop trough entries and extract title tag value. thank you

© Stack Overflow or respective owner

Related posts about java

Related posts about rome