IntelliJ IDEA 2020.1 Help

XML

IntelliJ IDEA brings powerful support for XML that includes structure validation, formatting (Ctrl+Alt+L) and indentation (Ctrl+Alt+I according to the XML code style, importing unbound namespaces, viewing code structure, unwrapping and removing tags (Ctrl+Shift+Delete), generating DTD files and schemas from instance documents, as well as syntax and error highlighting, code completion (Ctrl+Space), intention actions (Alt+Enter), quick documentation look-up (Ctrl+Q), and more.

IntelliJ IDEA uses Xerces 2.11, an XML parser developed by Apache Software Foundation Group.

Import XML namespaces

If you use a tag or an attribute from a namespace that is not bound, IntelliJ IDEA detects the problem and shows a tooltip:

Tooltip: Reference to an unbound namespace

To solve the problem, use the quickfix that IntelliJ IDEA suggests.

  1. Press Alt+Enter. If there are multiple choices, select the desired namespace from the list.

  2. Alternatively, hover your mouse pointer over the problem and click Create namespace declaration in the popup that opens. If there are multiple choices, select the desired namespace from the list.

Depending on the file type, IntelliJ IDEA creates a namespace declaration, or a taglib:

unboundNameSpace3.png

Configure syntax highlighting

You can configure XML-aware syntax highlighting according to your preferences and habits.

  1. In the Settings/Preferences dialog Ctrl+Alt+S, go to Editor | Color Scheme | XML.

  2. Select the color scheme, accept the highlighting settings inherited from defaults or customize them as described in Configuring Colors and Fonts.

Last modified: 29 June 2020