I got xml file which contains 100 sub tags.....
I need to parse only 10 开发者_JAVA技巧tags... when i click button i need to parse another 10 tags....
dude to my requirements i do parse the data...
I guess terminology is paging ...
Can any one help me out...
@thanks in advance.
If you need pagination and memory isn't an issue, I'd suggest parsing the entire xml in one go, and then storing all tags in an array. If you're sure your requirement of 10 tags won't change, you can allocate an array of size 10 with 10 tags at most for each one of them. Or an array of 100 elements, one for each tag. Whatever you find easier.
Why exactly do you want to parse the xml file bit by bit? Can't you just parse the whole file, store the tags in an array and reference 10 at a time?
U change the webservice you are using to include the start index and end index,which will give you your required range for your call to web service,so you need to simply parse the data that's returned in response to your request.
Parse, from top to bottom as normal, with your code treating the 10 tags you care about. You can ignore the other 90.
精彩评论