File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Parsing Amazon RSS problem with "title" tag.

 
Matt Partner
Greenhorn
Posts: 9
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 4181
21
IntelliJ IDE Java Python
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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:
 
Matt Partner
Greenhorn
Posts: 9
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 4181
21
IntelliJ IDE Java Python
  • 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic