Schematron Status - DeltaXML/vscode-xslt-tokenizer GitHub Wiki
XSLT/XPath extension for VS Code
Status of Schematron Support
Background
Recently there's been some interest in integrating support for Schematron in VSCode into this extension.
Four years ago, a 'proof of concept' for validating Schematron was actually integrated into the extension codebase as a trial. However, when it was found that a redesign was needed to decouple more fully the validation of XSLT from that for Schematron, the Schematron validation was disabled, but not removed, with an aspiration to reintroduce it following the redesign.
While much existing functionality can be extended relatively easily to support Schematron, this must be done in an organised way.
The Plan
1. Testing - Now
The lack of automated testing for this extension inevitably delays the introduction of new features such as Schematron support. The next release is mostly a 'maintenance release'. It includes tests that use the Mocha test framework for two of the most fundamental components in the extension: the Lexer and the Linter.
2. Linter Redesign - Next
The XSLT and Schematron each have their own class that represents the content model. However, the logic that loads references from external and local sources and then queries the content model currently resides in the same class. The redesign will seperate XSLT and Schematron functionality, but still allow common functionality such as XPath linting and content model lookup to be shared.
3. Schematron Support - Following Redesign
What is the authoratative version?
There are many variations of Schematron now, with some organisations using their own internal customisations. These variations may or may not include support for XSLT 1.0, 2.0 and 3.0. We now also have the XSLT 4.0 proposal on the roadmap. A decision needs to be made on which version to support at some stage but this should not impact the high-level design.
Feature Outline
We will need to prioritise how and when Schematron features are added. Some initial thoughts on the fundamentals:
- Code-formatting
- Syntax-highlighting (including embedded XPath)
- Linter
- References to patterns, variables and functions
- Importing of external resources
- Document Link Provider (for imports)
- Outline Provider (tree, breadcrumbs etc.)
- Schematron Task Provider
- compiler
- validator
- report generator
- Schematron Report Viewer
- Interaction with AI Agent (Github CoPilot)
- As-you-type problem reporting of XML - based on Schematron schema
To avoid this extension becoming too heavy-weight, it's likely that high-level features like the Schematron Report Viewer would be supported in separate extensions.
4. Conclusion
Currently there is no Schematron support. The plan is that support will be added once the redesign and test infrastructure work are completed. It is anticipated that some small XSLT/XPath bugfixes will also be needed. Schematron features will then be added incrementally, roughly in the order in the Feature Outline section above.