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 __SaxMethodCallHandler_H__
23 #define __SaxMethodCallHandler_H__
25 #include <SaxObjC/SaxDefaultHandler.h>
26 #import <Foundation/NSMapTable.h>
28 @class NSString, NSMutableArray, NSMutableDictionary;
31 [also take a look at SaxObjectDecoder]
33 This handler calls a method on a delegate for each tag. The selector is
36 [start|end] + nskey + tagname + ':'
38 If no method could be found for the tag, it is first checked whether the
41 [start|end] + nskey + 'unknownTag:attributes:'
43 and it this couldn't be found, it is checked for
45 [start|end] + 'tag:_tagName namespace:_ns attributes:'
47 If no key could be found for a namespace, it is first checked whether the
50 [start|end] + 'any_' + tagname + ':'
52 if this fails it is checked for this selector
54 [start|end] + 'tag:_tagName namespace:_ns attributes:'
56 if neither exists, the tag is ignored.
60 nskey='xhtml' startKey='start_' endKey='end_'
61 - (void)start_xhtml_br:(id<SaxAttributes>)_attrs;
65 @interface SaxMethodCallHandler : SaxDefaultHandler
67 id delegate; // non-retained: default=self (for subclasses)
68 NSMutableDictionary *namespaceToKey;
69 NSMutableArray *tagStack;
70 NSString *startKey; // default: 'start_'
71 NSString *endKey; // default: 'end_'
72 NSString *unknownNamespaceKey; // default: 'any_'
76 NSMapTable *fqNameToStartSel;
77 NSMutableString *selName; /* reused for each construction */
82 - (void)registerNamespace:(NSString *)_namespace withKey:(NSString *)_key;
86 - (void)setStartKey:(NSString *)_s;
87 - (NSString *)startKey;
88 - (void)setEndKey:(NSString *)_s;
90 - (void)setUnknownNamespaceKey:(NSString *)_s;
91 - (NSString *)unknownNamespaceKey;
95 - (NSArray *)tagStack;
98 - (void)ignoreChildren;
99 - (BOOL)doesIgnoreChildren;
103 - (void)setDelegate:(id)_delegate;
108 #endif /* __SaxMethodCallHandler_H__ */