not getting proper string from xml parsing

耗尽温柔 提交于 2019-12-25 16:51:59

问题


I'm parsing an xml which has data inbetween the tags like "S |nºconta|".I'm saving this as follows

-(void)parser:(NSXMLParser *)parser foundCharacters:(NSString *)string {     
foundText = (NSMutableString *)[string stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
}

Where foundText is NSString. But i'm not getting the complete data as "S |nºconta|" instead i'm getting just "nºconta|" where "S |" characters are removed.

This is the xmlversion: "". S |nºconta|. "Details" is the tag name.Whenever "Details" is encountered i'm taking this to NSMutableString *foundText as given above and adding this back to NSMutableArray.But when it encounters S |nºconta| foundText will have only "nºconta|" leaving "|S"

来源:https://stackoverflow.com/questions/21950788/not-getting-proper-string-from-xml-parsing

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!