Skip to content

Validates XML documents with XML Schema and Schematron

License

Notifications You must be signed in to change notification settings

jstaerk/validator

 
 

Repository files navigation

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.

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

Build

Requirements

  • Maven > 3.0.0
  • Java > 8 update 111

Procedure

mvn install generates two different packages in the dist directory:

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 and deployed on their own.

Third Party Validation Configurations

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

  • Validation Configuration for XRechnung is available on
  • Validation Configuration for XGewerbeanzeige

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

You can more CLI options by

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

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

Daemon-Mode

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

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

Per default the HTTP-Server listens on localhost at Port 8080.

You can configure it with -H for IP Adress and -P for port number:

java -jar  validationtool-<version>-standalone.jar  -s <scenario-config-file> -D -H 192.168.1.x -P 8081

You can HTTP-POST to / and the response will return the report document as defined in your validator configuration.

Additionally there is the GET /health endpoint which can be used by monitoring systems.

Application User Interface (embedded usage)

The validator can also be used in own Java Applications via the API. Details can be found here.

About

Validates XML documents with XML Schema and Schematron

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • XSLT 54.9%
  • Java 45.1%