microsoft / XmlNotepad

XML Notepad provides a simple intuitive User Interface for browsing and editing XML documents.
https://microsoft.github.io/XmlNotepad/
MIT License
966 stars 206 forks source link

Copy XPath of selected node #354

Closed LeMapper closed 6 months ago

LeMapper commented 7 months ago

Dear all, first of all thank you for this editor. I use it mainly for viewing large XML files (up to 300MB) and checking / searching content within specific nodes / XPaths.

XMLNotepad already offers a feature to search within an XPath (Find > "Use XPath"). As a user searching a lot within specific XPaths, I would like to be able to copy the XPath of nodes from the tree view and/or start a search within this specific node from the context menu of the tree view, to minimize the waiting time and get more specific results.

At the moment, I know only of Notepad++ with the "XML Tools"-Plugin, that has this ability: https://stackoverflow.com/questions/3148217/how-to-get-the-xpath-of-a-certain-node-when-viewing-an-xml-file-in-visual-studio

Edit: I am aware, that the XPath of the selected node gets pre-populated in the search field, when enabling the tick-box at "Use XPath". This is a bit cumbersome, though, because XMLNotepad freezes for several minutes after ticking this box (given large filesizes).

Kind regards, LeMapper

lovettchris commented 7 months ago

Does the "Copy XPath" command work? It should copy the XPath expression that locates the selected node in the tree view to your clipboard.

lovettchris commented 6 months ago

Hopefully Copy XPath does the trick.