|
1 | | -# Commands |
2 | | - |
3 | | -[vscode-xml](https://github.com/redhat-developer/vscode-xml) provides several vscode commands which are available with `Ctrl+Shift+P`. |
4 | | - |
5 | | - |
6 | | - |
7 | | -## Bind to grammar/schema file |
8 | | - |
9 | | -This command triggers the [XML Binding Wizard](BindingWithGrammar.md#the-xml-binding-wizard) for the current file. |
10 | | - |
11 | | -Details on the command are described [here](BindingWithGrammar.md#command). |
12 | | - |
13 | | -## Open XML Documentation |
14 | | - |
15 | | -This command opens the `XML Documentation`. |
16 | | - |
17 | | -## Revalidate current XML file |
18 | | - |
19 | | -This command re-triggers the [XML Validation](Validation.md#xml-validation) for the current file. |
20 | | - |
21 | | -When the [Server Cache Path](Preferences.md#server-cache-path) is activated, the command removes the referenced XSD, DTD grammar from the local cache. |
22 | | - |
23 | | -## Revalidate all open XML files |
24 | | - |
25 | | -This command re-triggers the [XML Validation](Validation.md#xml-validation) for the all opened XML files. |
26 | | - |
27 | | -When the [Server Cache Path](Preferences.md#server-cache-path) is activated, the command clears the remote grammar cache and revalidates all opened files. |
28 | | - |
29 | | -## Restart XML Language Server |
30 | | - |
31 | | -This command restarts the XML language server. |
| 1 | +# Commands |
| 2 | + |
| 3 | +[vscode-xml](https://github.com/redhat-developer/vscode-xml) provides several vscode commands which are available with `Ctrl+Shift+P`. |
| 4 | + |
| 5 | + |
| 6 | + |
| 7 | +## Bind to grammar/schema file |
| 8 | + |
| 9 | +This command triggers the [XML Binding Wizard](BindingWithGrammar.md#the-xml-binding-wizard) for the current file. |
| 10 | + |
| 11 | +Details on the command are described [here](BindingWithGrammar.md#command). |
| 12 | + |
| 13 | +## Open XML Documentation |
| 14 | + |
| 15 | +This command opens the `XML Documentation`. |
| 16 | + |
| 17 | +## Revalidate current XML file |
| 18 | + |
| 19 | +This command re-triggers the [XML Validation](Validation.md#xml-validation) for the current file. |
| 20 | + |
| 21 | +When the [Server Cache Path](Preferences.md#server-cache-path) is activated, the command removes the referenced XSD, DTD grammar from the local cache. |
| 22 | + |
| 23 | +## Revalidate all open XML files |
| 24 | + |
| 25 | +This command re-triggers the [XML Validation](Validation.md#xml-validation) for the all opened XML files. |
| 26 | + |
| 27 | +When the [Server Cache Path](Preferences.md#server-cache-path) is activated, the command clears the remote grammar cache and revalidates all opened files. |
| 28 | + |
| 29 | +## Restart XML Language Server |
| 30 | + |
| 31 | +This command restarts the XML language server. |
| 32 | + |
| 33 | +## Minify XML Document |
| 34 | + |
| 35 | +This command minifies the current XML document by removing unnecessary whitespace while preserving the document's structure and content. |
| 36 | + |
| 37 | +The minification can be triggered via the **Source > Minify XML** menu. |
| 38 | + |
| 39 | +The minification process: |
| 40 | +- Removes all indentation and line breaks between elements |
| 41 | +- Removes whitespace between the XML declaration and the root element |
| 42 | +- Normalizes whitespace sequences inside text content to a single space |
| 43 | +- Preserves whitespace in elements with `xml:space="preserve"` attribute |
| 44 | +- Preserves content in CDATA sections |
| 45 | +- Reduces multiple spaces between attributes to a single space |
| 46 | + |
| 47 | +This is useful for reducing file size before transmitting or storing XML documents. |
0 commit comments