The input string is
<path>a & b</path>
and my Objective C parser code is
- (void) parser:(NSXMLParser *)parser
foundCharacters:(NSString *)string {
...
if(parserState==EXPECT_PATH) {
NSLog(@"got %@", string);
}
...
}
This prints got a
instead of got a & b
parser:foundCharacters:
can be called multiple times for one element's contents. It is your responsibility to append all characters from multiple runs of the method to one string.So unless you can confirm that
parser:foundCharacters:
doesn't get called again right after the first run, this is expected behavior.