-
Notifications
You must be signed in to change notification settings - Fork 36
Home
ph-schematron is a Java library that validates XML documents via ISO Schematron.
Schematron is an XML based validation language to validate XML documents.
Schematron is part of the ISO 19757 standard "Information technology — Document Schema Definition Languages (DSDL)", Part 3 "Rule-based validation — Schematron". Until version 2016 the standard was free, since the 2020 version the standard needs to be bought.
This Wiki should provide you with all the information you need for version 6 and later releases. See the menu on the right side for your sub-navigation.
The project module structure was heavily reworked for version 6 to be more modular and flexible.
This module contains the basic shared components used by the different implementation modules (see below). This module is always required.
It transitively depends on ph-commons, ph-xml, ph-jaxb, SLF4J and Saxon HE.
This module uses the original XSLTs provided by the https://github.com/schematron/schematron project.
The dependency for ph-schematron-xslt
looks like this, replacing x.y.z
with the latest version number:
<dependency>
<groupId>com.helger.schematron</groupId>
<artifactId>ph-schematron-xslt</artifactId>
<version>x.y.z</version>
</dependency>
This module uses the XSLTs provided by the https://github.com/schxslt/schxslt project. This module was added for the v6 major release and might need additional tweeking, especially in the direction of parameters and configurability.
The dependency for ph-schematron-schxslt
looks like this, replacing x.y.z
with the latest version number:
<dependency>
<groupId>com.helger.schematron</groupId>
<artifactId>ph-schematron-schxslt</artifactId>
<version>x.y.z</version>
</dependency>
Alternatively ph-schematron-pure
offers a Java-native implementation for the Schematron XPath binding which offers superior performance over the XSLT approach but can only be used, if the Schematron rules consist purely of XPath expressions and don't contain any XSLT.
The dependency for ph-schematron-pure
looks like this, replacing x.y.z
with the latest version number:
<dependency>
<groupId>com.helger.schematron</groupId>
<artifactId>ph-schematron-pure</artifactId>
<version>x.y.z</version>
</dependency>
Note: up to and including v5.x the Maven groupId was com.helger
.
It is a validator for Schematron definitions based on RelaxNG definition.
Add the following to your pom.xml to use this artifact, replacing x.y.z
with the latest version number:
<dependency>
<groupId>com.helger.schematron</groupId>
<artifactId>ph-schematron-validator</artifactId>
<version>x.y.z</version>
</dependency>
On Twitter: Follow @philiphelger
Donation link: https://paypal.me/PhilipHelger
It is appreciated if you star the GitHub project if you like it.