I have an HTML form that I am trying to load using XDocument.Load and I get the following error:
' ' is an unexpected token. The expected token is ';'. Line 1257, position 66. at System.Xml.XmlTextReaderImpl.Throw(Exception e)
The code simply calls the following:
XDocument xmlDoc = XDocument.Load(pageData.Stream);
pageData is a custom object from another system that spills out a stream of data. I exported xml back to the string, and it looks fine.
When I check this line for HTML, it is just the closing tag for the element. How reliable is the line / position given by xml exception? I just dump the form source into notepad ++ for validation, and I don't see that this will be a problem.
EDIT: Below are the first few lines before and after the error. I marked a line with an error.
</p> </td> </tr> </table> </td> </tr> <----Error Line <tr> <td> <div id="BusinessJustificationForm"> <table id="BusinessJustificationTable"> <tr> <td class="seperator" colspan="7">
source share