mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-22 16:33:29 +00:00
only include the header when version, encoding, or standalone has been set
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@34433 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
e0b543f4ac
commit
8b518f58ee
2 changed files with 27 additions and 5 deletions
|
@ -1,3 +1,8 @@
|
|||
2012-01-05 22:20-EST Doug Simons <doug.simons@testplant.com>
|
||||
|
||||
* Source/NSXMLDocument.m: Modify XMLStringWithOptions: to only include
|
||||
the header when version, encoding, or standalone has been set.
|
||||
|
||||
2012-01-05 22:20-EST Gregory John Casamento <greg.casamento@gmail.com>
|
||||
|
||||
* Source/NSXMLElement.m: in setChildren: set the childCount.
|
||||
|
|
|
@ -311,13 +311,30 @@ GS_PRIVATE_INTERNAL(NSXMLDocument)
|
|||
NSEnumerator *en = [internal->children objectEnumerator];
|
||||
id obj = nil;
|
||||
|
||||
[string appendString: @"<?xml version=\"1.0\""];
|
||||
if (YES == internal->standalone)
|
||||
if (internal->version || internal->standalone || internal->encoding)
|
||||
{
|
||||
[string appendString: @" standalone=\"yes\""];
|
||||
NSString *version = internal->version;
|
||||
if (!version)
|
||||
version = @"1.0";
|
||||
[string appendString: @"<?xml version=\""];
|
||||
[string appendString: version];
|
||||
[string appendString: @"\""];
|
||||
if (internal->encoding)
|
||||
{
|
||||
[string appendString: @" encoding=\""];
|
||||
[string appendString: internal->encoding];
|
||||
[string appendString: @"\""];
|
||||
}
|
||||
if (YES == internal->standalone)
|
||||
{
|
||||
[string appendString: @" standalone=\"yes\""];
|
||||
}
|
||||
else
|
||||
{
|
||||
[string appendString: @" standalone=\"no\""];
|
||||
}
|
||||
[string appendString: @"?>\n"];
|
||||
}
|
||||
[string appendString: @"?>\n"];
|
||||
|
||||
while ((obj = [en nextObject]) != nil)
|
||||
{
|
||||
[string appendString: [obj XMLStringWithOptions: options]];
|
||||
|
|
Loading…
Reference in a new issue