IntelliJ IDEA 2024.1 Help

XPath and XSLT support

  • XSLT support is available in all XML files that declare the XSLT-Namespace on their root element.

  • IntelliJ IDEA supports XSLT versions 1.0 and 2.0, XPath versions 1.0 and 2.0.

IntelliJ IDEA lets you evaluate expressions against the currently focused document, including support for the document() function to make cross-document queries. You can also evaluate an expression against multiple XML documents in the Find in Files style using the Find by XPath action.

You can configure to highlight matching expressions in the current editor or to show a list of matching lines in the Find window. Editing XPath expressions is enhanced by on-the-fly error-checking including a set of customizable XPath inspections and a wide range of code completion suggestions.

IntelliJ IDEA also lets you display a unique XPath expression for a selected element in the editor by choosing View | Unique XPath from main menu.

XSLT support is not limited to XPath expressions, it also supports a wide range of XSLT constructs, like checking the existence of templates that are called via xsl:call-template and their parameters, refactoring and navigation enhancements. The bundled XSLT Debugger plugin allows you to debug XSLT stylesheets.

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.

  1. Press Ctrl+Alt+S to open settings and then select Plugins.

  2. Open the Installed tab, find the XPathView + XSLT plugin, and select the checkbox next to the plugin name.

Last modified: 11 February 2024