Hi everybody,
I don't know if someone has encountered this problem.
I'm trying to parse an xml file from the Documents Directory of my app and it crash. I use NSXMLParser and when i try to parse it, i've the NSXMLParserTagNameMismatchError, i don't know why because i can parse the same xml file when the xml file is in the Bundle.
Here is my code :
NSData *dataTest = (NSData*)[[NSFileManager defaultManager]contentsAtPath:[self DocumentDirectory:@"myFile.xml"]];
NSXMLParser *parser = [[NSXMLParser alloc] initWithData:dataTest];
And the DocumentDirectory function :
-(NSString *)DocumentDirectory

NSString *)relPath
{
NSArray *docPaths = NSSearchPathForDirectoriesInDomains(NSDocumentDire ctory, NSUserDomainMask, YES);
NSString *path = [docPaths objectAtIndex: 0];
if (relPath != nil )
path = [path stringByAppendingPathComponent: relPath];
NSLog(@"Path = %@", path);
return path;
}
Best Regards,
NosProduction