Files
HTMLKit/HTMLKit/HTMLParser.h
T
iska d1a4aeb5e1 Add HTML Parser methods for parsing a document and document fragments
The parser is initialized with a HTML string which can be parsed as a document or a document
fragment. When parsing a fragment a context element should be provided.
It is also possible to parse the same string as a fragment for different context elements. In this case
the parser reset its internal state and runs the parsing algorithm again. Parsing a fragment for the
same context element runs the algorithm only once, since the parser caches the context element
and the parsing results.
2015-04-04 02:30:08 +02:00

23 lines
516 B
Objective-C

//
// HTMLParser.h
// HTMLKit
//
// Created by Iska on 04/10/14.
// Copyright (c) 2014 BrainCookie. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "HTMLElement.h"
@interface HTMLParser : NSObject
@property (nonatomic, strong, readonly) NSArray *parseErrors;
@property (nonatomic, strong, readonly) HTMLDocument *document;
- (instancetype)initWithString:(NSString *)string;
- (HTMLDocument *)parseDocument;
- (NSArray *)parseFragmentWithContextElement:(HTMLElement *)contextElement;
@end