[英]Can i parse a binary XML file ( in res/xml ) with a SAX parser
To clarify my question :-) 为了澄清我的问题:-)
I want to have the best of both worlds. 我希望两全其美。
Most important question is: Can this be done? 最重要的问题是:这可以做到吗?
Closest i came to the solution is. 我最近来到解决方案是。
I hope someone can help me get a bit further in this situation. 我希望有人可以在这种情况下帮助我进一步发展。
Edit: link to reflect SAX-parser speed 编辑:链接以反映SAX分析器的速度
SAX parser is not more efficient than XmlResourceParser for XML in raw resource. SAX解析器不超过XmlResourceParser更有效率的原料资源XML。 Just use XmlResourceParser.
只需使用XmlResourceParser。
You can place your xml file assets folder and you can use Sax parser 您可以放置xml文件资产文件夹,并且可以使用Sax解析器
InputStream xmlFileStram = getAssets().open(filePath); // this gives the file in your asset folder
XmlHandler xmlHandler = new XmlHandler(activity);
SAXParserFactory.newInstance().newSAXParser().parse(xmlFileStram, xmlHandler);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.