我消耗了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