Why it convert xhtml to html

Nov 12, 2010 at 1:03 AM

when the input has <br/> it will be returned as <br>...duh

Nov 23, 2010 at 4:33 PM

I have the same problem. Did you find any solution to this problem?

Nov 24, 2010 at 3:11 PM
nordquist wrote:

I have the same problem. Did you find any solution to this problem?

 

  haha yes, replace <br> with <br/>

Nov 24, 2010 at 3:35 PM

Where does this replacement take place?

This is what I do:

HtmlDocument doc = new HtmlDocument();
doc.Load(url);
doc.GetElementbyId("elementId").InnerHtml = "<br/>";

This is where <br/> changes into <br>.

Nov 24, 2010 at 3:53 PM
nordquist wrote:

Where does this replacement take place?

This is what I do:

HtmlDocument doc = new HtmlDocument();
doc.Load(url);
doc.GetElementbyId("elementId").InnerHtml = "<br/>";

This is where <br/> changes into <br>.

I was talking about the document output after removing some tags.

Jan 11, 2011 at 3:39 PM

You must to do something like this:

 

HtmlDocument htmlDoc = new HtmlDocument();

htmlDoc.OptionWriteEmptyNodes = true;
htmlDoc.Load(url);


Jan 13, 2011 at 2:15 PM

Huh, that's this magical OptionWriteEmptyNodes for...

Jan 20, 2011 at 5:39 PM

jmoreno, thanks

Jan 21, 2011 at 9:37 AM

@xmen, ;-)