diff --git a/Source/NSXMLDocument.m b/Source/NSXMLDocument.m index a89c95fc4..d7e4cd3ab 100644 --- a/Source/NSXMLDocument.m +++ b/Source/NSXMLDocument.m @@ -219,8 +219,12 @@ GS_PRIVATE_INTERNAL(NSXMLDocument) [children release]; internal->rootElement = (NSXMLElement*)root; */ + xmlElementPtr newrootnode; + NSAssert(root != nil, NSInvalidArgumentException); // Set xmlDocSetRootElement(MY_DOC,[root _node]); + newrootnode = MY_DOC->children; + newrootnode->_private = root; // hmmm, this probably isn't where this belongs, but try it... } - (void) setStandalone: (BOOL)standalone diff --git a/Source/NSXMLNode.m b/Source/NSXMLNode.m index c5698927c..e69cf85e1 100644 --- a/Source/NSXMLNode.m +++ b/Source/NSXMLNode.m @@ -613,7 +613,7 @@ GS_PRIVATE_INTERNAL(NSXMLNode) xmlNodePtr node = (xmlNodePtr)[self _node]; xmlChar *buf = NULL; xmlDocPtr doc = node->doc; - xmlBufferPtr buffer = NULL; + xmlBufferPtr buffer = xmlBufferCreate(); //NULL; int error = 0; int len = 0; @@ -621,6 +621,7 @@ GS_PRIVATE_INTERNAL(NSXMLNode) buf = buffer->content; len = buffer->size; string = StringFromXMLString(buf,len); + xmlBufferFree(buffer); AUTORELEASE(string); return string;