Xml 我从下面的代码块中得到了以下异常。错误显示在第79行

Xml 我从下面的代码块中得到了以下异常。错误显示在第79行,xml,Xml,我的网站未显示,显示以下错误。它是由不正确的字符引起的吗 An error occurred while parsing EntityName. Line 2, position 1537. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about th

我的网站未显示,显示以下错误。它是由不正确的字符引起的吗

An error occurred while parsing EntityName. Line 2, position 1537.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Xml.XmlException: An error occurred while parsing EntityName. Line 2, position 1537.

Source Error:


Line 77:                 If strXML <> "" Then
Line 78:                     Dim rssDoc As New XmlDocument
Line 79:                     rssDoc.LoadXml(strXML)
Line 80: 
Line 81:                     Call Me.DateUpdated_Reset()



Stack Trace:


[XmlException: An error occurred while parsing EntityName. Line 2, position 1537.]
   System.Xml.XmlTextReaderImpl.Throw(Exception e) +76
   System.Xml.XmlTextReaderImpl.Throw(String res, String arg) +127
   System.Xml.XmlTextReaderImpl.ParseEntityName() +129
   System.Xml.XmlTextReaderImpl.ParseEntityReference() +50
   System.Xml.XmlTextReaderImpl.Read() +623
   System.Xml.XmlLoader.LoadNode(Boolean skipOverWhitespace) +786
   System.Xml.XmlLoader.LoadDocSequence(XmlDocument parentDoc) +53
   System.Xml.XmlLoader.Load(XmlDocument doc, XmlReader reader, Boolean preserveWhitespace) +171
   System.Xml.XmlDocument.Load(XmlReader reader) +109
   System.Xml.XmlDocument.LoadXml(String xml) +113
分析EntityName时出错。第2行,1537号位置。 描述:执行当前web请求期间发生未处理的异常。请查看堆栈跟踪以了解有关错误的更多信息以及错误在代码中的起源。 异常详细信息:System.Xml.XmlException:分析EntityName时出错。第2行,1537号位置。 源错误: 第77行:如果strXML为“”,则 第78行:将rssDoc标注为新的XML文档 第79行:rssDoc.LoadXml(strXML) 第80行: 第81行:给我打电话。DateUpdated_Reset() 堆栈跟踪: [XmlException:分析EntityName时出错。第2行,位置1537。] System.Xml.XmlTextReaderImpl.Throw(异常e)+76 System.Xml.XmlTextReaderImpl.Throw(stringres,stringarg)+127 System.Xml.XmlTextReaderImpl.ParseEntityName()+129 System.Xml.XmlTextReaderImpl.ParseEntityReference()+50 System.Xml.XmlTextReaderImpl.Read()+623 System.Xml.xmloader.LoadNode(布尔skipOverWhitespace)+786 System.Xml.xmloader.LoadDocSequence(XmlDocument parentDoc)+53 System.Xml.xmloader.Load(XmlDocument文档、XmlReader读取器、布尔值保留空格)+171 System.Xml.XmlDocument.Load(XmlReader)+109 System.Xml.XmlDocument.LoadXml(字符串Xml)+113
感谢您提供的帮助

您看过这篇帖子吗:谢谢。我确实看到了那篇文章,但我无法将解决方案与我的问题联系起来。这显然是同一件事吗?您应该向我们展示您的XML文档,特别是您收到的错误消息中所述的
第2行1537
位置周围的区域。XML必须格式不正确,或者在某个地方有特殊字符,但没有正确转义。您解决了问题吗?如果没有,请尝试发布您正在读取的xml字符串,这将导致此错误,以便我们可以更好地帮助您。