Compare commits

...

139 commits
v1.5.0 ... main

Author SHA1 Message Date
Renzo Kottmann
86d9ddfa2b Merge branch 'release/1.6.x' into 'main'
Release/1.6.2

See merge request kosit/validator!110
2026-02-17 16:57:40 +01:00
Renzo Kottmann
955d608f56 [maven-release-plugin] prepare for next development iteration 2026-02-17 16:43:17 +01:00
Renzo Kottmann
1572ea34e9 [maven-release-plugin] prepare release v1.6.2 2026-02-17 16:42:55 +01:00
Renzo Kottmann
e7a64227a2 Merge branch 'release/1.6.x' of https://projekte.kosit.org/kosit/validator into release/1.6.x 2026-02-17 16:28:21 +01:00
Philip Helger
a52bab4c69 Updated changelog for 1.6.2 2026-02-17 16:20:30 +01:00
Philip Helger
20c2ce71c1 Added license in addition to #180 2026-02-17 16:20:30 +01:00
Philip Helger
752ceb228d Resolve "Improve provided licenses in standalone JAR (Github 173)" 2026-02-17 16:20:30 +01:00
Philip Helger
c5c40c2009 Fixing Maven Assembly Output contains wrong XML Resolver JAR 2026-02-17 16:20:30 +01:00
Philip Helger
57ae444857 Update Validator 1.6.x dependencies to the latest versions 2026-02-17 16:20:30 +01:00
Philip Helger
1f5d79c027 Merge branch '178-maven-assembly-output-contains-wrong-jar' into 'release/1.6.x'
Resolve "Maven Assembly Output contains wrong JAR"

See merge request kosit/validator!106
2026-02-10 17:01:07 +01:00
Philip Helger
1fe8159c2b Fixing Maven Assembly Output contains wrong XML Resolver JAR 2026-02-10 17:01:07 +01:00
Philip Helger
2a3a099058 Merge branch '179-update-1-6-dependencies-to-the-latest-versions' into 'release/1.6.x'
Resolve "Update 1.6 dependencies to the latest versions"

See merge request kosit/validator!107
2026-02-10 16:55:47 +01:00
Philip Helger
44c455ba86 Update Validator 1.6.x dependencies to the latest versions 2026-02-10 16:55:47 +01:00
Philip Helger
82fdcabe3d Merge branch 'release/1.6.x' into 'main'
1.6.1 Release

See merge request kosit/validator!105
2026-02-05 12:53:43 +01:00
Renzo Kottmann
03e5be34b8 [maven-release-plugin] prepare for next development iteration 2026-02-05 12:25:33 +01:00
Renzo Kottmann
3b4765e9c1 [maven-release-plugin] prepare release v1.6.1 2026-02-05 12:25:11 +01:00
Philip Helger
06f6a77648 Merged 2026-02-05 11:57:42 +01:00
Philip Helger
cd1494747a Removed "Unreleased" 2026-02-05 11:52:06 +01:00
Philip Helger
a3fd64c946 Prepared for release 2026-02-05 11:52:06 +01:00
Philip Helger
7bd423c458 Resolve "Wrong Schematron/XSLTs lead to positive validation result (GitHub 165)" 2026-02-05 11:52:06 +01:00
Philip Helger
155d3dc692 Added changelog for #106 2026-02-05 11:52:06 +01:00
Philip Helger
e2c3f5eea3 Resolve "scenario.xsd: Match Element darf nicht leer sein" 2026-02-05 11:52:06 +01:00
Philip Helger
53f16f5199 Fix/owasp oom 2026-02-05 11:52:06 +01:00
Philip Helger
f43f0d32ac Resolve "Question: does the "standalone" JAR need to be in the assembly ZIP?" 2026-02-05 11:51:32 +01:00
Philip Helger
c29dd78b48 Resolve "Maven Central pom.xml is dependency-reduced" 2026-02-05 11:51:32 +01:00
Philip Helger
9f25e20108 Owasp using Java 21 2025-11-14 10:25:33 +01:00
Renzo Kottmann
938c87112d Merge branch 'release/1.6.x' into 'main'
Updated API code snippet in readme for GitHub #117

See merge request kosit/validator!89
2025-11-07 15:24:07 +01:00
Philip Helger
f482d4d213 Updated API code snippet in readme for GitHub #117 2025-11-07 15:24:06 +01:00
Philip Helger
0e944616a5 Merge branch 'release/1.6.x' into 'main'
Update links to source code to current locations

See merge request kosit/validator!88
2025-11-07 13:00:53 +01:00
Renzo Kottmann
29766cf34b chore: Minor correction 2025-11-07 11:17:32 +01:00
Renzo Kottmann
091c2c643c Add Unreleased section to Changelog 2025-11-07 11:17:06 +01:00
Renzo Kottmann
535d88c829 [maven-release-plugin] prepare for next development iteration 2025-11-06 13:32:55 +01:00
Renzo Kottmann
f338f5f5f5 [maven-release-plugin] prepare release v1.6.0 2025-11-06 13:32:47 +01:00
Renzo Kottmann
32bec7c749 chore: add release date for 1.6.0 to Changelog 2025-11-06 13:23:14 +01:00
Renzo Kottmann
bbe93c965c Merge branch 'release/1.6.x' of https://projekte.kosit.org/kosit/validator into release/1.6.x 2025-11-05 18:34:11 +01:00
Renzo Kottmann
9601f921e5 chore: bump exec plugin to 3.6.2, use successCode for broken daemon shutdown 2025-11-05 18:32:34 +01:00
Renzo Kottmann
f412f72110 chore: bump exec plugin to 3.6.2, use successCode for broken daemon shutdown 2025-11-05 18:31:08 +01:00
Philip Helger
53a967f4a8 Official images 2025-11-05 14:01:29 +01:00
Philip Helger
140b6d009d Re-added Java 25 2025-11-05 13:55:49 +01:00
Philip Helger
f2d77b01e9 Version bump 2025-11-05 13:51:41 +01:00
Renzo Kottmann
6524c07631 Merge branch 'cleansing-ph-1.6' into 'release/1.6.x'
Replaced deprecated methods etc.

See merge request kosit/validator!77
2025-10-24 12:27:20 +02:00
Philip Helger
0b22c3ea91 Replaced deprecated methods etc. 2025-10-24 12:27:20 +02:00
Philip Helger
c030aaff02 Back to 24 2025-10-22 16:02:20 +02:00
Philip Helger
70f6026196 Add Java 25 instead of 24 2025-10-22 15:57:36 +02:00
Philip Helger
1da41a718f Enforcing specific Java versions for compilation 2025-10-22 15:54:07 +02:00
Philip Helger
be9dcaac03 Using release instead of source/target 2025-10-22 15:37:21 +02:00
Philip Helger
e6d537f78a Merge branch 'release/1.6.x' of https://projekte.kosit.org/kosit/validator.git into release/1.6.x 2025-10-22 15:33:37 +02:00
Philip Helger
9774dddb17 Lombok update for Java 25 2025-10-22 15:33:29 +02:00
Renzo Kottmann
1c5c3ab66f Add github #127 to changelog.md 2025-10-22 15:19:06 +02:00
Renzo Kottmann
8b869a7804 Merge branch '127-custom-error-level-java-result' into 'release/1.6.x'
Added custom error level to Result object.

