* Source/NSXMLDocument.m: Change stack implementation to

use lastObject/removeLastObject to implement the stack instead
	of inserting and deleting at index 0.
	* Source/NSXMLElement.m: Implemented XMLStringWithOptions:
	* Source/NSXMLNode.m: Implemented XMLStringWithOptions:,
	skeletal implementation of setStringValue:resolvingEntities:



git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@34403 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
gcasa 2012-01-03 17:15:29 +00:00
parent 9a5f196bf1
commit 8f97e14738
4 changed files with 74 additions and 7 deletions

View file

@ -213,5 +213,41 @@
[self notImplemented: _cmd];
}
- (NSString *) XMLStringWithOptions: (NSUInteger)options
{
NSMutableString *result = [NSMutableString string];
NSEnumerator *en = nil;
id object = nil;
// XML Element open tag...
[result appendString: [NSString stringWithFormat: @"<%@",[self name]]];
// get the attributes...
en = [[self attributes] objectEnumerator];
while((object = [en nextObject]) != nil)
{
[result appendString: @" "];
[result appendString: [object XMLStringWithOptions: options]];
}
// close the brackets...
[result appendString: @">"];
[result appendString: [self stringValue]]; // need to escape entities...
// Iterate over the children...
en = [[self children] objectEnumerator];
while((object = [en nextObject]) != nil)
{
[result appendString: @" "];
[result appendString: [object XMLStringWithOptions: options]];
}
// Close the entire tag...
[result appendString: [NSString stringWithFormat: @"</%@>",[self name]]];
// return
return result;
}
@end