File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed
Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change 5050// class = 'highlight'
5151- (NSDictionary *) attributes ;
5252
53+ // Returns the children of a given node
54+ - (NSArray *) children ;
55+
5356// Provides easy access to the content of a specific attribute,
5457// such as 'href' or 'class'.
5558- (NSString *) objectForKey : (NSString *) theKey ;
Original file line number Diff line number Diff line change 3232
3333static NSString * const TFHppleNodeContentKey = @" nodeContent" ;
3434static NSString * const TFHppleNodeNameKey = @" nodeName" ;
35+ static NSString * const TFHppleNodeChildrenKey = @" nodeChildArray" ;
3536static NSString * const TFHppleNodeAttributeArrayKey = @" nodeAttributeArray" ;
3637static NSString * const TFHppleNodeAttributeNameKey = @" attributeName" ;
3738
@@ -71,6 +72,16 @@ - (NSString *) tagName
7172 return [node objectForKey: TFHppleNodeNameKey];
7273}
7374
75+ - (NSArray *) children
76+ {
77+ NSMutableArray *children = [NSMutableArray array ];
78+ for (NSDictionary *child in [node objectForKey: TFHppleNodeChildrenKey]) {
79+ TFHppleElement *element = [TFHppleElement hppleElementWithNode: child];
80+ [children addObject: element];
81+ }
82+ return children;
83+ }
84+
7485- (NSDictionary *) attributes
7586{
7687 NSMutableDictionary * translatedAttributes = [NSMutableDictionary dictionary ];
You can’t perform that action at this time.
0 commit comments