我消耗了RSS源,并在文档中包含特殊字符»加载XML文档失败,特殊字符»
我猜饲料不正确编码,但我不能改变的。我想重写一下,或者只是用友好的东西替换冒犯的字符。
using (Stream stream = response.GetResponseStream())
{
using (XmlReader reader = XmlReader.Create(stream))
{
try
{
XmlDocument xmlDoc = new XmlDocument();
xmlDoc.Load(reader); //<--- FAILS HERE
//parse the items of the feed
...
你可以检查这个帖子 [http://stackoverflow.com/questions/700686/an-error-occurred-while-parsing-entityname](http://stackoverflow.com/questions/700686/an-error-occurrence-while-parsing-entityname) – 2011-01-11 16:11:06