I am developing an app for iPad, and I need to modify several attributes in a XML file at runtime.
I found the class NSXMLDocument. But I haven't been able to import it to my project.
Is this class not available for iPhone/iPad development?开发者_运维知识库
Is there some other approach I can consider?
I read about libxml library. Is it my answer or there is a better approach?
NSXMLDocument
is MacOS X Cocoa only. You have available on iPhone NSXMLParser
, and several external libraries built on libxml2 - TouchXML
, KissXML
and a couple of others.
Note that KissXML supports writing XML.
Other XML libraries that have been suggested include the XML support from Google Data and VTD-XML.
You are looking for a DOM XML parser, which is best for modification of XML documents. See for example this tutorial - without mapping to and from Model Objects - use the XPath.
精彩评论