2 Copyright (C) 2000-2005 SKYRIX Software AG
4 This file is part of SOPE.
6 SOPE is free software; you can redistribute it and/or modify it under
7 the terms of the GNU Lesser General Public License as published by the
8 Free Software Foundation; either version 2, or (at your option) any
11 SOPE is distributed in the hope that it will be useful, but WITHOUT ANY
12 WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
14 License for more details.
16 You should have received a copy of the GNU Lesser General Public
17 License along with SOPE; see the file COPYING. If not, write to the
18 Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
22 #ifndef __WOHTMLParser_H__
23 #define __WOHTMLParser_H__
25 #import <Foundation/NSObject.h>
30 This parser parses "old-style" .wo templates. It does *not* process the
31 whole HTML of the file, it only searches for text sections which start
32 with "<#". That way you can process "illegal" HTML code, eg:
34 <a href="<#MyLink" />"> ...
37 <#wod-name>...</#wod-name>
40 @class NSString, NSDictionary, NSArray, NSException, NSData;
43 @protocol WOHTMLParserHandler
45 - (BOOL)parser:(id)_parser willParseHTMLData:(NSData *)_data;
46 - (void)parser:(id)_parser finishedParsingHTMLData:(NSData *)_data
47 elements:(NSArray *)_elements;
48 - (void)parser:(id)_parser failedParsingHTMLData:(NSData *)_data
49 exception:(NSException *)_exception;
51 - (WOElement *)dynamicElementWithName:(NSString *)_element
52 attributes:(NSDictionary *)_attributes // not the associations !
53 contentElements:(NSArray *)_subElements;
57 @interface WOHTMLParser : NSObject
59 id<NSObject,WOHTMLParserHandler> callback;
60 NSException *parsingException;
63 - (id)initWithHandler:(id<NSObject,WOHTMLParserHandler>)_handler;
67 - (NSException *)parsingException;
71 - (NSArray *)parseHTMLData:(NSData *)_html;
75 #endif /* __WOHTMLParser_H__ */