mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-25 01:31:08 +00:00
* Source/NSXMLDocument.m (-XMLDataWithOptions:): Correct convesion
to NSData. Add some comments. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@34931 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
3318835025
commit
a1cbb4f003
2 changed files with 13 additions and 7 deletions
|
@ -1,3 +1,8 @@
|
|||
2012-03-12 Fred Kiefer <FredKiefer@gmx.de>
|
||||
|
||||
* Source/NSXMLDocument.m (-XMLDataWithOptions:): Correct convesion
|
||||
to NSData. Add some comments.
|
||||
|
||||
2012-03-12 Fred Kiefer <FredKiefer@gmx.de>
|
||||
|
||||
* Source/NSXMLPrivate.h: Add comments on owner policy.
|
||||
|
|
|
@ -222,6 +222,7 @@ GS_PRIVATE_INTERNAL(NSXMLDocument)
|
|||
- (void) setDTD: (NSXMLDTD*)documentTypeDeclaration
|
||||
{
|
||||
NSAssert(documentTypeDeclaration != nil, NSInvalidArgumentException);
|
||||
// FIXME: do node house keeping, remove ivar, use intSubset
|
||||
ASSIGNCOPY(internal->docType, documentTypeDeclaration);
|
||||
internal->node->extSubset = [documentTypeDeclaration _node];
|
||||
}
|
||||
|
@ -233,8 +234,6 @@ GS_PRIVATE_INTERNAL(NSXMLDocument)
|
|||
|
||||
- (void) setRootElement: (NSXMLNode*)root
|
||||
{
|
||||
id oldElement = [self rootElement];
|
||||
|
||||
if (root == nil)
|
||||
{
|
||||
return;
|
||||
|
@ -247,12 +246,12 @@ GS_PRIVATE_INTERNAL(NSXMLDocument)
|
|||
self];
|
||||
}
|
||||
|
||||
// FIXME: Should remove all sub nodes
|
||||
// remove all sub nodes
|
||||
[self setChildren: nil];
|
||||
|
||||
xmlDocSetRootElement(internal->node, [root _node]);
|
||||
|
||||
// Do our subNode housekeeping...
|
||||
[self _removeSubNode: oldElement];
|
||||
[self _addSubNode: root];
|
||||
}
|
||||
|
||||
|
@ -360,9 +359,9 @@ GS_PRIVATE_INTERNAL(NSXMLDocument)
|
|||
- (NSData *) XMLDataWithOptions: (NSUInteger)options
|
||||
{
|
||||
NSString *xmlString = [self XMLStringWithOptions: options];
|
||||
NSData *data = [NSData dataWithBytes: [xmlString UTF8String]
|
||||
length: [xmlString length]];
|
||||
return data;
|
||||
|
||||
return [xmlString dataUsingEncoding: NSUTF8StringEncoding
|
||||
allowLossyConversion: NO];
|
||||
}
|
||||
|
||||
- (id) objectByApplyingXSLT: (NSData*)xslt
|
||||
|
@ -447,6 +446,7 @@ GS_PRIVATE_INTERNAL(NSXMLDocument)
|
|||
NSXMLDocument *c = (NSXMLDocument*)[super copyWithZone: zone];
|
||||
|
||||
[c setMIMEType: [self MIMEType]];
|
||||
// the extSubset isnt copied by libxml2
|
||||
[c setDTD: [self DTD]];
|
||||
[c setDocumentContentKind: [self documentContentKind]];
|
||||
return c;
|
||||
|
@ -458,6 +458,7 @@ GS_PRIVATE_INTERNAL(NSXMLDocument)
|
|||
{
|
||||
return YES;
|
||||
}
|
||||
// FIXME
|
||||
return [[self rootElement] isEqual: [other rootElement]];
|
||||
}
|
||||
@end
|
||||
|
|
Loading…
Reference in a new issue