mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-29 16:01:38 +00:00
for documents, use children of rootElement; fix XMLStringWithOptions:
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/branches/nsxml_using_libxml2@34511 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
5667bb4af7
commit
eaa49d6e39
1 changed files with 7 additions and 1 deletions
|
@ -251,6 +251,8 @@ GS_PRIVATE_INTERNAL(NSXMLNode)
|
|||
NSUInteger count = 0;
|
||||
xmlNodePtr children = NULL;
|
||||
xmlNodePtr node = (xmlNodePtr)(internal->node);
|
||||
if (node->type == XML_DOCUMENT_NODE)
|
||||
node = xmlDocGetRootElement((xmlDocPtr)node);
|
||||
|
||||
for (children = node->children; children && count != index; children = children->next)
|
||||
{
|
||||
|
@ -265,6 +267,8 @@ GS_PRIVATE_INTERNAL(NSXMLNode)
|
|||
NSUInteger childCount = 0;
|
||||
xmlNodePtr children = NULL;
|
||||
xmlNodePtr node = (xmlNodePtr)(internal->node);
|
||||
if (node->type == XML_DOCUMENT_NODE)
|
||||
node = xmlDocGetRootElement((xmlDocPtr)node);
|
||||
|
||||
for (children = node->children; children; children = children->next)
|
||||
{
|
||||
|
@ -279,6 +283,8 @@ GS_PRIVATE_INTERNAL(NSXMLNode)
|
|||
NSMutableArray *childrenArray = [NSMutableArray array];
|
||||
xmlNodePtr children = NULL;
|
||||
xmlNodePtr node = (xmlNodePtr)(internal->node);
|
||||
if (node->type == XML_DOCUMENT_NODE)
|
||||
node = xmlDocGetRootElement((xmlDocPtr)node);
|
||||
|
||||
for (children = node->children; children; children = children->next)
|
||||
{
|
||||
|
@ -619,7 +625,7 @@ GS_PRIVATE_INTERNAL(NSXMLNode)
|
|||
|
||||
error = xmlNodeDump(buffer, doc, node, 1, 1);
|
||||
buf = buffer->content;
|
||||
len = buffer->size;
|
||||
len = buffer->use;
|
||||
string = StringFromXMLString(buf,len);
|
||||
xmlBufferFree(buffer);
|
||||
AUTORELEASE(string);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue