* Source/NSXMLDocument.m: Correct issues with unit tests.

ignore nil on setRootElement:.  Correct other issues.



git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/branches/nsxml_using_libxml2@34561 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Gregory John Casamento 2012-01-17 08:09:01 +00:00
parent 9f3fe8391a
commit c28fe9a54b
2 changed files with 16 additions and 2 deletions

View file

@ -1,3 +1,8 @@
2012-01-17 03:06-EST Gregory John Casamento <greg.casamento@gmail.com>
* Source/NSXMLDocument.m: Correct issues with unit tests.
ignore nil on setRootElement:. Correct other issues.
2012-01-16 13:30-EST Gregory John Casamento <greg.casamento@gmail.com>
* Source/NSXMLElement.m

View file

@ -220,8 +220,12 @@ extern void clearPrivatePointers(xmlNodePtr aNode);
{
#warning properly dispose of old root element.
xmlNodePtr newrootnode;
NSAssert(root != nil, NSInvalidArgumentException);
// Set
if(root == nil)
{
return;
}
xmlDocSetRootElement(MY_DOC,[root _node]);
newrootnode = MY_DOC->children;
newrootnode->_private = root; // hmmm, this probably isn't where this belongs, but try it...
@ -296,6 +300,11 @@ extern void clearPrivatePointers(xmlNodePtr aNode);
nextNode->prev = newNode;
}
if(MY_DOC->children == NULL)
{
MY_DOC->children = newNode;
}
GSIVar(child, parent) = self;
}