我在 iPhone 应用程序中解析 xml 时遇到一些问题。以下是我想使用标准 NSXMLParser
解析器解析的 xml 代码的一部分。
<item>
<title>AMNews: Facebook & Twitter Updates Might Lead To Burglary, Oldham School Violates DPA, Amazon Cloud “Burstsâ€</title>
<link>http://www.itproportal.com/2011/04/22/amnews-facebook-twitter-updates-might-lead-to-burglary-oldham-school-violates-dpa-amazon-cloud-bursts/</link>
<description>People announcing their holiday plans on social networking platforms like Facebook and Twitter are putting themselves at risks from thieves and burglars. A new study ha</description>
<author>ravimandalia@itproportal.com (Ravi Mandalia)</author>
<pubDate>Fri, 22 Apr 2011 08:19:36 +0100</pubDate>
<guid>http://cdn.itproportal.com/photos/facebook-logo-4_thumb80x80.png</guid>
</item>
如何查看
<title>AMNews: Facebook & Twitter Updates Might Lead To Burglary, Oldham School Violates DPA, Amazon Cloud “Burstsâ€</title>
标题标 checkout 现一些奇怪的符号“–”“–”。在函数中
- (void)parser:(NSXMLParser *)parser foundCharacters:(NSString *)string;
我正在尝试获取标题并保存它,但我的解析器工作错误。解析器仅接受“–”符号之后的文本!!!
我能做什么,有人可以告诉我 parse 会发生什么吗?非常感谢!!!
最佳答案
您能否向我们展示您的 -parser:foundCharacters:
实现?如何存储字符串
?
我也曾经在 XML 文件中使用过带有特殊字符的 NSXMLParser
,并且它运行没有问题。
关于iphone - NSXMLParser 对于像“这样的符号”工作不正确,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5755011/