Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for Schematron validation #1338

Open
adunning opened this issue Oct 19, 2022 · 6 comments
Open

Support for Schematron validation #1338

adunning opened this issue Oct 19, 2022 · 6 comments

Comments

@adunning
Copy link

adunning commented Oct 19, 2022

With its Relax NG support (from #237), this language server is now extremely close to meeting the needs of a number of large XML initiatives such as DocBook, the Text Encoding Initiative, and Citation Style Language that largely expect users to edit XML files by hand, and being able to do this in everyday text editors would make an enormous difference. These rely on a combination of Relax NG and Schematron for validation. See the Schematron website for other examples.

Since LemMinX uses Jing for Relax NG, can its Schematron support be enabled easily? Jing only supports Schematron 1.5 rather than the finalized ISO Schematron, but according to their website support for ISO Schematron is coming.

For a list of validators covering ISO Schematron, see https://github.com/Schematron/awesome-schematron#software.

Thank you for all your work on this crucial piece of infrastructure!

@angelozerr
Copy link
Contributor

Thanks @adunning for creating this issue.

@datho7561 already did some experimentation with Schematron, so it could give us some relevant feedback.

According @datho7561, Schematron requires Saxon for XSLT which grows the size of LemMinx uber JAR. We need to pay attention with this problem since vscode-xml is generaly used for XML, XSD, DTD.

We will see if RelaxNG is a lot used (by using telemetry, @rgrunber it should be nice to track that), and we will see if Schematron will become our priority.

Please vote for this issue if anybody are interested with Schematron.

@adunning
Copy link
Author

It looks as if ph-schematron can operate without XSLT.

@angelozerr
Copy link
Contributor

angelozerr commented Oct 20, 2022

It looks as if ph-schematron can operate without XSLT.

Is it not a wrapper around to other Schematron implementation? We need to find time to investigate it.

@adunning
Copy link
Author

There are several versions of ph-schematron, not all of which require Saxon. Its wiki explains the varying dependencies. Other Java implementations that do not appear to have other dependencies are https://github.com/itplr-kosit/validator and https://github.com/NASA-PDS/validate/.

There is also SaxonJS, which might be more lightweight than the full version. In this vein, there is an interesting implementation of Relax NG validation in TypeScript at https://github.com/mangalam-research/salve, used in the Scholarly XML extension for VS Code.

@angelozerr
Copy link
Contributor

angelozerr commented Oct 20, 2022

There is also SaxonJS, which might be more lightweight than the full version. In this vein, there is an interesting implementation of Relax NG validation in TypeScript at https://github.com/mangalam-research/salve, used in the Scholarly XML extension for VS Code.

@adunning we are in Java land because vscode-xml uses XML Language Server https://github.com/eclipse/lemminx so we cannot use TypeScript/JavaScript library.

The benefit with XML language server is that it can be consumed with other LSP client like Eclipse IDE, Sublime, etc which will benefit with RelaxNG support too and without having Java runtime because we provide binary to fix this problem.

@denismaier
Copy link

+1 for this feature

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants