I have been trying to use the HTML Agility Pack to parse HTML into valid XHTML to go into a larger XML file. This for the most part works however lists become formatted like:
<ul>
<li>item1
<li>item2
</li></li>
</ul>
As oppose to what I would expect:
<ul>
<li>item1</li>
<li>item2</li>
</ul>
Unfortunately this format with nested li tags doesn’t pass the schema validation which I have no control over. Does anyone know a simple way to correct this either through the HTML Agility Pack or an alternative. Preferably in .NET.
I found an alternative to the agility pack called HTML Tidy http://tidy.sourceforge.net/ I actually used the .NET port called Tidy.NET http://sourceforge.net/projects/tidynet/ this seemed to fix my issue.