# XSL Sublime Text Syntax definition, completions and snippets for [XPath](https://www.w3.org/TR/xpath), [XML Schema](https://www.w3.org/XML/Schema) and [XML Stylesheet Transformation](https://www.w3.org/TR/xslt20/) files. ![preview](preview.png) ## Installation ### Package Control The easiest way to install is using [Package Control](https://packagecontrol.io). It's listed as `XSL`. 1. Open `Command Palette` using ctrl+shift+P or menu item `Tools → Command Palette...` 2. Choose `Package Control: Install Package` 3. Find `XSL` and hit Enter ### Manual Install 1. Download appropriate [XSL-2.0.0-stxxxx.sublime-package](https://github.com/SublimeText/XSL/releases) for your Sublime Text build. _The `st4xxx` suffix denotes the least required ST build for the sublime-package to work._ 2. Rename it to _Astro.sublime-package_ 3. Copy it into _Installed Packages_ directory > [!NOTE] > > To find _Installed Packages_... > > 1. call _Menu > Preferences > Browse Packages.._ > 2. Navigate to parent folder ## Usage ### Begin a Document To easily start a new XML Schema or Stylesheet ... 1. Open `Command Palette` using ctrl+shift+P or menu item `Tools → Command Palette...` 2. Execute one of: - `New XML Schema...` - `New XML Stylesheet...` - `New XML Stylesheet 1.0 (exslt)...` ### Deactivate Snippets To ignore snippets that are provided by default, add them to `ignored_snippets` setting. | ignored snippets | values |------------------|-------------------------------------- | all | `"XSL/Snippets/*"` | XSD | `"XSL/Snippets/XSD/*"` | XSLT | `"XSL/Snippets/XSLT/*"` To only keep schema related snippets... ```json { "ignored_snippets": [ "XSL/Snippets/XSLT", ], } ``` ### Main Snippets Snippets to start a new document with. #### schema-10 Start a new XML Schema Version 1.0 ``` $0 ``` #### schema-11 Start a new XML Schema Version 1.1 ``` $0 ``` #### stylesheet Start a new XML Stylesheet Version 2.0 or 3.0 ``` ${0} ``` #### stylesheet-exslt Start a new XML Stylesheet Version 1.0 with basic EXSL extension. ``` ${0} ``` #### stylesheet-exslt-all Start a new XML Stylesheet Version 1.0 with all EXSL extensions. ``` ${0} ``` #### XSLT Snippets Snippets to work with XSL transformation. #### ai ``` ``` #### apw ``` ``` #### ap ``` ``` #### attrs ``` ${4} ``` #### attr ``` ${0} ``` #### callw ``` ``` #### call ``` ``` #### cw ``` ${2} ${3:${0}} ``` #### ch ``` ${0} ``` #### com ``` ${0} ``` #### cpo ``` ``` #### cp ``` ${0} ``` #### dec ``` ``` #### doci ``` ${0} ``` #### doc ``` ``` #### elt ``` ${0} ``` #### fb ``` ${0} ``` #### for ``` ${0} ``` #### if ``` ${0} ``` #### imp ``` ``` #### inc ``` ``` #### key ``` ``` #### msg ``` ${0} ``` #### nam ``` ``` #### num ``` ``` #### ot ``` ${0} ``` #### out ``` ``` #### pari ``` ${0} ``` #### par ``` ``` #### pres ``` ``` #### proc ``` ${0} ``` #### scr ``` ${0} ``` #### sort ``` ``` #### strip ``` ``` #### tm ``` ${0} ``` #### tn ``` ${0} ``` #### txt ``` ``` #### text ``` ${0} ``` #### vari ``` ${0} ``` #### var ``` ``` #### wh ``` ${0} ``` #### wpi ``` ${0} ``` #### wp ``` ``` ## Troubleshooting ### §1 Syntax Definition Parse Errors XSL extends Sublime Text's _Regular Expressions_ and _XML_ syntax definition. If XSL syntax highlighting doesn't work and console displays syntax errors in _XSD.sublime-syntax_ or _XSL.sublime-syntax_ please make sure to remove any out-dated syntax override. Steps: 1. call _Menu > Preferences > Browse Packages.._ 2. Look for _XML_ folder 3. Remove it or at least delete any syntax definition in it.