mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 08:21:25 +00:00
support creating PI and Comment nodes; implemented attributes method in NSXMLElement
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/branches/nsxml_using_libxml2@34520 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
e395d2f42a
commit
d43aa730a1
2 changed files with 21 additions and 7 deletions
|
@ -57,7 +57,8 @@ void clearPrivatePointers(xmlNodePtr aNode)
|
|||
|
||||
- (void) _setNode: (void *)_anode
|
||||
{
|
||||
((xmlNodePtr)_anode)->_private = self;
|
||||
if (_anode)
|
||||
((xmlNodePtr)_anode)->_private = self;
|
||||
internal->node = _anode;
|
||||
}
|
||||
|
||||
|
@ -68,7 +69,6 @@ void clearPrivatePointers(xmlNodePtr aNode)
|
|||
if (node)
|
||||
{
|
||||
xmlElementType type = node->type;
|
||||
xmlChar *name = NULL;
|
||||
// NSXMLNodeKind kind = 0;
|
||||
result = node->_private;
|
||||
|
||||
|
@ -78,15 +78,18 @@ void clearPrivatePointers(xmlNodePtr aNode)
|
|||
switch(type)
|
||||
{
|
||||
case(XML_DOCUMENT_NODE):
|
||||
name = (xmlChar *)node->name;
|
||||
result = [[self alloc] initWithKind: NSXMLDocumentKind];
|
||||
break;
|
||||
case(XML_ELEMENT_NODE):
|
||||
name = (xmlChar *)node->name;
|
||||
result = [[self alloc] initWithKind: NSXMLElementKind];
|
||||
break;
|
||||
case(XML_PI_NODE):
|
||||
result = [[self alloc] initWithKind: NSXMLProcessingInstructionKind];
|
||||
break;
|
||||
case(XML_COMMENT_NODE):
|
||||
result = [[self alloc] initWithKind: NSXMLCommentKind];
|
||||
break;
|
||||
case(XML_ATTRIBUTE_NODE):
|
||||
name = (xmlChar *)node->name;
|
||||
result = [[self alloc] initWithKind: NSXMLAttributeKind];
|
||||
[result setStringValue: StringFromXMLStringPtr(node->content)];
|
||||
break;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue