iOS: Combining SAX and DOM parsing

僤鯓⒐⒋嵵緔 提交于 2019-12-06 08:12:43

In general your approach sounds fine to me. If your solution is working for you without performance problems then I wouldn't be too worried about the string handling. If you want to you can profile your application to see how much CPU time is wasted by this.

If you want to do something slightly more optimized, you could try to find a SAX parser that gives you the byte offsets of the original buffer and combine this with a DOM parser that lets you work with non null-terminated C strings. I would believe this means you have to switch to a C or maybe C++ library. I have used rapidxml for something vaguely similar to what you are trying (xml chunks embedded in huge file).

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!