-
Notifications
You must be signed in to change notification settings - Fork 197
Open
Description
-(NSArray *)childrenAtIndexes:(NSIndexSet *)indexes {
NSMutableArray *mutableChildren = [NSMutableArray array];
xmlNodePtr cursor = self.xmlNode->children;
NSUInteger idx = 0;
while (cursor) {
if ([indexes containsIndex:idx] && cursor->type == XML_ELEMENT_NODE) {
[mutableChildren addObject:[self.document elementWithNode:cursor]];
}
cursor = cursor->next;
idx++;
}
return [NSArray arrayWithArray:mutableChildren];
}
According to the above code I get child node must be element nodes, but also I think text node's child nodes.
Namely:
if ([indexes containsIndex:idx] && (cursor->type == XML_ELEMENT_NODE || cursor->type == XML_TEXT_NODE)) { [mutableChildren addObject:[self.document elementWithNode:cursor]]; }
Metadata
Metadata
Assignees
Labels
No labels