// // HTMLNode.h // StackOverflow // // Created by Ben Reeves on 09/03/2010. // Copyright 2010 Ben Reeves. All rights reserved. // #import #import #import "HTMLParser.h" @class HTMLParser; #define ParsingDepthUnlimited 0 #define ParsingDepthSame -1 #define ParsingDepth size_t typedef enum { HTMLHrefNode, HTMLTextNode, HTMLUnkownNode, HTMLCodeNode, HTMLSpanNode, HTMLPNode, HTMLLiNode, HTMLUlNode, HTMLImageNode, HTMLOlNode, HTMLStrongNode, HTMLPreNode, HTMLBlockQuoteNode, } HTMLNodeType; @interface HTMLNode : NSObject { @public xmlNode * _node; } //Init with a lib xml node (shouldn't need to be called manually) //Use [parser doc] to get the root Node -(id)initWithXMLNode:(xmlNode*)xmlNode; //Returns a single child of class -(HTMLNode*)findChildOfClass:(NSString*)className; //Returns all children of class -(NSArray*)findChildrenOfClass:(NSString*)className; //Finds a single child with a matching attribute //set allowPartial to match partial matches //e.g.