I need help to debug my XML parsing please
- by Griffo
I'm parsing this line:
<type>branch</type>
with this code
if ([elementName isEqualToString:@"type"]) {
[currentBranchDictionary setValue:currentText forKey:currentElementName];
}
When I test the value in the type key, it does not contain branch but instead it contains branch\n. Here is the test I'm performing:
if ([[currentBranchDictionary valueForKey:@"type"] isEqualToString:@"branch"]) {
NSLog(@"no new-line");
} else if ([[currentBranchDictionary valueForKey:@"type"] isEqualToString:@"branch\n"]) {
NSLog(@"new-line");
}
this returns the "new-line" output
I don't understand where the carriage return is being added, can anyone help?