How to parse such kind of Data using NSXML Parsing?

我的梦境 提交于 2019-12-11 14:57:13

问题


How should i parse data which contains CDATA in the Attribute?


回答1:


If you could, I'ld really suggest converting this to JSON-data. The JSON-framework is lots easier to use. Else, I'ld suggest to use the TouchXML-classes (but they're a bit complicated in my opinion because they return elements with attributes instead of plain NSDictionaries and NSArrays).

TouchXML: http://code.google.com/p/touchcode/wiki/TouchXML

JSON-framework: http://code.google.com/p/json-framework/




回答2:


Read Event-Driven XML Programming Guide One way to do it is to use NSXMLParser to parse the data. Implement NSXMLParserDelegate's parser:foundCDATA: to capture the data in the CDATA element.

There are lots of examples of how to use NSXMLParser.




回答3:


I suggest to read the following Apple documentation, it should explain that.

http://developer.apple.com/mac/library/documentation/Cocoa/Conceptual/NSXML_Concepts/NSXML.html



来源:https://stackoverflow.com/questions/3447993/how-to-parse-such-kind-of-data-using-nsxml-parsing

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