Compare commits

..

No commits in common. "main" and "v1.5.2" have entirely different histories.
main ... v1.5.2

144 changed files with 17702 additions and 15216 deletions

7
.gitignore vendored
View file

@ -36,7 +36,6 @@ src/generated
.factorypath
.idea/
.settings/
.externalToolBuilders/
.vscode
*.code-workspace
*.xpr
@ -47,9 +46,3 @@ xrechnung
.DS_Store
andre*-simple.xml
somePrefix*.xml
zz
# 2.0 stuff
api/
cli/
core/

View file

@ -2,7 +2,7 @@ image: maven:latest
variables:
BUILD_PROPS: "-Dbuild.revision=$CI_COMMIT_SHA -Dbuild.branch=$CI_COMMIT_REF_NAME -Dbuild.number=$CI_PIPELINE_IID -Dfile.encoding=UTF-8 -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false"
MAVEN_OPTS: "-Dmaven.repo.local=$CI_PROJECT_DIR/.m2/repository -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=WARN -Dorg.slf4j.simpleLogger.showDateTime=true -Djava.awt.headless=true -Xmx6g"
MAVEN_OPTS: "-Dmaven.repo.local=$CI_PROJECT_DIR/.m2/repository -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=WARN -Dorg.slf4j.simpleLogger.showDateTime=true -Djava.awt.headless=true"
MAVEN_CLI_OPTS: " --batch-mode --update-snapshots --errors --fail-at-end --show-version -s .mvn/settings.xml"
MAVEN_CLI_OPTS_CENTRAL: " --batch-mode --show-version -s .mvn/settings-maven-central.xml"
@ -11,11 +11,10 @@ before_script:
cache:
# Change the cache key if major dependencies change
key: constant160
key: constant151
paths:
- .m2/repository
# Basic Java build steps
.java:
stage: build
needs:
@ -33,9 +32,23 @@ cache:
- target/surefire-reports/*.xml
- target/failsafe-reports/*.xml
.java_extended:
extends: .java
rules:
- if: $CI_PIPELINE_SOURCE == "schedule"
# Note: image "maven:3-eclipse-temurin-8-alpine" does not work!
java-8:
extends: .java
image: $CI_REGISTRY_IMAGE/maven:3-jdk-8
java-8-openj9:
extends: .java_extended
image: $CI_REGISTRY_IMAGE/maven:3-jdk-8-openj9
java-11:
extends: .java
image: maven:3-eclipse-temurin-11-alpine
image: $CI_REGISTRY_IMAGE/maven:3-eclipse-temurin-11-alpine
needs: [ ]
script:
- mvn $MAVEN_CLI_OPTS $BUILD_PROPS $CI_JOB_TIMESTAMP install
@ -50,52 +63,42 @@ java-11:
- target/surefire-reports/*.xml
- target/failsafe-reports/*.xml
java-11-openj9:
extends: .java_extended
image: $CI_REGISTRY_IMAGE/maven:3-jdk-11-openj9
java-17:
extends: .java
image: maven:3-eclipse-temurin-17-alpine
image: $CI_REGISTRY_IMAGE/maven:3-eclipse-temurin-17-alpine
java-21:
extends: .java
image: maven:3-eclipse-temurin-21-alpine
image: $CI_REGISTRY_IMAGE/maven:3-eclipse-temurin-21-alpine
java-25:
extends: .java
image: maven:3-eclipse-temurin-25-alpine
java-24:
extends: .java_extended
image: $CI_REGISTRY_IMAGE/maven:3-eclipse-temurin-24-alpine
# Rare Java stuff
.java_extended:
extends: .java
rules:
- if: $CI_PIPELINE_SOURCE == "schedule"
# Note: the openj9 images don't exist for Java 17, 21 or 25
# Removed because the latest public image is 11.0.11 which is not comaptible to the Lombok requirement of 11.0.23
#java-11-openj9:
# extends: .java_extended
# image: maven:3-jdk-11-openj9
# Deploy Java 11 build on Maven Central
deploy-java-11-snapshot:
extends: java-11
script:
- mvn $MAVEN_CLI_OPTS_CENTRAL -P release-snapshot deploy
# Deploy Java 11 build to KoSIT repository (manually)
deploy:
stage: deploy
image: maven:3-eclipse-temurin-11-alpine
image: $CI_REGISTRY_IMAGE/maven:3-eclipse-temurin-11-alpine
needs:
- job: java-11
script:
- export PROJECT_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
- mvn $MAVEN_CLI_OPTS deploy:deploy-file -Dfile=target/validator-${PROJECT_VERSION}.zip -DgroupId=kosit -DartifactId=validator -Dversion=${PROJECT_VERSION} -Dclassifier="distribution" -Dpackaging=zip -DrepositoryId="gitlab-maven" -Durl=https://projekte.kosit.org/api/v4/projects/7/packages/maven
- mvn $MAVEN_CLI_OPTS deploy:deploy-file -Dfile=target/validator-${PROJECT_VERSION}.jar -DgroupId=kosit -DartifactId=validator -Dversion=${PROJECT_VERSION} -Dpackaging=jar -DrepositoryId="gitlab-maven" -Durl=https://projekte.kosit.org/api/v4/projects/7/packages/maven
- mvn $MAVEN_CLI_OPTS deploy:deploy-file -Dfile=target/validator-${PROJECT_VERSION}-javadoc.jar -DgroupId=kosit -DartifactId=validator -Dversion=${PROJECT_VERSION} -Dclassifier="javadoc" -Dpackaging=zip -DrepositoryId="gitlab-maven" -Durl=https://projekte.kosit.org/api/v4/projects/7/packages/maven
- mvn $MAVEN_CLI_OPTS deploy:deploy-file -Dfile=target/validator-${PROJECT_VERSION}-standalone.jar -DgroupId=kosit -DartifactId=validator -Dversion=${PROJECT_VERSION} -Dclassifier="standalone" -Dpackaging=jar -DrepositoryId="gitlab-maven" -Durl=https://projekte.kosit.org/api/v4/projects/7/packages/maven
- mvn $MAVEN_CLI_OPTS deploy:deploy-file -Dfile=target/validator-${PROJECT_VERSION}-sources.jar -DgroupId=kosit -DartifactId=validator -Dversion=${PROJECT_VERSION} -Dclassifier="sources" -Dpackaging=jar -DrepositoryId="gitlab-maven" -Durl=https://projekte.kosit.org/api/v4/projects/7/packages/maven
- mvn $MAVEN_CLI_OPTS deploy:deploy-file -Dfile=target/validationtool-${PROJECT_VERSION}.zip -DgroupId=kosit -DartifactId=validator -Dclassifier="distribution" -Dversion=${PROJECT_VERSION} -Dpackaging=zip -DrepositoryId="gitlab-maven" -Durl=https://projekte.kosit.org/api/v4/projects/7/packages/maven
- mvn $MAVEN_CLI_OPTS deploy:deploy-file -Dfile=target/validationtool-${PROJECT_VERSION}.jar -DgroupId=kosit -DartifactId=validator -Dversion=${PROJECT_VERSION} -Dpackaging=jar -DrepositoryId="gitlab-maven" -Durl=https://projekte.kosit.org/api/v4/projects/7/packages/maven
- mvn $MAVEN_CLI_OPTS deploy:deploy-file -Dfile=target/validationtool-${PROJECT_VERSION}-javadoc.jar -DgroupId=kosit -DartifactId=validator -Dclassifier="javadoc" -Dversion=${PROJECT_VERSION} -Dpackaging=zip -DrepositoryId="gitlab-maven" -Durl=https://projekte.kosit.org/api/v4/projects/7/packages/maven
- mvn $MAVEN_CLI_OPTS deploy:deploy-file -Dfile=target/validationtool-${PROJECT_VERSION}-standalone.jar -DgroupId=kosit -DartifactId=validator -Dclassifier="standalone" -Dversion=${PROJECT_VERSION} -Dpackaging=jar -DrepositoryId="gitlab-maven" -Durl=https://projekte.kosit.org/api/v4/projects/7/packages/maven
- mvn $MAVEN_CLI_OPTS deploy:deploy-file -Dfile=target/validationtool-${PROJECT_VERSION}-java8-standalone.jar -DgroupId=kosit -DartifactId=validator -Dclassifier="java8-standalone" -Dversion=${PROJECT_VERSION} -Dpackaging=jar -DrepositoryId="gitlab-maven" -Durl=https://projekte.kosit.org/api/v4/projects/7/packages/maven
- mvn $MAVEN_CLI_OPTS deploy:deploy-file -Dfile=target/validationtool-${PROJECT_VERSION}-sources.jar -DgroupId=kosit -DartifactId=validator -Dclassifier="sources" -Dversion=${PROJECT_VERSION} -Dpackaging=jar -DrepositoryId="gitlab-maven" -Durl=https://projekte.kosit.org/api/v4/projects/7/packages/maven
when: manual
# Build Docker images and upload to KoSIT registry
deploy-snapshot:
extends: java-8
script:
- mvn $MAVEN_CLI_OPTS_CENTRAL -P release-snapshot deploy
create-build-image:
stage: deploy
image: docker:latest
@ -111,22 +114,12 @@ create-build-image:
changes:
- .mvn/createBuildImages.sh
# Run OWASP checks - expensive so only on main branch
owasp-check:
stage: test
image: maven:3-eclipse-temurin-21-alpine
extends: .java
image: $CI_REGISTRY_IMAGE/maven:3-eclipse-temurin-11-alpine
needs: [ ]
# set job timeout to 1 hour - it's required when new rules are downloaded
timeout: 1h
variables:
RUNNER_SCRIPT_TIMEOUT: 1h
script:
- mvn $MAVEN_CLI_OPTS $BUILD_PROPS $CI_JOB_TIMESTAMP validate -Powasp-check
artifacts:
name: artifacts
reports:
codequality:
- target/dependency-check-report.html
rules:
- if: $CI_PIPELINE_SOURCE == "schedule"
- if: $CI_COMMIT_REF_NAME == "main"

View file

@ -5,56 +5,13 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/)
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## 1.6.2 - 2026-02-17
### Changed
- (BUILD) [GitHub #173]( https://github.com/itplr-kosit/validator/issues/173) The JAR files now contain details on the used third-party component licenses. Thanks to @cech12
- (BUILD) [GitHub #169](https://github.com/itplr-kosit/validator/issues/169) The `.zip` file created from `maven-assembly-plugin` now contains the correct xml-resolver dependencies. Thanks to @landrix for pointing that out
- (BUILD) [#179](https://projekte.kosit.org/kosit/validator/-/issues/179) Updated all dependencies to the latest suitable versions
## 1.6.1 - 2026-02-05
### Changed
- (CORE) [#106](https://projekte.kosit.org/kosit/validator/-/issues/106) The `match` element in `scenarios.xml` is required to have at least one character (per XSD change)
- (BUILD) [#176](https://projekte.kosit.org/kosit/validator/-/issues/176) The Maven Central deployed `pom.xml` properly includes runtime dependencies
- (BUILD) [#175](https://projekte.kosit.org/kosit/validator/-/issues/175) The `.zip` file created from `maven-assembly-plugin` no longer contains the standalone validator, which reduces its size to 50%
## 1.6.0 - 2025-11-07
### Added
- (CORE) [GitHub #127](https://github.com/itplr-kosit/validator/issues/127) New API method `Result.getCustomFailedAsserts()` to access failed asserts with custom error levels
### Fixed
- (DOC) [GitHub PR#166](https://github.com/itplr-kosit/validator/pull/166) Fixed broken links in `docs/api.md`
### Changed
- (CORE) Migration from javax to jakarta xml bind
- (DOC) [GitHub PR#132](https://github.com/itplr-kosit/validator/pull/132) Updated the link to the example Validator scenario configuration
- (BUILD) Support for *building and compilation* is restricted to the following Java versions:
- Java 11: any version ≥ 11.0.23
- Java 12 to 16 will not work
- Java 17: any version ≥ 17.0.11
- Java 18 to 20 will not work
- Any version from Java 21 onwards will work
- The reason for this is the usage of the `-proc:full` compiler parameter which in turn is needed for Lombok usage in JDK 23+.
### Removed
- (CORE) java 8 support. new default jdk 11
## 1.5.2 - 2025-09-01
### Fixed
- (BUILD) [#148](https://projekte.kosit.org/kosit/validator/-/issues/148) Regression that due to renaming from `validationtool` to `validator` the distribution zip did not contain all jars anymore
- (BUILD) [#148](https://projekte.kosit.org/kosit/validator/-/issues/148): Regression that due to renaming from `validationtool` to `validator` the distribution zip did not contain all jars anymore
## 1.5.1 - 2025-09-01
# 1.5.1 - 2025-09-01
### Fixed
@ -113,7 +70,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- [#80](https://github.com/itplr-kosit/validator/issues/80) using classloader to initialize jaxb context (to support
usage in OSGi
environments)
- [#75](https://github.com/itplr-kosit/validator/issues/75) Improve logging on invalid documents
- [#75] (<https://github.com/itplr-kosit/validator/issues/75>) Improve logging on invalid documents
## 1.4.1
@ -155,7 +112,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed
- `getFailedAsserts()` and `isSchematronValid()`
in [DefaultResult.java](https://github.com/itplr-kosit/validator/blob/main/src/main/java/de/kosit/validationtool/impl/DefaultResult.java)
in [DefaultResult.java](https://github.com/itplr-kosit/validator/blob/master/src/main/java/de/kosit/validationtool/impl/DefaultResult.java)
do not reflect actual schematron validation result
- processing aborts on schematron execution errors (e.g. errors within schematron logic). The validator now generates a
report in such cases.
@ -203,7 +160,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added
- Provide access to schematron result
through [Result.java](https://github.com/itplr-kosit/validator/blob/main/src/main/java/de/kosit/validationtool/api/Result.java)
through [Result.java](https://github.com/itplr-kosit/validator/blob/master/src/main/java/de/kosit/validationtool/api/Result.java)
- *Result#getFailedAsserts()* returns a list of failed asserts found by schematron
- *Result#isSchematronValid()* convinience access to evaluate whether schematron was processed without any *
FailedAsserts*

28
NOTICE
View file

@ -1,29 +1,5 @@
KoSIT XML Validator
Copyright 2017-2026 Koordinierungsstelle für IT-Standards (KoSIT)
Copyright 2017-2025 Koordinierungsstelle für IT-Standards (KoSIT)
This product includes software developed by
Koordinierungsstelle für IT-Standards (<https://xeinkauf.de/>).
This product includes software developed at
The Apache Software Foundation (http://www.apache.org/).
Licensed under Apache 2.0
This product includes software developed at
Fusesource (http://fusesource.github.io/jansi/).
Licensed under Apache 2.0
This product includes software developed at
Remko Popma (https://picocli.info/).
Licensed under Apache 2.0
This product includes software developed at
Saxonica (https://github.com/Saxonica/Saxon-HE).
Licensed under MPL 2.0
This product includes software developed at
Eclipse Foundation (https://github.com/eclipse-ee4j/jaxb-ri).
Licensed under EDL 1.0
This product includes software developed at
QOS.ch (https://www.slf4j.org/).
Licensed under MIT
Koordinierungsstelle für IT-Standards (<https://www.xoev.de/>).

108
README.md
View file

@ -1,19 +1,24 @@
# KoSIT Validator
[![Maven Central](https://img.shields.io/maven-central/v/org.kosit/validator)](https://central.sonatype.com/artifact/org.kosit/validator)
[![Apache 2.0 license](https://img.shields.io/badge/license-Apache%202-blue)](https://www.apache.org/licenses/LICENSE-2.0)
- [Introduction](#introduction)
- [Validation Configurations](#validation-configurations)
* [Third Party Validation Configurations](#third-party-validation-configurations)
- [Usage](#usage)
* [Standalone Command-Line Interface](#standalone-command-line-interface)
* [Application User Interface (API / embedded usage)](#application-user-interface--api---embedded-usage-)
* [Daemon-Mode](#daemon-mode)
- [Packages](#packages)
## Introduction
The Validator is an XML validation engine to validate and process XML files in various formats. It basically does the following in order:
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
1. validate the XML file (using schema and schematron rules)
1. generate a custom report / extract custom data from the XML file
1. compute an acceptance status (according the supplied schema and rules)
The Validator depends on self defined [scenarios](docs/configurations.md) in order to fully configure the whole process.
The validator depends on self defined [scenarios](docs/configurations.md) in order to fully configure the whole process.
It always creates a [validation report in XML](docs/configurations.md#validators-report). The actual content of the report can also be controlled by the scenario.
See [architecture](docs/architecture.md) for information about the whole validation process.
@ -21,31 +26,28 @@ See [architecture](docs/architecture.md) for information about the whole validat
## Validation configurations
The Validator is just an engine and does not know anything about XML documents and has no own validation rules.
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](docs/configurations.md) 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
### Third party validation configurations
Here are some public validation configurations:
Here are two public third party validation configurations available which might serve as examples:
* Validation Configuration for [XRechnung](https://xeinkauf.de/xrechnung/):
* Validation Configuration for [XRechnung](http://www.xoev.de/de/xrechnung):
* Source code is available on [GitHub](https://github.com/itplr-kosit/validator-configuration-xrechnung)
* [Releases](https://github.com/itplr-kosit/validator-configuration-xrechnung/releases) can also be downloaded
* Validation Configuration for [Peppol BIS Billing](https://docs.peppol.eu/poacc/billing/3.0/):
* Source code is available on [GitHub](https://github.com/itplr-kosit/validator-configuration-bis)
* [Releases](https://github.com/itplr-kosit/validator-configuration-bis/releases) can also be downloaded
* Validation Configuration for [XGewerbeanzeige](https://xgewerbeanzeige.de/)
* Source code is available on [GitHub](https://github.com/itplr-kosit/validator-configuration-xgewerbeanzeige)
* [Releases](https://github.com/itplr-kosit/validator-configuration-xgewerbeanzeige/releases) can also be downloaded
## Usage
The Validator can be used in three different ways:
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
* as a daemon providing a http interface
### Standalone Command Line Interface (CLI)
@ -54,7 +56,7 @@ The Validator can be used in three different ways:
The general way using the CLI is:
```shell
java -jar validator-<version>-standalone.jar -s <scenario-config-file> [-r <repository-path>]
java -jar validator-<version>-standalone.jar -s <scenario-config-file> -r <repository-path>
[OPTIONS] [FILE] [FILE] [FILE] ...
```
@ -64,22 +66,22 @@ 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](https://github.com/itplr-kosit/validator-configuration-bis)
A concrete example with a specific validator configuration can be found on
[GitHub](https://github.com/itplr-kosit/validator-configuration-xrechnung)
The [CLI documentation](./docs/cli.md) 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:
The validator can also be used in own Java Applications via the API. An example use of the API as follows:
```java
URL scenarios = this.getClass().getClassLoader().getResource("scenarios.xml");
Configuration config = Configuration.load(scenarios.toURI()).build(ProcessorProvider.getProcessor());
Check validator = new DefaultCheck(config);
Path scenarios = Paths.get("scenarios.xml");
Configuration config = Configuration.load(scenarios.toUri());
Input document = InputFactory.read(testDocument);
Result report = validator.checkInput(document);
Check validator = new DefaultCheck(config);
Result validationResult = validator.checkInput(document);
// examine the result here
```
@ -87,7 +89,8 @@ Result report = validator.checkInput(document);
The [API documentation](./docs/api.md) 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.
as that dependency is marked `optional` in this project and
will thus not be resolved transitively.
### Daemon-Mode
@ -102,58 +105,9 @@ The [daemon documentation](./docs/daemon.md) shows more usage details and furthe
## Packages
The Validator distribution contains the following artifacts:
The validator distribution contains the following artifacts:
1. **validator-`<version>`.jar**: Java library for embedded use within an application
1. **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)
1. **libs/**: directory containing all (incl. optional) dependencies of the validator
## Installation
Download from the following sources is possible:
* GitHub releases: https://github.com/itplr-kosit/validator/releases
* This release contains a ZIP file with all the different JAR variants
* Maven Central with the below coordinates (replace `x.y.z` with the actual version to use)
```xml
<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:
```xml
<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.
* Version 1.5.x is frozen - no maintainance, no support
* Version 1.6.x - no feature development, but maintainance and best-effort support
* 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](https://github.com/xproc/xvrl)-based document types &rarr; 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](https://github.com/itplr-kosit/validator/graphs/contributors).
## License
The Validator is licensed under the [Apache 2.0 license](https://www.apache.org/licenses/LICENSE-2.0).
1. **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 8 and Java >= 11)
1. **validator-`<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.
1. **libs/***: directory containing all (incl. optional) dependencies of the validator

View file

@ -2,4 +2,4 @@
## German
In seiner 23. Sitzung hat der [IT-Planungsrat](https://www.it-planungsrat.de) mit [Beschluss 2017/22 (6a)](https://www.it-planungsrat.de/SharedDocs/Sitzungen/DE/2017/Sitzung_23.html?pos=3) die [Koordinierungsstelle für IT-Standards (KoSIT)](https://xeinkauf.de/) im Rahmen des Betriebs des Standards XRechnung mit der dauerhaften„…Bereitstellung eines Moduls zur Konformitätsprüfung elektronischer Rechnungen als offene Referenzimplementierung sowie …“ aller zugehöriger Artefakte beauftragt. Im Rahmen dieser Beauftragung wurde die hier bereitgestellte Software "Prüftool" (Engl. Validator) entwickelt und (vor-) konfiguriert.
In seiner 23. Sitzung hat der [IT-Planungsrat](https://www.it-planungsrat.de) mit [Beschluss 2017/22 (6a)](https://www.it-planungsrat.de/SharedDocs/Sitzungen/DE/2017/Sitzung_23.html?pos=3) die [Koordinierungsstelle für IT-Standards (KoSIT)](https://www.xoev.de/) im Rahmen des Betriebs des Standards XRechnung mit der dauerhaften„…Bereitstellung eines Moduls zur Konformitätsprüfung elektronischer Rechnungen als offene Referenzimplementierung sowie …“ aller zugehöriger Artefakte beauftragt. Im Rahmen dieser Beauftragung wurde die hier bereitgestellte Software "Prüftool" (Engl. Validator) entwickelt und (vor-) konfiguriert.

View file

@ -92,26 +92,25 @@ public class StandardExample {
```
The `Result` interface has convenience methods to retrieve details about XSD validation errors and Schematron messages and other processing results. See
[Result.java](https://github.com/itplr-kosit/validator/blob/main/src/main/java/de/kosit/validationtool/api/Result.java) for details.
[Result.java](https://github.com/itplr-kosit/validator/blob/master/src/main/java/de/kosit/validationtool/api/Result.java) for details.
Initializing all XML artifacts and XSLT-executables is expensive. The `Check` instance is *threadsafe* and keeps all artifacts. Therefore,
we recommend the re-use of a `Check` instance.
Beside the validator's configuration the only input are instances of [Input](https://github.com/itplr-kosit/validator/blob/main/src/main/java/de/kosit/validationtool/api/Input.java)
which can be created by various methods of the [InputFactory](https://github.com/itplr-kosit/validator/blob/main/src/main/java/de/kosit/validationtool/api/InputFactory.java).
The [InputFactory](https://github.com/itplr-kosit/validator/blob/main/src/main/java/de/kosit/validationtool/api/InputFactory.java)
Beside the validator's configuration the only input are instances of [Input](https://github.com/itplr-kosit/validator/blob/master/src/main/java/de/kosit/validationtool/api/Input.java)
which can be created by various methods of the [InputFactory](https://github.com/itplr-kosit/validator/blob/master/src/main/java/de/kosit/validationtool/api/InputFactory.java).
The [InputFactory](https://github.com/itplr-kosit/validator/blob/master/src/main/java/de/kosit/validationtool/api/InputFactory.java)
calculates a hash sum for each Input which is also written to the Report. _SHA-256_ from the JDK is the default algorithm.
It can be changed using other `read`-methods of [InputFactory](https://github.com/itplr-kosit/validator/blob/main/src/main/java/de/kosit/validationtool/api/InputFactory.java).
It can be changed using other `read`-methods of [InputFactory](https://github.com/itplr-kosit/validator/blob/master/src/main/java/de/kosit/validationtool/api/InputFactory.java).
The main interface [Check.java](https://github.com/itplr-kosit/validator/blob/main/src/main/java/de/kosit/validationtool/api/Check.java)
allows using a batch interface (processing list of [Inputs](https://github.com/itplr-kosit/validator/blob/main/src/main/java/de/kosit/validationtool/api/Input.java)).
The main interface [Check.java](https://github.com/itplr-kosit/validator/blob/master/src/main/java/de/kosit/validationtool/api/Check.java)
allows using a batch interface (processing list of [Inputs](https://github.com/itplr-kosit/validator/blob/master/src/main/java/de/kosit/validationtool/api/Input.java)).
However, there is no parallel processing implemented at the moment.
## Accept Recommendation and Accept Match
A tri-state object [AcceptRecommendation](https://github.com/itplr-kosit/validator/blob/main/src/main/java/de/kosit/validationtool/api/AcceptRecommendation.java)
can be retrieved from the [Result](https://github.com/itplr-kosit/validator/blob/main/src/main/java/de/kosit/validationtool/api/Result.java) using `getAcceptRecommendation()`.
A tri-state object [AcceptRecommendation](https://github.com/itplr-kosit/validator/blob/master/src/main/java/de/kosit/validationtool/api/AcceptRecommendation.java)
can be retrieved from the [Result](https://github.com/itplr-kosit/validator/blob/master/src/main/java/de/kosit/validationtool/api/Result.java) using `getAcceptRecommendation()`.
The three defined states are:
@ -196,15 +195,15 @@ When using XML related technologies you are supposed to handle certain security
* allows loading/resolving only from a configured local content repository (a specific folder)
* tries to prevent known XML security issues (see [OWASP XML_Security_Cheat_Sheet.html](https://cheatsheetseries.owasp.org/cheatsheets/XML_Security_Cheat_Sheet.html))
However, you can configure certain aspects related to resolving and security yourself. The validator uses a single interface for accessing or creating the necessary XML API objects like `SchemaFactory`, `Validator`,`URIResolver` or `Processor`: [ResolvingConfigurationStrategy.java](https://github.com/itplr-kosit/validator/tree/main/src/main/java/de/kosit/validationtool/api/ResolvingConfigurationStrategy.java)
However, you can configure certain aspects related to resolving and security yourself. The validator uses a single interface for accessing or creating the necessary XML API objects like `SchemaFactory`, `Validator`,`URIResolver` or `Processor`: [ResolvingConfigurationStrategy.java](https://github.com/itplr-kosit/validator/tree/master/src/main/java/de/kosit/validationtool/api/ResolvingConfigurationStrategy.java)
There are 3 implementations available out of the box:
1. [StrictRelativeResolvingStrategy.java](https://github.com/itplr-kosit/validator/tree/main/src/main/java/de/kosit/validationtool/impl/xml/StrictRelativeResolvingStrategy.java)
1. [StrictRelativeResolvingStrategy.java](https://github.com/itplr-kosit/validator/tree/master/src/main/java/de/kosit/validationtool/impl/xml/StrictRelativeResolvingStrategy.java)
which is the **default**, prevents known XML attacks and only allows loading from a specific local repository location
1. [StrictLocalResolvingStrategy.java](https://github.com/itplr-kosit/validator/tree/main/src/main/java/de/kosit/validationtool/impl/xml/StrictLocalResolvingStrategy.java)
1. [StrictLocalResolvingStrategy.java](https://github.com/itplr-kosit/validator/tree/master/src/main/java/de/kosit/validationtool/impl/xml/StrictLocalResolvingStrategy.java)
which opens the first strategy to load resources from local locations
1. [RemoteResolvingStrategy.java](https://github.com/itplr-kosit/validator/tree/main/src/main/java/de/kosit/validationtool/impl/xml/RemoteResolvingStrategy.java)
1. [RemoteResolvingStrategy.java](https://github.com/itplr-kosit/validator/tree/master/src/main/java/de/kosit/validationtool/impl/xml/RemoteResolvingStrategy.java)
which further opens the second to load resources also from remote locations via http and https
You can configure usage of one of these implementations using the `ResolvingMode` via
@ -223,6 +222,6 @@ final Configuration config = Configuration.load(URI.create("myscenarios.xml"))
---
:warning: **Attention:** If you decide to implement a custom strategy you need to handle XML security risks on your own. Please make sure, that you prevent XXE and other kind of attacks. Consider using [BaseResolvingStrategy.java](https://github.com/itplr-kosit/validator/blob/main/src/main/java/de/kosit/validationtool/impl/xml/BaseResolvingStrategy.java) and the protected methods within to disable certain features.
:warning: **Attention:** If you decide to implement a custom strategy you need to handle XML security risks on your own. Please make sure, that you prevent XXE and other kind of attacks. Consider using [BaseResolvingStrategy.java](https://github.com/itplr-kosit/validator/tree/master/src/main/java/de/kosit/validationtool/impl/xml/BaseResolvingStrategy.java) and the protected methods within to disable certain features.
---

View file

@ -48,13 +48,12 @@ java -jar validator-<version>-standalone.jar -s "NAME1=<scenario-config-file1>"
Besides the obvious functionality of validating, the cli provides additional functionality to customize the processing:
| name | option | description |
| - | - | - |
| [Daemon mode](daemon.md) | `-D` | Starts the validator in daemon mode as an HTTP service |
| print mode | `-p` | Print the report to stdout |
| extract html | `-h` | Extracts any html blocks within the report and saves the content to the filesystem. Note: the file name is derived from the node name the html appears in |
| print memory stats | `-m` | Prints some memory usage information. Mainly for debugging purposes on processing huge xml files |
| check assertions | `-c <file>` | Check assertions on the generated reports. This is mainly useful for scenario developers. Ask KoSIT for documentation, if you want to use this feauture |
|name | option | description | | - | - | - | | [Daemon mode](daemon.md) | `-D` | Starts the validator in daemon mode as an HTTP service | |
print mode | `-p` | Print the report to stdout | | extract html | `-h` | Extracts any html blocks within the report and saves the content to
the filesystem. Note: the file name is derived from the node name the html appears in | | print memory stats | `-m` | Prints some memory
usage information. Mainly for debugging purposes on processing huge xml files | | check assertions | `-c <file>` | Check assertions on the
generated reports. This is mainly useful for scenario developers. Ask KoSIT for documentation, if you want to use this feauture |
## Return codes

201
pom.xml
View file

@ -6,7 +6,7 @@
<groupId>org.kosit</groupId>
<artifactId>validator</artifactId>
<version>1.6.3-SNAPSHOT</version>
<version>1.5.2</version>
<description>KoSIT XML Validator against XSD and Schematron based on defined scenarios.</description>
<developers>
@ -15,13 +15,13 @@
<id>fabian.buettner</id>
<name>Fabian Büttner</name>
<organization>KoSIT</organization>
<organizationUrl>https://xoev.de/</organizationUrl>
<organizationUrl>http://www.xoev.de</organizationUrl>
</developer>
<developer>
<id>renzo.kottmann</id>
<name>Renzo Kottmann</name>
<organization>KoSIT</organization>
<organizationUrl>https://xeinkauf.de</organizationUrl>
<organizationUrl>http://www.xeinkauf.de</organizationUrl>
<roles>
<role>Product Owner</role>
</roles>
@ -38,20 +38,17 @@
</developers>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<version.assertj>3.27.7</version.assertj>
<version.commons-io>2.21.0</version.commons-io>
<version.commons-lang>3.20.0</version.commons-lang>
<version.assertj>3.27.3</version.assertj>
<version.commons-io>2.20.0</version.commons-io>
<version.commons-lang>3.18.0</version.commons-lang>
<version.jacoco>0.8.13</version.jacoco>
<version.jaxb-api>4.0.4</version.jaxb-api>
<version.jaxb-impl>4.0.6</version.jaxb-impl>
<version.lombok>1.18.42</version.lombok>
<version.mockito>5.21.0</version.mockito>
<version.owasp-dependency-check>12.1.8</version.owasp-dependency-check>
<!-- 6.0.0 requires Java 17+ -->
<version.rest-assured>5.5.7</version.rest-assured>
<version.saxon-he>12.9</version.saxon-he>
<version.jaxb>2.3.9</version.jaxb>
<version.lombok>1.18.38</version.lombok>
<version.mockito>4.11.0</version.mockito>
<version.owasp-dependency-check>10.0.4</version.owasp-dependency-check>
<version.rest-assured>5.5.5</version.rest-assured>
<version.saxon-he>12.8</version.saxon-he>
<version.slf4j>2.0.17</version.slf4j>
<version.jaxb-maven-plugin>4.0.11</version.jaxb-maven-plugin>
</properties>
<repositories>
@ -81,15 +78,16 @@
<version>${version.lombok}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${version.slf4j}</version>
</dependency>
<dependency>
<groupId>net.sf.saxon</groupId>
<artifactId>Saxon-HE</artifactId>
<version>${version.saxon-he}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${version.slf4j}</version>
</dependency>
<dependency>
<groupId>info.picocli</groupId>
@ -118,14 +116,9 @@
<dependency>
<groupId>org.glassfish.jaxb</groupId>
<artifactId>jaxb-runtime</artifactId>
<version>${version.jaxb-impl}</version>
<version>${version.jaxb}</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>jakarta.xml.bind</groupId>
<artifactId>jakarta.xml.bind-api</artifactId>
<version>${version.jaxb-api}</version>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
@ -161,6 +154,7 @@
<version>1.0.2</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
@ -180,7 +174,7 @@
<plugin>
<groupId>org.sonatype.central</groupId>
<artifactId>central-publishing-maven-plugin</artifactId>
<version>0.10.0</version>
<version>0.8.0</version>
<extensions>true</extensions>
<configuration>
<publishingServerId>central</publishingServerId>
@ -206,33 +200,6 @@
</configuration>
</plugin>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>3.4.0</version>
<executions>
<execution>
<id>copy-license-notice</id>
<phase>process-resources</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${project.build.outputDirectory}/META-INF</outputDirectory>
<resources>
<resource>
<directory>${project.basedir}</directory>
<includes>
<include>NOTICE</include>
</includes>
</resource>
</resources>
<overwrite>true</overwrite>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
@ -266,19 +233,8 @@
<configuration>
<rules>
<requireMavenVersion>
<!-- minimum for OWASP check-->
<version>[3.6.3,)</version>
<version>[3.3.9,)</version>
</requireMavenVersion>
<requireJavaVersion>
<!-- Required for "-proc:full" required for Lombok:
Any Java 11 (LTS) >= 11.0.23
No Java 12 to 16
Any Java 17 (LTS) >= 17.0.11
No Java 18 to 20
Any Java 21 or higher
-->
<version>[11.0.23,12),[17.0.11,18),[21,)</version>
</requireJavaVersion>
</rules>
</configuration>
</execution>
@ -289,67 +245,76 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>3.14.0</version>
<configuration>
<release>11</release>
<source>1.8</source>
<target>1.8</target>
<encoding>UTF-8</encoding>
<!-- This is required for Lombok only since JDK 23
Was backported to 17.0.11 and 11.0.23.
See: https://inside.java/2024/06/18/quality-heads-up/
-->
<proc>full</proc>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.6.1</version>
<version>3.6.0</version>
<executions>
<execution>
<id>jdk11+</id>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<createDependencyReducedPom>false</createDependencyReducedPom>
<shadedArtifactAttached>true</shadedArtifactAttached>
<shadedClassifierName>standalone</shadedClassifierName>
<transformers>
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>de.kosit.validationtool.cmd.CommandLineApplication</mainClass>
</transformer>
<!--
Some open source producers (including the Apache Software Foundation) include a copy of their
license in the META-INF directory. These are conventionally named either LICENSE,LICENSE.txt
or LICENSE.md. When merging these dependencies, adding these resources may cause confusion.
The ApacheLicenseResourceTransformer ensures that duplicate licenses (named according to this
convention) are not merged.
Technically it simply avoids adding them into the final JAR.
We don't need the detailed licensed in the shaded JAR.
-->
<transformer implementation="org.apache.maven.plugins.shade.resource.ApacheLicenseResourceTransformer" />
<!--
Some licenses (including the Apache License, Version 2) require that notices are preserved by
downstream distributors. ApacheNoticeResourceTransformer automates the assembly of an
appropriate NOTICE.
Technically it merges all NOTICE files together
-->
<transformer implementation="org.apache.maven.plugins.shade.resource.ApacheNoticeResourceTransformer">
<addHeader>false</addHeader>
</transformers>
<filters>
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>META-INF/*.SF</exclude>
<exclude>META-INF/*.DSA</exclude>
<exclude>META-INF/*.RSA</exclude>
<exclude>**/module-info.class</exclude>
</excludes>
</filter>
</filters>
</configuration>
</execution>
<execution>
<id>jdk8</id>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<shadedArtifactAttached>true</shadedArtifactAttached>
<shadedClassifierName>java8-standalone</shadedClassifierName>
<artifactSet>
<excludes>
<exclude>org.glassfish.jaxb:jaxb-runtime</exclude>
<exclude>com.sun.istack:istack-commons-runtime</exclude>
<exclude>com.sun.xml.fastinfoset:FastInfoset</exclude>
<exclude>jakarta.activation:jakarta.activation-api</exclude>
<exclude>jakarta.xml.bind:jakarta.xml.bind-api</exclude>
<exclude>org.jvnet.staxex:stax-ex</exclude>
<exclude>org.glassfish.jaxb:txw2</exclude>
</excludes>
</artifactSet>
<transformers>
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>de.kosit.validationtool.cmd.CommandLineApplication</mainClass>
</transformer>
</transformers>
<filters>
<filter>
<artifact>*:*</artifact>
<excludes>
<!-- E.g. MANIFEST.MF -->
<exclude>META-INF/*.MF</exclude>
<!-- Required for JAR signing artefacts -->
<exclude>META-INF/*.SF</exclude>
<exclude>META-INF/*.DSA</exclude>
<exclude>META-INF/*.RSA</exclude>
<!-- We're breaking the Java module system -->
<exclude>**/module-info.class</exclude>
</excludes>
</filter>
@ -385,9 +350,9 @@
<!-- Generate model classes -->
<plugin>
<groupId>org.jvnet.jaxb</groupId>
<artifactId>jaxb-maven-plugin</artifactId>
<version>${version.jaxb-maven-plugin}</version>
<groupId>org.jvnet.jaxb2.maven2</groupId>
<artifactId>maven-jaxb2-plugin</artifactId>
<version>0.15.3</version>
<executions>
<execution>
<goals>
@ -405,12 +370,20 @@
</args>
<plugins>
<plugin>
<groupId>org.jvnet.jaxb</groupId>
<artifactId>jaxb-plugins</artifactId>
<version>${version.jaxb-maven-plugin}</version>
<groupId>org.jvnet.jaxb2_commons</groupId>
<artifactId>jaxb2-basics</artifactId>
<version>0.13.1</version>
</plugin>
</plugins>
</configuration>
<dependencies>
<dependency>
<groupId>org.glassfish.jaxb</groupId>
<artifactId>jaxb-runtime</artifactId>
<version>${version.jaxb}</version>
<optional>true</optional>
</dependency>
</dependencies>
</plugin>
<!-- Integrate code coverage -->
@ -511,7 +484,7 @@
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>3.6.2</version>
<version>3.5.0</version>
<executions>
<execution>
<id>run</id>
@ -522,15 +495,10 @@
</execution>
</executions>
<configuration>
<inheritIo>true</inheritIo>
<!-- have to catch exit codes, cause daemon throws 1 if shutdown is not proper-->
<successCodes>0,1</successCodes>
<executable>java</executable>
<longClasspath>false</longClasspath>
<async>true</async>
<asyncDestroyOnShutdown>true</asyncDestroyOnShutdown>
<cleanupDaemonThreads>false</cleanupDaemonThreads>
<arguments>
<!--suppress MavenModelInspection -->
<argument>${jacocoFailsafe}</argument>
@ -558,7 +526,7 @@
<target>
<!-- schlafen um den Start des Daemon abzuwarten -->
<sleep seconds="10" />
<echo>jacoco.tcp.port=${jacoco.tcp.port}</echo>
<echo>${jacoco.tcp.port}</echo>
</target>
</configuration>
<executions>
@ -595,7 +563,7 @@
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.11.2</version>
<configuration>
<source>11</source>
<source>8</source>
<doclint>none</doclint>
</configuration>
<executions>
@ -670,16 +638,11 @@
<artifactId>dependency-check-maven</artifactId>
<version>${version.owasp-dependency-check}</version>
<configuration>
<!-- Specifies if the build should be failed if a CVSS score
above a specified level is identified.
The default is 11 which means since the CVSS scores are 0-10,
by default the build will never fail.-->
<failBuildOnCVSS>0</failBuildOnCVSS>
<suppressionFiles>
<suppressionFile>${project.basedir}/owasp-suppressions.xml</suppressionFile>
</suppressionFiles>
<!-- ref to CI CD variable -->
<nvdApiKey>${NVD_API_KEY}</nvdApiKey>
</configuration>
<executions>
<execution>
@ -744,7 +707,7 @@
<scm>
<connection>scm:git:https://github.com/itplr-kosit/validator.git</connection>
<developerConnection>scm:git:https://projekte.kosit.org/kosit/validator.git</developerConnection>
<tag>release/1.6.x</tag>
<tag>v1.5.2</tag>
<url>https://github.com/itplr-kosit/validator</url>
</scm>

