]> git.saurik.com Git - apple/ld64.git/blob - unit-tests/src/xmlparser/xmlparser.m
ld64-409.12.tar.gz
[apple/ld64.git] / unit-tests / src / xmlparser / xmlparser.m
1 #import <Foundation/Foundation.h>
2
3 int main(int argc, char *argv[]) {
4 [[NSAutoreleasePool alloc] init];
5
6 if(argc != 2) {
7 NSLog(@"Usage: %s path-to-XML\n", argv[0]);
8 return 1;
9 }
10 NSString *path = [NSString stringWithUTF8String:argv[1]];
11
12 NSError *err = nil;
13 NSXMLDocument *doc = [[NSXMLDocument alloc]
14 initWithContentsOfURL:[NSURL
15 fileURLWithPath:path]
16 options:0
17 error:&err];
18 if(err) {
19 NSLog(@"ERROR: %@", err);
20 return 1;
21 } else {
22 NSLog(@"Parsed!");
23 return 0;
24 }
25 }