Validates XML documents with XML Schema and Schematron
Find a file
2025-10-22 15:33:29 +02:00
.mvn Resolve "Create Maven release profile for releasing to Maven Central" 2025-08-19 15:41:52 +02:00
docs Using XEinkauf instead of XOEV 2025-09-10 19:29:17 +02:00
libs/de/kosit/validationtool/packaged-test-scenarios Update Copyright 2022-11-07 16:09:12 +01:00
server/ui Updated to new JS component versions; #153 2025-09-10 19:38:40 +02:00
src Added custom error level to Result object. 2025-10-22 14:59:35 +02:00
.gitattributes (chore) eol style defined 2020-10-14 15:51:11 +02:00
.gitignore Resolve "Prepare pom.xml to be able to release to Maven Central" 2025-08-13 17:58:21 +02:00
.gitlab-ci.yml Removed Java 8 from GitLab 2025-08-29 17:24:34 +02:00
CHANGELOG.md Fixed links 2025-09-10 18:47:44 +02:00
formatter.xml Update Copyright 2022-11-07 16:09:12 +01:00
LICENSE https://github.com/itplr-kosit/validator/issues/53 Fix copyright and licensing information 2020-10-02 08:30:39 +00:00
NOTICE Using XEinkauf instead of XOEV 2025-09-10 19:29:17 +02:00
owasp-suppressions.xml Restructure build process 2022-11-09 12:59:14 +00:00
pom.xml Lombok update for Java 25 2025-10-22 15:33:29 +02:00
README.md Merge branch 'main' into release/1.6.x 2025-10-06 09:08:21 +02:00

KoSIT Validator

Maven Central Apache 2.0 license

Introduction

The Validator is an XML validation engine to validate and process XML files in various formats. It basically does the following in order:

  1. identify actual XML format
  2. validate the XML file (using schema and schematron rules)
  3. generate a custom report / extract custom data from the XML file
  4. compute an acceptance status (according the supplied schema and rules)

The Validator depends on self defined scenarios in order to fully configure the whole process. It always creates a validation report in XML. The actual content of the report can also be controlled by the scenario.

See architecture for information about the whole validation process.

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.

Example validation configurations

Here are some public validation configurations:

Usage

The Validator can be used in three different ways:

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

Standalone Command Line Interface (CLI)

Important hint: since v1.5.1 the filename has been changed from validationtool-* to validator-*

The general way using the CLI is:

java -jar validator-<version>-standalone.jar -s <scenario-config-file> [-r <repository-path>]
[OPTIONS] [FILE] [FILE] [FILE] ...

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

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

A concrete example with a specific Validator configuration can be found on validator-configuration-bis

The CLI documentation shows further configuration options.

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.

Note: With Java 11+, you need to include a dependency to org.glassfish.jaxb:jaxb-runtime in your project explicitly, as that dependency is marked optional in this project and will thus not be resolved transitively.

Daemon-Mode

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

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

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

Packages

The Validator distribution contains the following artifacts:

  1. validator-<version>.jar: Java library for embedded use within an application
  2. validator-<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 >= 11)
  3. libs/: directory containing all (incl. optional) dependencies of the validator

Installation

Download from the following sources is possible:

<dependency>
    <groupId>org.kosit</groupId>
    <artifactId>validator</artifactId>
    <version>x.y.z</version>
</dependency>

To use the standalone version with Maven coordinates, add the respective classifier:

<dependency>
    <groupId>org.kosit</groupId>
    <artifactId>validator</artifactId>
    <version>x.y.z</version>
    <classifier>standalone</classifier>
</dependency>

Roadmap

This section describes the next steps planned in the Validator development.

  • Release version 1.6.0 based on Java 11 and using Jakarta 4.x. - Autumn 2025
    • Drop support of version 1.5.x when version 1.6 is released
  • Develop version 2.0.0 which will include major API incompatibilities - Winter 2025
    • Rework scenarios.xml
    • Rework report output engine
    • Change the output type to XVRL-based document types → this implies that existing XSL templates need to be updated
    • Consider multi Schematron engine support
    • Extract the daemon mode into its own submodule
    • Consider extracting the CLI into its own submodule
  • The release of version 2.0.0 implies a feature-freeze for version 1.6

Authors & Acknowledgements

We are thankful to numerous third-party contributors.

License

The Validator is licensed under the Apache 2.0 license.