See merge request kosit/validator!81
2025-10-22 14:59:35 +02:00
Marija Stojanovic
9ed443ffdb Added custom error level to Result object. 2025-10-22 14:59:35 +02:00
andreb
3c6b4d2e2e Merge branch 'main' into release/1.6.x
# Conflicts:
#	README.md
2025-10-06 09:08:21 +02:00
Philip Helger
da0478f838 Fixed typo 2025-09-12 11:06:17 +02:00
Philip Helger
3d783857ab Updated to new JS component versions; #153 2025-09-10 19:38:40 +02:00
Philip Helger
1f859bc678 Using XEinkauf instead of XOEV 2025-09-10 19:29:17 +02:00
Philip Helger
e90e4be6f0 Updated 2025-09-10 19:09:46 +02:00
Philip Helger
6bd4839495 Fixed Javadoc error 2025-09-10 18:58:46 +02:00
Philip Helger
2e8ce6869b Fixed link 2025-09-10 18:55:16 +02:00
Philip Helger
5e31f0fcdc Fixed links 2025-09-10 18:47:44 +02:00
Philip Helger
2f90992249 Fixed formatting 2025-09-10 18:43:17 +02:00
Philip Helger
88a7102df8 Version bump to Docusaur 3.x (#153) 2025-09-10 15:58:45 +02:00
Philip Helger
709da29fe9 Updated changelog 2025-09-10 15:39:35 +02:00
Philip Helger
446e1726d4 Latest docusaurus 2.x 2025-09-10 15:17:56 +02:00
Philip Helger
87f297f6e3 Updated examples + links 2025-09-10 14:55:27 +02:00
Philip Helger
705b0b2501 Updated examples + links 2025-09-10 14:52:29 +02:00
yunussozeri
714e5e7803 Update links to source code to current locations
The links were old and not redirecting to the correct location
2025-09-10 14:38:57 +02:00
yunussozeri
1ed9377b83
Update links to source code to current locations
The links were old and not redirecting to the correct location
2025-09-08 14:43:51 +02:00
Renzo Kottmann
93a64223b8 minor grammar in README.md
(cherry picked from commit a96751e08f)

Co-authored-by: Renzo Kottmann <renzo.kottmann@finanzen.bremen.de>
2025-09-04 12:07:23 +02:00
Renzo Kottmann
a96751e08f minor grammar in README.md 2025-09-04 12:06:19 +02:00
Renzo Kottmann
5bbc0eb98f Merge branch 'readme-update-16' into 'release/1.6.x'
Updated readme

See merge request kosit/validator!80
2025-09-03 16:36:36 +02:00
Philip Helger
36e425388d Updated readme 2025-09-03 16:36:36 +02:00
Renzo Kottmann
16c6784c5b Merge branch 'version-badge' into 'main'
Added Maven Central badge

See merge request kosit/validator!78
2025-09-03 16:28:51 +02:00
Philip Helger
52e42fe6dc Removed ToC 2025-09-03 16:23:12 +02:00
Philip Helger
78e5d3d4ee Added badge, roadmap, contributors and license 2025-09-03 16:22:22 +02:00
Philip Helger
162339d485 Added Maven Central badge 2025-09-03 15:30:37 +02:00
Philip Helger
51e573f02c Removed Java8 file 2025-08-29 17:28:20 +02:00
Philip Helger
100644fb38 Format fix from https://github.com/itplr-kosit/validator/pull/153 2025-08-29 17:28:06 +02:00
Philip Helger
1bda64f610 Removed Java 8 from GitLab 2025-08-29 17:24:34 +02:00
Philip Helger
0be3eac6ed Fixed git branch name 2025-08-29 17:23:15 +02:00
Philip Helger
f082d48dd8 Different version between API and impl 2025-08-29 17:19:04 +02:00
Philip Helger
4e0a1e1fc5 Merge remote-tracking branch 'origin/release/1.5.x' into release/1.6.x 2025-08-29 17:14:00 +02:00
Renzo Kottmann
fda9de5b3e Merge branch 'release/1.5.x' into 'main'
v1.5.2 release back to main

See merge request kosit/validator!75
2025-08-29 17:08:31 +02:00
Renzo Kottmann
c906adf39b [maven-release-plugin] prepare for next development iteration 2025-08-29 15:59:27 +02:00
Renzo Kottmann
e5f2298293 [maven-release-plugin] prepare release v1.5.2 2025-08-29 15:59:19 +02:00
Renzo Kottmann
561d719b28 Merge branch 'release/1.5.x' of https://projekte.kosit.org/kosit/validator into release/1.5.x 2025-08-29 15:49:56 +02:00
Renzo Kottmann
c0f823f399 Prepare for release 1.5.2 2025-08-29 15:49:32 +02:00
Renzo Kottmann
6a60bc561a Merge branch '148-regression-distribution-zip-does-not-contain-validator-jar' into 'release/1.5.x'
Resolve "Regression: distribution zip does not contain validator*.jar"

See merge request kosit/validator!74
2025-08-29 15:48:53 +02:00
Renzo Kottmann
3aab435d8e Resolve "Regression: distribution zip does not contain validator*.jar" 2025-08-29 15:48:52 +02:00
Renzo Kottmann
1e6f96dfad [maven-release-plugin] prepare for next development iteration 2025-08-29 10:52:23 +02:00
Renzo Kottmann
fc31e98da9 [maven-release-plugin] prepare release v1.5.1 2025-08-29 10:52:10 +02:00
Renzo Kottmann
05079676b5 Changed name in pom.xml 2025-08-29 10:47:10 +02:00
Philip Helger
e444a60695 Re-added latest POM changes 2025-08-29 10:45:58 +02:00
Philip Helger
cf10fa09e5 Changed back to validator 2025-08-29 10:44:12 +02:00
Renzo Kottmann
4a15af6ef2 [maven-release-plugin] rollback the release of v1.5.1 2025-08-29 10:32:39 +02:00
Philip Helger
da42b9e404 [maven-release-plugin] rollback the release of v1.5.1 2025-08-29 10:31:41 +02:00
Philip Helger
2dd5e0dbb0 [maven-release-plugin] prepare for next development iteration 2025-08-29 10:31:26 +02:00
Philip Helger
be30c80617 [maven-release-plugin] prepare release v1.5.1 2025-08-29 10:31:24 +02:00
Philip Helger
90b860d8ec [maven-release-plugin] rollback the release of v1.5.1 2025-08-29 10:29:32 +02:00
Philip Helger
eb7fc87f07 [maven-release-plugin] prepare for next development iteration 2025-08-29 10:29:22 +02:00
Philip Helger
f4f0d9eceb [maven-release-plugin] prepare release v1.5.1 2025-08-29 10:28:37 +02:00
Philip Helger
269862503e Added Maven Central plugin 2025-08-29 10:27:42 +02:00
Renzo Kottmann
02d12b614e Merge branch '151-release-docs' into 'release/1.5.x'
Release documentation update

See merge request kosit/validator!73
2025-08-29 10:15:40 +02:00
Philip Helger
740a880276 Release documentation update 2025-08-29 10:15:40 +02:00
Renzo Kottmann
da7515a055 Merge branch '146-write-changelog-for-1-5-1' into 'release/1.5.x'
Resolve "write changelog for 1.5.1"

See merge request kosit/validator!72
2025-08-28 13:53:06 +02:00
Philip Helger
05c3d9ea09 Resolve "write changelog for 1.5.1" 2025-08-28 13:53:06 +02:00
Renzo Kottmann
d4d1aaea51 Merge branch '145-if-the-cli-is-invoked-without-any-parameter-the-usage-is-shown-twice' into 'release/1.5.x'
Resolve "If the CLI is invoked without any parameter, the usage is shown twice"

See merge request kosit/validator!71
2025-08-27 18:14:09 +02:00
Philip Helger
5e57c3e978 Resolve "If the CLI is invoked without any parameter, the usage is shown twice" 2025-08-27 18:14:09 +02:00
Renzo Kottmann
22910c1ca0 Merge branch '130-check-result-to-stdout-causes-an-exception' into 'release/1.5.x'
Resolve "Check result to stdout causes an exception"

See merge request kosit/validator!70
2025-08-27 17:40:46 +02:00
Philip Helger
911b9a3291 Resolve "Check result to stdout causes an exception" 2025-08-27 17:40:46 +02:00
Renzo Kottmann
7eaf9bcc09 Merge branch '129-api-doc-supdate' into 'release/1.5.x'
Resolve #129 - Api Doc Updates

See merge request kosit/validator!69
2025-08-27 17:30:08 +02:00
Philip Helger
122b647853 Resolve #129 - Api Doc Updates 2025-08-27 17:30:08 +02:00
Philip Helger
a8a3fd100c Checking only for "Usage:" but as a constant; No ANSI codes! 2025-08-27 17:08:19 +02:00
Philip Helger
7a7712188d WiP Sysout debugging 2025-08-27 16:21:12 +02:00
Renzo Kottmann
ce65c99f6c Merge branch '62-surefire-test-error' into 'release/1.5.x'
Resolve "Surefire Test Error running de.kosit.validationtool.impl.xml.RemoteResolvingStrategyTest fails without http.proxy setting"

See merge request kosit/validator!68
2025-08-27 15:15:59 +02:00
Marija Stojanovic
6698e6b865 Resolve "Surefire Test Error running de.kosit.validationtool.impl.xml.RemoteResolvingStrategyTest fails without http.proxy setting" 2025-08-27 15:15:59 +02:00
Renzo Kottmann
edde0f5134 Merge branch '104-backwards-incompatibility-problem-from-1-4-2-to-1-5-0' into 'release/1.5.x'
Resolve "Backwards incompatibility problem from 1.4.2 to 1.5.0"

See merge request kosit/validator!66
2025-08-19 18:05:54 +02:00
Philip Helger
e4d4ee44e5 Resolve "Backwards incompatibility problem from 1.4.2 to 1.5.0" 2025-08-19 18:05:54 +02:00
Renzo Kottmann
a45563e41a [maven-release-plugin] rollback the release of v1.5.1 2025-08-19 16:12:50 +02:00
Philip Helger
3edc5c6ae4 Constant cache key 2025-08-19 15:42:51 +02:00
Renzo Kottmann
6cc9a6eea7 Merge branch '144-create-maven-release-profile-for-releasing-to-maven-central' into 'release/1.5.x'
Resolve "Create Maven release profile for releasing to Maven Central"

See merge request kosit/validator!67
2025-08-19 15:41:52 +02:00
Philip Helger
5bbb5b373d Resolve "Create Maven release profile for releasing to Maven Central" 2025-08-19 15:41:52 +02:00
Renzo Kottmann
b24e97e43f Merge branch '131-unsupportedoperationexception-because-of-read-only-list' into 'release/1.5.x'
Resolve "UnsupportedOperationException because of read-only List"

See merge request kosit/validator!65
2025-08-13 18:27:06 +02:00
Philip Helger
361ed5863d Resolve "UnsupportedOperationException because of read-only List" 2025-08-13 18:27:06 +02:00
Philip Helger
0092c2f0e1 Merge branch '140-prepare-pom-xml-to-be-able-to-release-to-maven-central' into 'release/1.5.x'
Resolve "Prepare pom.xml to be able to release to Maven Central"

See merge request kosit/validator!62
2025-08-13 17:58:22 +02:00
Philip Helger
ef6ea7a92c Resolve "Prepare pom.xml to be able to release to Maven Central" 2025-08-13 17:58:21 +02:00
Renzo Kottmann
864c36b3c2 Merge branch '136-remove-ide-project-folders-from-git' into 'release/1.5.x'
Resolve "Remove IDE project folders from git"

See merge request kosit/validator!63
2025-08-13 17:00:31 +02:00
Philip Helger
7bfd3309d1 Resolve "Remove IDE project folders from git" 2025-08-13 17:00:30 +02:00
Philip Helger
827eded0ed Merge branch 'issue/137' into 'release/1.5.x'
Resolve #137

See merge request kosit/validator!59
2025-08-08 12:08:29 +02:00
Philip Helger
910320a5f1 Resolve #137 2025-08-08 12:08:29 +02:00
Renzo Kottmann
6950a98f09 Merge branch 'issue/141' into 'release/1.5.x'
Using https URL

See merge request kosit/validator!60
2025-08-08 10:24:30 +02:00
Philip Helger
acd7740846 Using https URL 2025-08-07 11:11:33 +02:00
andreb
e3ac6cdb39 initalize 1.6.x migrate to jakarta 2025-07-29 08:16:48 +02:00
andreb
96c1d346ee initalize 1.6.x migrate to jakarta 2025-07-28 17:04:56 +02:00
Andre Babinsky
de41d61b04 Merge branch '110-gitlab-ci-umgebung-reaktivieren' into 'release/1.5.x'
GitLab CI-Umgebung reaktivieren

See merge request kosit/validator!58
2025-07-25 07:04:59 +00:00
Andre Babinsky
40f6f4a296 GitLab CI-Umgebung reaktivieren 2025-07-25 07:04:59 +00:00
Andre Babinsky
0b2d812dd1 Merge branch '109-komponente-upgrade-fur-1-5' into 'release/1.5.x'
upgrade dependencies and plugins

See merge request kosit/validator!57
2025-07-25 06:48:45 +00:00
andreb
98c2e1c18c upgrade dependencies and plugins 2025-07-23 13:29:34 +02:00
Philip Helger
4ce8f4de58 Updated versions 2025-04-09 19:25:35 +02:00
Renzo Kottmann
5a1ca79ed8 WIP: bump apache.common.io to v2.18.0 2025-04-09 18:41:31 +02:00
167 changed files with 15937 additions and 18435 deletions

16
.gitignore vendored
View file

@ -5,7 +5,6 @@
# Log file
*.log
.idea
#*.iml
# Package Files #
@ -35,9 +34,22 @@ src/generated
.project
.classpath
.factorypath
.settings
.idea/
.settings/
.externalToolBuilders/
.vscode
*.code-workspace
*.xpr
# Testing stuff
xrechnung
# Mac stuff
.DS_Store
andre*-simple.xml
somePrefix*.xml
zz
# 2.0 stuff
api/
cli/
core/

View file

@ -2,17 +2,20 @@ 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"
MAVEN_CLI_OPTS: " --batch-mode --errors --fail-at-end --show-version -s .mvn/settings.xml"
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_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"
before_script:
- export CI_JOB_TIMESTAMP="-Dbuild.timestamp=$(date --utc --iso-8601=seconds)"
cache:
key: "$CI_JOB_NAME"
# Change the cache key if major dependencies change
key: constant160
paths:
- .m2/repository
# Basic Java build steps
.java:
stage: build
needs:
@ -30,14 +33,9 @@ cache:
- target/surefire-reports/*.xml
- target/failsafe-reports/*.xml
.java_extended:
extends: .java
rules:
- if: $CI_PIPELINE_SOURCE == "schedule"
java-11:
extends: .java
image: $CI_REGISTRY_IMAGE/maven:3-jdk-11
image: maven:3-eclipse-temurin-11-alpine
needs: [ ]
script:
- mvn $MAVEN_CLI_OPTS $BUILD_PROPS $CI_JOB_TIMESTAMP install
@ -52,53 +50,52 @@ java-11:
- target/surefire-reports/*.xml
- target/failsafe-reports/*.xml
java8:
extends: .java
image: $CI_REGISTRY_IMAGE/maven:3-jdk-8
java-11-openj9:
extends: .java_extended
image: $CI_REGISTRY_IMAGE/maven:3-jdk-11-openj9
java-8-openj9:
extends: .java_extended
image: $CI_REGISTRY_IMAGE/maven:3-jdk-8-openj9
java-15:
extends: .java_extended
image: $CI_REGISTRY_IMAGE/maven:3-openjdk-15
java-16:
extends: .java_extended
image: $CI_REGISTRY_IMAGE/maven:3-openjdk-16
java-17:
extends: .java
image: $CI_REGISTRY_IMAGE/maven:3-openjdk-17
image: maven:3-eclipse-temurin-17-alpine
java-18:
extends: .java_extended
image: $CI_REGISTRY_IMAGE/maven:3-openjdk-18
java-21:
extends: .java
image: maven:3-eclipse-temurin-21-alpine
java-19:
extends: .java_extended
image: $CI_REGISTRY_IMAGE/maven:3-eclipse-temurin-19-alpine
java-25:
extends: .java
image: maven:3-eclipse-temurin-25-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: $CI_REGISTRY_IMAGE/maven:3-jdk-11
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/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
- 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
when: manual
# Build Docker images and upload to KoSIT registry
create-build-image:
stage: deploy
image: docker:latest
@ -114,17 +111,25 @@ create-build-image:
changes:
- .mvn/createBuildImages.sh
# Run OWASP checks - expensive so only on main branch
owasp-check:
extends: .java
image: $CI_REGISTRY_IMAGE/maven:3-jdk-11
stage: test
image: maven:3-eclipse-temurin-21-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"
changes:
- pom.xml
- owasp-suppressions.xml

View file

@ -1,16 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CheckStyle-IDEA">
<option name="configuration">
<map>
<entry key="checkstyle-version" value="8.16" />
<entry key="copy-libs" value="true" />
<entry key="location-0" value="BUNDLED:(bundled):Sun Checks" />
<entry key="location-1" value="BUNDLED:(bundled):Google Checks" />
<entry key="scan-before-checkin" value="false" />
<entry key="scanscope" value="JavaOnly" />
<entry key="suppress-errors" value="false" />
</map>
</option>
</component>
</project>

18
.idea/compiler.xml generated
View file

@ -1,18 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<annotationProcessing>
<profile default="true" name="Default" enabled="true" />
<profile name="Maven default annotation processors profile" enabled="true">
<sourceOutputDir name="target/generated-sources/annotations" />
<sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
<outputRelativeToContentRoot value="true" />
<module name="validator" />
<module name="validationtool" />
</profile>
</annotationProcessing>
<bytecodeTargetLevel>
<module name="validator" target="1.8" />
</bytecodeTargetLevel>
</component>
</project>

View file

@ -1,6 +0,0 @@
<component name="CopyrightManager">
<copyright>
<option name="notice" value="Copyright 2017-2022 Koordinierungsstelle für IT-Standards (KoSIT)&#10;&#10;Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);&#10;you may not use this file except in compliance with the License.&#10;You may obtain a copy of the License at&#10;&#10; http://www.apache.org/licenses/LICENSE-2.0&#10;&#10;Unless required by applicable law or agreed to in writing, software&#10;distributed under the License is distributed on an &quot;AS IS&quot; BASIS,&#10;WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.&#10;See the License for the specific language governing permissions and&#10;limitations under the License." />
<option name="myName" value="KoSIT Validator" />
</copyright>
</component>

View file

@ -1,7 +0,0 @@
<component name="CopyrightManager">
<settings default="KoSIT Validator">
<module2copyright>
<element module="All" copyright="KoSIT Validator" />
</module2copyright>
</settings>
</component>

View file

@ -1,17 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="EclipseCodeFormatterProjectSettings">
<option name="projectSpecificProfile">
<ProjectSpecificProfile>
<option name="disabledFileTypes" value="xml" />
<option name="formatSeletedTextInAllFileTypes" value="false" />
<option name="formatter" value="ECLIPSE" />
<option name="importOrderConfigFilePath" value="$PROJECT_DIR$/.settings/org.eclipse.jdt.ui.prefs" />
<option name="importOrderFromFile" value="true" />
<option name="pathToConfigFileJava" value="$PROJECT_DIR$/formatter.xml" />
<option name="selectedJavaProfile" value="init" />
<option name="useForLiveTemplates" value="true" />
</ProjectSpecificProfile>
</option>
</component>
</project>

11
.idea/encodings.xml generated
View file

@ -1,11 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding">
<file url="file://$PROJECT_DIR$" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/src/main/model" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/src/main/resources" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/target/generated-sources/xjc" charset="UTF-8" />
<file url="PROJECT" charset="UTF-8" />
</component>
</project>

89
.idea/misc.xml generated
View file

@ -1,89 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ExternalStorageConfigurationManager" enabled="true" />
<component name="JavaScriptSettings">
<option name="languageLevel" value="ES6" />
</component>
<component name="JavadocGenerationManager">
<option name="OUTPUT_DIRECTORY" value="$PROJECT_DIR$/target" />
</component>
<component name="MarkdownProjectSettings">
<PreviewSettings splitEditorLayout="SPLIT" splitEditorPreview="PREVIEW" useGrayscaleRendering="false" zoomFactor="1.0" maxImageWidth="0" showGitHubPageIfSynced="false" allowBrowsingInPreview="false" synchronizePreviewPosition="true" highlightPreviewType="LINE" highlightFadeOut="5" highlightOnTyping="true" synchronizeSourcePosition="true">
<PanelProvider>
<provider providerId="com.vladsch.idea.multimarkdown.editor.swing.html.panel" providerName="Default - Swing" />
</PanelProvider>
</PreviewSettings>
<ParserSettings>
<PegdownExtensions>
<option name="ABBREVIATIONS" value="false" />
<option name="ANCHORLINKS" value="true" />
<option name="ATXHEADERSPACE" value="true" />
<option name="AUTOLINKS" value="true" />
<option name="DEFINITIONS" value="false" />
<option name="FENCED_CODE_BLOCKS" value="true" />
<option name="FOOTNOTES" value="false" />
<option name="HARDWRAPS" value="false" />
<option name="INSERTED" value="false" />
<option name="QUOTES" value="false" />
<option name="RELAXEDHRULES" value="true" />
<option name="SMARTS" value="false" />
<option name="STRIKETHROUGH" value="true" />
<option name="SUBSCRIPT" value="false" />
<option name="SUPERSCRIPT" value="false" />
<option name="SUPPRESS_HTML_BLOCKS" value="false" />
<option name="SUPPRESS_INLINE_HTML" value="false" />
<option name="TABLES" value="true" />
<option name="TASKLISTITEMS" value="true" />
<option name="TOC" value="false" />
<option name="WIKILINKS" value="true" />
</PegdownExtensions>
<ParserOptions>
<option name="COMMONMARK_LISTS" value="false" />
<option name="DUMMY" value="false" />
<option name="EMOJI_SHORTCUTS" value="true" />
<option name="FLEXMARK_FRONT_MATTER" value="false" />
<option name="GFM_TABLE_RENDERING" value="true" />
<option name="GITBOOK_URL_ENCODING" value="false" />
<option name="GITHUB_EMOJI_URL" value="false" />
<option name="GITHUB_LISTS" value="true" />
<option name="GITHUB_WIKI_LINKS" value="true" />
<option name="JEKYLL_FRONT_MATTER" value="false" />
<option name="SIM_TOC_BLANK_LINE_SPACER" value="true" />
</ParserOptions>
</ParserSettings>
<HtmlSettings headerTopEnabled="false" headerBottomEnabled="false" bodyTopEnabled="false" bodyBottomEnabled="false" embedUrlContent="false" addPageHeader="true">
<GeneratorProvider>
<provider providerId="com.vladsch.idea.multimarkdown.editor.swing.html.generator" providerName="Default Swing HTML Generator" />
</GeneratorProvider>
<headerTop />
<headerBottom />
<bodyTop />
<bodyBottom />
</HtmlSettings>
<CssSettings previewScheme="UI_SCHEME" cssUri="" isCssUriEnabled="false" isCssTextEnabled="false" isDynamicPageWidth="true">
<StylesheetProvider>
<provider providerId="com.vladsch.idea.multimarkdown.editor.swing.html.css" providerName="Default Swing Stylesheet" />
</StylesheetProvider>
<ScriptProviders />
<cssText />
</CssSettings>
<HtmlExportSettings updateOnSave="false" parentDir="$ProjectFileDir$" targetDir="$ProjectFileDir$" cssDir="" scriptDir="" plainHtml="false" imageDir="" copyLinkedImages="false" imageUniquifyType="0" targetExt="" useTargetExt="false" noCssNoScripts="false" linkToExportedHtml="true" exportOnSettingsChange="true" regenerateOnProjectOpen="false" />
<LinkMapSettings>
<textMaps />
</LinkMapSettings>
</component>
<component name="MavenProjectsManager">
<option name="originalFiles">
<list>
<option value="$PROJECT_DIR$/pom.xml" />
</list>
</option>
</component>
<component name="NodePackageJsonFileManager">
<packageJsonPaths />
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_6" project-jdk-name="oracle-1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
<component name="jetbrains.communicator.idea.IdProvider" IDEtalkID="4B2DA906C3A7DF4F7B6EA28093E19A3F" />
</project>

View file

@ -1,22 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="SaveActionSettings">
<option name="actions">
<set>
<option value="activate" />
<option value="activateOnShortcut" />
<option value="activateOnBatch" />
<option value="organizeImports" />
<option value="reformatChangedCode" />
<option value="rearrange" />
<option value="fieldCanBeFinal" />
<option value="localCanBeFinal" />
<option value="methodMayBeStatic" />
<option value="unqualifiedFieldAccess" />
<option value="missingOverrideAnnotation" />
<option value="useBlocks" />
</set>
</option>
<option name="configurationPath" value="" />
</component>
</project>

6
.idea/vcs.xml generated
View file

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>

View file

@ -16,7 +16,7 @@
# limitations under the License.
#
TAGS=("3-openjdk-16" "3-jdk-11" "3-jdk-11-openj9" "3-jdk-8" "3-jdk-8-openj9" "3-openjdk-15" "3-openjdk-17" "3-openjdk-18" "3-eclipse-temurin-19-alpine")
TAGS=("3-jdk-8" "3-jdk-8-openj9" "3-eclipse-temurin-11-alpine" "3-jdk-11-openj9" "3-eclipse-temurin-17-alpine" "3-eclipse-temurin-21-alpine" "3-eclipse-temurin-24-alpine")
docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" "$CI_REGISTRY"
for i in "${TAGS[@]}"

View file

@ -0,0 +1,11 @@
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
<servers>
<server>
<id>central</id>
<username>${MVN_CENTRAL_USER}</username>
<password>${MAVEN_CENTRAL_TOKEN}</password>
</server>
</servers>
</settings>

View file

@ -1,36 +1,6 @@
<!--
~ 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.
-->
<settings xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/SETTINGS/1.1.0"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.1.0 http://maven.apache.org/xsd/settings-1.1.0.xsd">
<!--
~ Copyright 2017-2021 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.
-->
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
<servers>
<server>
<id>gitlab-maven</id>

File diff suppressed because one or more lines are too long

View file

@ -1,47 +0,0 @@
<!--
~ 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.
-->
<settings xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/SETTINGS/1.1.0"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.1.0 http://maven.apache.org/xsd/settings-1.1.0.xsd">
<!--
~ Copyright 2017-2021 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.
-->
<servers>
<server>
<id>gitlab-maven</id>
<configuration>
<httpHeaders>
<property>
<name>Job-Token</name>
<value>${env.CI_JOB_TOKEN}</value>
</property>
</httpHeaders>
</configuration>
</server>
</servers>
</settings>

View file

@ -2,16 +2,93 @@
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.0.0/)
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.5.0 (to be released)
## 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 &ge; 11.0.23
- Java 12 to 16 will not work
- Java 17: any version &ge; 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
## 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
### 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) [#101](https://github.com/itplr-kosit/validator/issues/101) Role is null in FailedAssert
- (CORE) [GitHub #101](https://github.com/itplr-kosit/validator/issues/101) Role is null in FailedAssert
### Added
@ -19,15 +96,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- (API) Possibility to use preconfigured Saxon `Processor` instance for validation
### Changed
- (CORE) [#100](https://github.com/itplr-kosit/validator/issues/100) Make createReport optional
- (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()](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
@ -38,14 +113,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
@ -80,7 +155,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/master/src/main/java/de/kosit/validationtool/impl/DefaultResult.java)
in [DefaultResult.java](https://github.com/itplr-kosit/validator/blob/main/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.
@ -128,20 +203,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/master/src/main/java/de/kosit/validationtool/api/Result.java)
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*
### Changed
- *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
- *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
- _UNDEFINED_ is only returned, when processing is stopped somehow
- *Result#isAcceptable()* can now evaluate to true, when no _acceptMatch_ is configured (see above)
- 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)
## 1.1.3
@ -172,10 +247,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added
- Enhanced API-Usage e.g. return _Result_ object with processing information
- Enhanced API-Usage e.g. return *Result* object with processing information
- Support loading scenarios and content from a JAR-File
- Simple Daemon-Mode exposing validation functionality via http
- cli option to serialize the 'report input' xml document to _cwd_ (current working directory)
- cli option to serialize the 'report input' xml document to *cwd* (current working directory)
- Documentation in `docs` folder
### Changed

30
NOTICE
View file

@ -1,5 +1,29 @@
KoSIT Validator
Copyright 2017-2022 Koordinierungsstelle für IT-Standards (KoSIT)
KoSIT XML Validator
Copyright 2017-2026 Koordinierungsstelle für IT-Standards (KoSIT)
This product includes software developed by
Koordinierungsstelle für IT-Standards (https://www.xoev.de/).
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

135
README.md
View file

@ -1,82 +1,85 @@
# KoSIT Validator
- [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)
[![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
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
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) which are used to fully configure the process.
It always creates a [validation report in XML](docs/configurations.md#validators-report). The actual content of this is controlled by the scenario.
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 actual validation process.
See [architecture](docs/architecture.md) for information about the whole validation process.
## Validation configurations
The validator is just an engine and does not know anything about XML documents and has no own validation rules.
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.
### Third party validation configurations
### Example validation configurations
Currently, there are two public third party validation configurations available.
Here are some public validation configurations:
* Validation Configuration for [XRechnung](http://www.xoev.de/de/xrechnung):
* Validation Configuration for [XRechnung](https://xeinkauf.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 standalone application running from the CLI
* as library embedded within a custom application
* as a daemon providing a http interface
* as a daemon providing an http interface
### Standalone Command-Line Interface
### Standalone Command Line Interface (CLI)
**Important hint**: since v1.5.1 the filename has been changed from `validationtool-*` to `validator-*`
The general way using the CLI is:
```shell
java -jar validationtool-<version>-standalone.jar -s <scenario-config-file> [OPTIONS] [FILE] [FILE] [FILE] ...
java -jar validator-<version>-standalone.jar -s <scenario-config-file> [-r <repository-path>]
[OPTIONS] [FILE] [FILE] [FILE] ...
```
The help option displays further CLI options to customize the process:
```shell
java -jar validationtool-<version>-standalone.jar --help
java -jar validator-<version>-standalone.jar --help
```
A concrete example with a specific validator configuration can be found on
[GitHub](https://github.com/itplr-kosit/validator-configuration-xrechnung)
A concrete example with a specific Validator configuration can be found on
[validator-configuration-bis](https://github.com/itplr-kosit/validator-configuration-bis)
The [CLI documentation](./docs/cli.md) shows further configuration options.
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
Path scenarios = Paths.get("scenarios.xml");
Configuration config = Configuration.load(scenarios.toUri());
Input document = InputFactory.read(testDocument);
URL scenarios = this.getClass().getClassLoader().getResource("scenarios.xml");
Configuration config = Configuration.load(scenarios.toURI()).build(ProcessorProvider.getProcessor());
Check validator = new DefaultCheck(config);
Result validationResult = validator.checkInput(document);
Input document = InputFactory.read(testDocument);
Result report = validator.checkInput(document);
// examine the result here
```
@ -84,15 +87,14 @@ Result validationResult = 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
You can also start the validator as a HTTP-Server. Just start it in _Daemon-Mode_ with the `-D` option.
```shell
java -jar validationtool-<version>-standalone.jar -s <scenario-config-file> -D
java -jar validator-<version>-standalone.jar -s <scenario-config-file> -D
```
@ -100,9 +102,58 @@ 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. **validationtool-`<version>`.jar**: Java library for embedded use within an application
1. **validationtool-`<version`>-standalone.jar**: Uber-JAR for standalone usage containing all dependencies in one jar file. This file comes with JAXB *embedded* and can be used with Java 8 and Java >= 11)
1. **validationtool-`<version`>-java8-standalone.jar**: Uber-JAR for standalone usage with Java JDK 8 containing all dependencies in one jar file. This file file *does not* contain JAXB and depends on the bundled version of the JDK.
1. **libs/***: directory containing all (incl. optional) dependencies of the validator
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).

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://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.
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.

View file

@ -12,8 +12,8 @@ Then you can declare the dependency as follows:
```xml
<dependency>
<groupId>de.kosit</groupId>
<artifactId>validationtool</artifactId>
<groupId>org.kosit</groupId>
<artifactId>validator</artifactId>
<version>${validator.version}</version>
</dependency>
```
@ -22,10 +22,12 @@ Then you can declare the dependency as follows:
```js
dependencies {
compile group: 'de.kosit', name: 'validationtool', version: '1.1.0'
compile group: 'org.kosit', name: 'validator', version: '1.5.1'
}
```
Hint: prior to v1.5.1 the group ID was `de.kosit` and the artifact ID was `validationtool`.
## Usage
Prerequisite for use is a valid [scenario definition](configurations.md) and the a folder with all necessary artifacts for validation (repository) either on the filesystem or on the classpath.
@ -33,34 +35,39 @@ Prerequisite for use is a valid [scenario definition](configurations.md) and the
The following example demonstrates loading scenario.xml and whole configuration from classpath and validating one XML document:
```java
package org.kosit.validator.example;
package de.kosit.validationtool.docs;
import java.net.URISyntaxException;
import java.net.URL;
import java.nio.file.Path;
import java.nio.file.Paths;
import org.w3c.dom.Document;
import de.kosit.validationtool.api.Check;
import de.kosit.validationtool.api.Configuration;
import de.kosit.validationtool.api.Input;
import de.kosit.validationtool.api.InputFactory;
import de.kosit.validationtool.api.Result;
import de.kosit.validationtool.impl.DefaultCheck;
import org.w3c.dom.Document;
import de.kosit.validationtool.impl.xml.ProcessorProvider;
/**
* Example code that is used in the docs/api.md file
*/
public class StandardExample {
public void run(Path testDocument) throws URISyntaxException {
public void run(final Path testDocument) throws URISyntaxException {
// Load scenarios.xml from classpath
URL scenarios = this.getClass().getClassLoader().getResource("scenarios.xml");
final URL scenarios = this.getClass().getClassLoader().getResource("examples/simple/scenarios-with-relative-paths.xml");
// Load the rest of the specific Validator configuration from classpath
Configuration config = Configuration.load(scenarios.toURI()).build();
final Configuration config = Configuration.load(scenarios.toURI()).build(ProcessorProvider.getProcessor());
// Use the default validation procedure
Check validator = new DefaultCheck(config);
final Check validator = new DefaultCheck(config);
// Validate a single document
Input document = InputFactory.read(testDocument);
final Input document = InputFactory.read(testDocument);
// Get Result including information about the whole validation
Result report = validator.checkInput(document);
final Result report = validator.checkInput(document);
System.out.println("Is processing succesful=" + report.isProcessingSuccessful());
// Get report document if processing was successful
Document result = null;
@ -70,37 +77,41 @@ public class StandardExample {
// continue processing results...
}
public static void main(String[] args) throws Exception {
public static void main(final String[] args) throws Exception {
// Use e.g. "src/test/resources/examples/simple/input/foo.xml"
if (args.length == 0) {
throw new IllegalStateException("Provide a test document filename on the commandline");
}
// Path of document for validation
Path testDoc = Paths.get(args[0]);
StandardExample example = new StandardExample();
final Path testDoc = Paths.get(args[0]);
final StandardExample example = new StandardExample();
// run example validation
example.run(testDoc);
}
}
```
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/master/src/main/java/de/kosit/validationtool/api/Result.java) for details.
[Result.java](https://github.com/itplr-kosit/validator/blob/main/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/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)
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)
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/master/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/main/src/main/java/de/kosit/validationtool/api/InputFactory.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)).
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)).
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/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()`.
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()`.
The three defined states are:
@ -134,26 +145,36 @@ Instead of pre-configured [scenario files](configurations.md) it is possible to
A simple configuration looks like this:
```java
import static de.kosit.validationtool.config.ConfigurationBuilder.*;
import de.kosit.validationtool.api.Configuration;
import java.net.URI;
import java.nio.file.Path;
package de.kosit.validationtool.docs;
import static de.kosit.validationtool.config.ConfigurationBuilder.fallback;
import static de.kosit.validationtool.config.ConfigurationBuilder.report;
import static de.kosit.validationtool.config.ConfigurationBuilder.scenario;
import static de.kosit.validationtool.config.ConfigurationBuilder.schema;
import static de.kosit.validationtool.config.ConfigurationBuilder.schematron;
import java.net.URI;
import java.nio.file.Paths;
import de.kosit.validationtool.api.Check;
import de.kosit.validationtool.api.Configuration;
import de.kosit.validationtool.impl.DefaultCheck;
import de.kosit.validationtool.impl.xml.ProcessorProvider;
/**
* Example code that is used in the docs/api.md file
*/
public class MyValidator {
public static void main(String[] args) {
Configuration config = Configuration.create().name("myconfiguration")
.with(scenario("firstScenario")
.match("//myNode")
.validate(schema("Sample Schema").schemaLocation(URI.create("simple.xsd")))
.validate(schematron("my rules").source("myRules.xsl"))
.with(report("my report").source("report.xsl")))
.with(fallback().name("default-report").source("fallback.xsl"))
.useRepository(Paths.get("/opt/myrepository"))
.build();
Check validator = new DefaultCheck(config);
// .. run your checks
}
public static void main(final String[] args) {
final Configuration config = Configuration.create().name("myconfiguration")
.with(scenario("firstScenario").match("//myNode").validate(schema("Sample Schema").schemaLocation(URI.create("simple.xsd")))
.validate(schematron("my rules").source("myRules.xsl")).with(report("my report").source("report.xsl")))
.with(fallback().name("default-report").source("fallback.xsl")).useRepository(Paths.get("/opt/myrepository"))
.build(ProcessorProvider.getProcessor());
final Check validator = new DefaultCheck(config);
// .. run your checks
}
}
```
@ -175,35 +196,33 @@ 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/master/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/main/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/master/src/main/java/de/kosit/validationtool/impl/xml/StrictRelativeResolvingStrategy.java)
1. [StrictRelativeResolvingStrategy.java](https://github.com/itplr-kosit/validator/tree/main/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/master/src/main/java/de/kosit/validationtool/impl/xml/StrictLocalResolvingStrategy.java)
1. [StrictLocalResolvingStrategy.java](https://github.com/itplr-kosit/validator/tree/main/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/master/src/main/java/de/kosit/validationtool/impl/xml/RemoteResolvingStrategy.java)
1. [RemoteResolvingStrategy.java](https://github.com/itplr-kosit/validator/tree/main/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
````java
Conifuguration config = Configuration.load(URI.create("myscenarios.xml"))
.resolvingMode(ResolvingMode.STRICT_LOCAL)
.build();
````
```java
final Configuration config = Configuration.load(URI.create("myscenarios.xml")).setResolvingMode(ResolvingMode.STRICT_LOCAL)
.build(ProcessorProvider.getProcessor());
```
If you decide to implement your own strategy, you can configure this via:
````java
Conifuguration config = Configuration.load(URI.create("myscenarios.xml"))
.resolvingStrategy(new MyCustomResolvingConfigurationStrategy())
.build();
````
```java
final Configuration config = Configuration.load(URI.create("myscenarios.xml"))
.setResolvingStrategy(new MyCustomResolvingConfigurationStrategy()).build(ProcessorProvider.getProcessor());
```
---
: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.
: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.
---

View file

@ -1,27 +1,29 @@
# Validator CLI
# Validator Command Line Interface (CLI)
The validator comes with a commandline interface (CLI) which allows validating any number of input xml files.
The `validator` comes with a command line interface (CLI) which allows validating any number of input XML files.
**Important hint**: since v1.5.1 the filename has been changed from `validationtool-*` to `validator-*`
The general way using the CLI is:
```shell
java -jar validationtool-<version>-standalone.jar -s <scenario-config-file> [OPTIONS] [FILE] [FILE] [FILE] ...
java -jar validator-<version>-standalone.jar -s <scenario-config-file> [OPTIONS] [FILE] [FILE] [FILE] ...
```
The validator can also read the xml file from the standard input
```shell script
# via redirection
java -jar validationtool-<version>-standalone.jar -s <scenario-config-file> [OPTIONS] < my-input.xml
# read from pipe
cat my-input.xml | validationtool-<version>-standalone.jar -s <scenario-config-file> [OPTIONS]
```
The help option displays further CLI options to customize the process:
The validator can also read the XML file from the standard input
```shell
java -jar validationtool-<version>-standalone.jar --help
# via redirection
java -jar validator-<version>-standalone.jar -s <scenario-config-file> [OPTIONS] < my-input.xml
# read from pipe
cat my-input.xml | validator-<version>-standalone.jar -s <scenario-config-file> [OPTIONS]
```
The help option displays further CLI options:
```shell
java -jar validator-<version>-standalone.jar --help
```
You can also use multiple scenario configurations and multiple repositories with resources for these. The validator either supports
@ -29,35 +31,36 @@ supplying the parameters in order or using named configuration. Valid usages are
```shell
# multiple scenarios, implicit repository
java -jar validationtool-<version>-standalone.jar -s <scenario-config-file1> -s <scenario-config-file2> [OPTIONS] [FILE]
java -jar validator-<version>-standalone.jar -s <scenario-config-file1> -s <scenario-config-file2> [OPTIONS] [FILE]
# multiple scenarios, single defined repository
java -jar validationtool-<version>-standalone.jar -s <scenario-config-file1> -s <scenario-config-file2> -r <path-to-repo> [OPTIONS] [FILE]
java -jar validator-<version>-standalone.jar -s <scenario-config-file1> -s <scenario-config-file2> -r <path-to-repo> [OPTIONS] [FILE]
# multiple scenarios, multiple repositories ordered
java -jar validationtool-<version>-standalone.jar -s <scenario-config-file1> -r <path-to-repo1> -s <scenario-config-file2> -r <path-to-repo2> [OPTIONS] [FILE]
java -jar validationtool-<version>-standalone.jar -s <scenario-config-file1> -s <scenario-config-file2> -r <path-to-repo1> -r <path-to-repo2> [OPTIONS] [FILE]
java -jar validator-<version>-standalone.jar -s <scenario-config-file1> -r <path-to-repo1> -s <scenario-config-file2> -r <path-to-repo2> [OPTIONS] [FILE]
java -jar validator-<version>-standalone.jar -s <scenario-config-file1> -s <scenario-config-file2> -r <path-to-repo1> -r <path-to-repo2> [OPTIONS] [FILE]
# multiple scenarios, multiple repositories (named)
java -jar validationtool-<version>-standalone.jar -s "NAME1=<scenario-config-file1>" -s "NAME2=<scenario-config-file2>" -r "NAME1=<path-to-repo1>" -r "NAME2=<path-to-repo2>" [OPTIONS] [FILE]
java -jar validator-<version>-standalone.jar -s "NAME1=<scenario-config-file1>" -s "NAME2=<scenario-config-file2>" -r "NAME1=<path-to-repo1>" -r "NAME2=<path-to-repo2>" [OPTIONS] [FILE]
```
## Special features
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
| code | description |
|-|-|
| 0 | All validated xml files are acceptable according to the scenario configurations |
| 0 | All validated xml files are acceptable according to the scenario configurations or application usage was requested |
| positive integer | Number of rejected (e.g. not acceptable) xml files according to the scenario configurations|
| -1 | Parsing error. The commandline arguments specified are incorrect |
| -2 | Configuration error. There is an error loading the configuration and/or validation targets |
| -2 | Configuration error. There is an error loading the configuration and/or validation targets |

View file

@ -8,8 +8,10 @@ and should work with OpenJDK based distributions. Keep this in mind, if you want
To use the validator daemon as is, start the _Daemon-Mode_ with the `-D` option and supply a suitable
[validator configuration](configurations.md).
**Important hint**: since v1.5.1 the filename has been changed from `validationtool-*` to `validator-*`
```shell
java -jar validationtool-<version>-standalone.jar -s <scenario-config-file> -D
java -jar validator-<version>-standalone.jar -s <scenario-config-file> -D
```
Per default the HTTP-Server listens on _localhost_ at Port 8080.
@ -17,7 +19,7 @@ Per default the HTTP-Server listens on _localhost_ at Port 8080.
You can configure the daemon with `-H` for IP Adress and `-P` for port number:
```shell
java -jar validationtool-<version>-standalone.jar -s <scenario-config-file> -D -H 192.168.1.x -P 8081
java -jar validator-<version>-standalone.jar -s <scenario-config-file> -D -H 192.168.1.x -P 8081
```
## Customized usage
@ -135,5 +137,5 @@ The daemon provides a simple GUI when issuing `GET` requests providing the follo
The GUI can be disabled using the API (see above) or via CLI:
```shell script
java -jar validationtool-<version>-standalone.jar -s <scenario-config-file> -D --disable-gui
java -jar validator-<version>-standalone.jar -s <scenario-config-file> -D --disable-gui
```

361
pom.xml
View file

@ -1,29 +1,13 @@
<?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.
-->
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<name>KoSIT XML Prüftool Implementierung</name>
<name>KoSIT XML Validator</name>
<groupId>de.kosit</groupId>
<version>1.5.0</version>
<groupId>org.kosit</groupId>
<artifactId>validator</artifactId>
<version>1.6.3-SNAPSHOT</version>
<artifactId>validationtool</artifactId>
<description>KoSIT XML Validator against XSD and Schematron based on defined scenarios.</description>
<developers>
<!-- In alphabetical order by last name -->
@ -31,13 +15,13 @@
<id>fabian.buettner</id>
<name>Fabian Büttner</name>
<organization>KoSIT</organization>
<organizationUrl>http://www.xoev.de</organizationUrl>
<organizationUrl>https://xoev.de/</organizationUrl>
</developer>
<developer>
<id>renzo.kottmann</id>
<name>Renzo Kottmann</name>
<organization>KoSIT</organization>
<organizationUrl>http://www.xoev.de</organizationUrl>
<organizationUrl>https://xeinkauf.de</organizationUrl>
<roles>
<role>Product Owner</role>
</roles>
@ -54,24 +38,40 @@
</developers>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<version.assertj>3.23.1</version.assertj>
<version.commons-io>2.11.0</version.commons-io>
<version.commons-lang>3.12.0</version.commons-lang>
<version.jacoco>0.8.8</version.jacoco>
<version.jaxb>2.3.7</version.jaxb>
<version.lombok>1.18.24</version.lombok>
<version.mockito>4.9.0</version.mockito>
<version.owasp-dependency-check>7.2.0</version.owasp-dependency-check>
<version.rest-assured>5.2.0</version.rest-assured>
<version.saxon-he>11.4</version.saxon-he>
<version.slf4j>1.7.36</version.slf4j>
<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.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.slf4j>2.0.17</version.slf4j>
<version.jaxb-maven-plugin>4.0.11</version.jaxb-maven-plugin>
</properties>
<repositories>
<repository>
<id>project.local</id>
<name>project</name>
<url>file:${project.basedir}/libs</url>
</repository>
<repository>
<name>Central Portal Snapshots</name>
<id>central-portal-snapshots</id>
<url>https://central.sonatype.com/repository/maven-snapshots/</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
<dependencies>
@ -81,27 +81,26 @@
<version>${version.lombok}</version>
<scope>provided</scope>
</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>net.sf.saxon</groupId>
<artifactId>Saxon-HE</artifactId>
<version>${version.saxon-he}</version>
</dependency>
<dependency>
<groupId>info.picocli</groupId>
<artifactId>picocli</artifactId>
<version>4.7.0</version>
<version>4.7.7</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.fusesource.jansi</groupId>
<artifactId>jansi</artifactId>
<version>2.4.0</version>
<version>2.4.2</version>
<optional>true</optional>
</dependency>
<dependency>
@ -119,9 +118,14 @@
<dependency>
<groupId>org.glassfish.jaxb</groupId>
<artifactId>jaxb-runtime</artifactId>
<version>${version.jaxb}</version>
<version>${version.jaxb-impl}</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>
@ -131,7 +135,7 @@
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13.1</version>
<version>4.13.2</version>
<scope>test</scope>
</dependency>
<dependency>
@ -142,7 +146,7 @@
<dependency>
<groupId>io.rest-assured</groupId>
<artifactId>rest-assured</artifactId>
<version>5.3.0</version>
<version>${version.rest-assured}</version>
<scope>test</scope>
</dependency>
<dependency>
@ -157,7 +161,6 @@
<version>1.0.2</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
@ -172,11 +175,68 @@
</resource>
</resources>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.sonatype.central</groupId>
<artifactId>central-publishing-maven-plugin</artifactId>
<version>0.10.0</version>
<extensions>true</extensions>
<configuration>
<publishingServerId>central</publishingServerId>
<autoPublish>true</autoPublish>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>3.2.8</version>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<!-- for PR 152 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>3.3.1</version>
<configuration>
<propertiesEncoding>ISO-8859-1</propertiesEncoding>
</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>
<version>3.3.0</version>
<version>3.6.1</version>
<executions>
<execution>
<id>reserve-network-port</id>
@ -196,7 +256,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>3.1.0</version>
<version>3.6.1</version>
<executions>
<execution>
<id>enforce-versions</id>
@ -206,8 +266,19 @@
<configuration>
<rules>
<requireMavenVersion>
<version>[3.3.9,)</version>
<!-- minimum for OWASP check-->
<version>[3.6.3,)</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>
@ -216,78 +287,69 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.10.1</version>
<version>3.14.0</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<release>11</release>
<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.4.1</version>
<version>3.6.1</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>
</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>
<!--
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>
</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>
@ -300,7 +362,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>3.4.2</version>
<version>3.7.1</version>
<executions>
<execution>
<id>full_dist</id>
@ -323,9 +385,9 @@
<!-- Generate model classes -->
<plugin>
<groupId>org.jvnet.jaxb2.maven2</groupId>
<artifactId>maven-jaxb2-plugin</artifactId>
<version>0.15.1</version>
<groupId>org.jvnet.jaxb</groupId>
<artifactId>jaxb-maven-plugin</artifactId>
<version>${version.jaxb-maven-plugin}</version>
<executions>
<execution>
<goals>
@ -343,20 +405,12 @@
</args>
<plugins>
<plugin>
<groupId>org.jvnet.jaxb2_commons</groupId>
<artifactId>jaxb2-basics</artifactId>
<version>0.11.1</version>
<groupId>org.jvnet.jaxb</groupId>
<artifactId>jaxb-plugins</artifactId>
<version>${version.jaxb-maven-plugin}</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 -->
@ -400,11 +454,11 @@
<goal>dump</goal>
</goals>
<configuration>
<address>localhost</address>
<port>${jacoco.tcp.port}</port>
<append>true</append>
</configuration>
<configuration>
<address>localhost</address>
<port>${jacoco.tcp.port}</port>
<append>true</append>
</configuration>
</execution>
<execution>
<id>generateJacocoReport</id>
@ -418,17 +472,23 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M7</version>
<version>3.5.3</version>
<configuration>
<!--suppress MavenModelInspection -->
<argLine>-Dfile.encoding=UTF-8 ${jacocoSurefire}</argLine>
<systemProperties>
<property>
<name>java.net.useSystemProxies</name>
<value>true</value>
</property>
</systemProperties>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.2.1</version>
<version>3.3.1</version>
<executions>
<execution>
<id>attach-sources</id>
@ -442,7 +502,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>2.5.3</version>
<version>3.1.1</version>
<configuration>
<tagNameFormat>v@{project.version}</tagNameFormat>
</configuration>
@ -451,21 +511,26 @@
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>3.1.0</version>
<version>3.6.2</version>
<executions>
<execution>
<execution>
<id>run</id>
<phase>pre-integration-test</phase>
<goals>
<phase>pre-integration-test</phase>
<goals>
<goal>exec</goal>
</goals>
</goals>
</execution>
</executions>
<configuration>
<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>
@ -493,7 +558,7 @@
<target>
<!-- schlafen um den Start des Daemon abzuwarten -->
<sleep seconds="10" />
<echo>${jacoco.tcp.port}</echo>
<echo>jacoco.tcp.port=${jacoco.tcp.port}</echo>
</target>
</configuration>
<executions>
@ -509,7 +574,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>3.0.0-M7</version>
<version>3.5.3</version>
<executions>
<execution>
<id>test-it</id>
@ -518,8 +583,8 @@
<goal>verify</goal>
</goals>
<configuration>
<!--suppress MavenModelInspection -->
<argLine>-Dfile.encoding=UTF-8 -Ddaemon.port=${validator.server.port}</argLine>
<!--suppress MavenModelInspection -->
<argLine>-Dfile.encoding=UTF-8 -Ddaemon.port=${validator.server.port}</argLine>
</configuration>
</execution>
@ -528,9 +593,9 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.4.1</version>
<version>3.11.2</version>
<configuration>
<source>8</source>
<source>11</source>
<doclint>none</doclint>
</configuration>
<executions>
@ -577,8 +642,8 @@
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.6</version>
<executions>
<execution>
<id>sign-artifacts</id>
@ -589,6 +654,10 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.sonatype.central</groupId>
<artifactId>central-publishing-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</profile>
@ -601,11 +670,16 @@
<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>
@ -623,13 +697,15 @@
</profile>
<profile>
<id>format</id>
<activation><activeByDefault>false</activeByDefault></activation>
<activation>
<activeByDefault>false</activeByDefault>
</activation>
<build>
<plugins>
<plugin>
<groupId>net.revelc.code.formatter</groupId>
<artifactId>formatter-maven-plugin</artifactId>
<version>2.12.2</version>
<version>2.13.0</version>
<executions>
<execution>
<id>maven-formatting</id>
@ -646,6 +722,17 @@
</plugins>
</build>
</profile>
<profile>
<id>release-snapshot</id>
<build>
<plugins>
<plugin>
<groupId>org.sonatype.central</groupId>
<artifactId>central-publishing-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<reporting>
@ -655,12 +742,14 @@
</reporting>
<scm>
<connection>https://github.com/itplr-kosit/validationtool.git</connection>
<connection>scm:git:https://github.com/itplr-kosit/validator.git</connection>
<developerConnection>scm:git:https://projekte.kosit.org/kosit/validator.git</developerConnection>
<tag>v1.1.0</tag>
<tag>release/1.6.x</tag>
<url>https://github.com/itplr-kosit/validator</url>
</scm>
<url>https://github.com/itplr-kosit/validator</url>
<licenses>
<license>
<name>Apache License, Version 2.0</name>
@ -668,12 +757,4 @@
<distribution>repo</distribution>
</license>
</licenses>
<distributionManagement>
<repository>
<id>sonatype-nexus-staging</id>
<name>Nexus Release Repository</name>
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2</url>
</repository>
</distributionManagement>
</project>

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 2](https://docusaurus.io/), a modern static
This ui is built using [Docusaurus 3](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
```
$ npm build
```shell
$ npm run 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,30 +2,79 @@
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.0.0/)
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.5.0
## 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
### 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](https://github.com/itplr-kosit/validator/blob/master/docs/cli.md) for details
- (CLI) Support for multiple configurations and multiple repositories. See [cli documentation](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()](https://github.com/itplr-kosit/validator/blob/master/src/main/java/de/kosit/validationtool/api/ResolvingConfigurationStrategy)
is removed.
- (API) [ResolvingConfigurationStrategy.java#getProcessor()](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
@ -36,14 +85,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
@ -71,14 +120,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](https://github.com/itplr-kosit/validator/blob/master/docs/daemon.md#status-codes))
- [DAEMON] proper status codes when returning results (see [daemon documentation](./docs/daemon.md#status-codes))
## 1.3.1
### Fixed
- `getFailedAsserts()` and `isSchematronValid()`
in [DefaultResult.java](https://github.com/itplr-kosit/validator/blob/master/src/main/java/de/kosit/validationtool/impl/DefaultResult.java)
in [DefaultResult.java](https://github.com/itplr-kosit/validator/blob/main/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.
@ -126,20 +175,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/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*
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_
### 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,15 +6,19 @@ sidebar_position: 1
The validator needs a scenario configuration for working properly.
Currently, there are two public third party validation configurations available.
Here are some public validation configurations:
* Validation Configuration for [XRechnung](http://www.xoev.de/de/xrechnung):
* Validation Configuration for [XRechnung](https://xeinkauf.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/master/docs/configurations.md)
see [configuration documentation](https://github.com/itplr-kosit/validator/blob/main/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: "throw",
onBrokenLinks: "log",
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://www.xoev.de",
href: "https://xeinkauf.de",
},
{
label: "XRechnung",
href: "https://www.xoev.de/xrechnung-16828",
href: "https://xeinkauf.de/xrechnung/",
},
],
},

30173
server/ui/package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -20,34 +20,33 @@
"lint:fix": "npm run format && eslint . --fix"
},
"dependencies": {
"@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",
"@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",
"js-file-download": "^0.4.12",
"prism-react-renderer": "^1.3.5",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-dropzone": "^14.2.3"
"prism-react-renderer": "^2.4.1",
"react": "^19.1.1",
"react-dom": "^19.1.1",
"react-dropzone": "^14.3.8"
},
"devDependencies": {
"@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"
"@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"
},
"browserslist": {
"production": [
@ -63,12 +62,7 @@
]
},
"engines": {
"node": ">=16.14"
"node": ">=18.0"
},
"overrides": {
"loader-utils": "^2.0.4",
"react-dev-utils": {
"loader-utils": "^3.2.1"
}
}
"overrides": {}
}

View file

@ -1,5 +1,5 @@
import clsx from "clsx";
import type { ButtonHTMLAttributes, DetailedHTMLProps, ReactNode } from "react";
import type { ButtonHTMLAttributes, DetailedHTMLProps, JSX, 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, { useEffect, useState } from "react";
import React, { JSX, useEffect, useState } from "react";
import type { PrismTheme, Language } from "prism-react-renderer";
import Highlight, { defaultProps } from "prism-react-renderer";
import { Highlight, themes } from "prism-react-renderer";
import useDocusaurusContext from "@docusaurus/useDocusaurusContext";
import clsx from "clsx";
import downloadFile from "js-file-download";
@ -63,7 +63,6 @@ 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 from "react";
import React, { JSX } 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 { ReactNode } from "react";
import type { JSX, 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 from "react";
import React, { JSX } from "react";
import PageLayout from "@site/src/components/PageLayout";
import XmlView from "@site/src/components/XmlView";

View file

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

View file

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

View file

@ -1,22 +1,5 @@
<!--
~ 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.
-->
<assembly xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://maven.apache.org/ASSEMBLY/2.0.0"
xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.0.0 http://maven.apache.org/xsd/assembly-2.0.0.xsd">
xmlns="http://maven.apache.org/ASSEMBLY/2.0.0" xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.0.0 http://maven.apache.org/xsd/assembly-2.0.0.xsd">
<id>full</id>
<formats>
<format>zip</format>
@ -35,8 +18,12 @@
<directory>${project.build.directory}</directory>
<outputDirectory/>
<includes>
<include>validationtool-*.jar</include>
<include>validator-*.jar</include>
</includes>
<!-- excludes always win over includes if both patterns match -->
<excludes>
<exclude>*standalone.jar</exclude>
</excludes>
</fileSet>
</fileSets>
@ -45,7 +32,6 @@
<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 algorith
* @return the name of the digest algorithm
*/
String getDigestAlgorithm();

View file

@ -22,6 +22,7 @@ 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;
/**
@ -69,23 +70,31 @@ public interface Result {
/**
* Schnellzugriff auf die Empfehlung zur Weiterverarbeitung des Dokuments.
*
* @return true wenn {@link AcceptRecommendation#ACCEPTABLE}
* @return <code>true</code> 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 Liste mit Schematron-Ergebnissen
* @return List with Schematron results
*/
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.
*
@ -96,14 +105,14 @@ public interface Result {
/**
* Liefert ein true, wenn keine Schema-Violations vorhanden sind.
*
* @return true wenn Schema-valide
* @return <code>true</code> if XML Schema compliant
*/
boolean isSchemaValid();
/**
* Liefert ein true, wenn der Prüfling eine well-formed XML-Datei ist.
*
* @return true wenn well-formed
* @return <code>true</code> if wellformed
*/
boolean isWellformed();
@ -111,7 +120,7 @@ public interface Result {
* Returns true, if schematron has been checked and the result does not contain any {@link FailedAssert
* FailedAsserts}.
*
* @return true, if valid
* @return <code>true</code>, if valid
*/
boolean isSchematronValid();
}

View file

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

View file

@ -25,7 +25,6 @@ import org.fusesource.jansi.AnsiRenderer.Code;
import de.kosit.validationtool.cmd.report.Line;
import de.kosit.validationtool.impl.Printer;
import picocli.CommandLine;
import picocli.CommandLine.ParseResult;
@ -79,11 +78,11 @@ public class CommandLineApplication {
final CommandLine commandLine = new CommandLine(new CommandLineOptions());
try {
commandLine.setExecutionExceptionHandler(CommandLineApplication::logExecutionException);
commandLine.execute(args);
if (commandLine.isUsageHelpRequested()) {
final int cmdlineRetVal = commandLine.execute(args);
if (commandLine.isUsageHelpRequested() || cmdlineRetVal == CommandLine.ExitCode.USAGE) {
resultStatus = ReturnValue.HELP_REQUEST;
} else {
resultStatus = ObjectUtils.defaultIfNull(commandLine.getExecutionResult(), ReturnValue.PARSING_ERROR);
resultStatus = ObjectUtils.getIfNull(commandLine.getExecutionResult(), ReturnValue.PARSING_ERROR);
if (resultStatus.isError()) {
commandLine.usage(System.out);
}
@ -96,6 +95,8 @@ 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,12 +20,10 @@ import java.nio.file.Path;
import java.util.List;
import java.util.concurrent.Callable;
import de.kosit.validationtool.cmd.CommandLineApplication.Level;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import de.kosit.validationtool.cmd.CommandLineApplication.Level;
import picocli.CommandLine.ArgGroup;
import picocli.CommandLine.Command;
import picocli.CommandLine.Help.Visibility;
@ -38,10 +36,12 @@ import picocli.CommandLine.Parameters;
* @author Andreas Penski
*/
@Command(description = "Structural and semantic validation of xml files", name = "KoSIT Validator", mixinStandardHelpOptions = false,
separator = " ")
separator = " ", synopsisHeading = CommandLineOptions.SYNOSIS_HEADING)
@Getter
public class CommandLineOptions implements Callable<ReturnValue> {
static final String SYNOSIS_HEADING = "Usage: ";
/**
* @author Andreas Penski
*/
@ -175,9 +175,9 @@ public class CommandLineOptions implements Callable<ReturnValue> {
private static void configureLogging(final CommandLineOptions cmd) {
if (cmd.isDebugLog()) {
System.setProperty(org.slf4j.impl.SimpleLogger.DEFAULT_LOG_LEVEL_KEY, "DEBUG");
System.setProperty(org.slf4j.simple.SimpleLogger.DEFAULT_LOG_LEVEL_KEY, "DEBUG");
} else {
System.setProperty(org.slf4j.impl.SimpleLogger.DEFAULT_LOG_LEVEL_KEY, cmd.getLogLevel().name());
System.setProperty(org.slf4j.simple.SimpleLogger.DEFAULT_LOG_LEVEL_KEY, cmd.getLogLevel().name());
}
}

View file

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

View file

@ -16,7 +16,7 @@
package de.kosit.validationtool.cmd;
import static org.apache.commons.lang3.ObjectUtils.defaultIfNull;
import static org.apache.commons.lang3.ObjectUtils.getIfNull;
import static org.apache.commons.lang3.StringUtils.EMPTY;
import static org.apache.commons.lang3.StringUtils.isNotEmpty;
@ -37,14 +37,11 @@ import java.util.stream.Stream;
import org.fusesource.jansi.AnsiRenderer.Code;
import lombok.extern.slf4j.Slf4j;
import de.kosit.validationtool.api.Configuration;
import de.kosit.validationtool.api.Input;
import de.kosit.validationtool.api.InputFactory;
import de.kosit.validationtool.api.Result;
import de.kosit.validationtool.cmd.CommandLineOptions.CliOptions;
import de.kosit.validationtool.cmd.CommandLineOptions.Definition;
import de.kosit.validationtool.cmd.CommandLineOptions.RepositoryDefinition;
import de.kosit.validationtool.cmd.CommandLineOptions.ScenarioDefinition;
import de.kosit.validationtool.cmd.assertions.Assertions;
@ -55,7 +52,7 @@ import de.kosit.validationtool.impl.EngineInformation;
import de.kosit.validationtool.impl.Printer;
import de.kosit.validationtool.impl.ScenarioRepository;
import de.kosit.validationtool.impl.xml.ProcessorProvider;
import lombok.extern.slf4j.Slf4j;
import net.sf.saxon.s9api.Processor;
/**
@ -132,7 +129,7 @@ public class Validator {
final Processor processor = ProcessorProvider.getProcessor();
final List<Configuration> config = getConfiguration(cmd);
final InternalCheck check = new InternalCheck(processor, config.toArray(new Configuration[0]));
final CommandLineOptions.CliOptions cliOptions = defaultIfNull(cmd.getCliOptions(), new CliOptions());
final CommandLineOptions.CliOptions cliOptions = getIfNull(cmd.getCliOptions(), new CliOptions());
final Path outputDirectory = determineOutputDirectory(cliOptions);
if (cliOptions.isExtractHtml()) {
check.getCheckSteps().add(new ExtractHtmlContentAction(processor, outputDirectory));
@ -180,17 +177,19 @@ public class Validator {
* @return a list of configurations of the scenarios and repositories passed in cmd
*/
private static List<Configuration> getConfiguration(final CommandLineOptions cmd) {
final List<ScenarioDefinition> scenarios = defaultIfNull(cmd.getScenarios(), Collections.emptyList());
final List<ScenarioDefinition> scenarios = getIfNull(cmd.getScenarios(), Collections.emptyList());
// Map from scenario name to scenario path
final Map<String, Path> mappedScenarios = scenarios.stream()
.collect(Collectors.toMap(ScenarioDefinition::getName, ScenarioDefinition::getPath));
final List<RepositoryDefinition> repos = defaultIfNull(cmd.getRepositories(), Collections.emptyList());
final Map<String, Path> mappedRepos = repos.stream().collect(Collectors.toMap(Definition::getName, Definition::getPath));
final List<RepositoryDefinition> repos = getIfNull(cmd.getRepositories(), Collections.emptyList());
final Map<String, Path> mappedRepos = repos.stream()
.collect(Collectors.toMap(RepositoryDefinition::getName, RepositoryDefinition::getPath));
checkUnused(mappedScenarios, mappedRepos);
return mappedScenarios.entrySet().stream().map(e -> {
assertFileExistance(e.getValue(), "scenario");
final URI scenarioLocation = e.getValue().toUri();
final URI repositoryLocation = findRepository(e.getKey(), mappedRepos);
final URI repositoryLocation = findRepository(scenarioLocation, e.getKey(), mappedRepos);
reportLoading(scenarioLocation, repositoryLocation);
final Configuration configuration = Configuration.load(scenarioLocation, repositoryLocation)
@ -208,9 +207,14 @@ public class Validator {
unused.forEach(e -> Printer.writeErr("Warning: repository definition \"{0}\" is not used", e.getKey()));
}
private static URI findRepository(final String key, final Map<String, Path> repositories) {
private static URI findRepository(final URI scenarioLocation, final String key, final Map<String, Path> repositories) {
final Path path = repositories.getOrDefault(key, repositories.get(ScenarioRepository.DEFAULT_ID));
if (path == null) {
// If it is an unnamed scenario, use the CWD instead
if (key.startsWith(ScenarioRepository.DEFAULT)) {
// Assume directory of scenario location instead
return Paths.get(scenarioLocation).getParent().toUri();
}
throw new IllegalArgumentException(String.format("No repository location for scenario definition '%s' specified", key));
}
return determineRepository(path);
@ -317,10 +321,8 @@ 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,6 +82,7 @@ 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);
@ -91,7 +92,8 @@ public class Grid {
* Constructor.
*
* @param name the name of the column
* @param minLength the max length of the column
* @param maxLength the max length of the column
* @param minLength the minimum 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) {
@ -149,10 +151,6 @@ 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();
@ -194,11 +192,6 @@ 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();
@ -321,7 +314,7 @@ public class Grid {
}
private static boolean isEmpty(final StringBuilder current) {
return current.toString().replaceAll("\\|", "").trim().length() == 0;
return current.toString().replace("|", "").trim().length() == 0;
}
private int getMaxVirtualLine() {

View file

@ -16,8 +16,6 @@
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;
@ -27,10 +25,7 @@ import java.util.stream.Collectors;
import javax.xml.validation.Schema;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.Strings;
import de.kosit.validationtool.api.Check;
import de.kosit.validationtool.api.Configuration;
@ -49,7 +44,10 @@ 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;
@ -113,8 +111,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 startsWith(frameworkVersion, SUPPORTED_MAJOR_VERSION)
&& root.getNodeName().getNamespaceURI().equals(SUPPORTED_MAJOR_VERSION_SCHEMA);
return Strings.CS.startsWith(frameworkVersion, SUPPORTED_MAJOR_VERSION)
&& root.getNodeName().getNamespace().equals(SUPPORTED_MAJOR_VERSION_SCHEMA);
}
private static Scenario createFallback(final Scenarios scenarios, final ContentRepository repository) {

View file

@ -114,7 +114,7 @@ class XPathBuilder implements Builder<XPathExecutable> {
final Iterable<String> iterable = () -> iterator;
StreamSupport.stream(iterable.spliterator(), false).filter(e -> !ArrayUtils.contains(IGNORED_PREFIXES, e))
.filter(StringUtils::isNotBlank).forEach(e -> ns.put(e, this.executable.getUnderlyingExpression().getInternalExpression()
.getRetainedStaticContext().getURIForPrefix(e, false)));
.getRetainedStaticContext().getURIForPrefix(e, false).toString()));
getNamespaces().putAll(ns);
}

View file

@ -44,18 +44,18 @@ abstract class BaseHandler implements HttpHandler {
throws IOException {
exchange.getResponseHeaders().add("Content-Type", contentType);
exchange.sendResponseHeaders(statusCode, 0);
final OutputStream os = exchange.getResponseBody();
write.write(os);
os.close();
try ( final OutputStream os = exchange.getResponseBody() ) {
write.write(os);
}
}
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);
final OutputStream os = exchange.getResponseBody();
os.write(bytes);
os.close();
try ( final OutputStream os = exchange.getResponseBody() ) {
os.write(bytes);
}
}
@FunctionalInterface

View file

@ -17,11 +17,9 @@
package de.kosit.validationtool.impl;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
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;
@ -30,11 +28,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;
@ -49,9 +47,9 @@ public class CollectingErrorEventHandler implements ValidationEventHandler, Erro
private static final int DEFAULT_ABORT_COUNT = 50;
private static final int stopProcessCount = DEFAULT_ABORT_COUNT;
private final int stopProcessCount = DEFAULT_ABORT_COUNT;
private final Collection<XMLSyntaxError> errors = new ArrayList<>();
private final List<XMLSyntaxError> errors = new ArrayList<>();
private static XMLSyntaxError createError(final XMLSyntaxErrorSeverity severity, final String message) {
final XMLSyntaxError e = new XMLSyntaxError();

View file

@ -37,10 +37,6 @@ 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;
@ -49,7 +45,9 @@ 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,14 +24,6 @@ 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;
@ -44,6 +36,14 @@ 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,6 +219,7 @@ 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,19 +20,21 @@ import static de.kosit.validationtool.impl.DateFactory.createTimestamp;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.stream.Collectors;
import lombok.Getter;
import lombok.extern.slf4j.Slf4j;
import org.oclc.purl.dsdl.svrl.FailedAssert;
import org.oclc.purl.dsdl.svrl.SchematronOutput;
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;
@ -47,7 +49,10 @@ 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;
/**
@ -141,10 +146,31 @@ 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 static List<XmlError> convertErrors(final Collection<XMLSyntaxError> errors) {
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) {
// noinspection unchecked
return (List<XmlError>) (List<?>) errors;
}

View file

@ -25,15 +25,14 @@ import org.oclc.purl.dsdl.svrl.SchematronOutput;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
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.impl.model.CustomFailedAssert;
import de.kosit.validationtool.model.reportInput.CreateReportInput;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.Setter;
import net.sf.saxon.dom.NodeOverNodeInfo;
import net.sf.saxon.s9api.XdmNode;
@ -67,6 +66,11 @@ 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;
@ -149,19 +153,28 @@ public class DefaultResult implements Result {
}
private <T> List<T> filterSchematronResult(final Class<T> type) {
return getSchematronResult() != null
? getSchematronResult().stream().flatMap(e -> e.getActivePatternAndFiredRuleAndFailedAssert().stream())
return this.schematronResult != null
? this.schematronResult.stream().flatMap(e -> e.getActivePatternAndFiredRuleAndFailedAssert().stream())
.filter(type::isInstance).map(type::cast).collect(Collectors.toList())
: Collections.emptyList();
}
private boolean isSchematronEvaluated() {
return getSchematronResult() != null
&& getSchematronResult().stream().noneMatch(e -> e.getActivePatternAndFiredRuleAndFailedAssert().isEmpty());
return this.schematronResult != null
&& this.schematronResult.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

@ -38,7 +38,11 @@ public class Printer {
* @param params the params.
*/
public static void writeOut(final String message, final Object... params) {
System.out.println(new MessageFormat(message, Locale.ENGLISH).format(params));
try {
System.out.println(new MessageFormat(message, Locale.ENGLISH).format(params));
} catch (final RuntimeException ex) {
System.err.println("[Format error!] <" + message + "> with params <" + params + ">");
}
}
/**
@ -48,7 +52,11 @@ public class Printer {
* @param params the params.
*/
public static void writeErr(final String message, final Object... params) {
System.err.println(new MessageFormat(message, Locale.ENGLISH).format(params));
try {
System.err.println(new MessageFormat(message, Locale.ENGLISH).format(params));
} catch (final RuntimeException ex) {
System.err.println("[Format error!] <" + message + "> with params <" + params + ">");
}
}
/**

View file

@ -16,22 +16,20 @@
package de.kosit.validationtool.impl;
import java.util.Collections;
import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
import javax.xml.transform.URIResolver;
import javax.xml.validation.Schema;
import de.kosit.validationtool.api.ResolvingConfigurationStrategy;
import de.kosit.validationtool.model.scenarios.ResourceType;
import de.kosit.validationtool.model.scenarios.ScenarioType;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import lombok.Setter;
import de.kosit.validationtool.api.ResolvingConfigurationStrategy;
import de.kosit.validationtool.model.scenarios.ResourceType;
import de.kosit.validationtool.model.scenarios.ScenarioType;
import net.sf.saxon.lib.UnparsedTextURIResolver;
import net.sf.saxon.s9api.XPathExecutable;
import net.sf.saxon.s9api.XPathSelector;
@ -80,7 +78,11 @@ public class Scenario {
private Transformation reportTransformation;
public List<Transformation> getSchematronValidations() {
return this.schematronValidations == null ? Collections.emptyList() : this.schematronValidations;
// Must return a mutable list
if (this.schematronValidations == null) {
this.schematronValidations = new ArrayList<>();
}
return this.schematronValidations;
}
public String getName() {
@ -95,9 +97,9 @@ public class Scenario {
}
/**
* Liefert einen neuen XPath-Selector zur Evaluierung der {@link de.kosit.validationtool.api.AcceptRecommendation}.
* Returns a new XPath selector for evaluating the {@link de.kosit.validationtool.api.AcceptRecommendation}.
*
* @return neuer Selector
* @return new selector
*/
public Optional<XPathSelector> getAcceptSelector() {
final XPathSelector selector = this.acceptExecutable != null ? this.acceptExecutable.load() : null;

View file

@ -17,15 +17,12 @@
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;
@ -67,17 +64,14 @@ public class ScenarioRepository {
private String summarizeScenarios() {
final StringBuilder b = new StringBuilder();
getScenarios().forEach(s -> {
b.append(s.getName());
b.append("\n");
});
getScenarios().forEach(s -> b.append(s.getName()).append('\n'));
return b.toString();
}
/**
* Ermittelt für das gegebene Dokument das passende Szenario.
* Determine the matching Scenario for the provided input document
*
* @param document das Eingabedokument
* @param document input document
* @return ein Ergebnis-Objekt zur weiteren Verarbeitung
*/
public Result<Scenario, String> selectScenario(final XdmNode document) {
@ -86,10 +80,9 @@ public class ScenarioRepository {
if (collect.size() == 1) {
result = new Result<>(collect.get(0));
} else if (collect.isEmpty()) {
result = new Result<>(getFallbackScenario(),
Collections.singleton("None of the loaded scenarios matches the specified document"));
result = new Result<>(getFallbackScenario(), Arrays.asList("None of the loaded scenarios matches the specified document"));
} else {
result = new Result<>(getFallbackScenario(), Collections.singleton("More than on scenario matches the specified document"));
result = new Result<>(getFallbackScenario(), Arrays.asList("More than one 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 javax.xml.bind.util.JAXBSource}</li>
* <li>{@link jakarta.xml.bind.util.JAXBSource}</li>
* <li>{@link TreeInfo}</li>
* </ul>
*
@ -102,7 +102,7 @@ public class SourceInput extends AbstractInput {
return isStreamSource();
}
private boolean isConsumed() throws IOException {
private boolean isConsumed() {
if (isStreamSource()) {
final StreamSource ss = (StreamSource) this.source;
@ -140,7 +140,13 @@ public class SourceInput extends AbstractInput {
if (ss.getInputStream() != null) {
result = new StreamSource(wrap(ss.getInputStream()), this.source.getSystemId());
} else if (ss.getReader() != null) {
result = new StreamSource(wrap(new ReaderInputStream(ss.getReader(), Charset.defaultCharset())), this.source.getSystemId());
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);
}
}
}
return result;

View file

@ -20,13 +20,14 @@ 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.CountingInputStream;
import org.apache.commons.io.input.BoundedInputStream;
import de.kosit.validationtool.api.Input;
@ -39,7 +40,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 aditional reading step.
* generating the hashcode without an additional reading step.
*/
@SuppressWarnings("squid:S4929") // efficient read is done by internally used stream
private static class DigestingInputStream extends FilterInputStream {
@ -96,15 +97,15 @@ public class StreamHelper {
private final LazyReadInput reference;
public CountInputStream(final LazyReadInput input, final InputStream stream) {
super(new org.apache.commons.io.input.CountingInputStream(stream));
public CountInputStream(final LazyReadInput input, final InputStream stream) throws IOException {
super(BoundedInputStream.builder().setInputStream(stream).get());
this.reference = input;
}
@Override
public void close() throws IOException {
super.close();
this.reference.setLength(((CountingInputStream) this.in).getByteCount());
this.reference.setLength(((BoundedInputStream) this.in).getCount());
}
}
@ -130,19 +131,24 @@ public class StreamHelper {
/**
* Wraps the {@link InputStream} with a counting length implementation.
*
* @param input the {@link LazyReadInput input}
* @param input the lazy read input
* @param stream the stream
* @return a wrapped stream
*/
public static InputStream wrapCount(final LazyReadInput input, final InputStream stream) {
return new CountInputStream(input, 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 {@link LazyReadInput input}
* @param input the lazy read 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) {
@ -175,7 +181,7 @@ public class StreamHelper {
* @param input the input
* @throws IOException on I/O errors
*/
@SuppressWarnings("squid:S1854")
@SuppressWarnings({ "squid:S1854", "unused" })
public static void drain(final InputStream input) throws IOException {
final byte[] buffer = new byte[DEFAULT_BUFFER_SIZE];

View file

@ -0,0 +1,41 @@
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 Collection<E> errors = new ArrayList<>();
private List<E> errors = new ArrayList<>();
/**
* Erzeugt ein neues Ergebnis mit Fehler
*
* @param errors die Fehler
*/
public Result(Collection<E> errors) {
public Result(final List<E> errors) {
this(null, errors);
}
@ -53,7 +53,7 @@ public class Result<T, E> {
*
* @param o
*/
public Result(T o) {
public Result(final T o) {
this(o, Collections.emptyList());
}

View file

@ -21,10 +21,6 @@ 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;
@ -32,7 +28,9 @@ 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;
/**
@ -55,9 +53,9 @@ public interface CheckAction {
private Result<Scenario, String> scenarioSelectionResult;
@Setter(AccessLevel.NONE)
private CreateReportInput reportInput;
private final CreateReportInput reportInput;
/** Das finale Ergebnis */
/** The final result */
private XdmNode report;
private boolean finished;
@ -66,7 +64,7 @@ public interface CheckAction {
private AcceptRecommendation acceptStatus = AcceptRecommendation.UNDEFINED;
/** Das zu prüfende Dokument */
/** The document to validate */
private Input input;
private Result<XdmNode, XMLSyntaxError> parserResult;
@ -85,7 +83,9 @@ public interface CheckAction {
}
/**
* Signalisiert einen vorzeitigen Stop der Vearbeitung.
* Indicates an early stop in processing.
*
* @param error Error text
*/
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 javax.xml.bind.JAXBException;
import javax.xml.bind.Marshaller;
import javax.xml.bind.util.JAXBSource;
import jakarta.xml.bind.JAXBException;
import jakarta.xml.bind.Marshaller;
import jakarta.xml.bind.util.JAXBSource;
import org.xml.sax.ContentHandler;
import org.xml.sax.DTDHandler;

View file

@ -17,19 +17,18 @@
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;
@ -75,7 +74,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<>(Collections.singleton(error));
result = new Result<>(Arrays.asList(error));
}
return result;

View file

@ -31,12 +31,6 @@ 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;
@ -45,7 +39,11 @@ 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;
@ -216,7 +214,7 @@ public class SchemaValidationAction implements CheckAction {
}
}
private interface SerializedDocument extends AutoCloseable, SourceProvider {
private interface SerializedDocument extends SourceProvider {
void serialize(XdmNode node) throws SaxonApiException, IOException;

View file

@ -23,9 +23,6 @@ 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;
@ -33,7 +30,8 @@ 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;
@ -71,6 +69,11 @@ 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.StringUtils;
import org.apache.commons.lang3.Strings;
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 (!StringUtils.startsWith(basePath, "/")) {
if (!Strings.CS.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,7 +26,6 @@ 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;
@ -54,10 +53,9 @@ 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));
}
/**
@ -96,10 +94,9 @@ 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));
}
throw new XPathException(String.format("The resolved transformation artifact %s is not within the configured repository %s",
absoluteURI, this.baseUri));
}
}

View file

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

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!--
~ Copyright 2017-2022 Koordinierungsstelle für IT-Standards (KoSIT)
~ 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.
@ -16,22 +16,21 @@
-->
<jaxb:bindings
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc"
xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
xmlns:inheritance="http://jaxb2-commons.dev.java.net/basic/inheritance"
jaxb:extensionBindingPrefixes="inheritance"
version="2.1">
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"
jaxb:extensionBindingPrefixes="inheritance"
version="3.0">
<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" />
name="java.lang.String"
xmlType="xs:string"
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"/>
@ -40,24 +39,28 @@
<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,21 +1,4 @@
<?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">
@ -73,12 +56,18 @@
<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="xs:string" />
<xs:element name="match" type="s:NonEmptyString" />
<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"/>
@ -138,3 +127,18 @@
</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

@ -0,0 +1,176 @@
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-2022 Koordinierungsstelle für IT-Standards (KoSIT)
# 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.

View file

@ -1,5 +1,5 @@
#
# Copyright 2017-2022 Koordinierungsstelle für IT-Standards (KoSIT)
# 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.
@ -32,21 +32,3 @@ 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,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright 2017-2022 Koordinierungsstelle für IT-Standards (KoSIT)
~ 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.
@ -13,7 +14,6 @@
~ 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,5 +24,4 @@
<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

@ -0,0 +1 @@
"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"}}}}')}}]);

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

@ -0,0 +1 @@
"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

@ -1 +0,0 @@
"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

@ -0,0 +1 @@
"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

@ -1 +0,0 @@
"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

@ -0,0 +1 @@
"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

@ -0,0 +1 @@
"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

@ -1 +0,0 @@
"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

@ -0,0 +1 @@
"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

@ -1 +0,0 @@
"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

@ -0,0 +1 @@
"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

@ -1 +0,0 @@
"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"}))}}}]);

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