I am using SAX parser to get a data from XML. unfortunately i am having two tags with same name example <tags> <sam开发者_如何学Pythonetag>Abc</sametag> <sametag>Def</sametag ></tags>
. so whenever i am parsing the file i only getting ABC the same tag which contains different data will never parse. if anyone having idea for to parse same name tags pls guide me to solve.
Simple XML Framework:
@Root(name = "tags")
class Tags {
@ElementList(entry = "sametag", inline = "true")
public ArrayList<String> sameTags;
}
I have totally not tested that code but you get the gist as to how easy it is to use. To see how to use it in Android take a look at my blog post.
Maybe this post could help you http://codeofaninja.blogspot.com/2011/05/android-how-to-parse-xml-file-and.html
精彩评论