Issue
My requirement is that to download xml from server and save it into sd-card and then parse that xml.XML size is very big I have parse that xml directly with url without saving sd card but requirement is that firstly save and then parse.
How can I do this?
Solution
It's only going to take a lot of memory to parse the XML if you load the entire XML DOM into memory. If you parse it with SAX, there's no issue. you can stream it directly from the network and parse on the fly. http://en.wikipedia.org/wiki/Simple_API_for_XML
Regardless, having it on the SD card makes no difference. You still need to parse it the same. The only difference is if you start with a stream from a file or a stream from the network. your parsing code is going to look exactly the same.
You might want to question whoever gave you that requirement. It sounds like either you misunderstood them / didn't get enough information or they are themselves confused.
Answered By - Jeffrey Blattman
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.