]> git.saurik.com Git - apple/ld64.git/blame - unit-tests/src/xmlparser/xmlparser.m
ld64-84.1.2.tar.gz
[apple/ld64.git] / unit-tests / src / xmlparser / xmlparser.m
CommitLineData
a61fdf0a
A
1#import <Foundation/Foundation.h>\r
2\r
3int 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