All Projects â†’ eerohele â†’ exalt

eerohele / exalt

Licence: MIT license
A Sublime Text plugin for validating and formatting XML documents

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to exalt

sublime
đŸ§›đŸ»â€â™‚ïž Dark theme for Sublime Text
Stars: ✭ 87 (+295.45%)
Mutual labels:  sublime-text
sublime-coconut
Coconut syntax highlighting for Sublime Text and VSCode.
Stars: ✭ 18 (-18.18%)
Mutual labels:  sublime-text
utools-recent-projects
uTools 插件, ćż«é€ŸæŸ„èŻąæœ€èż‘æ‰“ćŒ€çš„éĄč盼
Stars: ✭ 84 (+281.82%)
Mutual labels:  sublime-text
elm-format-on-save
Sublime Text plugin to run elm-format on save
Stars: ✭ 18 (-18.18%)
Mutual labels:  sublime-text
Tutkain
A Sublime Text package for interactive Clojure development
Stars: ✭ 62 (+181.82%)
Mutual labels:  sublime-text
elm-syntax-highlighting
Syntax Highlighting for Elm in Sublime Text
Stars: ✭ 27 (+22.73%)
Mutual labels:  sublime-text
sublime-color-scheme-unit
A testing framework for Sublime Text color schemes.
Stars: ✭ 19 (-13.64%)
Mutual labels:  sublime-text
SaneSnippets
Sublime Text snippets optimized for humans, not robots
Stars: ✭ 59 (+168.18%)
Mutual labels:  sublime-text
dimmed
👔 Dimmed Color Theme for Sublime Text 2/3
Stars: ✭ 18 (-18.18%)
Mutual labels:  sublime-text
zephir-sublime
Sublime Text syntax highlighting for for Zephir
Stars: ✭ 41 (+86.36%)
Mutual labels:  sublime-text
sublime-commands
Adds all default commands to the command pallet
Stars: ✭ 18 (-18.18%)
Mutual labels:  sublime-text
themeX
The ultimate UNIVERSAL syntax color theme generator that let's you build your color scheme in just one file and compile for a wide range of different editors.
Stars: ✭ 26 (+18.18%)
Mutual labels:  sublime-text
fatfree-snippets
🔝 Fat-Free Framework snippets for Sublime Text 2/3
Stars: ✭ 20 (-9.09%)
Mutual labels:  sublime-text
UnrealScriptIDE
Auto-completion, Syntax Highlighting, Go to Declaration, Build and Run and more..
Stars: ✭ 86 (+290.91%)
Mutual labels:  sublime-text
sublime-angular-material-snippets
Angular Material Design snippets plugin for Sublime Text 2/3
Stars: ✭ 25 (+13.64%)
Mutual labels:  sublime-text
sublime-reason
Official Reason plugin for Sublime Text
Stars: ✭ 42 (+90.91%)
Mutual labels:  sublime-text
sublime-fish
A robust Sublime Text syntax package for fish
Stars: ✭ 32 (+45.45%)
Mutual labels:  sublime-text
sublime-font-cycler
Quickly cycle between your favorite fonts in Sublime Text with the press of a key
Stars: ✭ 19 (-13.64%)
Mutual labels:  sublime-text
Cake
Yummy syntax theme for Atom, Brackets, Sublime Text and Visual Studio Code
Stars: ✭ 47 (+113.64%)
Mutual labels:  sublime-text
st package reviewer
A tool to review packages for Sublime Text
Stars: ✭ 13 (-40.91%)
Mutual labels:  sublime-text

Exalt

Exalt is a Sublime Text plugin for validating and formatting XML documents.

Note: You might also want to check out LSP-lemminx.

The theme in the screenshot is Boxy.

Features

Validate files on the fly

Validate XML, XHTML, and XSLT files on the fly with lxml with these validation mechanisms:

Exalt supports XML catalogs via lxml.

XSLT validation

