开发者

How do I set the doctype when building a document with GDataXML*

When using GDataXML* to build an XML document, how do I set the doctype of the generated X开发者_如何学PythonML? The rough outline of how I'm using GData can be found here:

http://www.raywenderlich.com/725/how-to-read-and-write-xml-documents-with-gdataxml


We ended up doing it this way, which is not ideal but does the trick:

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];
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