XPath problem

Sep 21, 2010 at 7:46 PM

Hello, I have problem when using XPath to select dynamically created nodes. See comments in example:

var head = doc.DocumentNode.SelectSingleNode("//head") as HtmlNode;
            
HtmlNode node = new HtmlNode(HtmlNodeType.Element, doc, 1);
node.Name = "meta";
node.Attributes.Add("http-equiv", "content-type");
node.Attributes.Add("content", "text/html; charset=iso-8859-1");
head.ChildNodes.Add(node);

//couldn't find node here
var meta = head.SelectNodes("//meta");

//after reloading document, it works fine
doc.LoadHtml(doc.DocumentNode.OuterHtml);
var meta2 = head.SelectNodes("//meta");

Can I (we) expect this to be fixed? I used 1.4 version in demo, because I had some problems to load 1.9, but in my app I'm using 1.9 version, and results are same.