我有一个HTML表单,正在尝试使用XDocument.Load加载它,但是我收到了以下错误:
' ' is an unexpected token. The expected token is ';'. Line 1257, position 66.
at System.Xml.XmlTextReaderImpl.Throw(Exception e)
代码只是调用以下内容:XDocument xmlDoc = XDocument.Load(pageData.Stream);
pageData是来自其他系统的自定义对象,它会输出一个数据流。我已经让它将XML导出到字符串中,并且看起来很好。
当我检查HTML上的那一行时,它只是一个元素的闭合标签。XML异常给出的行/位置有多可靠?我只是将表单的源代码倒入notepad++进行验证,我看不出会有什么问题。
编辑: 以下是错误之前和之后的前几行。我已标记错误行。
</p>
</td>
</tr>
</table>
</td>
</tr> <----Error Line
<tr>
<td>
<div id="BusinessJustificationForm">
<table id="BusinessJustificationTable">
<tr>
<td class="seperator" colspan="7">