0

Problem 1: Has anyone worked with TouchXML, I am facing problem parcing rssfeed that has characters like & or even & The parser takes the url as input and doesn’t seem to parse the XML content. NSXMLParser has no such problem for the same feed URL. Problem 2: Another problem with NSXMLParse is when the foundCharacter() method finds “\n” even the call like

if([currentElementValue isEqualToString:@"\n"])
return;

currentElementValue = [currentElementValue stringByReplacingOccurrencesOfString:@"\n" withString:@""];

both these lines doesn’t seem to eliminate the \n character.

Any help guys ?

Pankaj Kainthla
  • 2,439
  • 5
  • 31
  • 61

1 Answers1

0

You need to escape the newline character sequence

The XML has a "\n" in it as a string, but your line above is looking for the bytecode (0x0A I think) that is a newline character in OSX.

You need to look for "\\n" which is the character sequence backslash-n.

[currentElementValue stringByReplacingOccurrencesOfString:@"\\n" withString:@""]

Will get you what you want!

Luke
  • 2,562
  • 1
  • 18
  • 35