I dont know how to read data from such XML file. Lets say i want to read every every GUID and userID. How do i do it?
Here is part of XML: http://pastebin.com/7B25eyFz
您可以使用Xstream
Look into SAX Parser . Also, do a search for your terms - there are a ton of questions about this topic.
如果您的xml文件是基于树的,则使用DOM,如果未嵌套,则使用SAX,比DOM快。
添加到@user651407
点,如果您只想读取XML然后去SAX
,它将以串行方式解析XML
,这样速度更快,但是如果您想执行更复杂的操作(例如添加,更新或删除节点),请继续DOM
但DOM
有局限性
1. required more memory as entire XML is loaded at a time.
2. Slow in processing as it is a tree based parser.
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.