0
<catalog><channel><id>4</id>
<name>News</name>
<shortDescription>News happens!</shortDescription>
<subscribe>true</subscribe></channel>
<channel><id>10</id>
<name>Jokes</name>
<shortDescription>funny jokes!</shortDescription>  
</channel>
<channel><id>5</id><name>Markets</name<keyword>cc-markets</keyword>  
<shortDescription>Track the market's movers & shakers at-a-glance.</shortDescription> 
</channel>
</catalog>

I want to get the data between the tag "name", I have many tags with the name "name" but all the tags are not being parsed, the xml is being parsed only till the tag with data "Markets", this has been frustrating me for quite some time now. Any help will be much appreciated.

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129

3 Answers3

2

There are lot of alternatives

xmlpullparser

SAXParser

DomParser

etc.,

Here is interesting ibm article on xml parsers in android.

kosa
  • 65,990
  • 13
  • 130
  • 167
1

Here you have two possible xml parsers:

http://developer.android.com/reference/org/xmlpull/v1/XmlPullParser.html

http://www.bearcave.com/software/java/xml/xmlpull.html

oriolpons
  • 1,883
  • 12
  • 20
0

I figured it out, apparently SAXParser doesn't parse special characters such as "'" and "&" instead it uses "'" and "&" in place of them. So all I did was replacing these characters with their xml counterparts that is it.