Tuesday, 26 July 2011

HTML Agility Pack breaks XHTML

We have some HTML that contains the tag <br /> but when we parse this through the HTML Agility Pack to process the HTML, it converts it to <br>.

The solution to this the following:

var doc = new HtmlDocument();
HtmlNode.ElementsFlags["br"] = HtmlElementFlag.Empty;
doc.OptionWriteEmptyNodes = true;

doc.LoadHtml(html);
//process data
return doc.DocumentNode.OuterHtml;


More can be found on this StackOverflow post

Thursday, 14 July 2011

Compression support not configured

A colleague and I were having to debug an issue with the Lucene search engine. When trying to index data we kept receiving the following error.

Compression support not configured

Further details and the solution is avaliable on my colleagues blog.