当我按照本教程使用GDataXML生成XML时,http://www.raywenderlich.com/725/xml-tutorial-for-ios-how-to-read-and-write-xml-documents-with-gdataxml将其保存到documents文件夹中。在从documents文件夹中打开该文件后,它具有xml = "1.0“。我想将xml版本更改为2.0。请提出任何修改版本的建议。
发布于 2013-11-06 05:29:01
在教程里,你有这个,对吧?
GDataXMLDocument *document = [[[GDataXMLDocument alloc]
initWithRootElement:partyElement] autorelease];要将xml文档的版本从"1.0“更改为"2.0",可以这样做:
NSString *versionString = @"2.0";
const unsigned char *cVersionString = (const unsigned char*)[versionString cStringUsingEncoding:NSUTF8StringEncoding];
document.rootElement.XMLNode->doc->version = cVersionString;https://stackoverflow.com/questions/18097770
复制相似问题