XPath search
IntelliJ IDEA lets you use XPath 3.0 to find specific XML nodes in XML files in your current project, directory, or within a custom scope.
When you compose an XPath expression, IntelliJ IDEA provides code completion for XPath axes and checks the expression syntax. It also provides XPath syntax highlighting, which can be customized in .
Enable the XPathView + XSLT plugin
This functionality relies on the XPathView + XSLT plugin, which is bundled and enabled in IntelliJ IDEA by default. If the relevant features aren't available, make sure that you didn't disable the plugin.
Press Ctrl+Alt+S to open the IDE settings and then select .
Open the Installed tab, find the XPathView + XSLT plugin, and select the checkbox next to the plugin name.
Search in XML files
In the main menu, go to . The Find by XPath Expression dialog opens.
Type an XPath expression.
For example, the following expression:
//application[@title="BestApp"]/descendant::resourcewill search for
resourcetags that are descendants of anapplicationtag that has an attributetitlewith the valueBestApp.Choose the scope for the search.
If you select Directory and specify a path to a directory, you can also select the Recursively checkbox to search for nodes in all subdirectories.
The XPath search results are displayed in the Find tool window.