Validates XML documents with XML Schema and Schematron
Find a file
Andreas Penski e42405e622 fix typo
2020-07-29 13:26:38 +00:00
.idea (chore) config changes 2020-06-24 13:10:24 +02:00
.settings Automagic changes :( 2019-06-20 14:07:52 +02:00
docs fix typo 2020-07-29 13:26:38 +00:00
libs/de/kosit/validationtool/packaged-test-scenarios (wip) adding sample jar 2019-05-17 16:26:27 +02:00
src #55 More robust reporting in case of Schematron Error 2020-07-29 13:22:55 +00:00
.gitignore (chore) ignore occasional testing of xrechnung artefacts 2020-04-16 13:53:46 +02:00
.gitlab-ci.yml (chore) export zip artefact 2020-03-24 08:39:36 +01:00
CHANGELOG.md #55 More robust reporting in case of Schematron Error 2020-07-29 13:22:55 +00:00
LICENSE Initial commit 2017-10-26 09:35:40 +02:00
NOTICE Merge branch 'master' of https://projekte.kosit.org/kosit/validator 2019-05-16 11:55:20 +02:00
pom.xml [maven-release-plugin] prepare for next development iteration 2020-06-24 13:22:00 +02:00
README.md Minor typos and grammer 2020-06-20 16:41:19 +00:00

Validator

The validator is an XML validation-engine. It validates XML documents against XML Schema and Schematron Rules depending on self defined scenarios which are used to fully configure the validation process. The validator always outputs a validation report in XML including all validation errors and data about the validation.

See architecture for informations about the actual validation process.

Packages

The validator distribution contains the following artifacts:

  1. validationtool-<version>.jar: Java library for embedded use within an application
  2. validationtool-<version>-standalone.jar: Uber-JAR for standalone usage containing all dependencies in one jar file. This file comes with JAXB embedded and can be used with Java 8 and Java >= 11)
  3. validationtool-<version>-java8-standalone.jar: Uber-JAR for standalone usage with Java JDK 8 containing all dependencies in one jar file. This file file does not contain JAXB and depends on the bundled version of the JDK.
  4. libs/*: directory containing all (incl. optional) dependencies of the validator

Validation Configurations

The validator is just an engine and does not know anything about XML Documents and has no own validation rules. Validation rules and details are defined in validation scenarios which are used to fully configure the validation process. All configurations are self-contained modules which are deployed and developed on their own.

Third Party Validation Configurations

Currently, there are two public third party validation configurations available.

Usage

The validator is designed to be used in three different ways:

  • as standalone application running from the cli
  • as library embedded within a custom application
  • as a daemon providing a http interface

Standalone Command-Line Interface

The general way using the CLI is:

java -jar  validationtool-<version>-standalone.jar  -s <scenario-config-file> [OPTIONS] [FILE] [FILE] [FILE] ...

The help option displays further CLI options to customize the process:

java -jar  validationtool-<version>-standalone.jar --help

A concrete example with a specific validator configuration can be found on GitHub

Application User Interface (API / embedded usage)

The validator can also be used in own Java Applications via the API. An example use of the API as follows:

Path scenarios = Paths.get("scenarios.xml");
Configuration config = Configuration.load(scenarios.toUri());
Input document = InputFactory.read(testDocument);

Check validator = new DefaultCheck(config);
Result validationResult = validator.checkInput(document);

// examine the result here

The API documentation shows further configuration options.

Daemon-Mode

You can also start the validator as a HTTP-Server. Just start it in Daemon-Mode with the -D option.

java -jar  validationtool-<version>-standalone.jar  -s <scenario-config-file> -D

The daemon documentation shows more usage details and further configuration options.