The XSLT/XPath extension for VSCode provides comprehensive language support for XSLT 3.0 and XPath 3.1.
Screen shot showing XSLT symbol-outline, problem-reporting and syntax-highlighting:
- XSLT 3.0 / XPATH 3.1
- Syntax Highlighter uses Semantic Highlighting exclusively
- Built-in Code Diagnostics
- Integration with Saxon/Saxon-JS XSLT Processors
- XSLT Language support for VSCode features:
- Auto Completion/Intellisense
- Syntax Highlighting Themes
- Code Formatting
- Code Folding
- Snippets for XSLT/XPath context
- Code symbol outline
- Goto Symbol
- Symbol Breadcrumbs
- Goto Definition
- Peek Definition
- VScode Tasks include custom XSLT Tasks
- Bracket Matching
- Errors and Warnings for XSLT/XPath Syntax
- Follow
xsl:include
/xsl:import
links - Custom XML Editing Featues:
- XML Well-Formedness Checking
- Tag Rename
- Auto tag-close
- Auto clean orphaned end tag after
/
added to make start tag self-close
For lexical analysis, this extension processes code character-by-character. This analysis is exploited for all features including all syntax highlighting. Avoiding the much more common use of regular expressions on a line-by-line basis brings significant benefits. These benefits include improved responsiveness, lower CPU load, improved code maintainability and full integrity for syntax highlighting.
Auto-completion is available for XSLT and XPath, including contex-aware completion items for all code symbol names. XSLT and XPATH function signatures and descriptions are shown alongside fuction completion items.
This extension performs a comprehensive set of checks on the code, before any XSLT compilation. Thsese checks ensure that any code symbols within XSLT or XPath with problems are accurately identified at the symbol-level. Asynchronous processing for xsl:include/xsl:import dependencies allows checking of references to symbol definitions regardless of the location of the definition.
XSLT transforms are configured and run as special VSCode Tasks
For more detail, see XSLT Tasks
See: Release Notes on the project wiki
See: XSLT/XPath Wiki
See: VSCode Settings
To use the task-provider for the Java Saxon XSLT Processor, the following setting is required (alter path to suit actual jar location):
"XSLT.tasks.saxonJar": "/path/to/folder/SaxonHE10-0J/saxon-he-10.0.jar"
- On Windows -
Shift + Alt + F
. - On Mac -
Shift + Option + F
. - On Ubuntu -
Ctrl + Shift + I
.
Syntax highlighting is currently only enabled by default in VSCode's built-in themes. This is because some extension themes may not yet have specific language support for VSCode's 'Semantic Highlighting' as used by this extension.
To enable syntax highighting for a custom theme you need to change User Settings. For example, to enable syntax highlighting for XSLT in the City Lights theme use:
{
"editor.semanticTokenColorCustomizations":{
"[Monokai +Blue]": {"enabled": true}
},
}
Or, to enable syntax highlighting for all themes:
{
"editor.semanticTokenColorCustomizations":{
"enabled": true
},
}
{
"[xslt]": {
"editor.defaultFormatter": "deltaxml.xslt-xpath",
"editor.formatOnSave": true,
"editor.formatOnPaste": true,
"editor.formatOnType": true
}
}
For word selection/navigation, by default, names like $two-parts are treated as two words for selection purposes and $ is also excluded from the name. This behaviour can be altered using the VSCode setting:
editor.wordSeparators