Meaningless Drivel is fun!*
The moose likes Android and the fly likes Parsing Amazon RSS problem with Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Mobile » Android
Bookmark "Parsing Amazon RSS problem with "title" tag." Watch "Parsing Amazon RSS problem with "title" tag." New topic
Author

Parsing Amazon RSS problem with "title" tag.

Matt Partner
Greenhorn

Joined: Oct 24, 2012
Posts: 9
Hello to everyone,

First of all I want to say how useful has been in the past this forum to me and thank to all people who collaborates in this website.

Ok here we go with my problem. I'm trying to parse an Amazon RSS Feed like this:

Amazon product

The class in Java which I use is that:



I use this code in an Ebay Feed and works very good, but when I try to parse an Amazon RSS Feed the "title" tag appears in blank, only parses the description (And the photo of the product, because I wrote a class to manage it and works very well).

My problem and question is if anyone could help to me to see how I can to parse the "title" tag because doesn't work. Happens the same with the "link" tag but I think if I know how to parse the "title" I'll be able to fix the "link" problem.

Thanks to everyone and if you need more information about this, I'll post here.

Sincerelly,
Matt
Steve Luke
Bartender

Joined: Jan 28, 2003
Posts: 3970
    
  17

So what is the purpose of that TrovuXMLParser class, and where is the API. Since it is responsible for pulling the data out of the DOM we need to see how it works. I don't see what benefit it adds to the built-in tools that ship with Android (except that we all know the built-in ones and can access their documentation).

My suggestion would be to drop whatever the TrovuXMLParser is doing and use:


Steve
Matt Partner
Greenhorn

Joined: Oct 24, 2012
Posts: 9
Thanks for your help Steve!

I edited the first post with the API I missed, I'm sorry but I'm so new in Java and I forgot a lot of things and how to comment correctly.

TrovuXmlParser class is the class I use to get the XML from the URL:



Here there are the methods I use to parse the diferent kind of information. The getValue is the method used to get the "id, item, liink, title and description". The "img" tag is parsed with an other method and works fine in this Amazon Rss parse.

The idea is once I parsed the XML from the URL then in AmazonXmlParsingActivity I put inside a map the values using getValue.

If you need something more, please tell it to me

I'm sorry for my english, maybe I do a lot of mistakes for my low level :')
Steve Luke
Bartender

Joined: Jan 28, 2003
Posts: 3970
    
  17

Your getElementValue() method is wrong. It assumes the text in all your elements is a CDATA node, but for the title and link it is not - it is a text node.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Parsing Amazon RSS problem with "title" tag.
 
Similar Threads
How to sort a listview with comparator ?
How to get View from customised ListView?
File path to FileList.txt and xml files not working
Parse CDATA with XMLParser in this specific case for Android
BaseAdapter: getView() problem