This project is read-only.


Copy Node XPath - No attributes


'Copy Node XPath to Address Bar' - The generated XPath does not include the attributes
<child Name="label" />
Currently it generates the XPath for child element as,
Expecting it to generate,

file attachments

Closed Oct 22, 2011 at 1:43 AM by jcoon
Available in the 4.0.5 release


jcoon wrote Jun 3, 2010 at 3:56 AM

Thanks for the feedback. There are several different XPath expressions that could be copied for the example element given, such as:


All would result in the selection of the node. I'm sure I could provide all of the above, just not sure how best to expose them in the UI. I also just noticed that the copied XPath doesn't include namespace prefixes, if any. I'll see what I can do.


mbelles wrote May 20, 2011 at 3:37 AM


I just committed a change that adds a new menu to the node's context menu. Each attribute will show up as an item, allowing you to copy it's path to the address bar, with current attribute value.

The XPath will be in the format: /a/b/c[@foo='bar']

I made a decision to make the default use attribute name and value as the predicate. I've seen indices misused too often, and hopefully this will guide users away from them. :)


jcoon wrote May 20, 2011 at 4:13 AM

Well, done, Mark! Thanks for contributing. I was hung up on how to detect which attribute had been right-clicked, but this is a much simpler implementation. This will be very useful.