mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-22 16:33:29 +00:00
Added -childElement
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@13468 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
4af4bddb56
commit
4eb134c0fb
3 changed files with 24 additions and 2 deletions
|
@ -1,7 +1,8 @@
|
|||
2002-04-12 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* Source/Additions/GSXML.m: New method ([-nextElement]) to traverse
|
||||
tree skipping non-element nodes.
|
||||
tree skipping non-element nodes. Also ([-childElement]) to get the
|
||||
first child element of a node.
|
||||
|
||||
Thu Apr 11 15:34:33 2002 Nicola Pero <n.pero@mi.flashnet.it>
|
||||
|
||||
|
|
|
@ -117,6 +117,7 @@
|
|||
+ (GSXMLNode*) nodeWithNamespace: (GSXMLNamespace*)ns name: (NSString*)name;
|
||||
+ (int) typeFromDescription: (NSString*)desc;
|
||||
|
||||
- (GSXMLNode*) childElement;
|
||||
- (GSXMLNode*) children;
|
||||
- (NSString*) content;
|
||||
- (GSXMLDocument*) doc;
|
||||
|
|
|
@ -747,7 +747,27 @@ static NSMapTable *nodeNames = 0;
|
|||
}
|
||||
|
||||
/**
|
||||
* Return the children of this node
|
||||
* Return the first child element of this node. If you wish to step
|
||||
* through all children of the node (including non-element nodes)
|
||||
* you should use the -children method instead.
|
||||
*/
|
||||
- (GSXMLNode*) childElement
|
||||
{
|
||||
xmlNodePtr ptr = ((xmlNodePtr)lib)->children;
|
||||
|
||||
while (ptr != NULL)
|
||||
{
|
||||
if (ptr->type == XML_ELEMENT_NODE)
|
||||
{
|
||||
return [GSXMLNode nodeFrom: ptr];
|
||||
}
|
||||
ptr = ptr->next;
|
||||
}
|
||||
return nil;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the first child node of this node.
|
||||
* <example>
|
||||
* - (GSXMLNode*) elementRecursive: (GSXMLNode*)node
|
||||
* {
|
||||
|
|
Loading…
Reference in a new issue