2 Copyright (C) 2000-2003 SKYRIX Software AG
4 This file is part of OGo
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 __SaxAttributes_H__
24 #define __SaxAttributes_H__
26 #import <Foundation/NSObject.h>
28 @class NSString, NSArray, NSMutableArray, NSDictionary;
31 new in SAX 2.0beta, replaces the SaxAttributeList
34 @protocol SaxAttributes
38 - (unsigned int)indexOfRawName:(NSString *)_rawName;
39 - (unsigned int)indexOfName:(NSString *)_localPart uri:(NSString *)_uri;
41 /* lookup data by index */
43 - (NSString *)nameAtIndex:(unsigned int)_idx;
44 - (NSString *)rawNameAtIndex:(unsigned int)_idx;
45 - (NSString *)typeAtIndex:(unsigned int)_idx;
46 - (NSString *)uriAtIndex:(unsigned int)_idx;
47 - (NSString *)valueAtIndex:(unsigned int)_idx;
49 /* lookup data by name */
51 - (NSString *)typeForRawName:(NSString *)_rawName;
52 - (NSString *)typeForName:(NSString *)_localName uri:(NSString *)_uri;
53 - (NSString *)valueForRawName:(NSString *)_rawName;
54 - (NSString *)valueForName:(NSString *)_localName uri:(NSString *)_uri;
58 - (unsigned int)count;
62 /* simple attributes implementation, should be improved */
64 @interface SaxAttributes : NSObject < SaxAttributes, NSCopying >
67 NSMutableArray *names;
69 NSMutableArray *rawNames;
70 NSMutableArray *types;
71 NSMutableArray *values;
74 - (id)initWithAttributes:(id<SaxAttributes>)_attrs;
75 - (id)initWithDictionary:(NSDictionary *)_dict;
77 - (void)addAttribute:(NSString *)_localName uri:(NSString *)_uri
78 rawName:(NSString *)_rawName
79 type:(NSString *)_type
80 value:(NSString *)_value;
86 #include <SaxObjC/SaxAttributeList.h>
88 @interface SaxAttributes(Compatibility)
89 - (id)initWithAttributeList:(id<SaxAttributeList>)_attrList;
92 #endif /* __SaxAttributes_H__ */