If the syntax of your current file is set to XSLT, Exalt automatically validates the file against Norman Walsh's Relax NG grammars for XSLT stylesheets.

XSD validation

Exalt uses the xsi:schemaLocation or the xsi:noNamespaceSchemaLocation attribute of the root element to validate against the schema defined in that attribute.

This means Exalt can validate Maven POM files that look like this:

<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
                             http://maven.apache.org/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>foobar</groupId>

    . . .
</project>

You'll probably want to set up an XML catalog to avoid having to fetch schemas from the internet. See Installing for more information.

xml-model validation

Exalt also supports the xml-model processing instruction. That means that you can have a processing instruction like this before the root element of your DITA XML 1.2 document (but after the XML declaration, of course):

<?xml-model href="urn:dita-ng:dita:rng:topic.rng"
            schematypens="http://relaxng.org/ns/structure/1.0"?>

Exalt will validate against the schema in the href pseudo-attribute. It uses the XML catalog you've set up to resolve the path in the href pseudo-attribute and the schematypens pseudo-attribute to determine the the type of the schema.

You can also use absolute or relative paths in the href pseudo-attribute:

<!-- Relax NG -->
<?xml-model href="file:///etc/xml/common/schemas/docbook/docbook-5.0/docbook.rng"
            schematypens="http://relaxng.org/ns/structure/1.0"?>

<!-- XML Schema -->
<?xml-model href="../docbook-5.0/xsd/docbook.xsd"
            schematypens="http://www.w3.org/2001/XMLSchema"?>

<!-- ISO Schematron -->
<?xml-model href="file:///etc/xml/common/schemas/dita/schematron/dita-1.2-for-xslt1.sch"
            schematypens="http://purl.oclc.org/dsdl/schematron"?>

If your file doesn't validate, you can press ⌘ + Ctrl + E to jump to the validation error if it's not already in view.

Format XML & HTML files

Press ⌘ + Ctrl + X to reformat (pretty-print) an XML or HTML file. If you have nothing selected, Exalt will format the entire document. If you have one or more selections, Exalt will format those.

NOTE: When formatting a selection, Exalt assumes the selection is a well-formed XML fragment. It will try to recover, but if your selection isn't well-formed, chances are the result is not what you want.

Exalt tries to format non-well-formed XML files via the libxml2 recover flag.

Schema caching

Exalt caches the schemas it uses for performance. This is useful if you're working on XML documents that use large schemas or when the schema is stored elsewhere than your computer.

However, this means that if you're developing a schema, the changes in the schema will not take effect until you clear the Exalt schema cache.

To clear the schema cache, run the Exalt: Clear Parser Cache command via the Sublime Text command palette. If you need to do it often, you might want to add a keyboard shortcut for that command in the Sublime Text settings.

Installing

  1. Install Exalt via Package Control.

  2. Restart Sublime Text.

  3. (Optional, but recommended.) In User/Exalt.sublime-settings, set the path to your XML catalog files.

    For example:

    {
      "xml_catalog_files": ["/etc/xml/catalog", "~/.schemas/catalog.xml"]
    }

    By default, the plugin uses the catalog files defined in Exalt/Exalt.sublime-settings. Those catalog files might or might not exist on your system.

    If you want, you can use my catalogs repository to install a set of commonly used XML catalogs and schemas. Just set the xml_catalog_files setting of this plugin to point to the catalog.xml file in where you cloned the repo.

    Alternatively, you can clonecatalogs into /etc/xml and create /etc/xml/catalog.xml with this content:

    <catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">
      <nextCatalog catalog="catalogs/catalog.xml"/>
    </catalog>

    If you do that, you don't have to set the xml_catalog_files setting.

    NOTE: If you change XML catalogs in any way, you need to restart Sublime Text 3 for the changes to take effect.

Known issues

  • Due to libxml2 issues #573483, #753970, and #753997, none of the available validation methods work for DITA 1.3 files.
  • ISO Schematron validation doesn't always report the error position correctly.

Acknowledgements

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].