1
Vote

help me,serious bug

description

The following is the content of my page:
<html>
<head> </head> <body>
<div class='content'> this is a p<0.6 page! </div> </body>
</html>
 
The code fragment is as follows:
         HtmlAgilityPack.HtmlDocument doc = new HtmlAgilityPack.HtmlDocument();
        doc.OptionAutoCloseOnEnd = false;
        doc.OptionCheckSyntax = false;
        doc.OptionFixNestedTags = false;
        doc.LoadHtml(html);
       HtmlAgilityPack.HtmlNodeCollection htmlnodecols = doc.DocumentNode.SelectNodes("//div");
       string result=htmlnodecols[0].OuterHtml;
 
Returns the result:
<div class='content'>this is a p<0.6 page!=""></0.6></div> This result is wrong, the correct result should be:
<div class='content'>this is a p<0.6 page!</div>  
Please help me how to solve this problem, thank you

comments

Kir_Privalov wrote Jun 11, 2012 at 9:04 PM

Maybe, the HTML Eskulap can help you. http://sgmleskulapnet.codeplex.com/downloads/get/373048

simonm wrote Jun 15, 2012 at 9:32 AM

Your input is wrong HTML, it should be "this is a p<0.5". Results are unpredictable when HTML input is wrong.