This is a proof of concept for a Schematron extension to the LemMinX XML language server.
It uses schxslt and Saxon-HE in order to validate an XML document against a schema.
- In VS Code, install Red Hat's XML extension
- Run
mvn clean package
, which generates a shaded uber jar in./target/lemminx-schematron-0.1.0-SNAPSHOT.jar
- Add the following to your
package.json
:
"xml.extension.jars": [
"/path/to/lemminx-schematron/lemminx-schematron-0.1.0-SNAPSHOT.jar",
],
- Add the following snippet to your XML, with
href
pointing to your Schematron schema:
<?xml-model href="./my-schematron.sch"?>
- The XML document should be validated. If the schema file is invalid, a diagnostic will appear at the top of the document indicating this.
- You can only validate with local
.sch
files - Not tested thoroughly
- The
.jar
is prohibitively large to include as a part of the standard LemMinX distribution