mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-25 01:31:08 +00:00
fix rootElement
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/branches/nsxml_using_libxml2@34522 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
70b79c28fc
commit
25ffa3ff82
2 changed files with 7 additions and 4 deletions
|
@ -38,6 +38,9 @@ extern void clearPrivatePointers(xmlNodePtr aNode);
|
|||
@interface NSXMLNode (Private)
|
||||
- (void *) _node;
|
||||
- (void) _setNode: (void *)_anode;
|
||||
+ (NSXMLNode *) _objectForNode: (xmlNodePtr)node;
|
||||
- (void) _addSubNode:(NSXMLNode *)subNode;
|
||||
- (void) _removeSubNode:(NSXMLNode *)subNode;
|
||||
@end
|
||||
|
||||
@implementation NSXMLDocument
|
||||
|
@ -180,8 +183,8 @@ extern void clearPrivatePointers(xmlNodePtr aNode);
|
|||
|
||||
- (NSXMLElement*) rootElement
|
||||
{
|
||||
xmlNodePtr node = xmlDocGetRootElement(MY_DOC);
|
||||
return (NSXMLElement *)(node->_private);
|
||||
xmlNodePtr rootElem = xmlDocGetRootElement(MY_DOC);
|
||||
return (NSXMLElement *)[NSXMLNode _objectForNode:rootElem];
|
||||
}
|
||||
|
||||
- (void) setCharacterEncoding: (NSString*)encoding
|
||||
|
|
|
@ -78,10 +78,10 @@ void clearPrivatePointers(xmlNodePtr aNode)
|
|||
switch(type)
|
||||
{
|
||||
case(XML_DOCUMENT_NODE):
|
||||
result = [[self alloc] initWithKind: NSXMLDocumentKind];
|
||||
result = [[NSXMLDocument alloc] initWithKind: NSXMLDocumentKind];
|
||||
break;
|
||||
case(XML_ELEMENT_NODE):
|
||||
result = [[self alloc] initWithKind: NSXMLElementKind];
|
||||
result = [[NSXMLElement alloc] initWithKind: NSXMLElementKind];
|
||||
break;
|
||||
case(XML_TEXT_NODE):
|
||||
result = [[self alloc] initWithKind: NSXMLTextKind];
|
||||
|
|
Loading…
Reference in a new issue