Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7548251
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T09:39:04+00:00 2026-05-30T09:39:04+00:00

OK, so I am trying to parse this feed for an android application: and

  • 0

OK, so I am trying to parse this feed for an android application:

and I am doing it with this code:

    protected List<GamestarFeedItem> doInBackground(Context... params) {
    context = params[0];
    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
    List<GamestarFeedItem> items = new ArrayList<GamestarFeedItem>();
    test = new ArrayList<String>();
    try {
        DocumentBuilder builder = factory.newDocumentBuilder();
        Document document = builder.parse(new URL("http://rss.feedsportal.com/c/370/f/5299/index.rss").openConnection().getInputStream());
        //Document document = builder.parse(new URL("http://www.gamestar.de/rss/gamestar.rss").openConnection().getInputStream());
        Element root = document.getDocumentElement();
        NodeList docItems = root.getElementsByTagName("item");          
        Node nodeItem;

        for(int i = 0;i<docItems.getLength();i++){
            nodeItem = docItems.item(i);

            if(nodeItem.getNodeType() == Node.ELEMENT_NODE){
                GamestarFeedItem feedItem = new GamestarFeedItem();
                NodeList element = nodeItem.getChildNodes();                    
                feedItem.setTitle(element.item(0).getFirstChild().getNodeValue());
                feedItem.setSummary(element.item(2).getNodeValue());
                feedItem.setLink(element.item(1).getFirstChild().getNodeValue());                   feedItem.setDate(element.item(3).getFirstChild().getNodeValue());
                //feedItem.setImage(element.getChild(""));
                test.add(element.item(0).getFirstChild().getNodeValue());
                String aaa = element.item(2).getNodeName(); 
                items.add(feedItem);
            }
        }
    } catch (ParserConfigurationException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    } catch (MalformedURLException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    } catch (SAXException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    } catch (IOException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
    return items;
}

Now, everything so far works right, except that this line :

feedItem.setSummary(element.item(2).getNodeValue());

just returns a < instead of the description, and with this line i know that i am trying to extract the right element:

String aaa = element.item(2).getNodeName();

Now, here is a example of such a description:

<a href=”http://www.gamestar.de/news/vermischtes/2564931/gamepro_apps_fuer_ios_und_android.html”><img align=”left” hspace=”5″ src=”http://images.idgentertainment.de/images/idgwpgsgp/bdb/2275036/127x.jpg”/></a&gt; Aktuelle News, Spiele-Tests, Previews und Releases für Xbox 360, PlayStation 3 und Vita sowie Nintendo-Systeme auch unterwegs immer dabei: Ab jetzt sind kostenfreie GamePro-Apps im Android Market und in iTunes verfügbar.<img width=’1′ height=’1′ src=’http://rss.feedsportal.com/c/370/f/5299/s/1cbb8bf0/mf.gif‘ border=’0’/><div class=’mf-viral’><table border=’0′><tr><td valign=’middle’><a href=”http://share.feedsportal.com/viral/sendEmail.cfm?lang=de&title=GamePro-Apps+f%C3%BCr+iOS+und+Android+-+Auf+dem+Smartphone+up-to-date+in+der+Welt+der+Konsolen-Spiele&link=http%3A%2F%2Fwww.gamestar.de%2Fnews%2Fvermischtes%2F2564931%2Fgamepro_apps_fuer_ios_und_android.html&#8221; target=”_blank”><img src=”http://rss.feedsportal.com/images/emailthis2.gif&#8221; border=”0″ /></a></td><td valign=’middle’><a href=”http://res.feedsportal.com/viral/bookmark_de.cfm?title=GamePro-Apps+f%C3%BCr+iOS+und+Android+-+Auf+dem+Smartphone+up-to-date+in+der+Welt+der+Konsolen-Spiele&link=http%3A%2F%2Fwww.gamestar.de%2Fnews%2Fvermischtes%2F2564931%2Fgamepro_apps_fuer_ios_und_android.html&#8221; target=”_blank”><img src=”http://rss.feedsportal.com/images/bookmark.gif&#8221; border=”0″ /></a></td></tr></table></div><br/><br/><a href=”http://da.feedsportal.com/r/126178574663/u/355/f/5299/c/370/s/1cbb8bf0/kg/300/a2.htm”><img src=”http://da.feedsportal.com/r/126178574663/u/355/f/5299/c/370/s/1cbb8bf0/kg/300/a2.img&#8221; border=”0″/></a><img src=”http://da.feedsportal.com/r/126178574663/u/355/f/5299/c/370/s/1cbb8bf0/kg/300/a2t.img&#8221; border=”0″/>

So, can anyone help?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T09:39:06+00:00Added an answer on May 30, 2026 at 9:39 am

    OK, i found the solution.

    Because of the format of the “description”, it actually consists of multiple child items, so u just extract those childs into a Nodelist and loop over them to extraxt their content and problem solved

        String bbb = new String();
        NodeList desc = element.item(2).getChildNodes();
        for(int j = 0;j<desc.getLength();j++){
            bbb += desc.item(j).getNodeValue();
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to parse a html doc using some code I found from this
I am trying to parse a Rss2.0 feed on Android using a Pull parser.
I'm trying to parse this feed: http://musicbrainz.org/ws/1/artist/c0b2500e-0cef-4130-869d-732b23ed9df5?type=xml&inc=url-rels I want to grab the URLs inside
I'm trying to parse a rss feed that looks like this for the attribute
I have an xml feed at this url Now im trying parse the content,
I've been trying to parse this feed . If you click on that link,
I'm trying to parse an RSS feed using LINQ to Xml This is the
I am trying to parse this xml feed [0] => SimpleXMLElement Object ( [title]
Trying to parse out this xml file to get a list of Elements but
Since Days i'm trying to parse a YOUTUBE-XML-Feed by using GDATA-API for iOS. http://code.google.com/intl/de-DE/apis/youtube/2.0/developers_guide_protocol_channel_search.html

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.