]>
Commit | Line | Data |
---|---|---|
a61fdf0a A |
1 | #import <Foundation/Foundation.h>\r |
2 | \r | |
3 | int main(int argc, char *argv[]) {\r | |
4 | [[NSAutoreleasePool alloc] init];\r | |
5 | \r | |
6 | if(argc != 2) {\r | |
7 | NSLog(@"Usage: %s path-to-XML\n", argv[0]);\r | |
8 | return 1;\r | |
9 | }\r | |
10 | NSString *path = [NSString stringWithUTF8String:argv[1]];\r | |
11 | \r | |
12 | NSError *err = nil;\r | |
13 | NSXMLDocument *doc = [[NSXMLDocument alloc]\r | |
14 | initWithContentsOfURL:[NSURL\r | |
15 | fileURLWithPath:path]\r | |
16 | options:0\r | |
17 | error:&err];\r | |
18 | if(err) {\r | |
19 | NSLog(@"ERROR: %@", err);\r | |
20 | return 1;\r | |
21 | } else {\r | |
22 | NSLog(@"Parsed!");\r | |
23 | return 0;\r | |
24 | }\r | |
25 | }\r |