NSXMLParser not recognizing local xml file <p>I have some code that builds a path to an xml file on a local computer. The path to the XML file is correct but when I convert my path to a URL for parsing purposes it then says the parse is "bad". I am new to objective-C and I am not sure if perhaps because the file extension is not .xml? All the files I am looking for have the extensions listed in my code below. Any help would be greatly appreciated. </p> <pre><code>- (void)parseXMLFile { //Create path to users motion files. NSString *beginning = @"/Users/"; NSString *user = NSUserName(); NSString *docPath =@"/myLocalPath/"; NSString *combined = [NSString stringWithFormat:@"%@%@%@", beginning, user, docPath]; NSDirectoryEnumerator *dirEnum = [[NSFileManager defaultManager] enumeratorAtPath:combined]; NSString *filename; NSMutableArray *motionPaths = nil; while ((filename = [dirEnum nextObject])) { if([[filename pathExtension] compare: @"moti"] == NSOrderedSame || [[filename pathExtension] compare: @"moef"] == NSOrderedSame || [[filename pathExtension] compare: @"motr"] == NSOrderedSame || [[filename pathExtension] compare: @"motn"] == NSOrderedSame) { NSString *fullPath = [NSString stringWithFormat:@"%@%@", combined, filename]; motionPaths = [NSMutableArray new]; [motionPaths addObject:fullPath]; NSLog(@"First Motion File Path: %@",[motionPaths firstObject]); NSURL *url = [NSURL URLWithString:[[motionPaths firstObject] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]]; self.parser = [[NSXMLParser alloc] initWithContentsOfURL:url]; self.parser.delegate = self; [self.parser parse]; NSLog(@"%@", url); NSLog( @"XML file was %@.", [self.parser parse] ? @"good" : @"bad" ); } } } </code></pre>