Guest User

Untitled

a guest
May 4th, 2012
32
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. Special characters in XML attributes with NSXMLParser
  2. <el attr="test.
  3.  
  4. another test." />
  5.  
  6. NSData *xmlData = [NSData dataWithContentsOfURL:[NSURL URLWithString:@"url://"]];
  7. NSMutableString *myXmlStr = [[NSMutableString alloc] initWithData:xmlData encoding:NSUTF8StringEncoding];
  8. NSRange range = [myXmlStr rangeOfString:@"n"];
  9. [myXmlStr replaceCharactersInRange:range withString:@"[:newline:]"];
  10. NSData *newXmlData = [myXmlStr dataUsingEncoding:NSUTF8StringEncoding];
Advertisement
Add Comment
Please, Sign In to add comment