View file

@ -5,12 +5,12 @@ the moment, this is generated within this module and copied to the actual source
location of the daemon. There are plans to modularize the whole validator source
in the future so that this will be done by build process.
This ui is built using [Docusaurus 3](https://docusaurus.io/), a modern static
This ui is built using [Docusaurus 2](https://docusaurus.io/), a modern static
website generator.
### Local Development
```shell
```
$ npm start
```
@ -19,8 +19,8 @@ Most changes are reflected live without having to restart the server.
### Build
```shell
$ npm run build
```
$ npm build
```
This command generates static content into the `build` directory and must be

View file

@ -14,22 +14,22 @@ Examples:
```shell script
curl --location --request POST 'http://localhost:8080' \
--header 'Content-Type: application/xml' \
--data-binary '@/target.xml'
--header 'Content-Type: application/xml' \
--data-binary '@/target.xml'
```
* `Java` (Apache HttpClient)
* `java` (Apache HttpClient)
```java
HttpClient httpClient=HttpClientBuilder.create().build();
HttpPost postRequest=new HttpPost("http://localhost:8080/");
FileEntity entity=new FileEntity(Paths.get("some.xml").toFile(),ContentType.APPLICATION_XML);
postRequest.setEntity(entity);
HttpResponse response=httpClient.execute(postRequest);
System.out.println(IOUtils.toString(response.getEntity().getContent()));
HttpPost postRequest=new HttpPost("http://localhost:8080/");
FileEntity entity=new FileEntity(Paths.get("some.xml").toFile(),ContentType.APPLICATION_XML);
postRequest.setEntity(entity);
HttpResponse response=httpClient.execute(postRequest);
System.out.println(IOUtils.toString(response.getEntity().getContent()));
```
* `JavaScript`
* `javascript`
```javascript
var myHeaders = new Headers();

View file

@ -2,79 +2,30 @@
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/)
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## 1.6.0
### Fixed
- (DOC) [GitHub PR#166](https://github.com/itplr-kosit/validator/pull/166) Fixed broken links in `docs/api.md`
### Changed
- (CORE) Migration from javax to jakarta xml bind
- (DOC) [GitHub PR#132](https://github.com/itplr-kosit/validator/pull/132) Updated the link to the example Validator scenario configuration
### Removed
- (CORE) java 8 support. new default jdk 11
## 1.5.2 - 2025-09-01
### Fixed
- (BUILD) [#148](https://projekte.kosit.org/kosit/validator/-/issues/148) Regression that due to renaming from `validationtool` to `validator` the distribution zip did not contain all jars anymore
## 1.5.1 - 2025-09-01
### Fixed
- (CORE) [#130](https://projekte.kosit.org/kosit/validator/-/issues/130) Check result to stdout causes an exception. This also fixes [GitHub #131](https://github.com/itplr-kosit/validator/issues/131)
- (CORE) [#131](https://projekte.kosit.org/kosit/validator/-/issues/131) `UnsupportedOperationException` because of read-only list. This also fixes [GitHub #136](https://github.com/itplr-kosit/validator/issues/136)
- (CLI) [#104](https://projekte.kosit.org/kosit/validator/-/issues/104) made the usage of the `-r` parameter optional, if only one unnamed scenario is used
- (CLI) [#145](https://projekte.kosit.org/kosit/validator/-/issues/145) If the CLI is invoked without any parameter, the usage is shown twice
- (DOC) [#129](https://projekte.kosit.org/kosit/validator/-/issues/129) API documentation is outdated. This also fixes [GitHub #130](https://github.com/itplr-kosit/validator/issues/130)
- (BUILD) [#62](https://projekte.kosit.org/kosit/validator/-/issues/62) Surefire Test Error running `de.kosit.validationtool.impl.xml.RemoteResolvingStrategyTest` fails without `http.proxy` setting
- (BUILD) [#110](https://projekte.kosit.org/kosit/validator/-/issues/110) reactivated the GitLab CI environment
### Added
- (BUILD) [#140](https://projekte.kosit.org/kosit/validator/-/issues/140) prepare pom.xml to be able to release to Maven Central
- (BUILD) [#144](https://projekte.kosit.org/kosit/validator/-/issues/144) created a Maven profile to release on Maven Central
### Changed
- (CORE) [#109](https://projekte.kosit.org/kosit/validator/-/issues/109) dependencies were updated to the latest Java 1.8 compatible versions
- Bump [Saxon HE](https://www.saxonica.com/documentation11/documentation.xml) to 12.8
- Bump [jaxb-ri](https://github.com/eclipse-ee4j/jaxb-ri) to 2.3.9
- Bump [SLF4J](https://www.slf4j.org/) to 2.0.17
- (CORE) [#136](https://projekte.kosit.org/kosit/validator/-/issues/136) removed IDE project folders from git
- (BUILD) [#135](https://projekte.kosit.org/kosit/validator/-/issues/135) protected specific git branches
- (BUILD) [#137](https://projekte.kosit.org/kosit/validator/-/issues/137) GitLab CI should only run on Java LTS versions as well as the latest Java version
- (BUILD) [#147](https://projekte.kosit.org/kosit/validator/-/issues/147) Change Maven coordinates from `de.kosit:validationtool` to `org.kosit:validator`
## 1.5.0
# 1.5.0
### Fixed
- (CLI) [#93](https://projekte.kosit.org/kosit/validator/-/issues/93) Remove usage information, when validation failed
- (CLI) [#95](https://projekte.kosit.org/kosit/validator/-/issues/95) NPE when using empty repository definition (-r "")
- (CORE) [GitHub #101](https://github.com/itplr-kosit/validator/issues/101) Role is null in FailedAssert
### Added
- (CLI) Support for multiple configurations and multiple repositories. See [cli documentation](docs/cli.md) for details
- (CLI) Support for multiple configurations and multiple repositories. See [cli documentation](https://github.com/itplr-kosit/validator/blob/master/docs/cli.md) for details
- (API) Possibility to use preconfigured Saxon `Processor` instance for validation
### Changed
- (CORE) [GitHub #100](https://github.com/itplr-kosit/validator/issues/100) Make createReport optional
- (DAEMON) UI rewrite based on [Docusaurs](https://docusaurus.io)
- (API) [ResolvingConfigurationStrategy.java#getProcessor()](de/kosit/validationtool/api/ResolvingConfigurationStrategy) is removed.
- (
API) [ResolvingConfigurationStrategy.java#getProcessor()](https://github.com/itplr-kosit/validator/blob/master/src/main/java/de/kosit/validationtool/api/ResolvingConfigurationStrategy)
is removed.
- (CORE) Bump [Saxon HE](https://www.saxonica.com/documentation11/documentation.xml) to 11.4
- (CORE) Bump [jaxb-ri](https://github.com/eclipse-ee4j/jaxb-ri) to 2.3.7
- (CORE) Various other dependency updates. See pom.xml
- (CORE) CLI parsing based on pico-cli, commons-cli is removed
## 1.4.2
@ -85,14 +36,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- [#80](https://github.com/itplr-kosit/validator/issues/80) using classloader to initialize jaxb context (to support
usage in OSGi
environments)
- [#75](https://github.com/itplr-kosit/validator/issues/75) Improve logging on invalid documents
- [#75] (https://github.com/itplr-kosit/validator/issues/75) Improve logging on invalid documents
## 1.4.1
### Fixed
- Allow more than 3 customLevel elements in scenarios (see xrechnung
configuration [issue 49](https://github.com/itplr-kosit/validator-configuration-xrechnung/issues/49))
configuration [ issue 49](https://github.com/itplr-kosit/validator-configuration-xrechnung/issues/49))
- Remove saxon signature from java8 uber-jar (see [67](https://github.com/itplr-kosit/validator/issues/67))
## 1.4.0
@ -120,14 +71,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- InputFactory has methods to read any java.xml.transform.Source as Input not only StreamSources
- InputFactory uses a generated UUID as name for SourceInput, if no "real" name can be derived
- saxon dependency update (minor, 9.9.1-7)
- [DAEMON] proper status codes when returning results (see [daemon documentation](./docs/daemon.md#status-codes))
- [DAEMON] proper status codes when returning results (see [daemon documentation](https://github.com/itplr-kosit/validator/blob/master/docs/daemon.md#status-codes))
## 1.3.1
### Fixed
- `getFailedAsserts()` and `isSchematronValid()`
in [DefaultResult.java](https://github.com/itplr-kosit/validator/blob/main/src/main/java/de/kosit/validationtool/impl/DefaultResult.java)
in [DefaultResult.java](https://github.com/itplr-kosit/validator/blob/master/src/main/java/de/kosit/validationtool/impl/DefaultResult.java)
do not reflect actual schematron validation result
- processing aborts on schematron execution errors (e.g. errors within schematron logic). The validator now generates a
report in such cases.
@ -175,20 +126,20 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added
- Provide access to schematron result
through [Result.java](https://github.com/itplr-kosit/validator/blob/main/src/main/java/de/kosit/validationtool/api/Result.java)
- _Result#getFailedAsserts()_ returns a list of failed asserts found by schematron
- _Result#isSchematronValid()_ convinience access to evaluate whether schematron was processed without any _
FailedAsserts_
through [Result.java](https://github.com/itplr-kosit/validator/blob/master/src/main/java/de/kosit/validationtool/api/Result.java)
- *Result#getFailedAsserts()* returns a list of failed asserts found by schematron
- *Result#isSchematronValid()* convinience access to evaluate whether schematron was processed without any *
FailedAsserts*
### Changed
- _Result#getAcceptRecommendation()_ does not _only_ work when _acceptMatch_ is configured in the scenario
- *Result#getAcceptRecommendation()* does not _only_ work when _acceptMatch_ is configured in the scenario
- schema correctness is a precondition, if the checked instance is not valid, this evaluates to _REJECTED_
- if _acceptMatch_ is configured, the result is based on the boolean result of the xpath expression evaluated against
the generated report
- if _no_ _acceptMatch_ is configured, the result is based on evaluation of schema and schematron correctness
- if *no* _acceptMatch_ is configured, the result is based on evaluation of schema and schematron correctness
- _UNDEFINED_ is only returned, when processing is stopped somehow
- _Result#isAcceptable()_ can now evaluate to true, when no _acceptMatch_ is configured (see above)
- *Result#isAcceptable()* can now evaluate to true, when no _acceptMatch_ is configured (see above)
## 1.1.3

View file

@ -6,19 +6,15 @@ sidebar_position: 1
The validator needs a scenario configuration for working properly.
Here are some public validation configurations:
Currently, there are two public third party validation configurations available.
* Validation Configuration for [XRechnung](https://xeinkauf.de/xrechnung/):
* Validation Configuration for [XRechnung](http://www.xoev.de/de/xrechnung):
* Source code is available on [GitHub](https://github.com/itplr-kosit/validator-configuration-xrechnung)
* [Releases](https://github.com/itplr-kosit/validator-configuration-xrechnung/releases) can also be downloaded
* Validation Configuration for [Peppol BIS Billing](https://docs.peppol.eu/poacc/billing/3.0/):
* Source code is available on [GitHub](https://github.com/itplr-kosit/validator-configuration-bis)
* [Releases](https://github.com/itplr-kosit/validator-configuration-bis/releases) can also be downloaded
* Validation Configuration for [XGewerbeanzeige](https://xgewerbeanzeige.de/)
* Source code is available on [GitHub](https://github.com/itplr-kosit/validator-configuration-xgewerbeanzeige)
* [Releases](https://github.com/itplr-kosit/validator-configuration-xgewerbeanzeige/releases) can also be downloaded
For creating custom configurations
see [configuration documentation](https://github.com/itplr-kosit/validator/blob/main/docs/configurations.md)
see [configuration documentation](https://github.com/itplr-kosit/validator/blob/master/docs/configurations.md)
for details

View file

@ -18,8 +18,8 @@
// @ts-check
// Note: type annotations allow type checking and IDEs autocompletion
const lightCodeTheme = require("prism-react-renderer").themes.github;
const darkCodeTheme = require("prism-react-renderer").themes.dracula;
const lightCodeTheme = require("prism-react-renderer/themes/github");
const darkCodeTheme = require("prism-react-renderer/themes/dracula");
const pkg = require("./package.json");
/** @type {import('@docusaurus/types').Config} */
@ -28,7 +28,7 @@ const config = {
tagline: "Validating any XML",
url: "https://your-docusaurus-test-site.com",
baseUrl: "/",
onBrokenLinks: "log",
onBrokenLinks: "throw",
onBrokenMarkdownLinks: "warn",
favicon: "img/favicon.svg",
customFields: {
@ -119,7 +119,7 @@ const config = {
title: "Community",
items: [
{
label: "GitHub",
label: "Github",
href: "https://github.com/itplr-kosit/validator",
},
{
@ -133,11 +133,11 @@ const config = {
items: [
{
label: "KoSIT",
href: "https://xeinkauf.de",
href: "https://www.xoev.de",
},
{
label: "XRechnung",
href: "https://xeinkauf.de/xrechnung/",
href: "https://www.xoev.de/xrechnung-16828",
},
],
},

30009
server/ui/package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -20,33 +20,34 @@
"lint:fix": "npm run format && eslint . --fix"
},
"dependencies": {
"@docusaurus/core": "^3.8.1",
"@docusaurus/preset-classic": "^3.8.1",
"@mdx-js/react": "^3.1.1",
"@mui/icons-material": "^7.3.2",
"clsx": "^2.1.1",
"@docusaurus/core": "2.2.0",
"@docusaurus/preset-classic": "2.2.0",
"@mdx-js/react": "^1.6.22",
"@mui/icons-material": "^5.10.14",
"clsx": "^1.2.1",
"js-file-download": "^0.4.12",
"prism-react-renderer": "^2.4.1",
"react": "^19.1.1",
"react-dom": "^19.1.1",
"react-dropzone": "^14.3.8"
"prism-react-renderer": "^1.3.5",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-dropzone": "^14.2.3"
},
"devDependencies": {
"@docusaurus/module-type-aliases": "^3.8.1",
"@tsconfig/docusaurus": "^2.0.3",
"@typescript-eslint/eslint-plugin": "^8.43.0",
"@typescript-eslint/parser": "^8.43.0",
"cross-env": "^10.0.0",
"eslint": "^9.35.0",
"eslint-config-prettier": "^10.1.8",
"eslint-import-resolver-typescript": "^4.4.4",
"eslint-plugin-import": "^2.32.0",
"eslint-plugin-jsx-a11y": "^6.10.2",
"eslint-plugin-prettier": "^5.5.4",
"eslint-plugin-react": "^7.37.5",
"eslint-plugin-react-hooks": "^5.2.0",
"prettier": "^3.6.2",
"typescript": "^5.9.2"
"@docusaurus/module-type-aliases": "2.2.0",
"@tsconfig/docusaurus": "^1.0.5",
"@typescript-eslint/eslint-plugin": "^5.43.0",
"@typescript-eslint/parser": "^5.43.0",
"cross-env": "^7.0.3",
"eslint": "^8.27.0",
"eslint-config-airbnb": "^19.0.4",
"eslint-config-prettier": "^8.5.0",
"eslint-import-resolver-typescript": "^3.5.2",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-jsx-a11y": "^6.6.1",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-react": "^7.31.10",
"eslint-plugin-react-hooks": "^4.6.0",
"prettier": "^2.7.1",
"typescript": "^4.7.4"
},
"browserslist": {
"production": [
@ -62,7 +63,12 @@
]
},
"engines": {
"node": ">=18.0"
"node": ">=16.14"
},
"overrides": {}
"overrides": {
"loader-utils": "^2.0.4",
"react-dev-utils": {
"loader-utils": "^3.2.1"
}
}
}

View file

@ -1,5 +1,5 @@
import clsx from "clsx";
import type { ButtonHTMLAttributes, DetailedHTMLProps, JSX, ReactNode } from "react";
import type { ButtonHTMLAttributes, DetailedHTMLProps, ReactNode } from "react";
import React from "react";
import type { ExtendProps } from "../util/types";
import styles from "./Button.module.css";

View file

@ -1,6 +1,6 @@
import React, { JSX, useEffect, useState } from "react";
import React, { useEffect, useState } from "react";
import type { PrismTheme, Language } from "prism-react-renderer";
import { Highlight, themes } from "prism-react-renderer";
import Highlight, { defaultProps } from "prism-react-renderer";
import useDocusaurusContext from "@docusaurus/useDocusaurusContext";
import clsx from "clsx";
import downloadFile from "js-file-download";
@ -63,6 +63,7 @@ function Codeblock({
return (
<div className={styles.wrapper}>
<Highlight
{...defaultProps}
code={children}
language={language}
theme={codeTheme}

View file

@ -1,5 +1,5 @@
/* eslint-disable react/jsx-props-no-spreading */
import React, { JSX } from "react";
import React from "react";
import clsx from "clsx";
import type { DropEvent } from "react-dropzone";
import { useDropzone } from "react-dropzone";

View file

@ -1,4 +1,4 @@
import type { JSX, ReactNode } from "react";
import type { ReactNode } from "react";
import React from "react";
import Layout from "@theme/Layout";
import styles from "./PageLayout.module.css";

View file

@ -1,4 +1,4 @@
import React, { JSX } from "react";
import React from "react";
import PageLayout from "@site/src/components/PageLayout";
import XmlView from "@site/src/components/XmlView";

View file

@ -1,4 +1,4 @@
import React, { JSX } from "react";
import React from "react";
import PageLayout from "@site/src/components/PageLayout";
import XmlView from "@site/src/components/XmlView";

View file

@ -1,4 +1,4 @@
import React, { JSX } from "react";
import React from "react";
import Upload from "../components/Upload";
import PageLayout from "../components/PageLayout";

View file

@ -20,10 +20,6 @@
<includes>
<include>validator-*.jar</include>
</includes>
<!-- excludes always win over includes if both patterns match -->
<excludes>
<exclude>*standalone.jar</exclude>
</excludes>
</fileSet>
</fileSets>
@ -32,6 +28,7 @@
<outputDirectory>libs</outputDirectory>
<useProjectArtifact>false</useProjectArtifact>
<scope>runtime</scope>
<outputFileNameMapping>${artifact.artifactId}-${artifact.baseVersion}.${artifact.extension}</outputFileNameMapping>
</dependencySet>
</dependencySets>

View file

@ -45,7 +45,7 @@ public interface Input {
/**
* The digest algorithm used for computing the {@link #getHashCode()}
*
* @return the name of the digest algorithm
* @return the name of the digest algorith
*/
String getDigestAlgorithm();

View file

@ -22,7 +22,6 @@ import org.oclc.purl.dsdl.svrl.FailedAssert;
import org.oclc.purl.dsdl.svrl.SchematronOutput;
import org.w3c.dom.Document;
import de.kosit.validationtool.impl.model.CustomFailedAssert;
import net.sf.saxon.s9api.XdmNode;
/**
@ -70,31 +69,23 @@ public interface Result {
/**
* Schnellzugriff auf die Empfehlung zur Weiterverarbeitung des Dokuments.
*
* @return <code>true</code> wenn {@link AcceptRecommendation#ACCEPTABLE}
* @return true wenn {@link AcceptRecommendation#ACCEPTABLE}
*/
boolean isAcceptable();
/**
* Gibt eine Liste mit gefundenen Schema-Validation-Fehler zurück. Diese Liste ist leer, wenn keine Fehler gefunden
* wurden.
*
* @return List of schema validation errors.
*/
List<XmlError> getSchemaViolations();
/**
* Liefert die Ergebnisse der Schematron-Prüfungen, in der Reihenfolge der Szenario-Konfiguration.
*
* @return List with Schematron results
* @return Liste mit Schematron-Ergebnissen
*/
List<SchematronOutput> getSchematronResult();
/**
* @return List of custom failed asserts per Schematron level. Only failed assertions with a custom level are
* contained. Never <code>null</code> but maybe empty.
*/
List<CustomFailedAssert> getCustomFailedAsserts();
/**
* Returns {@link org.oclc.purl.dsdl.svrl.FailedAssert FailedAsserts} of a schematron evaluation.
*
@ -105,14 +96,14 @@ public interface Result {
/**
* Liefert ein true, wenn keine Schema-Violations vorhanden sind.
*
* @return <code>true</code> if XML Schema compliant
* @return true wenn Schema-valide
*/
boolean isSchemaValid();
/**
* Liefert ein true, wenn der Prüfling eine well-formed XML-Datei ist.
*
* @return <code>true</code> if wellformed
* @return true wenn well-formed
*/
boolean isWellformed();
@ -120,7 +111,7 @@ public interface Result {
* Returns true, if schematron has been checked and the result does not contain any {@link FailedAssert
* FailedAsserts}.
*
* @return <code>true</code>, if valid
* @return true, if valid
*/
boolean isSchematronValid();
}

View file

@ -23,14 +23,16 @@ import java.util.Map;
import org.apache.commons.lang3.StringUtils;
import de.kosit.validationtool.cmd.assertions.AssertionType;
import de.kosit.validationtool.cmd.assertions.Assertions;
import de.kosit.validationtool.impl.model.Result;
import de.kosit.validationtool.impl.tasks.CheckAction;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import de.kosit.validationtool.cmd.assertions.AssertionType;
import de.kosit.validationtool.cmd.assertions.Assertions;
import de.kosit.validationtool.impl.model.Result;
import de.kosit.validationtool.impl.tasks.CheckAction;
import net.sf.saxon.s9api.Processor;
import net.sf.saxon.s9api.SaxonApiException;
import net.sf.saxon.s9api.XPathCompiler;
@ -54,12 +56,12 @@ class CheckAssertionAction implements CheckAction {
private Map<String, List<AssertionType>> mappedAssertions;
private static boolean matches(final String key, final String name) {
private static boolean matches(String key, String name) {
return key.startsWith(name) || (name + ".xml").endsWith(key);
}
@Override
public void check(final Bag results) {
public void check(Bag results) {
log.info("Checking assertions for {}", results.getInput().getName());
final List<AssertionType> toCheck = findAssertions(results.getName());
final List<String> errors = new ArrayList<>();
@ -82,28 +84,28 @@ class CheckAssertionAction implements CheckAction {
}
}
private List<AssertionType> findAssertions(final String name) {
private List<AssertionType> findAssertions(String name) {
return getMapped().entrySet().stream().filter(e -> matches(e.getKey(), name)).map(Map.Entry::getValue).findFirst().orElse(null);
}
private boolean check(final XdmNode document, final AssertionType assertion) {
private boolean check(XdmNode document, AssertionType assertion) {
try {
final XPathSelector selector = createSelector(assertion);
selector.setContextItem(document);
return selector.effectiveBooleanValue();
} catch (final SaxonApiException e) {
} catch (SaxonApiException e) {
log.error("Error evaluating assertion {} for {}", assertion.getTest(), assertion.getReportDoc(), e);
}
return false;
}
private XPathSelector createSelector(final AssertionType assertion) {
private XPathSelector createSelector(AssertionType assertion) throws SaxonApiException {
try {
final XPathCompiler compiler = getProcessor().newXPathCompiler();
assertions.getNamespace().forEach(ns -> compiler.declareNamespace(ns.getPrefix(), ns.getValue()));
return compiler.compile(assertion.getTest()).load();
} catch (final SaxonApiException e) {
} catch (SaxonApiException e) {
throw new IllegalStateException(String.format("Can not compile xpath match expression '%s'",
StringUtils.isNotBlank(assertion.getTest()) ? assertion.getTest() : "EMPTY EXPRESSION"), e);
}
@ -112,8 +114,8 @@ class CheckAssertionAction implements CheckAction {
private Map<String, List<AssertionType>> getMapped() {
if (mappedAssertions == null) {
mappedAssertions = new HashMap<>();
for (final AssertionType assertionType : assertions.getAssertion()) {
final List<AssertionType> list = mappedAssertions.computeIfAbsent(assertionType.getReportDoc(), k -> new ArrayList<>());
for (AssertionType assertionType : assertions.getAssertion()) {
List<AssertionType> list = mappedAssertions.computeIfAbsent(assertionType.getReportDoc(), k -> new ArrayList<>());
list.add(assertionType);
}
}

View file

@ -95,8 +95,6 @@ public class CommandLineApplication {
return resultStatus;
}
// The signature is required, because the method is used a lambda
@SuppressWarnings("unused")
private static int logExecutionException(final Exception ex, final CommandLine cli, final ParseResult parseResult) {
final String message = isNotEmpty(ex.getMessage()) ? ex.getMessage() : "Es ist eine Fehler aufgetreten";
Printer.writeErr(ex, message);

View file

@ -20,8 +20,8 @@ import lombok.Getter;
import lombok.RequiredArgsConstructor;
/**
* CLI return codes. Codes &gt; 0 indicate a processing error. Codes &lt; 0 indicates a configuration error. Code 0
* indicates a successful processing.
* CLI return codes. Codes > 0 indicate a processing error. Codes < indicates a configuration error. Code 0 indicates a
* successful processing.
*
* @author Andreas Penski
*/

View file

@ -321,8 +321,10 @@ public class Validator {
private static URI determineRepository(final Path d) {
if (Files.isDirectory(d)) {
return d.toUri();
} else {
throw new IllegalArgumentException(
String.format("Not a valid path for repository definition specified: '%s'", d.toAbsolutePath()));
}
throw new IllegalArgumentException(String.format("Not a valid path for repository definition specified: '%s'", d.toAbsolutePath()));
}

View file

@ -82,7 +82,6 @@ public class Grid {
*
* @param name the name of the column
* @param maxLength the max length of the column
* @param minLength the minimum length of the column
*/
public ColumnDefinition(final String name, final int maxLength, final int minLength) {
this(name, maxLength, minLength, 1);
@ -92,8 +91,7 @@ public class Grid {
* Constructor.
*
* @param name the name of the column
* @param maxLength the max length of the column
* @param minLength the minimum length of the column
* @param minLength the max length of the column
* @param maxLines the max lines per cell
*/
public ColumnDefinition(final String name, final int maxLength, final int minLength, final int maxLines) {
@ -151,6 +149,10 @@ public class Grid {
this.text.add(txt);
}
public Cell(final Object object, final Code... codes) {
this(new Text(object, codes));
}
protected Line getFormattedLine(final int lineNumber, final ColumnDefinition def) {
final Line line = new Line();
int startSubstring = lineNumber * def.getLength();
@ -192,6 +194,11 @@ public class Grid {
}
public Cell add(final Object object, final Code... codes) {
this.text.add(new Text(object, codes));
return this;
}
}
private static final Format DEFAULT_FORMAT = new Format();
@ -314,7 +321,7 @@ public class Grid {
}
private static boolean isEmpty(final StringBuilder current) {
return current.toString().replace("|", "").trim().length() == 0;
return current.toString().replaceAll("\\|", "").trim().length() == 0;
}
private int getMaxVirtualLine() {

View file

@ -16,6 +16,8 @@
package de.kosit.validationtool.config;
import static org.apache.commons.lang3.StringUtils.startsWith;
import java.net.MalformedURLException;
import java.net.URI;
import java.util.HashMap;
@ -25,7 +27,10 @@ import java.util.stream.Collectors;
import javax.xml.validation.Schema;
import org.apache.commons.lang3.Strings;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import de.kosit.validationtool.api.Check;
import de.kosit.validationtool.api.Configuration;
@ -44,10 +49,7 @@ import de.kosit.validationtool.model.reportInput.XMLSyntaxError;
import de.kosit.validationtool.model.scenarios.ResourceType;
import de.kosit.validationtool.model.scenarios.ScenarioType;
import de.kosit.validationtool.model.scenarios.Scenarios;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import net.sf.saxon.s9api.Processor;
import net.sf.saxon.s9api.QName;
import net.sf.saxon.s9api.XdmNode;
@ -111,8 +113,8 @@ public class ConfigurationLoader {
private static boolean isSupportedDocument(final XdmNode doc) {
final XdmNode root = findRoot(doc);
final String frameworkVersion = root.getAttributeValue(new QName("frameworkVersion"));
return Strings.CS.startsWith(frameworkVersion, SUPPORTED_MAJOR_VERSION)
&& root.getNodeName().getNamespace().equals(SUPPORTED_MAJOR_VERSION_SCHEMA);
return startsWith(frameworkVersion, SUPPORTED_MAJOR_VERSION)
&& root.getNodeName().getNamespaceURI().equals(SUPPORTED_MAJOR_VERSION_SCHEMA);
}
private static Scenario createFallback(final Scenarios scenarios, final ContentRepository repository) {

View file

@ -44,18 +44,18 @@ abstract class BaseHandler implements HttpHandler {
throws IOException {
exchange.getResponseHeaders().add("Content-Type", contentType);
exchange.sendResponseHeaders(statusCode, 0);
try ( final OutputStream os = exchange.getResponseBody() ) {
final OutputStream os = exchange.getResponseBody();
write.write(os);
}
os.close();
}
protected static void error(final HttpExchange exchange, final int statusCode, final String message) throws IOException {
final byte[] bytes = message.getBytes();
exchange.getResponseHeaders().add("Content-Type", "text/plain");
exchange.sendResponseHeaders(statusCode, bytes.length);
try ( final OutputStream os = exchange.getResponseBody() ) {
final OutputStream os = exchange.getResponseBody();
os.write(bytes);
}
os.close();
}
@FunctionalInterface

View file

@ -17,9 +17,11 @@
package de.kosit.validationtool.impl;
import java.util.ArrayList;
import java.util.List;
import java.util.Collection;
import java.util.StringJoiner;
import javax.xml.bind.ValidationEvent;
import javax.xml.bind.ValidationEventHandler;
import javax.xml.transform.ErrorListener;
import javax.xml.transform.SourceLocator;
import javax.xml.transform.TransformerException;
@ -28,11 +30,11 @@ import org.xml.sax.ErrorHandler;
import org.xml.sax.SAXException;
import org.xml.sax.SAXParseException;
import lombok.Getter;
import de.kosit.validationtool.model.reportInput.XMLSyntaxError;
import de.kosit.validationtool.model.reportInput.XMLSyntaxErrorSeverity;
import jakarta.xml.bind.ValidationEvent;
import jakarta.xml.bind.ValidationEventHandler;
import lombok.Getter;
import net.sf.saxon.s9api.MessageListener2;
import net.sf.saxon.s9api.QName;
import net.sf.saxon.s9api.XdmNode;
@ -47,9 +49,9 @@ public class CollectingErrorEventHandler implements ValidationEventHandler, Erro
private static final int DEFAULT_ABORT_COUNT = 50;
private final int stopProcessCount = DEFAULT_ABORT_COUNT;
private static final int stopProcessCount = DEFAULT_ABORT_COUNT;
private final List<XMLSyntaxError> errors = new ArrayList<>();
private final Collection<XMLSyntaxError> errors = new ArrayList<>();
private static XMLSyntaxError createError(final XMLSyntaxErrorSeverity severity, final String message) {
final XMLSyntaxError e = new XMLSyntaxError();

View file

@ -37,6 +37,10 @@ import javax.xml.validation.SchemaFactory;
import org.apache.commons.lang3.StringUtils;
import org.xml.sax.SAXException;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import de.kosit.validationtool.api.ResolvingConfigurationStrategy;
import de.kosit.validationtool.impl.Scenario.Transformation;
import de.kosit.validationtool.impl.xml.RelativeUriResolver;
@ -45,9 +49,7 @@ import de.kosit.validationtool.model.scenarios.NamespaceType;
import de.kosit.validationtool.model.scenarios.ResourceType;
import de.kosit.validationtool.model.scenarios.ScenarioType;
import de.kosit.validationtool.model.scenarios.ValidateWithSchematron;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import net.sf.saxon.lib.UnparsedTextURIResolver;
import net.sf.saxon.s9api.Processor;
import net.sf.saxon.s9api.SaxonApiException;

View file

@ -24,6 +24,14 @@ import java.util.Arrays;
import java.util.Collection;
import java.util.StringJoiner;
import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBElement;
import javax.xml.bind.JAXBException;
import javax.xml.bind.JAXBIntrospector;
import javax.xml.bind.Marshaller;
import javax.xml.bind.Unmarshaller;
import javax.xml.bind.ValidationEventHandler;
import javax.xml.bind.annotation.XmlRegistry;
import javax.xml.namespace.QName;
import javax.xml.stream.XMLInputFactory;
import javax.xml.stream.XMLOutputFactory;
@ -36,14 +44,6 @@ import javax.xml.validation.Schema;
import org.apache.commons.lang3.StringUtils;
import jakarta.xml.bind.JAXBContext;
import jakarta.xml.bind.JAXBElement;
import jakarta.xml.bind.JAXBException;
import jakarta.xml.bind.JAXBIntrospector;
import jakarta.xml.bind.Marshaller;
import jakarta.xml.bind.Unmarshaller;
import jakarta.xml.bind.ValidationEventHandler;
import jakarta.xml.bind.annotation.XmlRegistry;
import lombok.extern.slf4j.Slf4j;
/**
@ -219,7 +219,6 @@ public class ConversionService {
final XMLOutputFactory xof = XMLOutputFactory.newFactory();
final XMLStreamWriter xmlStreamWriter = xof.createXMLStreamWriter(w);
if (null == introspector.getElementName(model)) {
@SuppressWarnings({ "rawtypes", "unchecked" })
final JAXBElement jaxbElement = new JAXBElement(createQName(model), model.getClass(), model);
marshaller.marshal(jaxbElement, xmlStreamWriter);
} else {

View file

@ -20,21 +20,19 @@ import static de.kosit.validationtool.impl.DateFactory.createTimestamp;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.stream.Collectors;
import org.oclc.purl.dsdl.svrl.FailedAssert;
import org.oclc.purl.dsdl.svrl.SchematronOutput;
import lombok.Getter;
import lombok.extern.slf4j.Slf4j;
import de.kosit.validationtool.api.Check;
import de.kosit.validationtool.api.Configuration;
import de.kosit.validationtool.api.Input;
import de.kosit.validationtool.api.Result;
import de.kosit.validationtool.api.XmlError;
import de.kosit.validationtool.impl.model.CustomFailedAssert;
import de.kosit.validationtool.impl.tasks.CheckAction;
import de.kosit.validationtool.impl.tasks.CheckAction.Bag;
import de.kosit.validationtool.impl.tasks.ComputeAcceptanceAction;
@ -49,10 +47,7 @@ import de.kosit.validationtool.impl.xml.ProcessorProvider;
import de.kosit.validationtool.model.reportInput.CreateReportInput;
import de.kosit.validationtool.model.reportInput.EngineType;
import de.kosit.validationtool.model.reportInput.XMLSyntaxError;
import de.kosit.validationtool.model.scenarios.ErrorLevelType;
import de.kosit.validationtool.model.scenarios.ScenarioType;
import lombok.Getter;
import lombok.extern.slf4j.Slf4j;
import net.sf.saxon.s9api.Processor;
/**
@ -146,31 +141,10 @@ public class DefaultCheck implements Check {
result.setProcessingSuccessful(!t.isStopped() && t.isFinished());
result.setSchematronResult(t.getReportInput().getValidationResultsSchematron().stream().filter(e -> e.getResults() != null)
.map(e -> e.getResults().getSchematronOutput()).collect(Collectors.toList()));
result.setCustomFailedAsserts(buildCustomFailedAssertsList(t, result.getSchematronResult()));
return result;
}
private List<CustomFailedAssert> buildCustomFailedAssertsList(final Bag t, final List<SchematronOutput> schematronResult) {
// Get Map of Assertion ID to custom error levels for the current scenario
final Map<String, ErrorLevelType> customLevels = Optional.ofNullable(t.getScenarioSelectionResult())
.map(de.kosit.validationtool.impl.model.Result::getObject).map(Scenario::getConfiguration)
.map(ScenarioType::getCreateReport)
.map(r -> r.getCustomLevel().stream()
.flatMap(customLevel -> customLevel.getValue().stream().map(id -> Map.entry(id, customLevel.getLevel())))
.collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue)))
.orElse(Collections.emptyMap());
// Now check all failed assertions of all schematron validations if they contain a failed assertion with one of
// the changed IDs
return schematronResult.stream().flatMap(x -> x.getActivePatternAndFiredRuleAndFailedAssert().stream())
.filter(FailedAssert.class::isInstance).map(FailedAssert.class::cast).filter(fa -> customLevels.containsKey(fa.getId()))
.map(fa -> new CustomFailedAssert(fa, customLevels.get(fa.getId()))).collect(Collectors.toList());
}
@SuppressWarnings("unchecked")
private static List<XmlError> convertErrors(final List<XMLSyntaxError> errors) {
private static List<XmlError> convertErrors(final Collection<XMLSyntaxError> errors) {
// noinspection unchecked
return (List<XmlError>) (List<?>) errors;
}

View file

@ -25,14 +25,15 @@ import org.oclc.purl.dsdl.svrl.SchematronOutput;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import de.kosit.validationtool.api.AcceptRecommendation;
import de.kosit.validationtool.api.Result;
import de.kosit.validationtool.api.XmlError;
import de.kosit.validationtool.impl.model.CustomFailedAssert;
import de.kosit.validationtool.model.reportInput.CreateReportInput;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.Setter;
import de.kosit.validationtool.api.AcceptRecommendation;
import de.kosit.validationtool.api.Result;
import de.kosit.validationtool.api.XmlError;
import de.kosit.validationtool.model.reportInput.CreateReportInput;
import net.sf.saxon.dom.NodeOverNodeInfo;
import net.sf.saxon.s9api.XdmNode;
@ -66,11 +67,6 @@ public class DefaultResult implements Result {
@Setter(AccessLevel.PACKAGE)
private List<SchematronOutput> schematronResult;
/**
* List of custom failed asserts per Schematron level. Only failed assertions with a custom level are contained.
*/
private List<CustomFailedAssert> customFailedAsserts;
@Getter
@Setter
private boolean processingSuccessful;
@ -153,28 +149,19 @@ public class DefaultResult implements Result {
}
private <T> List<T> filterSchematronResult(final Class<T> type) {
return this.schematronResult != null
? this.schematronResult.stream().flatMap(e -> e.getActivePatternAndFiredRuleAndFailedAssert().stream())
return getSchematronResult() != null
? getSchematronResult().stream().flatMap(e -> e.getActivePatternAndFiredRuleAndFailedAssert().stream())
.filter(type::isInstance).map(type::cast).collect(Collectors.toList())
: Collections.emptyList();
}
private boolean isSchematronEvaluated() {
return this.schematronResult != null
&& this.schematronResult.stream().noneMatch(e -> e.getActivePatternAndFiredRuleAndFailedAssert().isEmpty());
return getSchematronResult() != null
&& getSchematronResult().stream().noneMatch(e -> e.getActivePatternAndFiredRuleAndFailedAssert().isEmpty());
}
@Override
public boolean isSchematronValid() {
return isSchematronEvaluated() && getFailedAsserts().isEmpty();
}
@Override
public List<CustomFailedAssert> getCustomFailedAsserts() {
return this.customFailedAsserts;
}
public void setCustomFailedAsserts(List<CustomFailedAssert> customFailedAsserts) {
this.customFailedAsserts = customFailedAsserts;
}
}

View file

@ -17,12 +17,15 @@
package de.kosit.validationtool.impl;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.stream.Collectors;
import lombok.extern.slf4j.Slf4j;
import de.kosit.validationtool.api.Configuration;
import de.kosit.validationtool.impl.model.Result;
import lombok.extern.slf4j.Slf4j;
import net.sf.saxon.s9api.SaxonApiException;
import net.sf.saxon.s9api.XPathSelector;
import net.sf.saxon.s9api.XdmNode;
@ -64,14 +67,17 @@ public class ScenarioRepository {
private String summarizeScenarios() {
final StringBuilder b = new StringBuilder();
getScenarios().forEach(s -> b.append(s.getName()).append('\n'));
getScenarios().forEach(s -> {
b.append(s.getName());
b.append("\n");
});
return b.toString();
}
/**
* Determine the matching Scenario for the provided input document
* Ermittelt für das gegebene Dokument das passende Szenario.
*
* @param document input document
* @param document das Eingabedokument
* @return ein Ergebnis-Objekt zur weiteren Verarbeitung
*/
public Result<Scenario, String> selectScenario(final XdmNode document) {
@ -80,9 +86,10 @@ public class ScenarioRepository {
if (collect.size() == 1) {
result = new Result<>(collect.get(0));
} else if (collect.isEmpty()) {
result = new Result<>(getFallbackScenario(), Arrays.asList("None of the loaded scenarios matches the specified document"));
result = new Result<>(getFallbackScenario(),
Collections.singleton("None of the loaded scenarios matches the specified document"));
} else {
result = new Result<>(getFallbackScenario(), Arrays.asList("More than one scenario matches the specified document"));
result = new Result<>(getFallbackScenario(), Collections.singleton("More than on scenario matches the specified document"));
}
return result;

View file

@ -19,18 +19,18 @@ package de.kosit.validationtool.impl.input;
import static org.apache.commons.lang3.StringUtils.defaultIfBlank;
import java.io.IOException;
import java.io.UncheckedIOException;
import java.nio.charset.Charset;
import javax.xml.bind.util.JAXBSource;
import javax.xml.transform.Source;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamSource;
import org.apache.commons.io.input.ReaderInputStream;
import jakarta.xml.bind.util.JAXBSource;
import lombok.Getter;
import lombok.extern.slf4j.Slf4j;
import net.sf.saxon.om.TreeInfo;
/**
@ -43,7 +43,7 @@ import net.sf.saxon.om.TreeInfo;
* <ul>
* <li>{@link StreamSource} - both {@link java.io.InputStream} based and {@link java.io.Reader} based</li>
* <li>{@link javax.xml.transform.dom.DOMSource}</li>
* <li>{@link jakarta.xml.bind.util.JAXBSource}</li>
* <li>{@link javax.xml.bind.util.JAXBSource}</li>
* <li>{@link TreeInfo}</li>
* </ul>
*
@ -102,7 +102,7 @@ public class SourceInput extends AbstractInput {
return isStreamSource();
}
private boolean isConsumed() {
private boolean isConsumed() throws IOException {
if (isStreamSource()) {
final StreamSource ss = (StreamSource) this.source;
@ -140,13 +140,7 @@ public class SourceInput extends AbstractInput {
if (ss.getInputStream() != null) {
result = new StreamSource(wrap(ss.getInputStream()), this.source.getSystemId());
} else if (ss.getReader() != null) {
try {
result = new StreamSource(
wrap(ReaderInputStream.builder().setReader(ss.getReader()).setCharset(Charset.defaultCharset()).get()),
this.source.getSystemId());
} catch (final IOException ex) {
throw new UncheckedIOException(ex);
}
result = new StreamSource(wrap(new ReaderInputStream(ss.getReader(), Charset.defaultCharset())), this.source.getSystemId());
}
}
return result;

View file

@ -20,14 +20,13 @@ import java.io.BufferedInputStream;
import java.io.FilterInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.UncheckedIOException;
import java.security.DigestInputStream;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import javax.xml.transform.stream.StreamSource;
import org.apache.commons.io.input.BoundedInputStream;
import org.apache.commons.io.input.CountingInputStream;
import de.kosit.validationtool.api.Input;
@ -40,7 +39,7 @@ public class StreamHelper {
/**
* Helper class, which generates the hashcode while reading the stream e.g. for parsing the document. This allows
* generating the hashcode without an additional reading step.
* generating the hashcode without an aditional reading step.
*/
@SuppressWarnings("squid:S4929") // efficient read is done by internally used stream
private static class DigestingInputStream extends FilterInputStream {
@ -97,15 +96,15 @@ public class StreamHelper {
private final LazyReadInput reference;
public CountInputStream(final LazyReadInput input, final InputStream stream) throws IOException {
super(BoundedInputStream.builder().setInputStream(stream).get());
public CountInputStream(final LazyReadInput input, final InputStream stream) {
super(new org.apache.commons.io.input.CountingInputStream(stream));
this.reference = input;
}
@Override
public void close() throws IOException {
super.close();
this.reference.setLength(((BoundedInputStream) this.in).getCount());
this.reference.setLength(((CountingInputStream) this.in).getByteCount());
}
}
@ -131,24 +130,19 @@ public class StreamHelper {
/**
* Wraps the {@link InputStream} with a counting length implementation.
*
* @param input the lazy read input
* @param input the {@link LazyReadInput input}
* @param stream the stream
* @return a wrapped stream
*/
public static InputStream wrapCount(final LazyReadInput input, final InputStream stream) {
try {
return new CountInputStream(input, stream);
} catch (final IOException ex) {
throw new UncheckedIOException(ex);
}
}
/**
* Wraps the {@link InputStream} with an implementation the generates a hash sum over the stream data.
*
* @param input the lazy read input
* @param input the {@link LazyReadInput input}
* @param stream the stream
* @param digestAlgorithm the message digest algorithm to use
* @return a wrapped stream
*/
public static InputStream wrapDigesting(final LazyReadInput input, final InputStream stream, final String digestAlgorithm) {
@ -181,7 +175,7 @@ public class StreamHelper {
* @param input the input
* @throws IOException on I/O errors
*/
@SuppressWarnings({ "squid:S1854", "unused" })
@SuppressWarnings("squid:S1854")
public static void drain(final InputStream input) throws IOException {
final byte[] buffer = new byte[DEFAULT_BUFFER_SIZE];

View file

@ -1,41 +0,0 @@
package de.kosit.validationtool.impl.model;
import java.util.Objects;
import org.oclc.purl.dsdl.svrl.FailedAssert;
import de.kosit.validationtool.model.scenarios.ErrorLevelType;
/**
* This class contains a single Schematron failed assertion that has a custom error level.
*
* @since 1.6.0
*/
public class CustomFailedAssert {
private final FailedAssert originalFailedAssert;
private final ErrorLevelType customLevelFlag;
/**
* Constructor
*
* @param failedAssert The failed assert from Schematron. May not be <code>null</code>.
* @param customLevelFlag The custom error level. May not be <code>null</code>.
*/
public CustomFailedAssert(final FailedAssert failedAssert, final ErrorLevelType customLevelFlag) {
Objects.requireNonNull(failedAssert);
Objects.requireNonNull(customLevelFlag);
this.originalFailedAssert = failedAssert;
this.customLevelFlag = customLevelFlag;
}
public FailedAssert getFailedAssert() {
return this.originalFailedAssert;
}
public ErrorLevelType getCustomLevelFlag() {
return this.customLevelFlag;
}
}

View file

@ -17,8 +17,8 @@
package de.kosit.validationtool.impl.model;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import lombok.AllArgsConstructor;
import lombok.Getter;
@ -37,14 +37,14 @@ public class Result<T, E> {
private T object;
private List<E> errors = new ArrayList<>();
private Collection<E> errors = new ArrayList<>();
/**
* Erzeugt ein neues Ergebnis mit Fehler
*
* @param errors die Fehler
*/
public Result(final List<E> errors) {
public Result(Collection<E> errors) {
this(null, errors);
}
@ -53,7 +53,7 @@ public class Result<T, E> {
*
* @param o
*/
public Result(final T o) {
public Result(T o) {
this(o, Collections.emptyList());
}

View file

@ -21,6 +21,10 @@ import java.util.Collections;
import org.apache.commons.io.FilenameUtils;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.Setter;
import de.kosit.validationtool.api.AcceptRecommendation;
import de.kosit.validationtool.api.Input;
import de.kosit.validationtool.impl.Scenario;
@ -28,9 +32,7 @@ import de.kosit.validationtool.impl.model.Result;
import de.kosit.validationtool.model.reportInput.CreateReportInput;
import de.kosit.validationtool.model.reportInput.ProcessingError;
import de.kosit.validationtool.model.reportInput.XMLSyntaxError;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.Setter;
import net.sf.saxon.s9api.XdmNode;
/**
@ -53,9 +55,9 @@ public interface CheckAction {
private Result<Scenario, String> scenarioSelectionResult;
@Setter(AccessLevel.NONE)
private final CreateReportInput reportInput;
private CreateReportInput reportInput;
/** The final result */
/** Das finale Ergebnis */
private XdmNode report;
private boolean finished;
@ -64,7 +66,7 @@ public interface CheckAction {
private AcceptRecommendation acceptStatus = AcceptRecommendation.UNDEFINED;
/** The document to validate */
/** Das zu prüfende Dokument */
private Input input;
private Result<XdmNode, XMLSyntaxError> parserResult;
@ -83,9 +85,7 @@ public interface CheckAction {
}
/**
* Indicates an early stop in processing.
*
* @param error Error text
* Signalisiert einen vorzeitigen Stop der Vearbeitung.
*/
public void stopProcessing(final String error) {
stopProcessing(Collections.singleton(error));

View file

@ -20,9 +20,9 @@ import java.io.IOException;
import java.util.Collection;
import java.util.stream.Collectors;
import jakarta.xml.bind.JAXBException;
import jakarta.xml.bind.Marshaller;
import jakarta.xml.bind.util.JAXBSource;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Marshaller;
import javax.xml.bind.util.JAXBSource;
import org.xml.sax.ContentHandler;
import org.xml.sax.DTDHandler;

View file

@ -17,18 +17,19 @@
package de.kosit.validationtool.impl.tasks;
import java.io.IOException;
import java.util.Arrays;
import java.util.Collections;
import java.util.stream.Collectors;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import de.kosit.validationtool.api.Input;
import de.kosit.validationtool.impl.input.XdmNodeInput;
import de.kosit.validationtool.impl.model.Result;
import de.kosit.validationtool.model.reportInput.ValidationResultsWellformedness;
import de.kosit.validationtool.model.reportInput.XMLSyntaxError;
import de.kosit.validationtool.model.reportInput.XMLSyntaxErrorSeverity;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import net.sf.saxon.s9api.DocumentBuilder;
import net.sf.saxon.s9api.Processor;
import net.sf.saxon.s9api.SaxonApiException;
@ -74,7 +75,7 @@ public class DocumentParseAction implements CheckAction {
final XMLSyntaxError error = new XMLSyntaxError();
error.setSeverityCode(XMLSyntaxErrorSeverity.SEVERITY_FATAL_ERROR);
error.setMessage(String.format("IOException while reading resource %s: %s", content.getName(), e.getMessage()));
result = new Result<>(Arrays.asList(error));
result = new Result<>(Collections.singleton(error));
}
return result;

View file

@ -31,6 +31,12 @@ import javax.xml.validation.Validator;
import org.apache.commons.io.FileUtils;
import org.xml.sax.SAXException;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import lombok.Setter;
import lombok.extern.slf4j.Slf4j;
import de.kosit.validationtool.api.Input;
import de.kosit.validationtool.impl.CollectingErrorEventHandler;
import de.kosit.validationtool.impl.Scenario;
@ -39,11 +45,7 @@ import de.kosit.validationtool.impl.model.Result;
import de.kosit.validationtool.model.reportInput.CreateReportInput;
import de.kosit.validationtool.model.reportInput.ValidationResultsXmlSchema;
import de.kosit.validationtool.model.reportInput.XMLSyntaxError;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import lombok.Setter;
import lombok.extern.slf4j.Slf4j;
import net.sf.saxon.s9api.Processor;
import net.sf.saxon.s9api.SaxonApiException;
import net.sf.saxon.s9api.Serializer;
@ -214,7 +216,7 @@ public class SchemaValidationAction implements CheckAction {
}
}
private interface SerializedDocument extends SourceProvider {
private interface SerializedDocument extends AutoCloseable, SourceProvider {
void serialize(XdmNode node) throws SaxonApiException, IOException;

View file

@ -23,6 +23,9 @@ import javax.xml.transform.dom.DOMSource;
import org.oclc.purl.dsdl.svrl.SchematronOutput;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import de.kosit.validationtool.impl.CollectingErrorEventHandler;
import de.kosit.validationtool.impl.ConversionService;
import de.kosit.validationtool.impl.Scenario;
@ -30,8 +33,7 @@ import de.kosit.validationtool.impl.Scenario.Transformation;
import de.kosit.validationtool.model.reportInput.CreateReportInput;
import de.kosit.validationtool.model.reportInput.ValidationResultsSchematron;
import de.kosit.validationtool.model.reportInput.ValidationResultsSchematron.Results;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import net.sf.saxon.dom.NodeOverNodeInfo;
import net.sf.saxon.s9api.SaxonApiException;
import net.sf.saxon.s9api.XdmDestination;
@ -69,11 +71,6 @@ public class SchematronValidationAction implements CheckAction {
transformer.setInitialContextNode(document);
transformer.transform();
// If we reach this line, it means no Exception was thrown :-)
if (e.hasErrors()) {
log.error("XSLT errors found: " + e.getErrorDescription());
}
final ValidationResultsSchematron.Results r = new ValidationResultsSchematron.Results();
r.setSchematronOutput(this.conversionService.readDocument(
new DOMSource(NodeOverNodeInfo.wrap(result.getXdmNode().getUnderlyingNode()).getOwnerDocument()),

View file

@ -22,7 +22,7 @@ import java.io.Reader;
import java.net.URI;
import java.net.URL;
import org.apache.commons.lang3.Strings;
import org.apache.commons.lang3.StringUtils;
import org.w3c.dom.ls.LSInput;
import org.w3c.dom.ls.LSResourceResolver;
@ -90,7 +90,7 @@ public class ClassPathResourceResolver implements LSResourceResolver {
* @param basePath der Basispfad
*/
public ClassPathResourceResolver(final String basePath) {
if (!Strings.CS.startsWith(basePath, "/")) {
if (!StringUtils.startsWith(basePath, "/")) {
throw new IllegalArgumentException("Base path must start with a slash");
}
this.base = URI.create(basePath + (basePath.endsWith("/") == basePath.length() > 1 ? "" : "/"));

View file

@ -26,6 +26,7 @@ import javax.xml.transform.URIResolver;
import javax.xml.transform.stream.StreamSource;
import lombok.RequiredArgsConstructor;
import net.sf.saxon.Configuration;
import net.sf.saxon.lib.StandardUnparsedTextResolver;
import net.sf.saxon.lib.UnparsedTextURIResolver;
@ -53,9 +54,10 @@ public class RelativeUriResolver implements URIResolver, UnparsedTextURIResolver
throw new TransformerException(String.format("Can not resolve required %s", href), e);
}
} else {
throw new TransformerException(String
.format("The resolved transformation artifact %s is not within the configured repository %s", resolved, this.baseUri));
}
throw new TransformerException(String.format("The resolved transformation artifact %s is not within the configured repository %s",
resolved, this.baseUri));
}
/**
@ -94,9 +96,10 @@ public class RelativeUriResolver implements URIResolver, UnparsedTextURIResolver
public Reader resolve(final URI absoluteURI, final String encoding, final Configuration config) throws XPathException {
if (isUnderBaseUri(absoluteURI, this.baseUri)) {
return new StandardUnparsedTextResolver().resolve(absoluteURI, encoding, config);
}
} else {
throw new XPathException(String.format("The resolved transformation artifact %s is not within the configured repository %s",
absoluteURI, this.baseUri));
}
}
}

View file

@ -16,18 +16,24 @@
package de.kosit.validationtool.impl.xml;
import jakarta.xml.bind.annotation.adapters.XmlAdapter;
import javax.xml.bind.annotation.adapters.XmlAdapter;
public class StringTrimAdapter extends XmlAdapter<String, String> {
@Override
public String unmarshal(final String v) {
return trim(v);
if (v == null) {
return null;
}
return v.trim();
}
@Override
public String marshal(final String v) {
return trim(v);
if (v == null) {
return null;
}
return v.trim();
}
public static String trim(final String v) {

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!--
~ Copyright 2017-2026 Koordinierungsstelle für IT-Standards (KoSIT)
~ Copyright 2017-2022 Koordinierungsstelle für IT-Standards (KoSIT)
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
@ -18,19 +18,20 @@
<jaxb:bindings
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc"
xmlns:jaxb="https://jakarta.ee/xml/ns/jaxb"
xmlns:inheritance="urn:jaxb.jvnet.org:plugin:inheritance"
xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
xmlns:inheritance="http://jaxb2-commons.dev.java.net/basic/inheritance"
jaxb:extensionBindingPrefixes="inheritance"
version="3.0">
version="2.1">
<jaxb:globalBindings>
<xjc:serializable uid="-1"/>
<xjc:serializable uid="-1" />
<xjc:javaType
name="java.lang.String"
xmlType="xs:string"
adapter="de.kosit.validationtool.impl.xml.StringTrimAdapter"/>
adapter="de.kosit.validationtool.impl.xml.StringTrimAdapter" />
</jaxb:globalBindings>
<jaxb:bindings schemaLocation="../xsd/createReportInput.xsd">
<jaxb:schemaBindings>
<jaxb:package name="de.kosit.validationtool.model.reportInput"/>
@ -39,28 +40,24 @@
<inheritance:extends>de.kosit.validationtool.impl.model.BaseXMLSyntaxError</inheritance:extends>
</jaxb:bindings>
</jaxb:bindings>
<jaxb:bindings schemaLocation="../xsd/scenarios.xsd">
<jaxb:schemaBindings>
<jaxb:package name="de.kosit.validationtool.model.scenarios"/>
</jaxb:schemaBindings>
</jaxb:bindings>
<jaxb:bindings schemaLocation="../xsd/assertions.xsd">
<jaxb:schemaBindings>
<jaxb:package name="de.kosit.validationtool.cmd.assertions"/>
<jaxb:package name="de.kosit.validationtool.cmd.assertions" />
</jaxb:schemaBindings>
</jaxb:bindings>
<jaxb:bindings schemaLocation="../xsd/svrl-kosit.xsd">
<jaxb:bindings node="//xs:element[@name='schematron-output']/xs:complexType">
<inheritance:extends>de.kosit.validationtool.impl.model.BaseOutput</inheritance:extends>
</jaxb:bindings>
</jaxb:bindings>
<jaxb:bindings schemaLocation="../xsd/daemon.xsd">
<jaxb:schemaBindings>
<jaxb:package name="de.kosit.validationtool.model.daemon"/>
<jaxb:package name="de.kosit.validationtool.model.daemon" />
</jaxb:schemaBindings>
</jaxb:bindings>

View file

@ -1,4 +1,21 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!--
~ Copyright 2017-2022 Koordinierungsstelle für IT-Standards (KoSIT)
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<!-- $Id$ -->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:s="http://www.xoev.de/de/validator/framework/1/scenarios" targetNamespace="http://www.xoev.de/de/validator/framework/1/scenarios" version="1.1.0" elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:element name="scenarios">
@ -56,18 +73,12 @@
<xs:list itemType="xs:token" />
</xs:simpleType>
<xs:simpleType name="NonEmptyString">
<xs:restriction base="xs:string">
<xs:minLength value="1"/>
</xs:restriction>
</xs:simpleType>
<xs:complexType name="ScenarioType">
<xs:sequence>
<xs:element name="name" type="xs:token" />
<xs:element minOccurs="0" name="description" type="s:DescriptionType" />
<xs:element minOccurs="0" maxOccurs="unbounded" name="namespace" type="s:NamespaceType" />
<xs:element name="match" type="s:NonEmptyString" />
<xs:element name="match" type="xs:string" />
<xs:element name="validateWithXmlSchema" type="s:ValidateWithXmlSchema" />
<xs:element name="validateWithSchematron" maxOccurs="unbounded" minOccurs="0" type="s:ValidateWithSchematron" />
<xs:element name="createReport" type="s:CreateReportType" minOccurs="0"/>
@ -127,18 +138,3 @@
</xs:simpleContent>
</xs:complexType>
</xs:schema>
<!--
~ Copyright 2017-2026 Koordinierungsstelle für IT-Standards (KoSIT)
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->

View file

@ -1,176 +0,0 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS

View file

@ -1,5 +1,5 @@
#
# Copyright 2017-2026 Koordinierungsstelle für IT-Standards (KoSIT)
# Copyright 2017-2022 Koordinierungsstelle für IT-Standards (KoSIT)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.

View file

@ -1,5 +1,5 @@
#
# Copyright 2017-2026 Koordinierungsstelle für IT-Standards (KoSIT)
# Copyright 2017-2022 Koordinierungsstelle für IT-Standards (KoSIT)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@ -32,3 +32,21 @@ org.slf4j.simpleLogger.showLogName=false
# Defaults to false.
org.slf4j.simpleLogger.showShortLogName=false
org.slf4j.simpleLogger.levelInBrackets=true
#
# Licensed to the Koordinierungsstelle f�r IT-Standards (KoSIT) under
# one or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. KoSIT licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#

View file

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright 2017-2026 Koordinierungsstelle für IT-Standards (KoSIT)
~ Copyright 2017-2022 Koordinierungsstelle für IT-Standards (KoSIT)
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
@ -14,6 +13,7 @@
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
<xsl:template match="element()">
<xsl:copy>
@ -24,4 +24,5 @@
<xsl:template match="attribute()|text()|comment()|processing-instruction()">
<xsl:copy/>
</xsl:template>
</xsl:stylesheet>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -1 +0,0 @@
"use strict";(self.webpackChunkvalidator_frontend=self.webpackChunkvalidator_frontend||[]).push([[849],{6164:function(e){e.exports=JSON.parse('{"version":{"pluginId":"default","version":"current","label":"Next","banner":null,"badge":false,"noIndex":false,"className":"docs-version-current","isLast":true,"docsSidebars":{"tutorialSidebar":[{"type":"link","label":"Configurations","href":"/docs/configurations","docId":"configurations","unlisted":false},{"type":"link","label":"API Usage","href":"/docs/api","docId":"api","unlisted":false},{"type":"link","label":"Changelog","href":"/docs/changelog","docId":"changelog","unlisted":false}]},"docs":{"api":{"id":"api","title":"API Usage","description":"The validation service listens to POST-requests to any server uri. You need to supply the xml/object to validate in","sidebar":"tutorialSidebar"},"changelog":{"id":"changelog","title":"Changelog","description":"All notable changes to this project will be documented in this file.","sidebar":"tutorialSidebar"},"configurations":{"id":"configurations","title":"Configurations","description":"The validator needs a scenario configuration for working properly.","sidebar":"tutorialSidebar"}}}}')}}]);

View file

@ -1 +1 @@
"use strict";(self.webpackChunkvalidator_frontend=self.webpackChunkvalidator_frontend||[]).push([[742],{7093:function(e){e.exports=JSON.parse('{"name":"docusaurus-plugin-content-docs","id":"default"}')}}]);
"use strict";(self.webpackChunkvalidator_frontend=self.webpackChunkvalidator_frontend||[]).push([[983],{3769:function(e){e.exports=JSON.parse('{"name":"docusaurus-plugin-content-docs","id":"default"}')}}]);

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1 @@
"use strict";(self.webpackChunkvalidator_frontend=self.webpackChunkvalidator_frontend||[]).push([[237],{8451:function(e,t,a){a.r(t),a.d(t,{default:function(){return N}});var l=a(7294),n=a(6010),r=a(7462),i=a(8523),o={dropzone:"dropzone_p8R5",active:"active_ajsO",hasFiles:"hasFiles_h6nl",fileHoverPreview:"fileHoverPreview_IJ6m",icon:"icon_Zdm0",fileHoverIcon:"fileHoverIcon_TFrZ",uploadIcon:"uploadIcon__9vU"};var c=e=>{let{accept:t,children:a,className:c,activeClassName:s,multiple:d=!1,name:m,onDrop:p,hasSelectedFiles:u,...v}=e;const{getRootProps:h,getInputProps:f,isDragActive:E,isDragAccept:g,isDragReject:Z}=(0,i.uI)({accept:t,multiple:d,onDrop:(e,t,a)=>{const l=t.map((e=>e.file));p(e,l,a)},...v});return l.createElement("div",(0,r.Z)({},h(),{className:(0,n.Z)(o.dropzone,E&&o.active,u&&o.hasFiles,c,E&&s),"data-testid":"dropzone","data-is-drag-active":E,"data-is-drag-accepted":g,"data-is-drag-rejected":Z,"data-has-files":u}),l.createElement("div",{className:(0,n.Z)(o.fileHoverPreview,E&&o.previewActive)},l.createElement("svg",{className:(0,n.Z)(o.icon,o.fileHoverIcon),fill:"currentColor","aria-hidden":"true",viewBox:"0 0 24 24"},l.createElement("path",{d:"M6 2c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6H6zm7 7V3.5L18.5 9H13z"}))),l.createElement("svg",{className:(0,n.Z)(o.icon,o.uploadIcon),fill:"currentColor","aria-hidden":"true",viewBox:"0 0 24 24"},l.createElement("path",{d:"M9 16h6v-6h4l-7-7-7 7h4zm-4 2h14v2H5z"})),a,l.createElement("input",(0,r.Z)({name:m},f(),{"data-testid":"dropzone-input"})))},s=a(5833),d=a(7547),m=a(7506),p="button__Owf",u="spinnerWrapper_KcTt",v="loading_FTzi",h="spinner_hC2W";var f=function(e){let{children:t,type:a="button",className:i,loading:o=!1,...c}=e;return l.createElement("button",(0,r.Z)({},c,{className:(0,n.Z)(p,o&&v,i),type:a,"aria-busy":o}),l.createElement("div",{className:u,"aria-hidden":!0},l.createElement("div",{className:h})),t)},E="buttonGroup__nLk",g="resultDisplay_JbbN",Z="withError_Jabi";const _={"text/xml":[".xml",".XML"],"application/xml":[".xml",".XML"]};var b=function(){const[e,t]=(0,l.useState)(null),[a,r]=(0,l.useState)([]),{data:i,error:o,request:p,status:u}=(0,m.Z)(),v=(0,l.useCallback)(((e,a)=>{e.length?(t(e[0]),r([])):r(a)}),[]),h=!!o&&[406,422].includes(o.code);return l.createElement(l.Fragment,null,l.createElement("form",{onSubmit:t=>{t.preventDefault(),e&&p("/",{method:"POST",headers:{"Content-Type":"application/xml"},body:e,redirect:"follow"})}},u===m.e.Failure&&o&&!h&&l.createElement(d.Z,{title:"An error occurred while validating the file"},l.createElement(s.Z,{enableCopy:!0},o.message)),a.length>1&&l.createElement(d.Z,{title:"Please select a single file only"}),1===a.length&&l.createElement(d.Z,{title:"Only XML files are supported"},l.createElement(s.Z,null,`Invalid file found: ${a[0].name}`)),l.createElement(c,{onDrop:v,accept:_,multiple:!1,hasSelectedFiles:!!e},e?e.name:l.createElement(l.Fragment,null,"Drag & drop files here or click to select a file")),l.createElement("div",{className:E},l.createElement(f,{type:"submit",disabled:!e,loading:u===m.e.Loading},"Validate"))),(i&&u===m.e.Success||h)&&l.createElement("div",{className:(0,n.Z)(g,h&&Z)},l.createElement(s.Z,{download:{fileName:(b=null==e?void 0:e.name,b?`${b.replace(/\.xml$/i,"")}-report.xml`:"report.xml"),mime:"application/xml"},enableCopy:!0},i||(null==o?void 0:o.message)||"")));var b},y=a(8222);function N(){return l.createElement(y.Z,{layoutDescription:"KoSIT Validator Daemon",headline:"Try the validator!",description:"Upload an XML file here to validate its contents. Note: this is just a demo implementation, not meant for production usage. If you need a production ready implementation you are welcome to contribute to the open source project."},l.createElement(b,null))}}}]);

File diff suppressed because one or more lines are too long

View file

@ -1 +0,0 @@
"use strict";(self.webpackChunkvalidator_frontend=self.webpackChunkvalidator_frontend||[]).push([[61],{7973:function(e,a,t){t.r(a),t.d(a,{default:function(){return x}});t(6540);var s=t(4164),d=t(5500),r=t(7559),n=t(1656),i=t(3253),l=t(7763),c=t(6896),o=t(2153),m={mdxPageWrapper:"mdxPageWrapper_j9I6"},p=t(4848);function x(e){const{content:a}=e,{metadata:t,assets:x}=a,{title:g,editUrl:h,description:j,frontMatter:_,lastUpdatedBy:f,lastUpdatedAt:u}=t,{keywords:v,wrapperClassName:A,hide_table_of_contents:w}=_,N=x.image??_.image,k=!!(h||u||f);return(0,p.jsx)(d.e3,{className:(0,s.A)(A??r.G.wrapper.mdxPages,r.G.page.mdxPage),children:(0,p.jsxs)(n.A,{children:[(0,p.jsx)(d.be,{title:g,description:j,keywords:v,image:N}),(0,p.jsx)("main",{className:"container container--fluid margin-vert--lg",children:(0,p.jsxs)("div",{className:(0,s.A)("row",m.mdxPageWrapper),children:[(0,p.jsxs)("div",{className:(0,s.A)("col",!w&&"col--8"),children:[(0,p.jsx)(c.A,{metadata:t}),(0,p.jsx)("article",{children:(0,p.jsx)(i.A,{children:(0,p.jsx)(a,{})})}),k&&(0,p.jsx)(o.A,{className:(0,s.A)("margin-top--sm",r.G.pages.pageFooterEditMetaRow),editUrl:h,lastUpdatedAt:u,lastUpdatedBy:f})]}),!w&&a.toc.length>0&&(0,p.jsx)("div",{className:"col col--2",children:(0,p.jsx)(l.A,{toc:a.toc,minHeadingLevel:_.toc_min_heading_level,maxHeadingLevel:_.toc_max_heading_level})})]})})]})})}}}]);

View file

@ -0,0 +1 @@
"use strict";(self.webpackChunkvalidator_frontend=self.webpackChunkvalidator_frontend||[]).push([[85],{4247:function(e,t,a){a.r(t),a.d(t,{default:function(){return s}});var n=a(7294),l=a(6010),c=a(1944),r=a(5281),i=a(3285),m=a(9254),o=a(9407),d="mdxPageWrapper_j9I6";function s(e){const{content:t}=e,{metadata:{title:a,description:s,frontMatter:u}}=t,{wrapperClassName:p,hide_table_of_contents:_}=u;return n.createElement(c.FG,{className:(0,l.Z)(p??r.k.wrapper.mdxPages,r.k.page.mdxPage)},n.createElement(c.d,{title:a,description:s}),n.createElement(i.Z,null,n.createElement("main",{className:"container container--fluid margin-vert--lg"},n.createElement("div",{className:(0,l.Z)("row",d)},n.createElement("div",{className:(0,l.Z)("col",!_&&"col--8")},n.createElement("article",null,n.createElement(m.Z,null,n.createElement(t,null)))),!_&&t.toc.length>0&&n.createElement("div",{className:"col col--2"},n.createElement(o.Z,{toc:t.toc,minHeadingLevel:u.toc_min_heading_level,maxHeadingLevel:u.toc_max_heading_level}))))))}}}]);

View file

@ -1 +0,0 @@
"use strict";(self.webpackChunkvalidator_frontend=self.webpackChunkvalidator_frontend||[]).push([[237],{2237:function(e,t,n){n.r(t),n.d(t,{default:function(){return d}});n(6540);var i=n(1312),o=n(5500),r=n(1656),a=n(3363),s=n(4848);function d(){const e=(0,i.T)({id:"theme.NotFound.title",message:"Page Not Found"});return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(o.be,{title:e}),(0,s.jsx)(r.A,{children:(0,s.jsx)(a.A,{})})]})}},3363:function(e,t,n){n.d(t,{A:function(){return s}});n(6540);var i=n(4164),o=n(1312),r=n(1107),a=n(4848);function s({className:e}){return(0,a.jsx)("main",{className:(0,i.A)("container margin-vert--xl",e),children:(0,a.jsx)("div",{className:"row",children:(0,a.jsxs)("div",{className:"col col--6 col--offset-3",children:[(0,a.jsx)(r.A,{as:"h1",className:"hero__title",children:(0,a.jsx)(o.A,{id:"theme.NotFound.title",description:"The title of the 404 page",children:"Page Not Found"})}),(0,a.jsx)("p",{children:(0,a.jsx)(o.A,{id:"theme.NotFound.p1",description:"The first paragraph of the 404 page",children:"We could not find what you were looking for."})}),(0,a.jsx)("p",{children:(0,a.jsx)(o.A,{id:"theme.NotFound.p2",description:"The 2nd paragraph of the 404 page",children:"Please contact the owner of the site that linked you to the original URL and let them know their link is broken."})})]})})})}}}]);

View file

@ -0,0 +1 @@
"use strict";(self.webpackChunkvalidator_frontend=self.webpackChunkvalidator_frontend||[]).push([[414],{3123:function(e,t,n){n.r(t),n.d(t,{contentTitle:function(){return p},default:function(){return u},frontMatter:function(){return r},metadata:function(){return d},toc:function(){return i}});var a=n(7462),o=(n(7294),n(3905));const r={title:"Markdown page example"},p="Markdown page example",d={type:"mdx",permalink:"/markdown-page",source:"@site/src/pages/markdown-page.md",title:"Markdown page example",description:"You don't need React to write simple standalone pages.",frontMatter:{title:"Markdown page example"}},i=[],l={toc:i};function u(e){let{components:t,...n}=e;return(0,o.kt)("wrapper",(0,a.Z)({},l,n,{components:t,mdxType:"MDXLayout"}),(0,o.kt)("h1",{id:"markdown-page-example"},"Markdown page example"),(0,o.kt)("p",null,"You don't need React to write simple standalone pages."))}u.isMDXComponent=!0}}]);

View file

@ -1 +0,0 @@
"use strict";(self.webpackChunkvalidator_frontend=self.webpackChunkvalidator_frontend||[]).push([[134],{591:function(e,n,t){t.r(n),t.d(n,{assets:function(){return i},contentTitle:function(){return s},default:function(){return d},frontMatter:function(){return c},metadata:function(){return r},toc:function(){return u}});var r=JSON.parse('{"type":"mdx","permalink":"/markdown-page","source":"@site/src/pages/markdown-page.md","title":"Markdown page example","description":"You don\'t need React to write simple standalone pages.","frontMatter":{"title":"Markdown page example"},"unlisted":false}'),o=t(4848),a=t(8453);const c={title:"Markdown page example"},s="Markdown page example",i={},u=[];function p(e){const n={h1:"h1",header:"header",p:"p",...(0,a.R)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(n.header,{children:(0,o.jsx)(n.h1,{id:"markdown-page-example",children:"Markdown page example"})}),"\n",(0,o.jsx)(n.p,{children:"You don't need React to write simple standalone pages."})]})}function d(e={}){const{wrapper:n}={...(0,a.R)(),...e.components};return n?(0,o.jsx)(n,{...e,children:(0,o.jsx)(p,{...e})}):p(e)}},8453:function(e,n,t){t.d(n,{R:function(){return c},x:function(){return s}});var r=t(6540);const o={},a=r.createContext(o);function c(e){const n=r.useContext(a);return r.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}function s(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(o):e.components||o:c(e.components),r.createElement(a.Provider,{value:n},e.children)}}}]);

File diff suppressed because one or more lines are too long

View file

@ -1 +0,0 @@
"use strict";(self.webpackChunkvalidator_frontend=self.webpackChunkvalidator_frontend||[]).push([[611],{7663:function(n,i,e){e.r(i),e.d(i,{assets:function(){return c},contentTitle:function(){return a},default:function(){return d},frontMatter:function(){return s},metadata:function(){return t},toc:function(){return l}});var t=JSON.parse('{"id":"configurations","title":"Configurations","description":"The validator needs a scenario configuration for working properly.","source":"@site/docs/configurations.md","sourceDirName":".","slug":"/configurations","permalink":"/docs/configurations","draft":false,"unlisted":false,"editUrl":"https://github.com/itplr-kosit/validator/server/ui/docs/configurations.md","tags":[],"version":"current","sidebarPosition":1,"frontMatter":{"sidebar_position":1},"sidebar":"tutorialSidebar","next":{"title":"API Usage","permalink":"/docs/api"}}'),o=e(4848),r=e(8453);const s={sidebar_position:1},a="Configurations",c={},l=[];function u(n){const i={a:"a",h1:"h1",header:"header",li:"li",p:"p",ul:"ul",...(0,r.R)(),...n.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(i.header,{children:(0,o.jsx)(i.h1,{id:"configurations",children:"Configurations"})}),"\n",(0,o.jsx)(i.p,{children:"The validator needs a scenario configuration for working properly."}),"\n",(0,o.jsx)(i.p,{children:"Here are some public validation configurations:"}),"\n",(0,o.jsxs)(i.ul,{children:["\n",(0,o.jsxs)(i.li,{children:["Validation Configuration for ",(0,o.jsx)(i.a,{href:"https://xeinkauf.de/xrechnung/",children:"XRechnung"}),":","\n",(0,o.jsxs)(i.ul,{children:["\n",(0,o.jsxs)(i.li,{children:["Source code is available on ",(0,o.jsx)(i.a,{href:"https://github.com/itplr-kosit/validator-configuration-xrechnung",children:"GitHub"})]}),"\n",(0,o.jsxs)(i.li,{children:[(0,o.jsx)(i.a,{href:"https://github.com/itplr-kosit/validator-configuration-xrechnung/releases",children:"Releases"})," can also be downloaded"]}),"\n"]}),"\n"]}),"\n",(0,o.jsxs)(i.li,{children:["Validation Configuration for ",(0,o.jsx)(i.a,{href:"https://docs.peppol.eu/poacc/billing/3.0/",children:"Peppol BIS Billing"}),":","\n",(0,o.jsxs)(i.ul,{children:["\n",(0,o.jsxs)(i.li,{children:["Source code is available on ",(0,o.jsx)(i.a,{href:"https://github.com/itplr-kosit/validator-configuration-bis",children:"GitHub"})]}),"\n",(0,o.jsxs)(i.li,{children:[(0,o.jsx)(i.a,{href:"https://github.com/itplr-kosit/validator-configuration-bis/releases",children:"Releases"})," can also be downloaded"]}),"\n"]}),"\n"]}),"\n",(0,o.jsxs)(i.li,{children:["Validation Configuration for ",(0,o.jsx)(i.a,{href:"https://xgewerbeanzeige.de/",children:"XGewerbeanzeige"}),"\n",(0,o.jsxs)(i.ul,{children:["\n",(0,o.jsxs)(i.li,{children:["Source code is available on ",(0,o.jsx)(i.a,{href:"https://github.com/itplr-kosit/validator-configuration-xgewerbeanzeige",children:"GitHub"})]}),"\n",(0,o.jsxs)(i.li,{children:[(0,o.jsx)(i.a,{href:"https://github.com/itplr-kosit/validator-configuration-xgewerbeanzeige/releases",children:"Releases"})," can also be downloaded"]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,o.jsxs)(i.p,{children:["For creating custom configurations\nsee ",(0,o.jsx)(i.a,{href:"https://github.com/itplr-kosit/validator/blob/main/docs/configurations.md",children:"configuration documentation"}),"\nfor details"]})]})}function d(n={}){const{wrapper:i}={...(0,r.R)(),...n.components};return i?(0,o.jsx)(i,{...n,children:(0,o.jsx)(u,{...n})}):u(n)}},8453:function(n,i,e){e.d(i,{R:function(){return s},x:function(){return a}});var t=e(6540);const o={},r=t.createContext(o);function s(n){const i=t.useContext(r);return t.useMemo(function(){return"function"==typeof n?n(i):{...i,...n}},[i,n])}function a(n){let i;return i=n.disableParentContext?"function"==typeof n.components?n.components(o):n.components||o:s(n.components),t.createElement(r.Provider,{value:i},n.children)}}}]);

View file

@ -0,0 +1 @@
"use strict";(self.webpackChunkvalidator_frontend=self.webpackChunkvalidator_frontend||[]).push([[910],{809:function(t,e,i){i.r(e),i.d(e,{assets:function(){return u},contentTitle:function(){return r},default:function(){return d},frontMatter:function(){return o},metadata:function(){return l},toc:function(){return s}});var n=i(7462),a=(i(7294),i(3905));const o={sidebar_position:1},r="Configurations",l={unversionedId:"configurations",id:"configurations",title:"Configurations",description:"The validator needs a scenario configuration for working properly.",source:"@site/docs/configurations.md",sourceDirName:".",slug:"/configurations",permalink:"/docs/configurations",draft:!1,editUrl:"https://github.com/itplr-kosit/validator/server/ui/docs/configurations.md",tags:[],version:"current",sidebarPosition:1,frontMatter:{sidebar_position:1},sidebar:"tutorialSidebar",next:{title:"API Usage",permalink:"/docs/api"}},u={},s=[],c={toc:s};function d(t){let{components:e,...i}=t;return(0,a.kt)("wrapper",(0,n.Z)({},c,i,{components:e,mdxType:"MDXLayout"}),(0,a.kt)("h1",{id:"configurations"},"Configurations"),(0,a.kt)("p",null,"The validator needs a scenario configuration for working properly."),(0,a.kt)("p",null,"Currently, there are two public third party validation configurations available."),(0,a.kt)("ul",null,(0,a.kt)("li",{parentName:"ul"},"Validation Configuration for ",(0,a.kt)("a",{parentName:"li",href:"http://www.xoev.de/de/xrechnung"},"XRechnung"),":",(0,a.kt)("ul",{parentName:"li"},(0,a.kt)("li",{parentName:"ul"},"Source code is available on ",(0,a.kt)("a",{parentName:"li",href:"https://github.com/itplr-kosit/validator-configuration-xrechnung"},"GitHub")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"https://github.com/itplr-kosit/validator-configuration-xrechnung/releases"},"Releases")," can also be downloaded"))),(0,a.kt)("li",{parentName:"ul"},"Validation Configuration for ",(0,a.kt)("a",{parentName:"li",href:"https://xgewerbeanzeige.de/"},"XGewerbeanzeige"),(0,a.kt)("ul",{parentName:"li"},(0,a.kt)("li",{parentName:"ul"},"Source code is available on ",(0,a.kt)("a",{parentName:"li",href:"https://github.com/itplr-kosit/validator-configuration-xgewerbeanzeige"},"GitHub")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"https://github.com/itplr-kosit/validator-configuration-xgewerbeanzeige/releases"},"Releases")," can also be downloaded")))),(0,a.kt)("p",null,"For creating custom configurations\nsee ",(0,a.kt)("a",{parentName:"p",href:"https://github.com/itplr-kosit/validator/blob/master/docs/configurations.md"},"configuration documentation"),"\nfor details"))}d.isMDXComponent=!0}}]);

View file

@ -1 +0,0 @@
"use strict";(self.webpackChunkvalidator_frontend=self.webpackChunkvalidator_frontend||[]).push([[647],{7121:function(e,r,n){n.r(r),n.d(r,{default:function(){return d}});n(6540);var t=n(4164),a=n(7559),s=n(5500),u=n(2831),c=n(1656),o=n(4848);function d(e){return(0,o.jsx)(s.e3,{className:(0,t.A)(a.G.wrapper.docsPages),children:(0,o.jsx)(c.A,{children:(0,u.v)(e.route.routes)})})}}}]);

View file

@ -0,0 +1 @@
"use strict";(self.webpackChunkvalidator_frontend=self.webpackChunkvalidator_frontend||[]).push([[207],{7480:function(e,t,n){n.r(t),n.d(t,{assets:function(){return l},contentTitle:function(){return o},default:function(){return c},frontMatter:function(){return r},metadata:function(){return s},toc:function(){return p}});var a=n(7462),i=(n(7294),n(3905));const r={sidebar_position:2},o="API Usage",s={unversionedId:"api",id:"api",title:"API Usage",description:"The validation service listens to POST-requests to any server uri. You need to supply the xml/object to validate in",source:"@site/docs/api.md",sourceDirName:".",slug:"/api",permalink:"/docs/api",draft:!1,editUrl:"https://github.com/itplr-kosit/validator/server/ui/docs/api.md",tags:[],version:"current",sidebarPosition:2,frontMatter:{sidebar_position:2},sidebar:"tutorialSidebar",previous:{title:"Configurations",permalink:"/docs/configurations"},next:{title:"Changelog",permalink:"/docs/changelog"}},l={},p=[],u={toc:p};function c(e){let{components:t,...n}=e;return(0,i.kt)("wrapper",(0,a.Z)({},u,n,{components:t,mdxType:"MDXLayout"}),(0,i.kt)("h1",{id:"api-usage"},"API Usage"),(0,i.kt)("p",null,"The validation service listens to ",(0,i.kt)("inlineCode",{parentName:"p"},"POST"),"-requests to any server uri. You need to supply the xml/object to validate in\nthe post body.\nThe service expects a single plain input in the post body, e.g. ",(0,i.kt)("inlineCode",{parentName:"p"},"multipart/form-data")," is not supported."),(0,i.kt)("p",null,"Examples:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"cURL"))),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-shell",metastring:"script",script:!0},"curl --location --request POST 'http://localhost:8080' \\\n--header 'Content-Type: application/xml' \\\n--data-binary '@/target.xml'\n")),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"java")," (Apache HttpClient)")),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-java"},'HttpClient httpClient=HttpClientBuilder.create().build();\n HttpPost postRequest=new HttpPost("http://localhost:8080/");\n FileEntity entity=new FileEntity(Paths.get("some.xml").toFile(),ContentType.APPLICATION_XML);\n postRequest.setEntity(entity);\n HttpResponse response=httpClient.execute(postRequest);\n System.out.println(IOUtils.toString(response.getEntity().getContent()));\n')),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"javascript"))),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-javascript"},'var myHeaders = new Headers();\nmyHeaders.append("Content-Type", "application/xml");\n\nvar file = "<file contents here>";\n\nvar requestOptions = {\n method: \'POST\',\n headers: myHeaders,\n body: file,\n redirect: \'follow\'\n};\n\nfetch("http://localhost:8080", requestOptions)\n .then(response => response.text())\n .then(result => console.log(result))\n .catch(error => console.log(\'error\', error));\n')))}c.isMDXComponent=!0}}]);

View file

@ -1 +0,0 @@
"use strict";(self.webpackChunkvalidator_frontend=self.webpackChunkvalidator_frontend||[]).push([[624],{6439:function(e,t,n){n.r(t),n.d(t,{assets:function(){return l},contentTitle:function(){return a},default:function(){return p},frontMatter:function(){return o},metadata:function(){return r},toc:function(){return c}});var r=JSON.parse('{"id":"api","title":"API Usage","description":"The validation service listens to POST-requests to any server uri. You need to supply the xml/object to validate in","source":"@site/docs/api.md","sourceDirName":".","slug":"/api","permalink":"/docs/api","draft":false,"unlisted":false,"editUrl":"https://github.com/itplr-kosit/validator/server/ui/docs/api.md","tags":[],"version":"current","sidebarPosition":2,"frontMatter":{"sidebar_position":2},"sidebar":"tutorialSidebar","previous":{"title":"Configurations","permalink":"/docs/configurations"},"next":{"title":"Changelog","permalink":"/docs/changelog"}}'),s=n(4848),i=n(8453);const o={sidebar_position:2},a="API Usage",l={},c=[];function d(e){const t={code:"code",h1:"h1",header:"header",li:"li",p:"p",pre:"pre",ul:"ul",...(0,i.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(t.header,{children:(0,s.jsx)(t.h1,{id:"api-usage",children:"API Usage"})}),"\n",(0,s.jsxs)(t.p,{children:["The validation service listens to ",(0,s.jsx)(t.code,{children:"POST"}),"-requests to any server uri. You need to supply the xml/object to validate in\nthe post body.\nThe service expects a single plain input in the post body, e.g. ",(0,s.jsx)(t.code,{children:"multipart/form-data"})," is not supported."]}),"\n",(0,s.jsx)(t.p,{children:"Examples:"}),"\n",(0,s.jsxs)(t.ul,{children:["\n",(0,s.jsx)(t.li,{children:(0,s.jsx)(t.code,{children:"cURL"})}),"\n"]}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-shell",metastring:"script",children:"curl --location --request POST 'http://localhost:8080' \\\n --header 'Content-Type: application/xml' \\\n --data-binary '@/target.xml'\n"})}),"\n",(0,s.jsxs)(t.ul,{children:["\n",(0,s.jsxs)(t.li,{children:[(0,s.jsx)(t.code,{children:"Java"})," (Apache HttpClient)"]}),"\n"]}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-java",children:'HttpClient httpClient=HttpClientBuilder.create().build();\nHttpPost postRequest=new HttpPost("http://localhost:8080/");\nFileEntity entity=new FileEntity(Paths.get("some.xml").toFile(),ContentType.APPLICATION_XML);\npostRequest.setEntity(entity);\nHttpResponse response=httpClient.execute(postRequest);\nSystem.out.println(IOUtils.toString(response.getEntity().getContent()));\n'})}),"\n",(0,s.jsxs)(t.ul,{children:["\n",(0,s.jsx)(t.li,{children:(0,s.jsx)(t.code,{children:"JavaScript"})}),"\n"]}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-javascript",children:'var myHeaders = new Headers();\nmyHeaders.append("Content-Type", "application/xml");\n\nvar file = "<file contents here>";\n\nvar requestOptions = {\n method: \'POST\',\n headers: myHeaders,\n body: file,\n redirect: \'follow\'\n};\n\nfetch("http://localhost:8080", requestOptions)\n .then(response => response.text())\n .then(result => console.log(result))\n .catch(error => console.log(\'error\', error));\n'})})]})}function p(e={}){const{wrapper:t}={...(0,i.R)(),...e.components};return t?(0,s.jsx)(t,{...e,children:(0,s.jsx)(d,{...e})}):d(e)}},8453:function(e,t,n){n.d(t,{R:function(){return o},x:function(){return a}});var r=n(6540);const s={},i=r.createContext(s);function o(e){const t=r.useContext(i);return r.useMemo(function(){return"function"==typeof e?e(t):{...t,...e}},[t,e])}function a(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:o(e.components),r.createElement(i.Provider,{value:t},e.children)}}}]);

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1 @@
"use strict";(self.webpackChunkvalidator_frontend=self.webpackChunkvalidator_frontend||[]).push([[118],{6275:function(e,t,n){n.d(t,{Z:function(){return o}});var r=n(7294),a=n(5833),i=n(7547),l=n(7506);var o=function(e){let{endpoint:t,fileName:n}=e;const{request:o,data:c,error:u,status:d}=(0,l.Z)();return(0,r.useEffect)((()=>{o(t,{headers:{"Content-Type":"application/xml"}})}),[t,o]),r.createElement(r.Fragment,null,d===l.e.Failure&&u&&r.createElement(i.Z,{title:"An error occurred while fetching"},r.createElement(a.Z,null,u.message)),d===l.e.Success&&c&&r.createElement(a.Z,{download:{fileName:n,mime:"application/xml"},enableCopy:!0},c))}},3596:function(e,t,n){n.r(t);var r=n(7294),a=n(8222),i=n(6275);t.default=function(){return r.createElement(a.Z,{title:"Validator configuration",layoutDescription:"The currently loaded validator configuration",headline:"Validator configuration",description:"View the currently loaded validator configuration."},r.createElement(i.Z,{endpoint:"/server/config",fileName:"config.xml"}))}}}]);

View file

@ -0,0 +1 @@
"use strict";(self.webpackChunkvalidator_frontend=self.webpackChunkvalidator_frontend||[]).push([[433,981],{6275:function(e,t,n){n.d(t,{Z:function(){return o}});var a=n(7294),r=n(5833),l=n(7547),i=n(7506);var o=function(e){let{endpoint:t,fileName:n}=e;const{request:o,data:u,error:c,status:s}=(0,i.Z)();return(0,a.useEffect)((()=>{o(t,{headers:{"Content-Type":"application/xml"}})}),[t,o]),a.createElement(a.Fragment,null,s===i.e.Failure&&c&&a.createElement(l.Z,{title:"An error occurred while fetching"},a.createElement(r.Z,null,c.message)),s===i.e.Success&&u&&a.createElement(r.Z,{download:{fileName:n,mime:"application/xml"},enableCopy:!0},u))}},2406:function(e,t,n){n.r(t);var a=n(7294),r=n(8222),l=n(6275);t.default=function(){return a.createElement(r.Z,{title:"Health information",layoutDescription:"Health and status information about the system",headline:"Server health information",description:"Information about health and status of the running system."},a.createElement(l.Z,{endpoint:"/server/health",fileName:"health.xml"}))}},6411:function(e,t,n){n.r(t);var a=n(2406);t.default=a.default}}]);

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1 @@
"use strict";(self.webpackChunkvalidator_frontend=self.webpackChunkvalidator_frontend||[]).push([[53],{1109:function(e){e.exports=JSON.parse('{"pluginId":"default","version":"current","label":"Next","banner":null,"badge":false,"noIndex":false,"className":"docs-version-current","isLast":true,"docsSidebars":{"tutorialSidebar":[{"type":"link","label":"Configurations","href":"/docs/configurations","docId":"configurations"},{"type":"link","label":"API Usage","href":"/docs/api","docId":"api"},{"type":"link","label":"Changelog","href":"/docs/changelog","docId":"changelog"}]},"docs":{"api":{"id":"api","title":"API Usage","description":"The validation service listens to POST-requests to any server uri. You need to supply the xml/object to validate in","sidebar":"tutorialSidebar"},"changelog":{"id":"changelog","title":"Changelog","description":"All notable changes to this project will be documented in this file.","sidebar":"tutorialSidebar"},"configurations":{"id":"configurations","title":"Configurations","description":"The validator needs a scenario configuration for working properly.","sidebar":"tutorialSidebar"}}}')}}]);

View file

@ -0,0 +1 @@
"use strict";(self.webpackChunkvalidator_frontend=self.webpackChunkvalidator_frontend||[]).push([[972],{4972:function(e,t,n){n.r(t),n.d(t,{default:function(){return i}});var a=n(7294),o=n(5999),l=n(1944),r=n(3285);function i(){return a.createElement(a.Fragment,null,a.createElement(l.d,{title:(0,o.I)({id:"theme.NotFound.title",message:"Page Not Found"})}),a.createElement(r.Z,null,a.createElement("main",{className:"container margin-vert--xl"},a.createElement("div",{className:"row"},a.createElement("div",{className:"col col--6 col--offset-3"},a.createElement("h1",{className:"hero__title"},a.createElement(o.Z,{id:"theme.NotFound.title",description:"The title of the 404 page"},"Page Not Found")),a.createElement("p",null,a.createElement(o.Z,{id:"theme.NotFound.p1",description:"The first paragraph of the 404 page"},"We could not find what you were looking for.")),a.createElement("p",null,a.createElement(o.Z,{id:"theme.NotFound.p2",description:"The 2nd paragraph of the 404 page"},"Please contact the owner of the site that linked you to the original URL and let them know their link is broken.")))))))}}}]);

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -1 +0,0 @@
"use strict";(self.webpackChunkvalidator_frontend=self.webpackChunkvalidator_frontend||[]).push([[98],{1723:function(n,e,r){r.r(e),r.d(e,{default:function(){return l}});r(6540);var s=r(5500);function o(n,e){return`docs-${n}-${e}`}var t=r(3025),i=r(2831),c=r(1463),u=r(4848);function a(n){const{version:e}=n;return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(c.A,{version:e.version,tag:o(e.pluginId,e.version)}),(0,u.jsx)(s.be,{children:e.noIndex&&(0,u.jsx)("meta",{name:"robots",content:"noindex, nofollow"})})]})}function d(n){const{version:e,route:r}=n;return(0,u.jsx)(s.e3,{className:e.className,children:(0,u.jsx)(t.n,{version:e,children:(0,i.v)(r.routes)})})}function l(n){return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(a,{...n}),(0,u.jsx)(d,{...n})]})}}}]);

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1 @@
"use strict";(self.webpackChunkvalidator_frontend=self.webpackChunkvalidator_frontend||[]).push([[981],{6275:function(e,t,n){n.d(t,{Z:function(){return o}});var a=n(7294),r=n(5833),l=n(7547),i=n(7506);var o=function(e){let{endpoint:t,fileName:n}=e;const{request:o,data:u,error:s,status:c}=(0,i.Z)();return(0,a.useEffect)((()=>{o(t,{headers:{"Content-Type":"application/xml"}})}),[t,o]),a.createElement(a.Fragment,null,c===i.e.Failure&&s&&a.createElement(l.Z,{title:"An error occurred while fetching"},a.createElement(r.Z,null,s.message)),c===i.e.Success&&u&&a.createElement(r.Z,{download:{fileName:n,mime:"application/xml"},enableCopy:!0},u))}},2406:function(e,t,n){n.r(t);var a=n(7294),r=n(8222),l=n(6275);t.default=function(){return a.createElement(r.Z,{title:"Health information",layoutDescription:"Health and status information about the system",headline:"Server health information",description:"Information about health and status of the running system."},a.createElement(l.Z,{endpoint:"/server/health",fileName:"health.xml"}))}}}]);

View file

@ -0,0 +1 @@
"use strict";(self.webpackChunkvalidator_frontend=self.webpackChunkvalidator_frontend||[]).push([[962,118],{6275:function(e,t,n){n.d(t,{Z:function(){return o}});var a=n(7294),r=n(5833),i=n(7547),l=n(7506);var o=function(e){let{endpoint:t,fileName:n}=e;const{request:o,data:c,error:u,status:d}=(0,l.Z)();return(0,a.useEffect)((()=>{o(t,{headers:{"Content-Type":"application/xml"}})}),[t,o]),a.createElement(a.Fragment,null,d===l.e.Failure&&u&&a.createElement(i.Z,{title:"An error occurred while fetching"},a.createElement(r.Z,null,u.message)),d===l.e.Success&&c&&a.createElement(r.Z,{download:{fileName:n,mime:"application/xml"},enableCopy:!0},c))}},3596:function(e,t,n){n.r(t);var a=n(7294),r=n(8222),i=n(6275);t.default=function(){return a.createElement(r.Z,{title:"Validator configuration",layoutDescription:"The currently loaded validator configuration",headline:"Validator configuration",description:"View the currently loaded validator configuration."},a.createElement(i.Z,{endpoint:"/server/config",fileName:"config.xml"}))}},2536:function(e,t,n){n.r(t);var a=n(3596);t.default=a.default}}]);

File diff suppressed because one or more lines are too long

View file

@ -1 +1 @@
"use strict";(self.webpackChunkvalidator_frontend=self.webpackChunkvalidator_frontend||[]).push([[235],{8552:function(e){e.exports=JSON.parse('{"name":"docusaurus-plugin-content-pages","id":"default"}')}}]);
"use strict";(self.webpackChunkvalidator_frontend=self.webpackChunkvalidator_frontend||[]).push([[870],{5745:function(e){e.exports=JSON.parse('{"name":"docusaurus-plugin-content-pages","id":"default"}')}}]);

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,53 @@
/*
object-assign
(c) Sindre Sorhus
@license MIT
*/
/* NProgress, (c) 2013, 2014 Rico Sta. Cruz - http://ricostacruz.com/nprogress
* @license MIT */
/**
* Prism: Lightweight, robust, elegant syntax highlighting
*
* @license MIT <https://opensource.org/licenses/MIT>
* @author Lea Verou <https://lea.verou.me>
* @namespace
* @public
*/
/** @license React v0.20.2
* scheduler.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
/** @license React v16.13.1
* react-is.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
/** @license React v17.0.2
* react-dom.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
/** @license React v17.0.2
* react.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

File diff suppressed because one or more lines are too long

Some files were not shown because too many files have changed in this diff Show more