some XPath problem or feature :)

Topics: User Forum
Jan 11, 2007 at 6:54 PM
Examle:
//...some precode
HtmlNode nc = doc.DocumentNode.SelectSingleNode("//option@value='a'/@value");
bool isAllWorkGood = (nc.InnerHtml == "a");//nc not null there

if we use real XmlDocument - the isAllWorkGood is true
but Html Agility Pack there is false.

XmlDocument xdoc = new XmlDocument();
xdoc.LoadXml("<option value='a' />");
XmlNode xnc = xdoc.SelectSingleNode("//option@value='a'/@value");
xnc.InnerXml == "a" is true there...