mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-23 00:41:02 +00:00
* Source/NSXMLElement.m
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/branches/nsxml_using_libxml2@34563 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
96e464fc49
commit
14ac5c523f
2 changed files with 37 additions and 3 deletions
|
@ -1,3 +1,7 @@
|
|||
2012-01-17 04:05-EST Gregory John Casamento <greg.casamento@gmail.com>
|
||||
|
||||
* Source/NSXMLElement.m
|
||||
|
||||
2012-01-17 03:48-EST Gregory John Casamento <greg.casamento@gmail.com>
|
||||
|
||||
* Source/NSXMLDocument.m
|
||||
|
|
|
@ -209,7 +209,24 @@ extern void clearPrivatePointers(xmlNodePtr aNode);
|
|||
|
||||
- (void) setNamespaces: (NSArray*)namespaces
|
||||
{
|
||||
[self notImplemented: _cmd];
|
||||
NSEnumerator *en = [namespaces objectEnumerator];
|
||||
NSString *namespace = nil;
|
||||
xmlNsPtr cur = NULL;
|
||||
|
||||
while((namespace = (NSString *)[en nextObject]) != nil)
|
||||
{
|
||||
xmlNsPtr ns = xmlNewNs([self _node], NULL, XMLSTRING(namespace));
|
||||
if(MY_NODE->ns == NULL)
|
||||
{
|
||||
MY_NODE->ns = ns;
|
||||
cur = ns;
|
||||
}
|
||||
else
|
||||
{
|
||||
cur->next = ns;
|
||||
cur = ns;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -225,8 +242,21 @@ extern void clearPrivatePointers(xmlNodePtr aNode);
|
|||
|
||||
- (NSArray*) namespaces
|
||||
{
|
||||
[self notImplemented: _cmd];
|
||||
return nil; // internal->namespaces;
|
||||
NSMutableArray *result = nil;
|
||||
xmlNsPtr ns = MY_NODE->ns;
|
||||
|
||||
if(ns)
|
||||
{
|
||||
result = [NSMutableArray array];
|
||||
xmlNsPtr cur = NULL;
|
||||
for(cur = ns; cur != NULL; cur = cur->next)
|
||||
{
|
||||
[result addObject: StringFromXMLStringPtr(cur->prefix)];
|
||||
}
|
||||
}
|
||||
|
||||
// [self notImplemented: _cmd];
|
||||
return result; // nil; // internal->namespaces;
|
||||
}
|
||||
|
||||
- (NSXMLNode*) namespaceForPrefix: (NSString*)name
|
||||
|
|
Loading…
Reference in a new issue