Why it convert xhtml to html

Nov 12, 2010 at 2:03 AM

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

Nov 23, 2010 at 5:33 PM

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

Nov 24, 2010 at 4: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 4: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 4: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 4:39 PM

You must to do something like this:

 

HtmlDocument htmlDoc = new HtmlDocument();

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


Jan 13, 2011 at 3:15 PM

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

Jan 20, 2011 at 6:39 PM

jmoreno, thanks

Jan 21, 2011 at 10:37 AM

@xmen, ;-)