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

Update context foreach SelectNodes

Topics: Developer Forum, User Forum
Jul 11, 2008 at 9:19 AM
Hi there,

First of all, congratulations for the great tool you made, it saved me a lot of time.

I'm currently facing a little problem, here is what I'm doing:

HtmlNodeCollection myCollection = myHtml.DocumentNode.SelectNodes(myXPath);

foreach(HtmlNode myNode in myCollection)

The fact is when you select a single node, it automatically updates the context, and sets _currentNode to the appropriate value. But in order to proceed some relative XPath queries, I need the context to be updated during each iteration, which, I understand why, is not done automatically. But is there a way, other than using a XPath query, to set the _currentNode to some specific node (like myNode) ?


Lucas Hosseini
Mar 18, 2009 at 10:01 AM
I have the same problem...did you find anything on this?