简体   繁体   中英

How I Parse SD-Card xml?

我的要求是从服务器下载xml并将其保存到SD卡中,然后解析xml.XML大小非常大我已经用url解析xml direclly而没有保存SD卡但是要求是首先保存然后再解析任何人帮助我如何做到这一点。

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM