-
Notifications
You must be signed in to change notification settings - Fork 35
/
SMXMLDocument.h
50 lines (38 loc) · 1.27 KB
/
SMXMLDocument.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
// Thanks Apple, for not just exposing NSXMLDocument!
#ifdef __IPHONE_4_0
@interface SMXMLElement : NSObject<NSXMLParserDelegate> {
#else
@interface SMXMLElement : NSObject {
#endif
@private
SMXMLElement *parent; // nonretained
NSString *name;
NSMutableString *value;
NSMutableArray *children;
NSDictionary *attributes;
}
@property (nonatomic, assign) SMXMLElement *parent;
@property (nonatomic, copy) NSString *name;
@property (nonatomic, retain) NSString *value;
@property (nonatomic, retain) NSArray *children;
@property (nonatomic, readonly) SMXMLElement *firstChild, *lastChild;
@property (nonatomic, retain) NSDictionary *attributes;
- (SMXMLElement *)childNamed:(NSString *)name;
- (NSArray *)childrenNamed:(NSString *)name;
- (SMXMLElement *)childWithAttribute:(NSString *)attributeName value:(NSString *)attributeValue;
- (NSString *)attributeNamed:(NSString *)name;
- (SMXMLElement *)descendantWithPath:(NSString *)path;
- (NSString *)valueWithPath:(NSString *)path;
@end
#ifdef __IPHONE_4_0
@interface SMXMLDocument : NSObject<NSXMLParserDelegate> {
#else
@interface SMXMLDocument : NSObject {
#endif
@private
SMXMLElement *root;
}
@property (nonatomic, retain) SMXMLElement *root;
- (id)initWithData:(NSData *)data;
+ (SMXMLDocument *)documentWithData:(NSData *)data;
@end