2 Copyright (C) 2000-2004 SKYRIX Software AG
4 This file is part of OpenGroupware.org.
6 OGo 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 OGo 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 OGo; see the file COPYING. If not, write to the
18 Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
23 #ifndef __WOHTMLParser_H__
24 #define __WOHTMLParser_H__
26 #import <Foundation/NSObject.h>
31 This parser parses "old-style" .wo templates. It does *not* process the
32 whole HTML of the file, it only searches for text sections which start
33 with "<#". That way you can process "illegal" HTML code, eg:
35 <a href="<#MyLink" />"> ...
38 <#wod-name>...</#wod-name>
41 @class NSString, NSDictionary, NSArray, NSException, NSData;
44 @protocol WOHTMLParserHandler
46 - (BOOL)parser:(id)_parser willParseHTMLData:(NSData *)_data;
47 - (void)parser:(id)_parser finishedParsingHTMLData:(NSData *)_data
48 elements:(NSArray *)_elements;
49 - (void)parser:(id)_parser failedParsingHTMLData:(NSData *)_data
50 exception:(NSException *)_exception;
52 - (WOElement *)dynamicElementWithName:(NSString *)_element
53 attributes:(NSDictionary *)_attributes // not the associations !
54 contentElements:(NSArray *)_subElements;
58 @interface WOHTMLParser : NSObject
60 id<NSObject,WOHTMLParserHandler> callback;
61 NSException *parsingException;
64 - (id)initWithHandler:(id<NSObject,WOHTMLParserHandler>)_handler;
68 - (NSException *)parsingException;
72 - (NSArray *)parseHTMLData:(NSData *)_html;
76 #endif /* __WOHTMLParser_H__ */