Validates XML documents with XML Schema and Schematron
Find a file
2022-12-02 11:27:57 +01:00
.idea Restructure build process 2022-11-09 12:59:14 +00:00
.mvn Fix java 19 build 2022-11-16 07:33:17 +00:00
.settings Update Copyright 2022-11-07 16:09:12 +01:00
docs Add warning about GUI as show case 2022-01-11 10:18:26 +00:00
libs/de/kosit/validationtool/packaged-test-scenarios Update Copyright 2022-11-07 16:09:12 +01:00
server/ui (fix) update dev dependency 2022-11-18 09:54:23 +01:00
src Merge branch 'main' into #100_Make_createReport_optional 2022-11-28 09:05:24 +01:00
.gitattributes (chore) eol style defined 2020-10-14 15:51:11 +02:00
.gitignore Resolve "Allow more than 3 customLevel elements in scenarios" 2020-12-21 07:26:36 +00:00
.gitlab-ci.yml (chore) common build only on LTS platforms, other periodically 2022-11-16 08:35:23 +01:00
CHANGELOG.md Merge branch 'main' into #100_Make_createReport_optional 2022-11-28 09:05:24 +01: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 https://github.com/itplr-kosit/validator/issues/53 Fix copyright and licensing information 2020-10-02 08:30:39 +00:00
owasp-suppressions.xml Restructure build process 2022-11-09 12:59:14 +00:00
pom.xml (chore) Versionsupdates bei Test-Komponenten 2022-12-02 11:27:10 +01:00
README.md Update README.md 2020-11-09 12:13:28 +01:00

KoSIT Validator

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 which are used to fully configure the process. It always creates a validation report in XML. The actual content of this is controlled by the scenario.

See architecture for information about the actual 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.

Third party validation configurations

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

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 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

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  validationtool-<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. 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