This project has moved. For the latest updates, please go here.

some XPath problem or feature :)

Topics: User Forum
Jan 11, 2007 at 5:54 PM
//...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...