使用GDataXML *构建XML文档时,如何设置生成的XML的doctype?我可以在这里找到我如何使用GData的大致轮廓:
http://www.raywenderlich.com/725/how-to-read-and-write-xml-documents-with-gdataxml
答案 0 :(得分:1)
我们最终以这种方式做到了这一点,这不是理想的,而是诀窍:
NSMutableString* contentString = [[[NSMutableString alloc] init] autorelease];
[contentString setString: @"<?xml version=\"1.0\" encoding=\"UTF-8\"?>"];
[contentString appendString:@"<!DOCTYPE somedoc SYSTEM \"http://x.y.com/some.dtd\">"];
[contentString appendString:@"<somedoc></somedoc>"];
GDataXMLDocument *document = [[[GDataXMLDocument alloc] initWithXMLString:contentString options:0 error:nil] autorelease];