3

Resolved

HtmlNode.XPath Property

description

It would be nice to see an XPath property of the HTML Node class that return's a node's absolute xpath.

comments

thany wrote Aug 24, 2007 at 12:17 PM

How would you like to see that? There are thousands of possible xpaths to a single node, and there's no such thing as one true absolute xpath to a node. If you want the path (not xpath) to a node, simply walk the parents until you reach the DocumentNode.

DarthObiwan wrote Sep 17, 2009 at 5:57 AM

I've added preliminary support for this on HtmlNode and HtmlAttribute . The properties get their relative xpath and add that on to their parent xpath.

DarthObiwan wrote Oct 3, 2009 at 6:44 AM

I have implemented a property that returns a valid Xpath to that particular node. Beta 1 contains the property but the path created had the #document element on it that was causing the path to not work. The next release will have this fixed