Configuration files can grow very large, which is particularly true for the Web.config file in most Sitecore solutions. It contains XML elements and attributes often nested several layers deep.
When creating Sitecore include files or otherwise working with Web.config, the XPath of elements and attributes is often of interest, but determining the correct path can be a strain when reaching the “deeper levels” of the document structure.
The following Visual Studio extension attempts to simplify the process of determining the correct path within any document containing XML markup. This is done by displaying XPath information in the statusbar, matching the XML element or attribute at the caret position.
The XPath can be copied to the clipboard by selecting “Copy XPath” from the main menu.
The extension can be downloaded from within Visual Studio by opening “TOOLS” –> “Extensions and Updates…” and searching for “XPath”, or directly via the Visual Studio Gallery website (http://visualstudiogallery.msdn.microsoft.com/c06c7b10-41c3-4aa9-8707-570eb9d879e6).
The source code can be found/forked via https://github.com/uli-weltersbach/XPathInformation.