Permalink
Browse files

Merge branch 'master' of git@github.com:Objective3/ElementParser

  • Loading branch information...
2 parents 1ed46e1 + 17bcd09 commit f61be404569ce37be638dade18149c010548ed6c Jeremy Ellison committed Aug 9, 2009
Showing with 15 additions and 0 deletions.
  1. +5 −0 Classes/Element.h
  2. +10 −0 Classes/Element.m
View
@@ -159,6 +159,11 @@
*/
-(NSArray*)childElements;
+/**
+ * An array of child Elements in document order
+ */
+-(NSArray*)syblingElements;
+
/**
* The first child Element for this element (or nil if none).
View
@@ -229,6 +229,16 @@ -(NSArray*)childElements{
return kids;
}
+-(NSArray*)syblingElements{
+ NSMutableArray* syblings = [NSMutableArray array];
+ Element* e = self;
+ while (e){
+ [syblings addObject: e];
+ e = e.nextSybling;
+ }
+ return syblings;
+}
+
-(NSDictionary*)contentsOfChildren{
NSMutableDictionary* result = [NSMutableDictionary dictionary];
Element* e = [self firstChild];

0 comments on commit f61be40

Please sign in to comment.