在iPhone中将xml解析为json [英] parsing xml to json in iphone
问题描述
正在编写一个小应用程序,以将iphone从XML解析为JSON对象.谁能告诉我目前有开放源码库来进行usnig Objective-c的解析.
Am writing one small application to parse from XML to JSON object for iphone. can anyone tell me the availability of open source library present to do the parsing usnig objective-c.
推荐答案
objective-c中有很多开源解决方案可以处理JSON:
There are plenty of open source solutions in objective-c to deal with JSON :
- JSONKit: https://github.com/johnezang/JSONKit
- SBJson(又名json-framework): https://github.com/stig/json-framework
- YAJL框架: https://github.com/gabriel/yajl-objc
- JSONKit : https://github.com/johnezang/JSONKit
- SBJson (aka json-framework) : https://github.com/stig/json-framework
- YAJL Framework : https://github.com/gabriel/yajl-objc
要处理xml,可以使用默认的NSXMLParser类或其他一些解决方案,例如我在此处发布的某些代码(DOM解析器): NSXMLParser从XML标签中检索错误数据
To deal with xml, you can use the default NSXMLParser class or some other solutions like some code I've posted here (DOM parser) : NSXMLParser retrieving wrong data from XML tags
您还可以检查此页面,该页面将为您提供XML解析可用解决方案的完整概述(并解释SAX和DOM解析器之间的区别):
You can also check this page which will give you a good overview of available solutions for XML parsing (and an explaination of differences between SAX and DOM parsers) : http://www.raywenderlich.com/553/how-to-chose-the-best-xml-parser-for-your-iphone-project
这篇关于在iPhone中将xml解析为json的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!