Objective c NSXMLDocument:Remove standalone=“否”

Objective c NSXMLDocument:Remove standalone=“否”,objective-c,nsxmldocument,Objective C,Nsxmldocument,我使用NSXMLDocument生成xml字符串: NSXMLDocument *doc = [[NSXMLDocument alloc]init]; [doc setVersion:@"1.0"]; [doc setCharacterEncoding:@"UTF-8"]; 其产生: <?xml version="1.0" encoding="utf-8" standalone="no"?> 如何删除“standalone=no”据我所知,无法避免生成它。在文章中也提到了这一点。

我使用NSXMLDocument生成xml字符串:

NSXMLDocument *doc = [[NSXMLDocument alloc]init];
[doc setVersion:@"1.0"];
[doc setCharacterEncoding:@"UTF-8"];
其产生:

<?xml version="1.0" encoding="utf-8" standalone="no"?>

如何删除“standalone=no”

据我所知,无法避免生成它。在文章中也提到了这一点。但是,如果您阅读了被接受的答案,您可以尝试使用XSLT删除它。相关的问题是关于java的,但我认为在objective-c中也会有类似的函数