Html Agility Pack xPath issue
See the question and my original answer on StackOverflowThis is because the FORM tag has a special treatment by the HTML Agility Pack. The reasons are described here: HtmlAgilityPack -- Does <form> close itself for some reason?
So, you basically need to remove that special treatment, like this (must happen before any load):
// instruct the library to treat FORM like any other tag
HtmlNode.ElementsFlags.Remove("form");
HtmlDocument l_missionsDoc = new HtmlDocument();
l_missionsDoc.Load(l_stream);
XPathNavigator l_navigator = l_missionsDoc.CreateNavigator();
XPathNodeIterator l_iterator = l_navigator.Select("//form[@id='formliste']/table");
if (l_iterator.Count <= 0) continue;