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 __SaxAttributes_H__
23 #define __SaxAttributes_H__
25 #import <Foundation/NSObject.h>
27 @class NSString, NSArray, NSMutableArray, NSDictionary;
30 new in SAX 2.0beta, replaces the SaxAttributeList
33 @protocol SaxAttributes
37 - (unsigned int)indexOfRawName:(NSString *)_rawName;
38 - (unsigned int)indexOfName:(NSString *)_localPart uri:(NSString *)_uri;
40 /* lookup data by index */
42 - (NSString *)nameAtIndex:(unsigned int)_idx;
43 - (NSString *)rawNameAtIndex:(unsigned int)_idx;
44 - (NSString *)typeAtIndex:(unsigned int)_idx;
45 - (NSString *)uriAtIndex:(unsigned int)_idx;
46 - (NSString *)valueAtIndex:(unsigned int)_idx;
48 /* lookup data by name */
50 - (NSString *)typeForRawName:(NSString *)_rawName;
51 - (NSString *)typeForName:(NSString *)_localName uri:(NSString *)_uri;
52 - (NSString *)valueForRawName:(NSString *)_rawName;
53 - (NSString *)valueForName:(NSString *)_localName uri:(NSString *)_uri;
57 - (unsigned int)count;
61 /* simple attributes implementation, should be improved */
63 @interface SaxAttributes : NSObject < SaxAttributes, NSCopying >
66 NSMutableArray *names;
68 NSMutableArray *rawNames;
69 NSMutableArray *types;
70 NSMutableArray *values;
73 - (id)initWithAttributes:(id<SaxAttributes>)_attrs;
74 - (id)initWithDictionary:(NSDictionary *)_dict;
76 - (void)addAttribute:(NSString *)_localName uri:(NSString *)_uri
77 rawName:(NSString *)_rawName
78 type:(NSString *)_type
79 value:(NSString *)_value;
85 #include <SaxObjC/SaxAttributeList.h>
87 @interface SaxAttributes(Compatibility)
88 - (id)initWithAttributeList:(id<SaxAttributeList>)_attrList;
91 #endif /* __SaxAttributes_H__ */