I\'m trying to parse an XML feed using SimpleXML in Android: http://backend.deviantart.com/rss.xml?type=deviation&q=by%3Aspyed+sort%3Atime+meta%3Aall
Sample here
It appears that using
@Element(name = "title", required = false, inLine=true)
public String title = "";
will solve your problem, as shown here.
This fixes the problem:
Remove this:
@Element(name = "title", required = false)
Replace with:
//inside the inner class RssItem
@Path("title")
@Text(required=false)
public String title = "";
This should be repeated for any other field that gets the exception.
There are two title
elements in your XML file. The first title
element is in channel
tag and the other title
element is in item
tag. so you should specify to the parser that the paths for these titles are different. do that in the following way:
Edit this:
@Element(name = "title", required = false)
public String title = "";
Add Path Annotation:
@Element(name = "title", required = false)
@Path('rss/channel')
public String title = "";
here you specified for the title
in channel
tag that this is your path. the other title
differs from you :)