mirror of
https://github.com/itplr-kosit/validator.git
synced 2026-05-25 16:55:39 +00:00
Compare commits
25 commits
9f25e20108
...
86d9ddfa2b
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
86d9ddfa2b | ||
|
|
955d608f56 | ||
|
|
1572ea34e9 | ||
|
|
e7a64227a2 | ||
|
|
a52bab4c69 | ||
|
|
20c2ce71c1 | ||
|
|
752ceb228d | ||
|
|
c5c40c2009 | ||
|
|
57ae444857 | ||
|
|
1f5d79c027 | ||
|
|
1fe8159c2b | ||
|
|
2a3a099058 | ||
|
|
44c455ba86 | ||
|
|
82fdcabe3d | ||
|
|
03e5be34b8 | ||
|
|
3b4765e9c1 | ||
|
|
06f6a77648 | ||
|
|
cd1494747a | ||
|
|
a3fd64c946 | ||
|
|
7bd423c458 | ||
|
|
155d3dc692 | ||
|
|
e2c3f5eea3 | ||
|
|
53f16f5199 | ||
|
|
f43f0d32ac | ||
|
|
c29dd78b48 |
22 changed files with 786 additions and 110 deletions
7
.gitignore
vendored
7
.gitignore
vendored
|
|
@ -36,6 +36,7 @@ src/generated
|
||||||
.factorypath
|
.factorypath
|
||||||
.idea/
|
.idea/
|
||||||
.settings/
|
.settings/
|
||||||
|
.externalToolBuilders/
|
||||||
.vscode
|
.vscode
|
||||||
*.code-workspace
|
*.code-workspace
|
||||||
*.xpr
|
*.xpr
|
||||||
|
|
@ -46,3 +47,9 @@ xrechnung
|
||||||
.DS_Store
|
.DS_Store
|
||||||
andre*-simple.xml
|
andre*-simple.xml
|
||||||
somePrefix*.xml
|
somePrefix*.xml
|
||||||
|
zz
|
||||||
|
|
||||||
|
# 2.0 stuff
|
||||||
|
api/
|
||||||
|
cli/
|
||||||
|
core/
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
image: maven:latest
|
image: maven:latest
|
||||||
|
|
||||||
variables:
|
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"
|
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_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: " --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"
|
MAVEN_CLI_OPTS_CENTRAL: " --batch-mode --show-version -s .mvn/settings-maven-central.xml"
|
||||||
|
|
||||||
|
|
@ -15,6 +15,7 @@ cache:
|
||||||
paths:
|
paths:
|
||||||
- .m2/repository
|
- .m2/repository
|
||||||
|
|
||||||
|
# Basic Java build steps
|
||||||
.java:
|
.java:
|
||||||
stage: build
|
stage: build
|
||||||
needs:
|
needs:
|
||||||
|
|
@ -32,11 +33,6 @@ cache:
|
||||||
- target/surefire-reports/*.xml
|
- target/surefire-reports/*.xml
|
||||||
- target/failsafe-reports/*.xml
|
- target/failsafe-reports/*.xml
|
||||||
|
|
||||||
.java_extended:
|
|
||||||
extends: .java
|
|
||||||
rules:
|
|
||||||
- if: $CI_PIPELINE_SOURCE == "schedule"
|
|
||||||
|
|
||||||
java-11:
|
java-11:
|
||||||
extends: .java
|
extends: .java
|
||||||
image: maven:3-eclipse-temurin-11-alpine
|
image: maven:3-eclipse-temurin-11-alpine
|
||||||
|
|
@ -54,10 +50,6 @@ java-11:
|
||||||
- target/surefire-reports/*.xml
|
- target/surefire-reports/*.xml
|
||||||
- target/failsafe-reports/*.xml
|
- target/failsafe-reports/*.xml
|
||||||
|
|
||||||
java-11-openj9:
|
|
||||||
extends: .java_extended
|
|
||||||
image: maven:3-jdk-11-openj9
|
|
||||||
|
|
||||||
java-17:
|
java-17:
|
||||||
extends: .java
|
extends: .java
|
||||||
image: maven:3-eclipse-temurin-17-alpine
|
image: maven:3-eclipse-temurin-17-alpine
|
||||||
|
|
@ -66,14 +58,29 @@ java-21:
|
||||||
extends: .java
|
extends: .java
|
||||||
image: maven:3-eclipse-temurin-21-alpine
|
image: maven:3-eclipse-temurin-21-alpine
|
||||||
|
|
||||||
java-24:
|
|
||||||
extends: .java_extended
|
|
||||||
image: maven:3-eclipse-temurin-24-alpine
|
|
||||||
|
|
||||||
java-25:
|
java-25:
|
||||||
extends: .java
|
extends: .java
|
||||||
image: maven:3-eclipse-temurin-25-alpine
|
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:
|
deploy:
|
||||||
stage: deploy
|
stage: deploy
|
||||||
image: maven:3-eclipse-temurin-11-alpine
|
image: maven:3-eclipse-temurin-11-alpine
|
||||||
|
|
@ -81,18 +88,14 @@ deploy:
|
||||||
- job: java-11
|
- job: java-11
|
||||||
script:
|
script:
|
||||||
- export PROJECT_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
|
- export PROJECT_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
|
||||||
- mvn $MAVEN_CLI_OPTS deploy:deploy-file -Dfile=target/validator-${PROJECT_VERSION}.zip -DgroupId=kosit -DartifactId=validator -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/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}.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 -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/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 -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/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 -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}-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
|
when: manual
|
||||||
|
|
||||||
deploy-snapshot:
|
# Build Docker images and upload to KoSIT registry
|
||||||
extends: java-11
|
|
||||||
script:
|
|
||||||
- mvn $MAVEN_CLI_OPTS_CENTRAL -P release-snapshot deploy
|
|
||||||
|
|
||||||
create-build-image:
|
create-build-image:
|
||||||
stage: deploy
|
stage: deploy
|
||||||
image: docker:latest
|
image: docker:latest
|
||||||
|
|
@ -108,12 +111,22 @@ create-build-image:
|
||||||
changes:
|
changes:
|
||||||
- .mvn/createBuildImages.sh
|
- .mvn/createBuildImages.sh
|
||||||
|
|
||||||
|
# Run OWASP checks - expensive so only on main branch
|
||||||
owasp-check:
|
owasp-check:
|
||||||
extends: .java
|
stage: test
|
||||||
image: maven:3-eclipse-temurin-21-alpine
|
image: maven:3-eclipse-temurin-21-alpine
|
||||||
needs: [ ]
|
needs: [ ]
|
||||||
|
# set job timeout to 1 hour - it's required when new rules are downloaded
|
||||||
|
timeout: 1h
|
||||||
|
variables:
|
||||||
|
RUNNER_SCRIPT_TIMEOUT: 1h
|
||||||
script:
|
script:
|
||||||
- mvn $MAVEN_CLI_OPTS $BUILD_PROPS $CI_JOB_TIMESTAMP validate -Powasp-check
|
- mvn $MAVEN_CLI_OPTS $BUILD_PROPS $CI_JOB_TIMESTAMP validate -Powasp-check
|
||||||
|
artifacts:
|
||||||
|
name: artifacts
|
||||||
|
reports:
|
||||||
|
codequality:
|
||||||
|
- target/dependency-check-report.html
|
||||||
rules:
|
rules:
|
||||||
- if: $CI_PIPELINE_SOURCE == "schedule"
|
- if: $CI_PIPELINE_SOURCE == "schedule"
|
||||||
- if: $CI_COMMIT_REF_NAME == "main"
|
- if: $CI_COMMIT_REF_NAME == "main"
|
||||||
|
|
|
||||||
15
CHANGELOG.md
15
CHANGELOG.md
|
|
@ -6,8 +6,21 @@ 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).
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||||
|
|
||||||
|
|
||||||
## Unreleased
|
## 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
|
## 1.6.0 - 2025-11-07
|
||||||
|
|
||||||
|
|
|
||||||
26
NOTICE
26
NOTICE
|
|
@ -1,5 +1,29 @@
|
||||||
KoSIT XML Validator
|
KoSIT XML Validator
|
||||||
Copyright 2017-2025 Koordinierungsstelle für IT-Standards (KoSIT)
|
Copyright 2017-2026 Koordinierungsstelle für IT-Standards (KoSIT)
|
||||||
|
|
||||||
This product includes software developed by
|
This product includes software developed by
|
||||||
Koordinierungsstelle für IT-Standards (<https://xeinkauf.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
|
||||||
|
|
|
||||||
91
pom.xml
91
pom.xml
|
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
<groupId>org.kosit</groupId>
|
<groupId>org.kosit</groupId>
|
||||||
<artifactId>validator</artifactId>
|
<artifactId>validator</artifactId>
|
||||||
<version>1.6.1-SNAPSHOT</version>
|
<version>1.6.3-SNAPSHOT</version>
|
||||||
|
|
||||||
<description>KoSIT XML Validator against XSD and Schematron based on defined scenarios.</description>
|
<description>KoSIT XML Validator against XSD and Schematron based on defined scenarios.</description>
|
||||||
<developers>
|
<developers>
|
||||||
|
|
@ -38,17 +38,18 @@
|
||||||
</developers>
|
</developers>
|
||||||
<properties>
|
<properties>
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
<version.assertj>3.27.3</version.assertj>
|
<version.assertj>3.27.7</version.assertj>
|
||||||
<version.commons-io>2.20.0</version.commons-io>
|
<version.commons-io>2.21.0</version.commons-io>
|
||||||
<version.commons-lang>3.18.0</version.commons-lang>
|
<version.commons-lang>3.20.0</version.commons-lang>
|
||||||
<version.jacoco>0.8.13</version.jacoco>
|
<version.jacoco>0.8.13</version.jacoco>
|
||||||
<version.jaxb-api>4.0.2</version.jaxb-api>
|
<version.jaxb-api>4.0.4</version.jaxb-api>
|
||||||
<version.jaxb-impl>4.0.5</version.jaxb-impl>
|
<version.jaxb-impl>4.0.6</version.jaxb-impl>
|
||||||
<version.lombok>1.18.42</version.lombok>
|
<version.lombok>1.18.42</version.lombok>
|
||||||
<version.mockito>4.11.0</version.mockito>
|
<version.mockito>5.21.0</version.mockito>
|
||||||
<version.owasp-dependency-check>12.1.8</version.owasp-dependency-check>
|
<version.owasp-dependency-check>12.1.8</version.owasp-dependency-check>
|
||||||
<version.rest-assured>5.5.5</version.rest-assured>
|
<!-- 6.0.0 requires Java 17+ -->
|
||||||
<version.saxon-he>12.8</version.saxon-he>
|
<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.slf4j>2.0.17</version.slf4j>
|
||||||
<version.jaxb-maven-plugin>4.0.11</version.jaxb-maven-plugin>
|
<version.jaxb-maven-plugin>4.0.11</version.jaxb-maven-plugin>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
@ -80,17 +81,16 @@
|
||||||
<version>${version.lombok}</version>
|
<version>${version.lombok}</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<groupId>net.sf.saxon</groupId>
|
|
||||||
<artifactId>Saxon-HE</artifactId>
|
|
||||||
<version>${version.saxon-he}</version>
|
|
||||||
<scope>compile</scope>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.slf4j</groupId>
|
<groupId>org.slf4j</groupId>
|
||||||
<artifactId>slf4j-api</artifactId>
|
<artifactId>slf4j-api</artifactId>
|
||||||
<version>${version.slf4j}</version>
|
<version>${version.slf4j}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>net.sf.saxon</groupId>
|
||||||
|
<artifactId>Saxon-HE</artifactId>
|
||||||
|
<version>${version.saxon-he}</version>
|
||||||
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>info.picocli</groupId>
|
<groupId>info.picocli</groupId>
|
||||||
<artifactId>picocli</artifactId>
|
<artifactId>picocli</artifactId>
|
||||||
|
|
@ -180,7 +180,7 @@
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.sonatype.central</groupId>
|
<groupId>org.sonatype.central</groupId>
|
||||||
<artifactId>central-publishing-maven-plugin</artifactId>
|
<artifactId>central-publishing-maven-plugin</artifactId>
|
||||||
<version>0.8.0</version>
|
<version>0.10.0</version>
|
||||||
<extensions>true</extensions>
|
<extensions>true</extensions>
|
||||||
<configuration>
|
<configuration>
|
||||||
<publishingServerId>central</publishingServerId>
|
<publishingServerId>central</publishingServerId>
|
||||||
|
|
@ -206,6 +206,33 @@
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</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>
|
<plugin>
|
||||||
<groupId>org.codehaus.mojo</groupId>
|
<groupId>org.codehaus.mojo</groupId>
|
||||||
<artifactId>build-helper-maven-plugin</artifactId>
|
<artifactId>build-helper-maven-plugin</artifactId>
|
||||||
|
|
@ -275,29 +302,54 @@
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-shade-plugin</artifactId>
|
<artifactId>maven-shade-plugin</artifactId>
|
||||||
<version>3.6.0</version>
|
<version>3.6.1</version>
|
||||||
<executions>
|
<executions>
|
||||||
<execution>
|
<execution>
|
||||||
<id>jdk11+</id>
|
|
||||||
<phase>package</phase>
|
<phase>package</phase>
|
||||||
<goals>
|
<goals>
|
||||||
<goal>shade</goal>
|
<goal>shade</goal>
|
||||||
</goals>
|
</goals>
|
||||||
<configuration>
|
<configuration>
|
||||||
|
<createDependencyReducedPom>false</createDependencyReducedPom>
|
||||||
<shadedArtifactAttached>true</shadedArtifactAttached>
|
<shadedArtifactAttached>true</shadedArtifactAttached>
|
||||||
<shadedClassifierName>standalone</shadedClassifierName>
|
<shadedClassifierName>standalone</shadedClassifierName>
|
||||||
<transformers>
|
<transformers>
|
||||||
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
|
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
|
||||||
<mainClass>de.kosit.validationtool.cmd.CommandLineApplication</mainClass>
|
<mainClass>de.kosit.validationtool.cmd.CommandLineApplication</mainClass>
|
||||||
</transformer>
|
</transformer>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Some open source producers (including the Apache Software Foundation) include a copy of their
|
||||||
|
license in the META-INF directory. These are conventionally named either LICENSE,LICENSE.txt
|
||||||
|
or LICENSE.md. When merging these dependencies, adding these resources may cause confusion.
|
||||||
|
The ApacheLicenseResourceTransformer ensures that duplicate licenses (named according to this
|
||||||
|
convention) are not merged.
|
||||||
|
Technically it simply avoids adding them into the final JAR.
|
||||||
|
We don't need the detailed licensed in the shaded JAR.
|
||||||
|
-->
|
||||||
|
<transformer implementation="org.apache.maven.plugins.shade.resource.ApacheLicenseResourceTransformer" />
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Some licenses (including the Apache License, Version 2) require that notices are preserved by
|
||||||
|
downstream distributors. ApacheNoticeResourceTransformer automates the assembly of an
|
||||||
|
appropriate NOTICE.
|
||||||
|
Technically it merges all NOTICE files together
|
||||||
|
-->
|
||||||
|
<transformer implementation="org.apache.maven.plugins.shade.resource.ApacheNoticeResourceTransformer">
|
||||||
|
<addHeader>false</addHeader>
|
||||||
|
</transformer>
|
||||||
</transformers>
|
</transformers>
|
||||||
<filters>
|
<filters>
|
||||||
<filter>
|
<filter>
|
||||||
<artifact>*:*</artifact>
|
<artifact>*:*</artifact>
|
||||||
<excludes>
|
<excludes>
|
||||||
|
<!-- E.g. MANIFEST.MF -->
|
||||||
|
<exclude>META-INF/*.MF</exclude>
|
||||||
|
<!-- Required for JAR signing artefacts -->
|
||||||
<exclude>META-INF/*.SF</exclude>
|
<exclude>META-INF/*.SF</exclude>
|
||||||
<exclude>META-INF/*.DSA</exclude>
|
<exclude>META-INF/*.DSA</exclude>
|
||||||
<exclude>META-INF/*.RSA</exclude>
|
<exclude>META-INF/*.RSA</exclude>
|
||||||
|
<!-- We're breaking the Java module system -->
|
||||||
<exclude>**/module-info.class</exclude>
|
<exclude>**/module-info.class</exclude>
|
||||||
</excludes>
|
</excludes>
|
||||||
</filter>
|
</filter>
|
||||||
|
|
@ -626,7 +678,8 @@
|
||||||
<suppressionFiles>
|
<suppressionFiles>
|
||||||
<suppressionFile>${project.basedir}/owasp-suppressions.xml</suppressionFile>
|
<suppressionFile>${project.basedir}/owasp-suppressions.xml</suppressionFile>
|
||||||
</suppressionFiles>
|
</suppressionFiles>
|
||||||
|
<!-- ref to CI CD variable -->
|
||||||
|
<nvdApiKey>${NVD_API_KEY}</nvdApiKey>
|
||||||
</configuration>
|
</configuration>
|
||||||
<executions>
|
<executions>
|
||||||
<execution>
|
<execution>
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,10 @@
|
||||||
<includes>
|
<includes>
|
||||||
<include>validator-*.jar</include>
|
<include>validator-*.jar</include>
|
||||||
</includes>
|
</includes>
|
||||||
|
<!-- excludes always win over includes if both patterns match -->
|
||||||
|
<excludes>
|
||||||
|
<exclude>*standalone.jar</exclude>
|
||||||
|
</excludes>
|
||||||
</fileSet>
|
</fileSet>
|
||||||
|
|
||||||
</fileSets>
|
</fileSets>
|
||||||
|
|
@ -28,7 +32,6 @@
|
||||||
<outputDirectory>libs</outputDirectory>
|
<outputDirectory>libs</outputDirectory>
|
||||||
<useProjectArtifact>false</useProjectArtifact>
|
<useProjectArtifact>false</useProjectArtifact>
|
||||||
<scope>runtime</scope>
|
<scope>runtime</scope>
|
||||||
<outputFileNameMapping>${artifact.artifactId}-${artifact.baseVersion}.${artifact.extension}</outputFileNameMapping>
|
|
||||||
</dependencySet>
|
</dependencySet>
|
||||||
</dependencySets>
|
</dependencySets>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -47,7 +47,7 @@ public class CollectingErrorEventHandler implements ValidationEventHandler, Erro
|
||||||
|
|
||||||
private static final int DEFAULT_ABORT_COUNT = 50;
|
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 List<XMLSyntaxError> errors = new ArrayList<>();
|
private final List<XMLSyntaxError> errors = new ArrayList<>();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -23,9 +23,6 @@ import javax.xml.transform.dom.DOMSource;
|
||||||
|
|
||||||
import org.oclc.purl.dsdl.svrl.SchematronOutput;
|
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.CollectingErrorEventHandler;
|
||||||
import de.kosit.validationtool.impl.ConversionService;
|
import de.kosit.validationtool.impl.ConversionService;
|
||||||
import de.kosit.validationtool.impl.Scenario;
|
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.CreateReportInput;
|
||||||
import de.kosit.validationtool.model.reportInput.ValidationResultsSchematron;
|
import de.kosit.validationtool.model.reportInput.ValidationResultsSchematron;
|
||||||
import de.kosit.validationtool.model.reportInput.ValidationResultsSchematron.Results;
|
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.dom.NodeOverNodeInfo;
|
||||||
import net.sf.saxon.s9api.SaxonApiException;
|
import net.sf.saxon.s9api.SaxonApiException;
|
||||||
import net.sf.saxon.s9api.XdmDestination;
|
import net.sf.saxon.s9api.XdmDestination;
|
||||||
|
|
@ -71,6 +69,11 @@ public class SchematronValidationAction implements CheckAction {
|
||||||
transformer.setInitialContextNode(document);
|
transformer.setInitialContextNode(document);
|
||||||
transformer.transform();
|
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();
|
final ValidationResultsSchematron.Results r = new ValidationResultsSchematron.Results();
|
||||||
r.setSchematronOutput(this.conversionService.readDocument(
|
r.setSchematronOutput(this.conversionService.readDocument(
|
||||||
new DOMSource(NodeOverNodeInfo.wrap(result.getXdmNode().getUnderlyingNode()).getOwnerDocument()),
|
new DOMSource(NodeOverNodeInfo.wrap(result.getXdmNode().getUnderlyingNode()).getOwnerDocument()),
|
||||||
|
|
|
||||||
|
|
@ -22,18 +22,12 @@ public class StringTrimAdapter extends XmlAdapter<String, String> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String unmarshal(final String v) {
|
public String unmarshal(final String v) {
|
||||||
if (v == null) {
|
return trim(v);
|
||||||
return null;
|
|
||||||
}
|
|
||||||
return v.trim();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String marshal(final String v) {
|
public String marshal(final String v) {
|
||||||
if (v == null) {
|
return trim(v);
|
||||||
return null;
|
|
||||||
}
|
|
||||||
return v.trim();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String trim(final String v) {
|
public static String trim(final String v) {
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
<?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");
|
~ Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
~ you may not use this file except in compliance with the License.
|
~ you may not use this file except in compliance with the License.
|
||||||
|
|
@ -64,4 +64,4 @@
|
||||||
</jaxb:schemaBindings>
|
</jaxb:schemaBindings>
|
||||||
</jaxb:bindings>
|
</jaxb:bindings>
|
||||||
|
|
||||||
</jaxb:bindings>
|
</jaxb:bindings>
|
||||||
|
|
|
||||||
|
|
@ -1,21 +1,4 @@
|
||||||
<?xml version="1.0" encoding="UTF-8" ?>
|
<?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: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">
|
<xs:element name="scenarios">
|
||||||
|
|
@ -72,13 +55,19 @@
|
||||||
<xs:simpleType name="Tokens">
|
<xs:simpleType name="Tokens">
|
||||||
<xs:list itemType="xs:token" />
|
<xs:list itemType="xs:token" />
|
||||||
</xs:simpleType>
|
</xs:simpleType>
|
||||||
|
|
||||||
|
<xs:simpleType name="NonEmptyString">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:minLength value="1"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
|
||||||
<xs:complexType name="ScenarioType">
|
<xs:complexType name="ScenarioType">
|
||||||
<xs:sequence>
|
<xs:sequence>
|
||||||
<xs:element name="name" type="xs:token" />
|
<xs:element name="name" type="xs:token" />
|
||||||
<xs:element minOccurs="0" name="description" type="s:DescriptionType" />
|
<xs:element minOccurs="0" name="description" type="s:DescriptionType" />
|
||||||
<xs:element minOccurs="0" maxOccurs="unbounded" name="namespace" type="s:NamespaceType" />
|
<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="validateWithXmlSchema" type="s:ValidateWithXmlSchema" />
|
||||||
<xs:element name="validateWithSchematron" maxOccurs="unbounded" minOccurs="0" type="s:ValidateWithSchematron" />
|
<xs:element name="validateWithSchematron" maxOccurs="unbounded" minOccurs="0" type="s:ValidateWithSchematron" />
|
||||||
<xs:element name="createReport" type="s:CreateReportType" minOccurs="0"/>
|
<xs:element name="createReport" type="s:CreateReportType" minOccurs="0"/>
|
||||||
|
|
@ -138,3 +127,18 @@
|
||||||
</xs:simpleContent>
|
</xs:simpleContent>
|
||||||
</xs:complexType>
|
</xs:complexType>
|
||||||
</xs:schema>
|
</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.
|
||||||
|
-->
|
||||||
|
|
|
||||||
176
src/main/resources/LICENSE.validator
Normal file
176
src/main/resources/LICENSE.validator
Normal 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
|
||||||
|
|
@ -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");
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
# you may not use this file except in compliance with the License.
|
# you may not use this file except in compliance with the License.
|
||||||
|
|
|
||||||
|
|
@ -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");
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
# you may not use this file except in compliance with 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.
|
# Defaults to false.
|
||||||
org.slf4j.simpleLogger.showShortLogName=false
|
org.slf4j.simpleLogger.showShortLogName=false
|
||||||
org.slf4j.simpleLogger.levelInBrackets=true
|
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.
|
|
||||||
#
|
|
||||||
|
|
|
||||||
|
|
@ -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");
|
~ Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
~ you may not use this file except in compliance with 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
|
~ See the License for the specific language governing permissions and
|
||||||
~ limitations under the License.
|
~ limitations under the License.
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
|
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
|
||||||
<xsl:template match="element()">
|
<xsl:template match="element()">
|
||||||
<xsl:copy>
|
<xsl:copy>
|
||||||
|
|
@ -24,5 +24,4 @@
|
||||||
<xsl:template match="attribute()|text()|comment()|processing-instruction()">
|
<xsl:template match="attribute()|text()|comment()|processing-instruction()">
|
||||||
<xsl:copy/>
|
<xsl:copy/>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
|
</xsl:stylesheet>
|
||||||
</xsl:stylesheet>
|
|
||||||
|
|
|
||||||
|
|
@ -139,6 +139,15 @@ public class CommandlineApplicationTest {
|
||||||
assertThat(CommandLine.getErrorOutput()).contains(RESULT_OUTPUT);
|
assertThat(CommandLine.getErrorOutput()).contains(RESULT_OUTPUT);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testValidMinimalConfigurationXSLTRuntimeError() {
|
||||||
|
final String[] args = { "-s", Paths.get(Simple.SCENARIOS_XSLT_RUNTIME_ERROR).toString(), "-h", "-o",
|
||||||
|
this.output.toAbsolutePath().toString(), "--serialize-report-input",
|
||||||
|
Paths.get(Simple.SIMPLE_XSLT_RUNTIME_ERROR).toString() };
|
||||||
|
CommandLineApplication.mainProgram(args);
|
||||||
|
assertThat(CommandLine.getErrorOutput()).contains(RESULT_OUTPUT);
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testValidNamingConfiguration() {
|
public void testValidNamingConfiguration() {
|
||||||
final String[] args = { "-s", Paths.get(Simple.SCENARIOS).toString(), "-r", Paths.get(Simple.REPOSITORY_URI).toString(),
|
final String[] args = { "-s", Paths.get(Simple.SCENARIOS).toString(), "-r", Paths.get(Simple.REPOSITORY_URI).toString(),
|
||||||
|
|
@ -159,7 +168,7 @@ public class CommandlineApplicationTest {
|
||||||
@Test
|
@Test
|
||||||
public void testValidDirectoryInput() {
|
public void testValidDirectoryInput() {
|
||||||
final String[] args = { "-s", Paths.get(Simple.SCENARIOS).toString(), "-o", this.output.toString(), "-r",
|
final String[] args = { "-s", Paths.get(Simple.SCENARIOS).toString(), "-o", this.output.toString(), "-r",
|
||||||
Paths.get(Simple.REPOSITORY_URI).toString(), Paths.get(Simple.EXAMPLES).toString() };
|
Paths.get(Simple.REPOSITORY_URI).toString(), Paths.get(Simple.INPUT).toString() };
|
||||||
CommandLineApplication.mainProgram(args);
|
CommandLineApplication.mainProgram(args);
|
||||||
assertThat(CommandLine.getErrorOutput()).contains("Processing 9 object(s) completed");
|
assertThat(CommandLine.getErrorOutput()).contains("Processing 9 object(s) completed");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -49,15 +49,18 @@ public class Helper {
|
||||||
|
|
||||||
public static final URI ROOT = EXAMPLES_DIR.resolve("simple/");
|
public static final URI ROOT = EXAMPLES_DIR.resolve("simple/");
|
||||||
|
|
||||||
public static final URI EXAMPLES = ROOT.resolve("input/");
|
public static final URI INPUT = ROOT.resolve("input/");
|
||||||
|
|
||||||
public static final URI SIMPLE_VALID = ROOT.resolve("input/simple.xml");
|
public static final URI SIMPLE_VALID = ROOT.resolve("input/simple.xml");
|
||||||
|
|
||||||
|
public static final URI SIMPLE_XSLT_RUNTIME_ERROR = EXAMPLES_DIR
|
||||||
|
.resolve("invalid/xslt-runtime-error/input/simple-xslt-runtime-error.xml");
|
||||||
|
|
||||||
public static final URI FOO = ROOT.resolve("input/foo.xml");
|
public static final URI FOO = ROOT.resolve("input/foo.xml");
|
||||||
|
|
||||||
public static final URI FOO_SCHEMATRON_INVALID = EXAMPLES.resolve("foo-schematron-invalid.xml");
|
public static final URI FOO_SCHEMATRON_INVALID = INPUT.resolve("foo-schematron-invalid.xml");
|
||||||
|
|
||||||
public static final URI FOO_CUSTOM_LEVEL_ERROR = EXAMPLES.resolve("foo-custom-level-error.xml");
|
public static final URI FOO_CUSTOM_LEVEL_ERROR = INPUT.resolve("foo-custom-level-error.xml");
|
||||||
|
|
||||||
public static final URI REJECTED = ROOT.resolve("input/withManualReject.xml");
|
public static final URI REJECTED = ROOT.resolve("input/withManualReject.xml");
|
||||||
|
|
||||||
|
|
@ -65,6 +68,9 @@ public class Helper {
|
||||||
|
|
||||||
public static final URI SCENARIOS_WITH_RELATIVE_PATHS = ROOT.resolve("scenarios-with-relative-paths.xml");
|
public static final URI SCENARIOS_WITH_RELATIVE_PATHS = ROOT.resolve("scenarios-with-relative-paths.xml");
|
||||||
|
|
||||||
|
public static final URI SCENARIOS_XSLT_RUNTIME_ERROR = EXAMPLES_DIR
|
||||||
|
.resolve("invalid/xslt-runtime-error/scenarios-with-xslt-runtime-error.xml");
|
||||||
|
|
||||||
public static final URI OTHER_SCENARIOS = ROOT.resolve("otherScenarios.xml");
|
public static final URI OTHER_SCENARIOS = ROOT.resolve("otherScenarios.xml");
|
||||||
|
|
||||||
public static final URI ERROR_SCENARIOS = ROOT.resolve("scenarios-with-errors.xml");
|
public static final URI ERROR_SCENARIOS = ROOT.resolve("scenarios-with-errors.xml");
|
||||||
|
|
@ -101,6 +107,7 @@ public class Helper {
|
||||||
|
|
||||||
public static class Invalid {
|
public static class Invalid {
|
||||||
|
|
||||||
|
// Is the typo in the name on purpose???
|
||||||
public static final URI ROOT = EXAMPLES_DIR.resolve("invaid/");
|
public static final URI ROOT = EXAMPLES_DIR.resolve("invaid/");
|
||||||
|
|
||||||
public static final URI SCENARIOS = ROOT.resolve("scenarios.xml");
|
public static final URI SCENARIOS = ROOT.resolve("scenarios.xml");
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,23 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<simple xmlns="http://validator.kosit.de/test-sample">
|
||||||
|
<inner>abc</inner>
|
||||||
|
<inner>def</inner>
|
||||||
|
<content>
|
||||||
|
<IDontCare/>
|
||||||
|
</content>
|
||||||
|
</simple>
|
||||||
|
<!--
|
||||||
|
~ 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.
|
||||||
|
-->
|
||||||
|
|
@ -0,0 +1,44 @@
|
||||||
|
<?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.
|
||||||
|
-->
|
||||||
|
|
||||||
|
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||||
|
xmlns:xs="http://www.w3.org/2001/XMLSchema"
|
||||||
|
xmlns:in="http://www.xoev.de/de/validator/framework/1/createreportinput"
|
||||||
|
exclude-result-prefixes="xs"
|
||||||
|
version="2.0">
|
||||||
|
|
||||||
|
<xsl:output method="xml" indent="yes" />
|
||||||
|
|
||||||
|
<xsl:param name="input-document" as="document-node(element())" required="yes" />
|
||||||
|
|
||||||
|
|
||||||
|
<xsl:template match="in:createReportInput">
|
||||||
|
<report xmlns="http://validator.kosit.de/test-report">
|
||||||
|
<input>
|
||||||
|
<xsl:copy-of select="$input-document" />
|
||||||
|
</input>
|
||||||
|
<result>
|
||||||
|
<xsl:copy-of select="." />
|
||||||
|
</result>
|
||||||
|
<text>
|
||||||
|
<xsl:value-of select="unparsed-text('some.txt','UTF-8')" />
|
||||||
|
</text>
|
||||||
|
</report>
|
||||||
|
</xsl:template>
|
||||||
|
|
||||||
|
|
||||||
|
</xsl:stylesheet>
|
||||||
|
|
@ -0,0 +1,231 @@
|
||||||
|
<?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.
|
||||||
|
-->
|
||||||
|
|
||||||
|
<xsl:stylesheet
|
||||||
|
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||||
|
xmlns:xs="http://www.w3.org/2001/XMLSchema"
|
||||||
|
xmlns:s="http://validator.kosit.de/test-sample"
|
||||||
|
version="2.0"><!--Implementers: please note that overriding process-prolog or process-root is
|
||||||
|
the preferred method for meta-stylesheets to use where possible. -->
|
||||||
|
<xsl:param name="archiveDirParameter" />
|
||||||
|
<xsl:param name="archiveNameParameter" />
|
||||||
|
<xsl:param name="fileNameParameter" />
|
||||||
|
<xsl:param name="fileDirParameter" />
|
||||||
|
<xsl:variable name="document-uri">
|
||||||
|
<xsl:value-of select="document-uri(/)" />
|
||||||
|
</xsl:variable>
|
||||||
|
|
||||||
|
<!--PHASES-->
|
||||||
|
|
||||||
|
|
||||||
|
<!--PROLOG-->
|
||||||
|
<xsl:output xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
||||||
|
method="xml"
|
||||||
|
omit-xml-declaration="no"
|
||||||
|
standalone="yes"
|
||||||
|
indent="yes" />
|
||||||
|
|
||||||
|
<!--XSD TYPES FOR XSLT2-->
|
||||||
|
|
||||||
|
|
||||||
|
<!--KEYS AND FUNCTIONS-->
|
||||||
|
|
||||||
|
|
||||||
|
<!--DEFAULT RULES-->
|
||||||
|
|
||||||
|
|
||||||
|
<!--MODE: SCHEMATRON-SELECT-FULL-PATH-->
|
||||||
|
<!--This mode can be used to generate an ugly though full XPath for locators-->
|
||||||
|
<xsl:template match="*" mode="schematron-select-full-path">
|
||||||
|
<xsl:apply-templates select="." mode="schematron-get-full-path" />
|
||||||
|
</xsl:template>
|
||||||
|
|
||||||
|
<!--MODE: SCHEMATRON-FULL-PATH-->
|
||||||
|
<!--This mode can be used to generate an ugly though full XPath for locators-->
|
||||||
|
<xsl:template match="*" mode="schematron-get-full-path">
|
||||||
|
<xsl:apply-templates select="parent::*" mode="schematron-get-full-path" />
|
||||||
|
<xsl:text>/</xsl:text>
|
||||||
|
<xsl:choose>
|
||||||
|
<xsl:when test="namespace-uri()=''">
|
||||||
|
<xsl:value-of select="name()" />
|
||||||
|
</xsl:when>
|
||||||
|
<xsl:otherwise>
|
||||||
|
<xsl:text>*:</xsl:text>
|
||||||
|
<xsl:value-of select="local-name()" />
|
||||||
|
<xsl:text>[namespace-uri()='</xsl:text>
|
||||||
|
<xsl:value-of select="namespace-uri()" />
|
||||||
|
<xsl:text>']</xsl:text>
|
||||||
|
</xsl:otherwise>
|
||||||
|
</xsl:choose>
|
||||||
|
<xsl:variable name="preceding"
|
||||||
|
select="count(preceding-sibling::*[local-name()=local-name(current()) and namespace-uri() = namespace-uri(current())])" />
|
||||||
|
<xsl:text>[</xsl:text>
|
||||||
|
<xsl:value-of select="1+ $preceding" />
|
||||||
|
<xsl:text>]</xsl:text>
|
||||||
|
</xsl:template>
|
||||||
|
<xsl:template match="@*" mode="schematron-get-full-path">
|
||||||
|
<xsl:apply-templates select="parent::*" mode="schematron-get-full-path" />
|
||||||
|
<xsl:text>/</xsl:text>
|
||||||
|
<xsl:choose>
|
||||||
|
<xsl:when test="namespace-uri()=''">@<xsl:value-of select="name()" />
|
||||||
|
</xsl:when>
|
||||||
|
<xsl:otherwise>
|
||||||
|
<xsl:text>@*[local-name()='</xsl:text>
|
||||||
|
<xsl:value-of select="local-name()" />
|
||||||
|
<xsl:text>' and namespace-uri()='</xsl:text>
|
||||||
|
<xsl:value-of select="namespace-uri()" />
|
||||||
|
<xsl:text>']</xsl:text>
|
||||||
|
</xsl:otherwise>
|
||||||
|
</xsl:choose>
|
||||||
|
</xsl:template>
|
||||||
|
|
||||||
|
<!--MODE: SCHEMATRON-FULL-PATH-2-->
|
||||||
|
<!--This mode can be used to generate prefixed XPath for humans-->
|
||||||
|
<xsl:template match="node() | @*" mode="schematron-get-full-path-2">
|
||||||
|
<xsl:for-each select="ancestor-or-self::*">
|
||||||
|
<xsl:text>/</xsl:text>
|
||||||
|
<xsl:value-of select="name(.)" />
|
||||||
|
<xsl:if test="preceding-sibling::*[name(.)=name(current())]">
|
||||||
|
<xsl:text>[</xsl:text>
|
||||||
|
<xsl:value-of select="count(preceding-sibling::*[name(.)=name(current())])+1" />
|
||||||
|
<xsl:text>]</xsl:text>
|
||||||
|
</xsl:if>
|
||||||
|
</xsl:for-each>
|
||||||
|
<xsl:if test="not(self::*)">
|
||||||
|
<xsl:text />/@<xsl:value-of select="name(.)" />
|
||||||
|
</xsl:if>
|
||||||
|
</xsl:template>
|
||||||
|
<!--MODE: SCHEMATRON-FULL-PATH-3-->
|
||||||
|
<!--This mode can be used to generate prefixed XPath for humans
|
||||||
|
(Top-level element has index)-->
|
||||||
|
<xsl:template match="node() | @*" mode="schematron-get-full-path-3">
|
||||||
|
<xsl:for-each select="ancestor-or-self::*">
|
||||||
|
<xsl:text>/</xsl:text>
|
||||||
|
<xsl:value-of select="name(.)" />
|
||||||
|
<xsl:if test="parent::*">
|
||||||
|
<xsl:text>[</xsl:text>
|
||||||
|
<xsl:value-of select="count(preceding-sibling::*[name(.)=name(current())])+1" />
|
||||||
|
<xsl:text>]</xsl:text>
|
||||||
|
</xsl:if>
|
||||||
|
</xsl:for-each>
|
||||||
|
<xsl:if test="not(self::*)">
|
||||||
|
<xsl:text />/@<xsl:value-of select="name(.)" />
|
||||||
|
</xsl:if>
|
||||||
|
</xsl:template>
|
||||||
|
|
||||||
|
<!--MODE: GENERATE-ID-FROM-PATH -->
|
||||||
|
<xsl:template match="/" mode="generate-id-from-path" />
|
||||||
|
<xsl:template match="text()" mode="generate-id-from-path">
|
||||||
|
<xsl:apply-templates select="parent::*" mode="generate-id-from-path" />
|
||||||
|
<xsl:value-of select="concat('.text-', 1+count(preceding-sibling::text()), '-')" />
|
||||||
|
</xsl:template>
|
||||||
|
<xsl:template match="comment()" mode="generate-id-from-path">
|
||||||
|
<xsl:apply-templates select="parent::*" mode="generate-id-from-path" />
|
||||||
|
<xsl:value-of select="concat('.comment-', 1+count(preceding-sibling::comment()), '-')" />
|
||||||
|
</xsl:template>
|
||||||
|
<xsl:template match="processing-instruction()" mode="generate-id-from-path">
|
||||||
|
<xsl:apply-templates select="parent::*" mode="generate-id-from-path" />
|
||||||
|
<xsl:value-of select="concat('.processing-instruction-', 1+count(preceding-sibling::processing-instruction()), '-')" />
|
||||||
|
</xsl:template>
|
||||||
|
<xsl:template match="@*" mode="generate-id-from-path">
|
||||||
|
<xsl:apply-templates select="parent::*" mode="generate-id-from-path" />
|
||||||
|
<xsl:value-of select="concat('.@', name())" />
|
||||||
|
</xsl:template>
|
||||||
|
<xsl:template match="*" mode="generate-id-from-path" priority="-0.5">
|
||||||
|
<xsl:apply-templates select="parent::*" mode="generate-id-from-path" />
|
||||||
|
<xsl:text>.</xsl:text>
|
||||||
|
<xsl:value-of select="concat('.',name(),'-',1+count(preceding-sibling::*[name()=name(current())]),'-')" />
|
||||||
|
</xsl:template>
|
||||||
|
|
||||||
|
<!--MODE: GENERATE-ID-2 -->
|
||||||
|
<xsl:template match="/" mode="generate-id-2">U</xsl:template>
|
||||||
|
<xsl:template match="*" mode="generate-id-2" priority="2">
|
||||||
|
<xsl:text>U</xsl:text>
|
||||||
|
<xsl:number level="multiple" count="*" />
|
||||||
|
</xsl:template>
|
||||||
|
<xsl:template match="node()" mode="generate-id-2">
|
||||||
|
<xsl:text>U.</xsl:text>
|
||||||
|
<xsl:number level="multiple" count="*" />
|
||||||
|
<xsl:text>n</xsl:text>
|
||||||
|
<xsl:number count="node()" />
|
||||||
|
</xsl:template>
|
||||||
|
<xsl:template match="@*" mode="generate-id-2">
|
||||||
|
<xsl:text>U.</xsl:text>
|
||||||
|
<xsl:number level="multiple" count="*" />
|
||||||
|
<xsl:text>_</xsl:text>
|
||||||
|
<xsl:value-of select="string-length(local-name(.))" />
|
||||||
|
<xsl:text>_</xsl:text>
|
||||||
|
<xsl:value-of select="translate(name(),':','.')" />
|
||||||
|
</xsl:template>
|
||||||
|
<!--Strip characters-->
|
||||||
|
<xsl:template match="text()" priority="-1" />
|
||||||
|
|
||||||
|
<!--SCHEMA SETUP-->
|
||||||
|
<xsl:template match="/">
|
||||||
|
<svrl:schematron-output xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
||||||
|
title="Schematron Simple"
|
||||||
|
schemaVersion="">
|
||||||
|
<xsl:comment>
|
||||||
|
<xsl:value-of select="$archiveDirParameter" />
|
||||||
|
<xsl:value-of select="$archiveNameParameter" />
|
||||||
|
<xsl:value-of select="$fileNameParameter" />
|
||||||
|
<xsl:value-of select="$fileDirParameter" />
|
||||||
|
</xsl:comment>
|
||||||
|
<svrl:ns-prefix-in-attribute-values uri="http://www.w3.org/2001/XMLSchema" prefix="xs" />
|
||||||
|
<svrl:ns-prefix-in-attribute-values uri="http://validator.kosit.de/test-sample" prefix="s" />
|
||||||
|
<svrl:active-pattern>
|
||||||
|
<xsl:attribute name="document">
|
||||||
|
<xsl:value-of select="document-uri(/)" />
|
||||||
|
</xsl:attribute>
|
||||||
|
<xsl:apply-templates />
|
||||||
|
</svrl:active-pattern>
|
||||||
|
<xsl:apply-templates select="/" mode="M3" />
|
||||||
|
</svrl:schematron-output>
|
||||||
|
</xsl:template>
|
||||||
|
|
||||||
|
<!--SCHEMATRON PATTERNS-->
|
||||||
|
<svrl:text xmlns:svrl="http://purl.oclc.org/dsdl/svrl">Schematron Simple</svrl:text>
|
||||||
|
|
||||||
|
<!--PATTERN -->
|
||||||
|
|
||||||
|
|
||||||
|
<!--RULE -->
|
||||||
|
<xsl:template match="s:simple" priority="1001" mode="M3">
|
||||||
|
<svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl" context="s:simple" />
|
||||||
|
|
||||||
|
<!--ASSERT -->
|
||||||
|
<xsl:choose>
|
||||||
|
<xsl:when test="xs:decimal(s:inner) = 1" />
|
||||||
|
<xsl:otherwise>
|
||||||
|
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl" test="xs:decimal(s:inner) = 1">
|
||||||
|
<xsl:attribute name="id">content-2</xsl:attribute>
|
||||||
|
<xsl:attribute name="location">
|
||||||
|
<xsl:apply-templates select="." mode="schematron-select-full-path" />
|
||||||
|
</xsl:attribute>
|
||||||
|
<svrl:text>The decimal value of s:inner should be 1.</svrl:text>
|
||||||
|
</svrl:failed-assert>
|
||||||
|
</xsl:otherwise>
|
||||||
|
</xsl:choose>
|
||||||
|
|
||||||
|
<xsl:apply-templates select="*|comment()|processing-instruction()" mode="M3" />
|
||||||
|
</xsl:template>
|
||||||
|
|
||||||
|
<xsl:template match="text()" priority="-1" mode="M3" />
|
||||||
|
<xsl:template match="@*|node()" priority="-2" mode="M3">
|
||||||
|
<xsl:apply-templates select="*|comment()|processing-instruction()" mode="M3" />
|
||||||
|
</xsl:template>
|
||||||
|
</xsl:stylesheet>
|
||||||
|
|
@ -0,0 +1,30 @@
|
||||||
|
<?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.
|
||||||
|
-->
|
||||||
|
|
||||||
|
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://validator.kosit.de/test-sample" version="1.0" xml:lang="en"
|
||||||
|
targetNamespace="http://validator.kosit.de/test-sample" elementFormDefault="qualified">
|
||||||
|
|
||||||
|
<xs:element name="simple" type="tns:SimpleType" />
|
||||||
|
<xs:element name="foo" type="tns:SimpleType" />
|
||||||
|
|
||||||
|
<xs:complexType name="SimpleType">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element name="inner" type="xs:string" minOccurs="0" maxOccurs="unbounded" />
|
||||||
|
<xs:element name="content" type="xs:anyType" />
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
</xs:schema>
|
||||||
|
|
@ -0,0 +1,61 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<scenarios xmlns="http://www.xoev.de/de/validator/framework/1/scenarios" frameworkVersion="1.1.2">
|
||||||
|
<name>XSLT-Runtime-Error-TestSuite</name>
|
||||||
|
<author>QA</author>
|
||||||
|
<date>2026-03-02</date>
|
||||||
|
<description>
|
||||||
|
<p>Szenario für Tests</p>
|
||||||
|
</description>
|
||||||
|
|
||||||
|
<scenario>
|
||||||
|
<name>Simple</name>
|
||||||
|
<description>
|
||||||
|
<p>Teste Fehlerfall.</p>
|
||||||
|
</description>
|
||||||
|
<namespace prefix="cri">http://www.xoev.de/de/validator/framework/1/createreportinput</namespace>
|
||||||
|
<namespace prefix="test">http://validator.kosit.de/test-sample</namespace>
|
||||||
|
<namespace prefix="rpt">http://validator.kosit.de/test-report</namespace>
|
||||||
|
<match>/</match>
|
||||||
|
|
||||||
|
<validateWithXmlSchema>
|
||||||
|
<resource>
|
||||||
|
<name>Sample Schema</name>
|
||||||
|
<location>repository/simple.xsd</location>
|
||||||
|
</resource>
|
||||||
|
</validateWithXmlSchema>
|
||||||
|
<validateWithSchematron>
|
||||||
|
<resource>
|
||||||
|
<name>Sample Schematron</name>
|
||||||
|
<location>repository/simple-xslt-runtime-error.xsl</location>
|
||||||
|
</resource>
|
||||||
|
</validateWithSchematron>
|
||||||
|
<createReport>
|
||||||
|
<resource>
|
||||||
|
<name>Report für eRechnung</name>
|
||||||
|
<location>repository/report.xsl</location>
|
||||||
|
</resource>
|
||||||
|
</createReport>
|
||||||
|
</scenario>
|
||||||
|
|
||||||
|
<noScenarioReport>
|
||||||
|
<resource>
|
||||||
|
<name>default</name>
|
||||||
|
<location>repository/report.xsl</location>
|
||||||
|
</resource>
|
||||||
|
</noScenarioReport>
|
||||||
|
</scenarios>
|
||||||
|
<!--
|
||||||
|
~ 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.
|
||||||
|
-->
|
||||||
Loading…
Add table
Add a link
Reference in a new issue