# Language Injection Settings dialog: XML Tag Injection

> **TL;DR**
> `File | Settings | Editor | Language Injections |` ![the Add button](https://resources.jetbrains.com.cn/help/img/idea/2026.2/app.expui.general.add.svg) `| XML Tag Injection` for Windows and Linux
>
>
>
> `IntelliJ IDEA | Settings | Editor | Language Injections |` ![the Add button](https://resources.jetbrains.com.cn/help/img/idea/2026.2/app.expui.general.add.svg) `| XML Tag Injection` for macOS

| Item | Description |
| --- | --- |
| Name | The name of the injection. |
| Language |    The language to be injected.       * ID: select the ID or the name of the language to be injected.    * Prefix: specify a sequence of characters to be added before the corresponding string value.    * Suffix: specify a sequence of characters to be added after the corresponding string value.     The prefix and suffix are optional.    |
| XML Tag |    In this area, define the XML tag, which indicates that the text enclosed in this tag should be treated as the selected language.       * Local name: specify the tag name without a namespace prefix. Use regular expressions to specify multiple tag names `name1\|name2`, case-insensitive names (`(?i)tagname` matches tagname as well as TagName), and so on. > **Warning:** > Be sure not to enter any space characters as they would be significant for the match.    * Namespace: specify the namespace URI of the XML tag. The field is optional.    |
| Sub-tags | Select this checkbox to include all the subtags recursively. |
| Advanced |     Specify additional settings to enable more fine-grained control over the injection process.       * Value pattern - in this field, In the Value pattern field, type a regular expression that determines the context to inject the language into. By using the first capturing group of the patterns as the target for injection, you can configure the procedure to have the language injected only into values that match a certain pattern or into multiple parts that match the pattern. Examples: `[$#]\{(.*?)\}` matches the pattern used by the JSP/JSF Expression Language. `^javascript:(.*)` matches the `javascript` protocol that can be used in hyperlink-hrefs to execute JavaScript code. * Single file - If the option is off, the fragments that match the value pattern are treated separately, as different "files" - for example from the fragment editor's viewpoint. If the option is on, the corresponding fragments are all merged together to form a single unit, or "file". Given the value pattern `xxx (.+) yyy (.+) zzz` and the fragment `xxx select * yyy from family zzz`, `select *` and `from family` are treated as two independent fragments (or "files") if the option is off. If the option is on, `select * from family` is treated as a single unit or "file".    * XPath condition: specify an XPath expression to address the injection-target more precisely. The context in which the expression is evaluated is the surrounding XML tag. If necessary, use XPath [extension functions](http://www.cafeconleche.org/jaxen/apidocs/org/jaxen/function/ext/package-summary.html), for example, `lower-case()`. Also, there are three additional functions that can be used to determine the current file's name, extension, and file type: `file-name()`, `file-ext()`, and `file-type()`. Alternatively, a list of available functions can be retrieved through standard code completion. > **Note:** > For the field to be active, make sure the XPathView + XSLT Support [plugin is enabled](managing-plugins.html). > **Warning:** > For performance reasons, it is recommended that you keep these expressions as simple as possible. Especially expressions that cause the whole document to be scanned, such as `//foo/bar` might cause performance problems with large files.    |

## How it works

* [Language and reference injections](using-language-injections.html)

## See also

### Procedures

[Language and reference injections](using-language-injections.html)

### Reference

[Regular expression syntax reference](regular-expressions.html)

