mirror of
https://github.com/itplr-kosit/validator.git
synced 2026-05-25 16:55:39 +00:00
Merge branch 'master' into better-doc
This commit is contained in:
commit
d347cf121f
85 changed files with 1801 additions and 17721 deletions
7
.gitignore
vendored
7
.gitignore
vendored
|
|
@ -29,3 +29,10 @@ src/generated
|
||||||
# Avoid ignoring Maven wrapper jar file (.jar files are usually ignored)
|
# Avoid ignoring Maven wrapper jar file (.jar files are usually ignored)
|
||||||
!/.mvn/wrapper/maven-wrapper.jar
|
!/.mvn/wrapper/maven-wrapper.jar
|
||||||
|
|
||||||
|
# IDE stuff
|
||||||
|
.project
|
||||||
|
.classpath
|
||||||
|
.factorypath
|
||||||
|
.settings
|
||||||
|
.vscode
|
||||||
|
*.code-workspace
|
||||||
|
|
|
||||||
|
|
@ -1,19 +1,16 @@
|
||||||
image: maven:latest
|
image: maven:latest
|
||||||
|
|
||||||
variables:
|
variables:
|
||||||
MAVEN_CLI_OPTS: " --batch-mode -Dmaven.repo.local=repository -Dfile.encoding=UTF-8"
|
MAVEN_CLI_OPTS: " --batch-mode -Dmaven.repo.local=/cache/repository -Dfile.encoding=UTF-8"
|
||||||
|
|
||||||
cache:
|
|
||||||
paths:
|
|
||||||
- repository
|
|
||||||
|
|
||||||
build-validator:
|
build-java-latest:
|
||||||
stage: build
|
stage: build
|
||||||
|
image: maven:3-jdk-13
|
||||||
script:
|
script:
|
||||||
- mvn $MAVEN_CLI_OPTS -Pjava-11,java-8,gitlab verify
|
- mvn $MAVEN_CLI_OPTS verify
|
||||||
|
|
||||||
artifacts:
|
artifacts:
|
||||||
name: build-results
|
name: java-latest
|
||||||
paths:
|
paths:
|
||||||
- target/*.jar
|
- target/*.jar
|
||||||
reports:
|
reports:
|
||||||
|
|
@ -21,9 +18,45 @@ build-validator:
|
||||||
- target/surefire-reports/*.xml
|
- target/surefire-reports/*.xml
|
||||||
- target/failsafe-reports/*.xml
|
- target/failsafe-reports/*.xml
|
||||||
|
|
||||||
#deploy:
|
build-java-12:
|
||||||
# stage: deploy
|
stage: build
|
||||||
# script:
|
image: maven:3-jdk-12
|
||||||
# - mvn $MAVEN_CLI_OPTS deploy
|
script:
|
||||||
# only:
|
- mvn $MAVEN_CLI_OPTS verify
|
||||||
# - master
|
artifacts:
|
||||||
|
name: java-12
|
||||||
|
paths:
|
||||||
|
- target/*.jar
|
||||||
|
reports:
|
||||||
|
junit:
|
||||||
|
- target/surefire-reports/*.xml
|
||||||
|
- target/failsafe-reports/*.xml
|
||||||
|
|
||||||
|
|
||||||
|
build-java-11:
|
||||||
|
stage: build
|
||||||
|
image: maven:3-jdk-11
|
||||||
|
script:
|
||||||
|
- mvn $MAVEN_CLI_OPTS verify
|
||||||
|
artifacts:
|
||||||
|
name: java-11
|
||||||
|
paths:
|
||||||
|
- target/*.jar
|
||||||
|
reports:
|
||||||
|
junit:
|
||||||
|
- target/surefire-reports/*.xml
|
||||||
|
- target/failsafe-reports/*.xml
|
||||||
|
|
||||||
|
build-java8:
|
||||||
|
stage: build
|
||||||
|
image: maven:3-jdk-8-alpine
|
||||||
|
script:
|
||||||
|
- mvn $MAVEN_CLI_OPTS verify
|
||||||
|
artifacts:
|
||||||
|
name: java8
|
||||||
|
paths:
|
||||||
|
- target/*.jar
|
||||||
|
reports:
|
||||||
|
junit:
|
||||||
|
- target/surefire-reports/*.xml
|
||||||
|
- target/failsafe-reports/*.xml
|
||||||
|
|
|
||||||
1
.idea/eclipseCodeFormatter.xml
generated
1
.idea/eclipseCodeFormatter.xml
generated
|
|
@ -3,6 +3,7 @@
|
||||||
<component name="EclipseCodeFormatterProjectSettings">
|
<component name="EclipseCodeFormatterProjectSettings">
|
||||||
<option name="projectSpecificProfile">
|
<option name="projectSpecificProfile">
|
||||||
<ProjectSpecificProfile>
|
<ProjectSpecificProfile>
|
||||||
|
<option name="disabledFileTypes" value="xml" />
|
||||||
<option name="formatSeletedTextInAllFileTypes" value="false" />
|
<option name="formatSeletedTextInAllFileTypes" value="false" />
|
||||||
<option name="formatter" value="ECLIPSE" />
|
<option name="formatter" value="ECLIPSE" />
|
||||||
<option name="importOrderConfigFilePath" value="$PROJECT_DIR$/.settings/org.eclipse.jdt.ui.prefs" />
|
<option name="importOrderConfigFilePath" value="$PROJECT_DIR$/.settings/org.eclipse.jdt.ui.prefs" />
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,7 @@ org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
|
||||||
org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
|
org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
|
||||||
org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
|
org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
|
||||||
org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
|
org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
|
||||||
|
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
|
||||||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
||||||
org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=warning
|
org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=warning
|
||||||
org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
|
org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
|
||||||
|
|
@ -80,6 +81,7 @@ org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=warn
|
||||||
org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=warning
|
org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=warning
|
||||||
org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
|
org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
|
||||||
org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=warning
|
org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=warning
|
||||||
|
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore
|
||||||
org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
|
org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
|
||||||
org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
|
org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
|
||||||
org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
|
org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
|
||||||
|
|
@ -112,7 +114,8 @@ org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
|
||||||
org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore
|
org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore
|
||||||
org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
|
org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
|
||||||
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
|
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
|
||||||
org.eclipse.jdt.core.compiler.processAnnotations=disabled
|
org.eclipse.jdt.core.compiler.processAnnotations=enabled
|
||||||
|
org.eclipse.jdt.core.compiler.release=disabled
|
||||||
org.eclipse.jdt.core.compiler.source=1.8
|
org.eclipse.jdt.core.compiler.source=1.8
|
||||||
org.eclipse.jdt.core.formatter.align_fields_grouping_blank_lines=2147483647
|
org.eclipse.jdt.core.formatter.align_fields_grouping_blank_lines=2147483647
|
||||||
org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
|
org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
|
||||||
|
|
|
||||||
36
CHANGELOG.md
Normal file
36
CHANGELOG.md
Normal file
|
|
@ -0,0 +1,36 @@
|
||||||
|
# Changelog
|
||||||
|
|
||||||
|
All notable changes to the Schematron Rules and this project will be documented in this file.
|
||||||
|
|
||||||
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
|
||||||
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||||
|
|
||||||
|
## [Unreleased]
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- 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
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- Use s9api (e.g. XdmNode) internally for loading and holding xml objects (further memory optimization)
|
||||||
|
- Builds with java 8 and >= 11
|
||||||
|
- Packages for java8 and java >= 11 (with jaxb included)
|
||||||
|
|
||||||
|
## 1.0.2
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- Memory issues when validating multiple targets
|
||||||
|
|
||||||
|
## 1.0.1
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- Removed XRechnung configuration from release artifacts and source (moved to [own repository](https://github.com/itplr-kosit/validator-configuration-xrechnung) )
|
||||||
|
|
||||||
|
## 1.0.0
|
||||||
|
|
||||||
|
- Initial Release
|
||||||
|
|
@ -62,7 +62,7 @@ You can more CLI options by
|
||||||
java -jar validationtool-<version>-standalone.jar --help
|
java -jar validationtool-<version>-standalone.jar --help
|
||||||
```
|
```
|
||||||
|
|
||||||
A concrete exmaple 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 [GitHub](https://github.com/itplr-kosit/validator-configuration-xrechnung
|
||||||
|
|
||||||
### Daemon-Mode
|
### Daemon-Mode
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
# Setup development environment
|
# Setup development environment
|
||||||
|
|
||||||
## Prerequisites
|
## Prerequisites
|
||||||
|
|
||||||
We use IntelliJ >= 2018.3 and OpenJDK 11 for development. If you like to contribute please use the following plugins:
|
We use IntelliJ >= 2018.3 and OpenJDK 11 for development. If you like to contribute please use the following plugins:
|
||||||
|
|
||||||
1. Checkstyle Plugin
|
1. Checkstyle Plugin
|
||||||
|
|
@ -10,17 +11,17 @@ We use IntelliJ >= 2018.3 and OpenJDK 11 for development. If you like to contri
|
||||||
Any other IDE should be sufficient too. Just use suitable tools, plugins and setup comparable to our IntelliJ stuff.
|
Any other IDE should be sufficient too. Just use suitable tools, plugins and setup comparable to our IntelliJ stuff.
|
||||||
|
|
||||||
## Import into IDE
|
## Import into IDE
|
||||||
|
|
||||||
For IntelliJ we provide a suitable configuration within the code. Just clone the repository locally and open it in IntelliJ
|
For IntelliJ we provide a suitable configuration within the code. Just clone the repository locally and open it in IntelliJ
|
||||||
and you are up and running.
|
and you are up and running.
|
||||||
|
|
||||||
For other IDEs the correct setup is up to you.
|
For other IDEs the correct setup is up to you.
|
||||||
|
|
||||||
## Code Formatting
|
## Code Formatting
|
||||||
|
|
||||||
We use an automatic formatting of the source code in our environment. This is based on the Eclipse code formatter functionality
|
We use an automatic formatting of the source code in our environment. This is based on the Eclipse code formatter functionality
|
||||||
due to historical reasons. This not only works in Eclipse but also in IntelliJ (via plugin) and can be used standalone.
|
due to historical reasons. This not only works in Eclipse but also in IntelliJ (via plugin) and can be used standalone.
|
||||||
|
|
||||||
The configuration can be found in `.settings`-directory. For IntelliJ this is all set up. Additionally this should work in Eclipse out of the box.
|
The configuration can be found in `.settings`-directory. For IntelliJ this is all set up. Additionally this should work in Eclipse out of the box.
|
||||||
Another potential usage scenario would be to integrate the formatter via git hooks into the commit-pipeline (e.g [Example Hook](https://gist.github.com/ktoso/708972) ).
|
Another potential usage scenario would be to integrate the formatter via git hooks into the commit-pipeline (e.g [Example Hook](https://gist.github.com/ktoso/708972) ).
|
||||||
For other IDEs you are on your own.
|
For other IDEs you are on your own.
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Binary file not shown.
|
|
@ -0,0 +1,9 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<groupId>de.kosit.validationtool</groupId>
|
||||||
|
<artifactId>packaged-test-scenarios</artifactId>
|
||||||
|
<version>1.0.0</version>
|
||||||
|
<description>POM was created from install:install-file</description>
|
||||||
|
</project>
|
||||||
|
|
@ -0,0 +1,12 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<metadata>
|
||||||
|
<groupId>de.kosit.validationtool</groupId>
|
||||||
|
<artifactId>packaged-test-scenarios</artifactId>
|
||||||
|
<versioning>
|
||||||
|
<release>1.0.0</release>
|
||||||
|
<versions>
|
||||||
|
<version>1.0.0</version>
|
||||||
|
</versions>
|
||||||
|
<lastUpdated>20190507064929</lastUpdated>
|
||||||
|
</versioning>
|
||||||
|
</metadata>
|
||||||
396
pom.xml
396
pom.xml
|
|
@ -1,29 +1,7 @@
|
||||||
<?xml version="1.0" encoding="UTF-8" ?>
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
<!--
|
<!-- License below -->
|
||||||
~ Licensed to the Koordinierungsstelle für IT-Standards (KoSIT) under
|
<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">
|
||||||
~ 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.
|
|
||||||
-->
|
|
||||||
|
|
||||||
<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">
|
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<prerequisites>
|
|
||||||
<maven>3.3.9</maven>
|
|
||||||
</prerequisites>
|
|
||||||
|
|
||||||
<name>KoSIT XML Prüftool Implementierung</name>
|
<name>KoSIT XML Prüftool Implementierung</name>
|
||||||
|
|
||||||
|
|
@ -33,27 +11,53 @@
|
||||||
<artifactId>validationtool</artifactId>
|
<artifactId>validationtool</artifactId>
|
||||||
<description>KoSIT XML Prüftool zur Prüfung von XML Dateien gegenüber definierten Szenarien.</description>
|
<description>KoSIT XML Prüftool zur Prüfung von XML Dateien gegenüber definierten Szenarien.</description>
|
||||||
<developers>
|
<developers>
|
||||||
|
<!-- In alphabetical order by last name -->
|
||||||
|
<developer>
|
||||||
|
<id>fabian.buettner</id>
|
||||||
|
<name>Fabian Büttner</name>
|
||||||
|
<organization>KoSIT</organization>
|
||||||
|
<organizationUrl>http://www.xoev.de</organizationUrl>
|
||||||
|
</developer>
|
||||||
|
<developer>
|
||||||
|
|
||||||
|
<id>renzo.kottmann</id>
|
||||||
|
<name>Renzo Kottmann</name>
|
||||||
|
<organization>KoSIT</organization>
|
||||||
|
<organizationUrl>http://www.xoev.de</organizationUrl>
|
||||||
|
<roles>
|
||||||
|
<role>Product Owner</role>
|
||||||
|
</roles>
|
||||||
|
</developer>
|
||||||
<developer>
|
<developer>
|
||||||
<id>andreas.penski</id>
|
<id>andreas.penski</id>
|
||||||
<name>Andreas Penski</name>
|
<name>Andreas Penski</name>
|
||||||
<organization>]init[ AG</organization>
|
<organization>]init[ AG</organization>
|
||||||
<organizationUrl>https://www.init.de</organizationUrl>
|
<organizationUrl>https://www.init.de</organizationUrl>
|
||||||
|
<roles>
|
||||||
|
<role>developer</role>
|
||||||
|
</roles>
|
||||||
</developer>
|
</developer>
|
||||||
<developer>
|
<developer>
|
||||||
<id>fabian.buettner</id>
|
<id>fabian.buettner</id>
|
||||||
<name>Fabian Büttner</name>
|
<name>Fabian Büttner</name>
|
||||||
<organization>KoSIT</organization>
|
<organization>KoSIT</organization>
|
||||||
<organizationUrl>http://www.kosit.de</organizationUrl>
|
<organizationUrl>http://www.xoev.de</organizationUrl>
|
||||||
</developer>
|
</developer>
|
||||||
</developers>
|
</developers>
|
||||||
<properties>
|
<properties>
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
<version.jacoco>0.8.3</version.jacoco>
|
<version.jacoco>0.8.4</version.jacoco>
|
||||||
<version.lombok>1.18.6</version.lombok>
|
<version.lombok>1.18.8</version.lombok>
|
||||||
<version.saxon-he>9.9.1-1</version.saxon-he>
|
<version.saxon-he>9.9.1-3</version.saxon-he>
|
||||||
<version.slf4j>1.7.25</version.slf4j>
|
<version.slf4j>1.7.25</version.slf4j>
|
||||||
<docker.host>localhost</docker.host>
|
|
||||||
</properties>
|
</properties>
|
||||||
|
<repositories>
|
||||||
|
<repository>
|
||||||
|
<id>project.local</id>
|
||||||
|
<name>project</name>
|
||||||
|
<url>file:${project.basedir}/libs</url>
|
||||||
|
</repository>
|
||||||
|
</repositories>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
|
|
@ -89,7 +93,7 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.commons</groupId>
|
<groupId>org.apache.commons</groupId>
|
||||||
<artifactId>commons-lang3</artifactId>
|
<artifactId>commons-lang3</artifactId>
|
||||||
<version>3.5</version>
|
<version>3.9</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.glassfish.jaxb</groupId>
|
<groupId>org.glassfish.jaxb</groupId>
|
||||||
|
|
@ -100,7 +104,7 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.assertj</groupId>
|
<groupId>org.assertj</groupId>
|
||||||
<artifactId>assertj-core</artifactId>
|
<artifactId>assertj-core</artifactId>
|
||||||
<version>3.8.0</version>
|
<version>3.12.2</version>
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
|
|
@ -118,9 +122,14 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>io.rest-assured</groupId>
|
<groupId>io.rest-assured</groupId>
|
||||||
<artifactId>rest-assured</artifactId>
|
<artifactId>rest-assured</artifactId>
|
||||||
<version>3.2.0</version>
|
<version>3.3.0</version>
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>de.kosit.validationtool</groupId>
|
||||||
|
<artifactId>packaged-test-scenarios</artifactId>
|
||||||
|
<version>1.0.0</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
|
|
@ -132,10 +141,30 @@
|
||||||
</resources>
|
</resources>
|
||||||
|
|
||||||
<plugins>
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-enforcer-plugin</artifactId>
|
||||||
|
<version>3.0.0-M2</version>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<id>enforce-versions</id>
|
||||||
|
<goals>
|
||||||
|
<goal>enforce</goal>
|
||||||
|
</goals>
|
||||||
|
<configuration>
|
||||||
|
<rules>
|
||||||
|
<requireMavenVersion>
|
||||||
|
<version>[3.0.0,)</version>
|
||||||
|
</requireMavenVersion>
|
||||||
|
</rules>
|
||||||
|
</configuration>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-compiler-plugin</artifactId>
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
<version>3.8.0</version>
|
<version>3.8.1</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
<source>1.8</source>
|
<source>1.8</source>
|
||||||
<target>1.8</target>
|
<target>1.8</target>
|
||||||
|
|
@ -243,7 +272,7 @@
|
||||||
<!-- Integrate the /src/main/generated folder -->
|
<!-- Integrate the /src/main/generated folder -->
|
||||||
<groupId>org.codehaus.mojo</groupId>
|
<groupId>org.codehaus.mojo</groupId>
|
||||||
<artifactId>build-helper-maven-plugin</artifactId>
|
<artifactId>build-helper-maven-plugin</artifactId>
|
||||||
<version>1.1</version>
|
<version>3.0.0</version>
|
||||||
<executions>
|
<executions>
|
||||||
<execution>
|
<execution>
|
||||||
<id>add-source</id>
|
<id>add-source</id>
|
||||||
|
|
@ -334,6 +363,7 @@
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-source-plugin</artifactId>
|
<artifactId>maven-source-plugin</artifactId>
|
||||||
|
<version>3.1.0</version>
|
||||||
<executions>
|
<executions>
|
||||||
<execution>
|
<execution>
|
||||||
<id>attach-sources</id>
|
<id>attach-sources</id>
|
||||||
|
|
@ -353,14 +383,57 @@
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
|
||||||
</plugins>
|
<plugin>
|
||||||
</build>
|
<groupId>org.codehaus.mojo</groupId>
|
||||||
|
<artifactId>exec-maven-plugin</artifactId>
|
||||||
|
<version>1.6.0</version>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<id>run</id>
|
||||||
|
<phase>pre-integration-test</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>exec</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
<configuration>
|
||||||
|
<executable>java</executable>
|
||||||
|
<longClasspath>true</longClasspath>
|
||||||
|
<async>true</async>
|
||||||
|
<asyncDestroyOnShutdown>true</asyncDestroyOnShutdown>
|
||||||
|
<arguments>
|
||||||
|
<argument>-classpath</argument>
|
||||||
|
<classpath />
|
||||||
|
<argument>de.kosit.validationtool.cmd.CommandLineApplication</argument>
|
||||||
|
<argument>-s</argument>
|
||||||
|
<argument>${project.build.testOutputDirectory}/examples/UBLReady/scenarios-2.xml</argument>
|
||||||
|
<argument>-r</argument>
|
||||||
|
<argument>${project.build.testOutputDirectory}/examples/repository</argument>
|
||||||
|
<argument>-D</argument>
|
||||||
|
|
||||||
<profiles>
|
</arguments>
|
||||||
<profile>
|
|
||||||
<id>java-8</id>
|
</configuration>
|
||||||
<build>
|
</plugin>
|
||||||
<plugins>
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-antrun-plugin</artifactId>
|
||||||
|
<configuration>
|
||||||
|
<tasks>
|
||||||
|
<!-- schlafen um den Start des Daemon abzuwarten -->
|
||||||
|
<sleep seconds="5" />
|
||||||
|
</tasks>
|
||||||
|
</configuration>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<id>sleep-for-a-while</id>
|
||||||
|
<phase>pre-integration-test</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>run</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-failsafe-plugin</artifactId>
|
<artifactId>maven-failsafe-plugin</artifactId>
|
||||||
|
|
@ -372,237 +445,14 @@
|
||||||
<goal>integration-test</goal>
|
<goal>integration-test</goal>
|
||||||
<goal>verify</goal>
|
<goal>verify</goal>
|
||||||
</goals>
|
</goals>
|
||||||
<configuration>
|
|
||||||
<!--suppress MavenModelInspection -->
|
|
||||||
<argLine>
|
|
||||||
-Ddaemon.port=8081
|
|
||||||
-Ddaemon.host=http://${docker.host}
|
|
||||||
</argLine>
|
|
||||||
<summaryFile>${project.build.directory}/failsafe-reports/failsafe-summary-java8.xml</summaryFile>
|
|
||||||
</configuration>
|
|
||||||
</execution>
|
|
||||||
<execution>
|
|
||||||
<id>test-java-8-jdk-jaxb</id>
|
|
||||||
<goals>
|
|
||||||
<goal>integration-test</goal>
|
|
||||||
<goal>verify</goal>
|
|
||||||
</goals>
|
|
||||||
<configuration>
|
|
||||||
<!--suppress MavenModelInspection -->
|
|
||||||
<argLine>
|
|
||||||
-Ddaemon.port=8082
|
|
||||||
-Ddaemon.host=http://${docker.host}
|
|
||||||
</argLine>
|
|
||||||
<summaryFile>${project.build.directory}/failsafe-reports/failsafe-summary-java8-jdk-jaxb.xml
|
|
||||||
</summaryFile>
|
|
||||||
</configuration>
|
|
||||||
</execution>
|
|
||||||
</executions>
|
|
||||||
</plugin>
|
|
||||||
|
|
||||||
<plugin>
|
|
||||||
<groupId>io.fabric8</groupId>
|
|
||||||
<artifactId>docker-maven-plugin</artifactId>
|
|
||||||
<version>0.28.0</version>
|
|
||||||
<configuration>
|
|
||||||
<dockerHost>tcp://${docker.host}:2375</dockerHost>
|
|
||||||
<showLogs>true</showLogs>
|
|
||||||
<startParallel>true</startParallel>
|
|
||||||
<verbose>false</verbose>
|
|
||||||
<containerNamePattern>validator-%n-%t-%i-java8</containerNamePattern>
|
|
||||||
</configuration>
|
|
||||||
|
|
||||||
<executions>
|
|
||||||
<execution>
|
|
||||||
<id>up8</id>
|
|
||||||
<phase>pre-integration-test</phase>
|
|
||||||
<goals>
|
|
||||||
<goal>build</goal>
|
|
||||||
<goal>start</goal>
|
|
||||||
</goals>
|
|
||||||
<configuration>
|
|
||||||
<images>
|
|
||||||
<image>
|
|
||||||
<alias>daemon8</alias>
|
|
||||||
<name>daemon8</name>
|
|
||||||
<build>
|
|
||||||
<dockerFileDir>daemon</dockerFileDir>
|
|
||||||
<dockerFile>Dockerfile-java8</dockerFile>
|
|
||||||
<assembly>
|
|
||||||
<inline>
|
|
||||||
<files>
|
|
||||||
<file>
|
|
||||||
<source>
|
|
||||||
${project.build.directory}/validationtool-${project.version}-standalone.jar
|
|
||||||
</source>
|
|
||||||
<destName>validationtool-standalone.jar</destName>
|
|
||||||
</file>
|
|
||||||
</files>
|
|
||||||
</inline>
|
|
||||||
</assembly>
|
|
||||||
</build>
|
|
||||||
<run>
|
|
||||||
<network>
|
|
||||||
<mode>bridge</mode>
|
|
||||||
</network>
|
|
||||||
<ports>
|
|
||||||
<port>8081:8080</port>
|
|
||||||
</ports>
|
|
||||||
<wait>
|
|
||||||
<time>5000</time>
|
|
||||||
</wait>
|
|
||||||
</run>
|
|
||||||
</image>
|
|
||||||
<image>
|
|
||||||
<alias>daemon8-jdk-jaxb</alias>
|
|
||||||
<name>daemon8-jdk-jaxb</name>
|
|
||||||
<build>
|
|
||||||
<dockerFileDir>daemon</dockerFileDir>
|
|
||||||
<dockerFile>Dockerfile-java8-jdk-jaxb</dockerFile>
|
|
||||||
<assembly>
|
|
||||||
<inline>
|
|
||||||
<files>
|
|
||||||
<file>
|
|
||||||
<source>
|
|
||||||
${project.build.directory}/validationtool-${project.version}-java8-standalone.jar
|
|
||||||
</source>
|
|
||||||
<destName>validationtool-standalone.jar</destName>
|
|
||||||
</file>
|
|
||||||
</files>
|
|
||||||
</inline>
|
|
||||||
</assembly>
|
|
||||||
</build>
|
|
||||||
<run>
|
|
||||||
<network>
|
|
||||||
<mode>bridge</mode>
|
|
||||||
</network>
|
|
||||||
<ports>
|
|
||||||
<port>8082:8080</port>
|
|
||||||
</ports>
|
|
||||||
<wait>
|
|
||||||
<time>5000</time>
|
|
||||||
</wait>
|
|
||||||
</run>
|
|
||||||
</image>
|
|
||||||
</images>
|
|
||||||
</configuration>
|
|
||||||
</execution>
|
|
||||||
<execution>
|
|
||||||
<id>down8</id>
|
|
||||||
<phase>post-integration-test</phase>
|
|
||||||
<goals>
|
|
||||||
<goal>stop</goal>
|
|
||||||
</goals>
|
|
||||||
</execution>
|
</execution>
|
||||||
</executions>
|
</executions>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
</profile>
|
|
||||||
<profile>
|
|
||||||
<id>java-11</id>
|
|
||||||
<activation>
|
|
||||||
<activeByDefault>true</activeByDefault>
|
|
||||||
</activation>
|
|
||||||
<build>
|
|
||||||
<plugins>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-failsafe-plugin</artifactId>
|
|
||||||
<version>2.22.1</version>
|
|
||||||
<executions>
|
|
||||||
<execution>
|
|
||||||
<id>test-jdk11</id>
|
|
||||||
<goals>
|
|
||||||
<goal>integration-test</goal>
|
|
||||||
<goal>verify</goal>
|
|
||||||
</goals>
|
|
||||||
<configuration>
|
|
||||||
<!--suppress MavenModelInspection -->
|
|
||||||
<argLine>
|
|
||||||
-Ddaemon.port=8080
|
|
||||||
-Ddaemon.host=http://${docker.host}
|
|
||||||
</argLine>
|
|
||||||
</configuration>
|
|
||||||
</execution>
|
|
||||||
</executions>
|
|
||||||
</plugin>
|
|
||||||
|
|
||||||
<plugin>
|
|
||||||
<groupId>io.fabric8</groupId>
|
|
||||||
<artifactId>docker-maven-plugin</artifactId>
|
|
||||||
<version>0.28.0</version>
|
|
||||||
<configuration>
|
|
||||||
<dockerHost>tcp://${docker.host}:2375</dockerHost>
|
|
||||||
<showLogs>true</showLogs>
|
|
||||||
<startParallel>true</startParallel>
|
|
||||||
<verbose>false</verbose>
|
|
||||||
<containerNamePattern>validator-%n-%t-%i-java8</containerNamePattern>
|
|
||||||
</configuration>
|
|
||||||
<executions>
|
|
||||||
<execution>
|
|
||||||
<id>up11</id>
|
|
||||||
<phase>pre-integration-test</phase>
|
|
||||||
<goals>
|
|
||||||
<goal>build</goal>
|
|
||||||
<goal>start</goal>
|
|
||||||
</goals>
|
|
||||||
<configuration>
|
|
||||||
<images>
|
|
||||||
<image>
|
|
||||||
<alias>daemon11</alias>
|
|
||||||
<name>daemon11</name>
|
|
||||||
<build>
|
|
||||||
<dockerFileDir>daemon</dockerFileDir>
|
|
||||||
<assembly>
|
|
||||||
<inline>
|
|
||||||
<files>
|
|
||||||
<file>
|
|
||||||
<source>
|
|
||||||
${project.build.directory}/validationtool-${project.version}-standalone.jar
|
|
||||||
</source>
|
|
||||||
<destName>validationtool-standalone.jar</destName>
|
|
||||||
</file>
|
|
||||||
</files>
|
|
||||||
</inline>
|
|
||||||
</assembly>
|
|
||||||
</build>
|
|
||||||
<run>
|
|
||||||
<network>
|
|
||||||
<mode>bridge</mode>
|
|
||||||
</network>
|
|
||||||
<ports>
|
|
||||||
<port>8080:8080</port>
|
|
||||||
</ports>
|
|
||||||
<wait>
|
|
||||||
<time>5000</time>
|
|
||||||
</wait>
|
|
||||||
</run>
|
|
||||||
</image>
|
|
||||||
</images>
|
|
||||||
</configuration>
|
|
||||||
</execution>
|
|
||||||
<execution>
|
|
||||||
<id>down11</id>
|
|
||||||
<phase>post-integration-test</phase>
|
|
||||||
<goals>
|
|
||||||
<goal>stop</goal>
|
|
||||||
</goals>
|
|
||||||
</execution>
|
|
||||||
</executions>
|
|
||||||
</plugin>
|
|
||||||
|
|
||||||
</plugins>
|
|
||||||
</build>
|
|
||||||
</profile>
|
|
||||||
<profile>
|
|
||||||
<id>gitlab</id>
|
|
||||||
<properties>
|
|
||||||
<docker.host>host.docker.internal</docker.host>
|
|
||||||
</properties>
|
|
||||||
</profile>
|
|
||||||
</profiles>
|
|
||||||
<scm>
|
<scm>
|
||||||
<connection>https://github.com/itplr-kosit/validationtool.git</connection>
|
<connection>https://github.com/itplr-kosit/validationtool.git</connection>
|
||||||
<developerConnection>scm:git:https://github.com/itplr-kosit/validationtool.git</developerConnection>
|
<developerConnection>scm:git:https://github.com/itplr-kosit/validationtool.git</developerConnection>
|
||||||
|
|
@ -610,3 +460,21 @@
|
||||||
</scm>
|
</scm>
|
||||||
|
|
||||||
</project>
|
</project>
|
||||||
|
<!--
|
||||||
|
~ 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,8 +0,0 @@
|
||||||
FROM openjdk:11
|
|
||||||
|
|
||||||
RUN mkdir /opt/validationtool
|
|
||||||
ADD maven/validationtool-standalone.jar /opt/validationtool
|
|
||||||
ADD run.sh /opt/validationtool/
|
|
||||||
ADD config/ /opt/validationtool/
|
|
||||||
EXPOSE 8080
|
|
||||||
ENTRYPOINT ["bash", "/opt/validationtool/run.sh" ]
|
|
||||||
|
|
@ -1,8 +0,0 @@
|
||||||
FROM openjdk:8
|
|
||||||
|
|
||||||
RUN mkdir /opt/validationtool
|
|
||||||
ADD maven/validationtool-standalone.jar /opt/validationtool
|
|
||||||
ADD run.sh /opt/validationtool/
|
|
||||||
ADD config/ /opt/validationtool/
|
|
||||||
EXPOSE 8080
|
|
||||||
ENTRYPOINT ["bash", "/opt/validationtool/run.sh" ]
|
|
||||||
|
|
@ -1,8 +0,0 @@
|
||||||
FROM openjdk:8
|
|
||||||
|
|
||||||
RUN mkdir /opt/validationtool
|
|
||||||
ADD maven/validationtool-standalone.jar /opt/validationtool
|
|
||||||
ADD run.sh /opt/validationtool/
|
|
||||||
ADD config/ /opt/validationtool/
|
|
||||||
EXPOSE 8080
|
|
||||||
ENTRYPOINT ["bash", "/opt/validationtool/run.sh" ]
|
|
||||||
|
|
@ -1,769 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!--
|
|
||||||
~ 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.
|
|
||||||
-->
|
|
||||||
|
|
||||||
<!-- ====================================================================== -->
|
|
||||||
<!-- ===== CCTS Core Component Type Schema Module ===== -->
|
|
||||||
<!-- ====================================================================== -->
|
|
||||||
|
|
||||||
<xsd:schema xmlns:ccts="urn:un:unece:uncefact:documentation:2"
|
|
||||||
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
|
||||||
targetNamespace="urn:un:unece:uncefact:data:specification:CoreComponentTypeSchemaModule:2"
|
|
||||||
elementFormDefault="qualified"
|
|
||||||
attributeFormDefault="unqualified">
|
|
||||||
<!-- ===== Type Definitions ===== -->
|
|
||||||
<!-- =================================================================== -->
|
|
||||||
<!-- ===== CCT: AmountType ===== -->
|
|
||||||
<!-- =================================================================== -->
|
|
||||||
<xsd:complexType name="AmountType">
|
|
||||||
<xsd:annotation>
|
|
||||||
<xsd:documentation xml:lang="en">
|
|
||||||
<ccts:UniqueID>UNDT000001</ccts:UniqueID>
|
|
||||||
<ccts:CategoryCode>CCT</ccts:CategoryCode>
|
|
||||||
<ccts:DictionaryEntryName>Amount. Type</ccts:DictionaryEntryName>
|
|
||||||
<ccts:VersionID>1.0</ccts:VersionID>
|
|
||||||
<ccts:Definition>A number of monetary units specified in a currency where the unit of the currency is
|
|
||||||
explicit or implied.
|
|
||||||
</ccts:Definition>
|
|
||||||
<ccts:RepresentationTermName>Amount</ccts:RepresentationTermName>
|
|
||||||
<ccts:PrimitiveType>decimal</ccts:PrimitiveType>
|
|
||||||
</xsd:documentation>
|
|
||||||
</xsd:annotation>
|
|
||||||
<xsd:simpleContent>
|
|
||||||
<xsd:extension base="xsd:decimal">
|
|
||||||
<xsd:attribute name="currencyID" type="xsd:normalizedString" use="optional">
|
|
||||||
<xsd:annotation>
|
|
||||||
<xsd:documentation xml:lang="en">
|
|
||||||
<ccts:UniqueID>UNDT000001-SC2</ccts:UniqueID>
|
|
||||||
<ccts:CategoryCode>SC</ccts:CategoryCode>
|
|
||||||
<ccts:DictionaryEntryName>Amount Currency. Identifier</ccts:DictionaryEntryName>
|
|
||||||
<ccts:Definition>The currency of the amount.</ccts:Definition>
|
|
||||||
<ccts:ObjectClass>Amount Currency</ccts:ObjectClass>
|
|
||||||
<ccts:PropertyTermName>Identification</ccts:PropertyTermName>
|
|
||||||
<ccts:RepresentationTermName>Identifier</ccts:RepresentationTermName>
|
|
||||||
<ccts:PrimitiveType>string</ccts:PrimitiveType>
|
|
||||||
<ccts:UsageRule>Reference UNECE Rec 9, using 3-letter alphabetic codes.</ccts:UsageRule>
|
|
||||||
</xsd:documentation>
|
|
||||||
</xsd:annotation>
|
|
||||||
</xsd:attribute>
|
|
||||||
<xsd:attribute name="currencyCodeListVersionID" type="xsd:normalizedString" use="optional">
|
|
||||||
<xsd:annotation>
|
|
||||||
<xsd:documentation xml:lang="en">
|
|
||||||
<ccts:UniqueID>UNDT000001-SC3</ccts:UniqueID>
|
|
||||||
<ccts:CategoryCode>SC</ccts:CategoryCode>
|
|
||||||
<ccts:DictionaryEntryName>Amount Currency. Code List Version. Identifier
|
|
||||||
</ccts:DictionaryEntryName>
|
|
||||||
<ccts:Definition>The VersionID of the UN/ECE Rec9 code list.</ccts:Definition>
|
|
||||||
<ccts:ObjectClass>Amount Currency</ccts:ObjectClass>
|
|
||||||
<ccts:PropertyTermName>Code List Version</ccts:PropertyTermName>
|
|
||||||
<ccts:RepresentationTermName>Identifier</ccts:RepresentationTermName>
|
|
||||||
<ccts:PrimitiveType>string</ccts:PrimitiveType>
|
|
||||||
</xsd:documentation>
|
|
||||||
</xsd:annotation>
|
|
||||||
</xsd:attribute>
|
|
||||||
</xsd:extension>
|
|
||||||
</xsd:simpleContent>
|
|
||||||
</xsd:complexType>
|
|
||||||
<!-- ===== CCT: BinaryObjectType ===== -->
|
|
||||||
<!-- =================================================================== -->
|
|
||||||
<xsd:complexType name="BinaryObjectType">
|
|
||||||
<xsd:annotation>
|
|
||||||
<xsd:documentation xml:lang="en">
|
|
||||||
<ccts:UniqueID>UNDT000002</ccts:UniqueID>
|
|
||||||
<ccts:CategoryCode>CCT</ccts:CategoryCode>
|
|
||||||
<ccts:DictionaryEntryName>Binary Object. Type</ccts:DictionaryEntryName>
|
|
||||||
<ccts:VersionID>1.0</ccts:VersionID>
|
|
||||||
<ccts:Definition>A set of finite-length sequences of binary octets.</ccts:Definition>
|
|
||||||
<ccts:RepresentationTermName>Binary Object</ccts:RepresentationTermName>
|
|
||||||
<ccts:PrimitiveType>binary</ccts:PrimitiveType>
|
|
||||||
</xsd:documentation>
|
|
||||||
</xsd:annotation>
|
|
||||||
<xsd:simpleContent>
|
|
||||||
<xsd:extension base="xsd:base64Binary">
|
|
||||||
<xsd:attribute name="format" type="xsd:string" use="optional">
|
|
||||||
<xsd:annotation>
|
|
||||||
<xsd:documentation xml:lang="en">
|
|
||||||
<ccts:UniqueID>UNDT000002-SC2</ccts:UniqueID>
|
|
||||||
<ccts:CategoryCode>SC</ccts:CategoryCode>
|
|
||||||
<ccts:DictionaryEntryName>Binary Object. Format. Text</ccts:DictionaryEntryName>
|
|
||||||
<ccts:Definition>The format of the binary content.</ccts:Definition>
|
|
||||||
<ccts:ObjectClass>Binary Object</ccts:ObjectClass>
|
|
||||||
<ccts:PropertyTermName>Format</ccts:PropertyTermName>
|
|
||||||
<ccts:RepresentationTermName>Text</ccts:RepresentationTermName>
|
|
||||||
<ccts:PrimitiveType>string</ccts:PrimitiveType>
|
|
||||||
</xsd:documentation>
|
|
||||||
</xsd:annotation>
|
|
||||||
</xsd:attribute>
|
|
||||||
<xsd:attribute name="mimeCode" type="xsd:normalizedString" use="optional">
|
|
||||||
<xsd:annotation>
|
|
||||||
<xsd:documentation xml:lang="en">
|
|
||||||
<ccts:UniqueID>UNDT000002-SC3</ccts:UniqueID>
|
|
||||||
<ccts:CategoryCode>SC</ccts:CategoryCode>
|
|
||||||
<ccts:DictionaryEntryName>Binary Object. Mime. Code</ccts:DictionaryEntryName>
|
|
||||||
<ccts:Definition>The mime type of the binary object.</ccts:Definition>
|
|
||||||
<ccts:ObjectClass>Binary Object</ccts:ObjectClass>
|
|
||||||
<ccts:PropertyTermName>Mime</ccts:PropertyTermName>
|
|
||||||
<ccts:RepresentationTermName>Code</ccts:RepresentationTermName>
|
|
||||||
<ccts:PrimitiveType>string</ccts:PrimitiveType>
|
|
||||||
</xsd:documentation>
|
|
||||||
</xsd:annotation>
|
|
||||||
</xsd:attribute>
|
|
||||||
<xsd:attribute name="encodingCode" type="xsd:normalizedString" use="optional">
|
|
||||||
<xsd:annotation>
|
|
||||||
<xsd:documentation xml:lang="en">
|
|
||||||
<ccts:UniqueID>UNDT000002-SC4</ccts:UniqueID>
|
|
||||||
<ccts:CategoryCode>SC</ccts:CategoryCode>
|
|
||||||
<ccts:DictionaryEntryName>Binary Object. Encoding. Code</ccts:DictionaryEntryName>
|
|
||||||
<ccts:Definition>Specifies the decoding algorithm of the binary object.</ccts:Definition>
|
|
||||||
<ccts:ObjectClass>Binary Object</ccts:ObjectClass>
|
|
||||||
<ccts:PropertyTermName>Encoding</ccts:PropertyTermName>
|
|
||||||
<ccts:RepresentationTermName>Code</ccts:RepresentationTermName>
|
|
||||||
<ccts:PrimitiveType>string</ccts:PrimitiveType>
|
|
||||||
</xsd:documentation>
|
|
||||||
</xsd:annotation>
|
|
||||||
</xsd:attribute>
|
|
||||||
<xsd:attribute name="characterSetCode" type="xsd:normalizedString" use="optional">
|
|
||||||
<xsd:annotation>
|
|
||||||
<xsd:documentation xml:lang="en">
|
|
||||||
<ccts:UniqueID>UNDT000002-SC5</ccts:UniqueID>
|
|
||||||
<ccts:CategoryCode>SC</ccts:CategoryCode>
|
|
||||||
<ccts:DictionaryEntryName>Binary Object. Character Set. Code</ccts:DictionaryEntryName>
|
|
||||||
<ccts:Definition>The character set of the binary object if the mime type is text.
|
|
||||||
</ccts:Definition>
|
|
||||||
<ccts:ObjectClass>Binary Object</ccts:ObjectClass>
|
|
||||||
<ccts:PropertyTermName>Character Set</ccts:PropertyTermName>
|
|
||||||
<ccts:RepresentationTermName>Code</ccts:RepresentationTermName>
|
|
||||||
<ccts:PrimitiveType>string</ccts:PrimitiveType>
|
|
||||||
</xsd:documentation>
|
|
||||||
</xsd:annotation>
|
|
||||||
</xsd:attribute>
|
|
||||||
<xsd:attribute name="uri" type="xsd:anyURI" use="optional">
|
|
||||||
<xsd:annotation>
|
|
||||||
<xsd:documentation xml:lang="en">
|
|
||||||
<ccts:UniqueID>UNDT000002-SC6</ccts:UniqueID>
|
|
||||||
<ccts:CategoryCode>SC</ccts:CategoryCode>
|
|
||||||
<ccts:DictionaryEntryName>Binary Object. Uniform Resource. Identifier
|
|
||||||
</ccts:DictionaryEntryName>
|
|
||||||
<ccts:Definition>The Uniform Resource Identifier that identifies where the binary object is
|
|
||||||
located.
|
|
||||||
</ccts:Definition>
|
|
||||||
<ccts:ObjectClass>Binary Object</ccts:ObjectClass>
|
|
||||||
<ccts:PropertyTermName>Uniform Resource Identifier</ccts:PropertyTermName>
|
|
||||||
<ccts:RepresentationTermName>Identifier</ccts:RepresentationTermName>
|
|
||||||
<ccts:PrimitiveType>string</ccts:PrimitiveType>
|
|
||||||
</xsd:documentation>
|
|
||||||
</xsd:annotation>
|
|
||||||
</xsd:attribute>
|
|
||||||
<xsd:attribute name="filename" type="xsd:string" use="optional">
|
|
||||||
<xsd:annotation>
|
|
||||||
<xsd:documentation xml:lang="en">
|
|
||||||
<ccts:UniqueID>UNDT000002-SC7</ccts:UniqueID>
|
|
||||||
<ccts:CategoryCode>SC</ccts:CategoryCode>
|
|
||||||
<ccts:DictionaryEntryName>Binary Object. Filename.Text</ccts:DictionaryEntryName>
|
|
||||||
<ccts:Definition>The filename of the binary object.</ccts:Definition>
|
|
||||||
<ccts:ObjectClass>Binary Object</ccts:ObjectClass>
|
|
||||||
<ccts:PropertyTermName>Filename</ccts:PropertyTermName>
|
|
||||||
<ccts:RepresentationTermName>Text</ccts:RepresentationTermName>
|
|
||||||
<ccts:PrimitiveType>string</ccts:PrimitiveType>
|
|
||||||
</xsd:documentation>
|
|
||||||
</xsd:annotation>
|
|
||||||
</xsd:attribute>
|
|
||||||
</xsd:extension>
|
|
||||||
</xsd:simpleContent>
|
|
||||||
</xsd:complexType>
|
|
||||||
<!-- ===== CCT: CodeType ===== -->
|
|
||||||
<!-- =================================================================== -->
|
|
||||||
<xsd:complexType name="CodeType">
|
|
||||||
<xsd:annotation>
|
|
||||||
<xsd:documentation xml:lang="en">
|
|
||||||
<ccts:UniqueID>UNDT000007</ccts:UniqueID>
|
|
||||||
<ccts:CategoryCode>CCT</ccts:CategoryCode>
|
|
||||||
<ccts:DictionaryEntryName>Code. Type</ccts:DictionaryEntryName>
|
|
||||||
<ccts:VersionID>1.0</ccts:VersionID>
|
|
||||||
<ccts:Definition>A character string (letters, figures, or symbols) that for brevity and/or languange
|
|
||||||
independence may be used to represent or replace a definitive value or text of an attribute together
|
|
||||||
with relevant supplementary information.
|
|
||||||
</ccts:Definition>
|
|
||||||
<ccts:RepresentationTermName>Code</ccts:RepresentationTermName>
|
|
||||||
<ccts:PrimitiveType>string</ccts:PrimitiveType>
|
|
||||||
<ccts:UsageRule>Should not be used if the character string identifies an instance of an object class or
|
|
||||||
an object in the real world, in which case the Identifier. Type should be used.
|
|
||||||
</ccts:UsageRule>
|
|
||||||
</xsd:documentation>
|
|
||||||
</xsd:annotation>
|
|
||||||
<xsd:simpleContent>
|
|
||||||
<xsd:extension base="xsd:normalizedString">
|
|
||||||
<xsd:attribute name="listID" type="xsd:normalizedString" use="optional">
|
|
||||||
<xsd:annotation>
|
|
||||||
<xsd:documentation xml:lang="en">
|
|
||||||
<ccts:UniqueID>UNDT000007-SC2</ccts:UniqueID>
|
|
||||||
<ccts:CategoryCode>SC</ccts:CategoryCode>
|
|
||||||
<ccts:DictionaryEntryName>Code List. Identifier</ccts:DictionaryEntryName>
|
|
||||||
<ccts:Definition>The identification of a list of codes.</ccts:Definition>
|
|
||||||
<ccts:ObjectClass>Code List</ccts:ObjectClass>
|
|
||||||
<ccts:PropertyTermName>Identification</ccts:PropertyTermName>
|
|
||||||
<ccts:RepresentationTermName>Identifier</ccts:RepresentationTermName>
|
|
||||||
<ccts:PrimitiveType>string</ccts:PrimitiveType>
|
|
||||||
</xsd:documentation>
|
|
||||||
</xsd:annotation>
|
|
||||||
</xsd:attribute>
|
|
||||||
<xsd:attribute name="listAgencyID" type="xsd:normalizedString" use="optional">
|
|
||||||
<xsd:annotation>
|
|
||||||
<xsd:documentation xml:lang="en">
|
|
||||||
<ccts:UniqueID>UNDT000007-SC3</ccts:UniqueID>
|
|
||||||
<ccts:CategoryCode>SC</ccts:CategoryCode>
|
|
||||||
<ccts:DictionaryEntryName>Code List. Agency. Identifier</ccts:DictionaryEntryName>
|
|
||||||
<ccts:Definition>An agency that maintains one or more lists of codes.</ccts:Definition>
|
|
||||||
<ccts:ObjectClass>Code List</ccts:ObjectClass>
|
|
||||||
<ccts:PropertyTermName>Agency</ccts:PropertyTermName>
|
|
||||||
<ccts:RepresentationTermName>Identifier</ccts:RepresentationTermName>
|
|
||||||
<ccts:PrimitiveType>string</ccts:PrimitiveType>
|
|
||||||
<ccts:UsageRule>Defaults to the UN/EDIFACT data element 3055 code list.</ccts:UsageRule>
|
|
||||||
</xsd:documentation>
|
|
||||||
</xsd:annotation>
|
|
||||||
</xsd:attribute>
|
|
||||||
<xsd:attribute name="listAgencyName" type="xsd:string" use="optional">
|
|
||||||
<xsd:annotation>
|
|
||||||
<xsd:documentation xml:lang="en">
|
|
||||||
<ccts:UniqueID>UNDT000007-SC4</ccts:UniqueID>
|
|
||||||
<ccts:CategoryCode>SC</ccts:CategoryCode>
|
|
||||||
<ccts:DictionaryEntryName>Code List. Agency Name. Text</ccts:DictionaryEntryName>
|
|
||||||
<ccts:Definition>The name of the agency that maintains the list of codes.</ccts:Definition>
|
|
||||||
<ccts:ObjectClass>Code List</ccts:ObjectClass>
|
|
||||||
<ccts:PropertyTermName>Agency Name</ccts:PropertyTermName>
|
|
||||||
<ccts:RepresentationTermName>Text</ccts:RepresentationTermName>
|
|
||||||
<ccts:PrimitiveType>string</ccts:PrimitiveType>
|
|
||||||
</xsd:documentation>
|
|
||||||
</xsd:annotation>
|
|
||||||
</xsd:attribute>
|
|
||||||
<xsd:attribute name="listName" type="xsd:string" use="optional">
|
|
||||||
<xsd:annotation>
|
|
||||||
<xsd:documentation xml:lang="en">
|
|
||||||
<ccts:UniqueID>UNDT000007-SC5</ccts:UniqueID>
|
|
||||||
<ccts:CategoryCode>SC</ccts:CategoryCode>
|
|
||||||
<ccts:DictionaryEntryName>Code List. Name. Text</ccts:DictionaryEntryName>
|
|
||||||
<ccts:Definition>The name of a list of codes.</ccts:Definition>
|
|
||||||
<ccts:ObjectClass>Code List</ccts:ObjectClass>
|
|
||||||
<ccts:PropertyTermName>Name</ccts:PropertyTermName>
|
|
||||||
<ccts:RepresentationTermName>Text</ccts:RepresentationTermName>
|
|
||||||
<ccts:PrimitiveType>string</ccts:PrimitiveType>
|
|
||||||
</xsd:documentation>
|
|
||||||
</xsd:annotation>
|
|
||||||
</xsd:attribute>
|
|
||||||
<xsd:attribute name="listVersionID" type="xsd:normalizedString" use="optional">
|
|
||||||
<xsd:annotation>
|
|
||||||
<xsd:documentation xml:lang="en">
|
|
||||||
<ccts:UniqueID>UNDT000007-SC6</ccts:UniqueID>
|
|
||||||
<ccts:CategoryCode>SC</ccts:CategoryCode>
|
|
||||||
<ccts:DictionaryEntryName>Code List. Version. Identifier</ccts:DictionaryEntryName>
|
|
||||||
<ccts:Definition>The version of the list of codes.</ccts:Definition>
|
|
||||||
<ccts:ObjectClass>Code List</ccts:ObjectClass>
|
|
||||||
<ccts:PropertyTermName>Version</ccts:PropertyTermName>
|
|
||||||
<ccts:RepresentationTermName>Identifier</ccts:RepresentationTermName>
|
|
||||||
<ccts:PrimitiveType>string</ccts:PrimitiveType>
|
|
||||||
</xsd:documentation>
|
|
||||||
</xsd:annotation>
|
|
||||||
</xsd:attribute>
|
|
||||||
<xsd:attribute name="name" type="xsd:string" use="optional">
|
|
||||||
<xsd:annotation>
|
|
||||||
<xsd:documentation xml:lang="en">
|
|
||||||
<ccts:UniqueID>UNDT000007-SC7</ccts:UniqueID>
|
|
||||||
<ccts:CategoryCode>SC</ccts:CategoryCode>
|
|
||||||
<ccts:DictionaryEntryName>Code. Name. Text</ccts:DictionaryEntryName>
|
|
||||||
<ccts:Definition>The textual equivalent of the code content component.</ccts:Definition>
|
|
||||||
<ccts:ObjectClass>Code</ccts:ObjectClass>
|
|
||||||
<ccts:PropertyTermName>Name</ccts:PropertyTermName>
|
|
||||||
<ccts:RepresentationTermName>Text</ccts:RepresentationTermName>
|
|
||||||
<ccts:PrimitiveType>string</ccts:PrimitiveType>
|
|
||||||
</xsd:documentation>
|
|
||||||
</xsd:annotation>
|
|
||||||
</xsd:attribute>
|
|
||||||
<xsd:attribute name="languageID" type="xsd:language" use="optional">
|
|
||||||
<xsd:annotation>
|
|
||||||
<xsd:documentation xml:lang="en">
|
|
||||||
<ccts:UniqueID>UNDT000007-SC8</ccts:UniqueID>
|
|
||||||
<ccts:CategoryCode>SC</ccts:CategoryCode>
|
|
||||||
<ccts:DictionaryEntryName>Language. Identifier</ccts:DictionaryEntryName>
|
|
||||||
<ccts:Definition>The identifier of the language used in the code name.</ccts:Definition>
|
|
||||||
<ccts:ObjectClass>Language</ccts:ObjectClass>
|
|
||||||
<ccts:PropertyTermName>Identification</ccts:PropertyTermName>
|
|
||||||
<ccts:RepresentationTermName>Identifier</ccts:RepresentationTermName>
|
|
||||||
<ccts:PrimitiveType>string</ccts:PrimitiveType>
|
|
||||||
</xsd:documentation>
|
|
||||||
</xsd:annotation>
|
|
||||||
</xsd:attribute>
|
|
||||||
<xsd:attribute name="listURI" type="xsd:anyURI" use="optional">
|
|
||||||
<xsd:annotation>
|
|
||||||
<xsd:documentation xml:lang="en">
|
|
||||||
<ccts:UniqueID>UNDT000007-SC9</ccts:UniqueID>
|
|
||||||
<ccts:CategoryCode>SC</ccts:CategoryCode>
|
|
||||||
<ccts:DictionaryEntryName>Code List. Uniform Resource. Identifier</ccts:DictionaryEntryName>
|
|
||||||
<ccts:Definition>The Uniform Resource Identifier that identifies where the code list is
|
|
||||||
located.
|
|
||||||
</ccts:Definition>
|
|
||||||
<ccts:ObjectClass>Code List</ccts:ObjectClass>
|
|
||||||
<ccts:PropertyTermName>Uniform Resource Identifier</ccts:PropertyTermName>
|
|
||||||
<ccts:RepresentationTermName>Identifier</ccts:RepresentationTermName>
|
|
||||||
<ccts:PrimitiveType>string</ccts:PrimitiveType>
|
|
||||||
</xsd:documentation>
|
|
||||||
</xsd:annotation>
|
|
||||||
</xsd:attribute>
|
|
||||||
<xsd:attribute name="listSchemeURI" type="xsd:anyURI" use="optional">
|
|
||||||
<xsd:annotation>
|
|
||||||
<xsd:documentation xml:lang="en">
|
|
||||||
<ccts:UniqueID>UNDT000007-SC10</ccts:UniqueID>
|
|
||||||
<ccts:CategoryCode>SC</ccts:CategoryCode>
|
|
||||||
<ccts:DictionaryEntryName>Code List Scheme. Uniform Resource. Identifier
|
|
||||||
</ccts:DictionaryEntryName>
|
|
||||||
<ccts:Definition>The Uniform Resource Identifier that identifies where the code list scheme
|
|
||||||
is located.
|
|
||||||
</ccts:Definition>
|
|
||||||
<ccts:ObjectClass>Code List Scheme</ccts:ObjectClass>
|
|
||||||
<ccts:PropertyTermName>Uniform Resource Identifier</ccts:PropertyTermName>
|
|
||||||
<ccts:RepresentationTermName>Identifier</ccts:RepresentationTermName>
|
|
||||||
<ccts:PrimitiveType>string</ccts:PrimitiveType>
|
|
||||||
</xsd:documentation>
|
|
||||||
</xsd:annotation>
|
|
||||||
</xsd:attribute>
|
|
||||||
</xsd:extension>
|
|
||||||
</xsd:simpleContent>
|
|
||||||
</xsd:complexType>
|
|
||||||
<!-- ===== CCT: DateTimeType ===== -->
|
|
||||||
<!-- =================================================================== -->
|
|
||||||
<xsd:complexType name="DateTimeType">
|
|
||||||
<xsd:annotation>
|
|
||||||
<xsd:documentation xml:lang="en">
|
|
||||||
<ccts:UniqueID>UNDT000008</ccts:UniqueID>
|
|
||||||
<ccts:CategoryCode>CCT</ccts:CategoryCode>
|
|
||||||
<ccts:DictionaryEntryName>Date Time. Type</ccts:DictionaryEntryName>
|
|
||||||
<ccts:VersionID>1.0</ccts:VersionID>
|
|
||||||
<ccts:Definition>A particular point in the progression of time together with the relevant supplementary
|
|
||||||
information.
|
|
||||||
</ccts:Definition>
|
|
||||||
<ccts:RepresentationTermName>Date Time</ccts:RepresentationTermName>
|
|
||||||
<ccts:PrimitiveType>string</ccts:PrimitiveType>
|
|
||||||
<ccts:UsageRule>Can be used for a date and/or time.</ccts:UsageRule>
|
|
||||||
</xsd:documentation>
|
|
||||||
</xsd:annotation>
|
|
||||||
<xsd:simpleContent>
|
|
||||||
<xsd:extension base="xsd:string">
|
|
||||||
<xsd:attribute name="format" type="xsd:string" use="optional">
|
|
||||||
<xsd:annotation>
|
|
||||||
<xsd:documentation xml:lang="en">
|
|
||||||
<ccts:UniqueID>UNDT000008-SC1</ccts:UniqueID>
|
|
||||||
<ccts:CategoryCode>SC</ccts:CategoryCode>
|
|
||||||
<ccts:DictionaryEntryName>Date Time. Format. Text</ccts:DictionaryEntryName>
|
|
||||||
<ccts:Definition>The format of the date time content</ccts:Definition>
|
|
||||||
<ccts:ObjectClass>Date Time</ccts:ObjectClass>
|
|
||||||
<ccts:PropertyTermName>Format</ccts:PropertyTermName>
|
|
||||||
<ccts:RepresentationTermName>Text</ccts:RepresentationTermName>
|
|
||||||
<ccts:PrimitiveType>string</ccts:PrimitiveType>
|
|
||||||
</xsd:documentation>
|
|
||||||
</xsd:annotation>
|
|
||||||
</xsd:attribute>
|
|
||||||
</xsd:extension>
|
|
||||||
</xsd:simpleContent>
|
|
||||||
</xsd:complexType>
|
|
||||||
<!-- ===== CCT: IdentifierType ===== -->
|
|
||||||
<!-- =================================================================== -->
|
|
||||||
<xsd:complexType name="IdentifierType">
|
|
||||||
<xsd:annotation>
|
|
||||||
<xsd:documentation xml:lang="en">
|
|
||||||
<ccts:UniqueID>UNDT000011</ccts:UniqueID>
|
|
||||||
<ccts:CategoryCode>CCT</ccts:CategoryCode>
|
|
||||||
<ccts:DictionaryEntryName>Identifier. Type</ccts:DictionaryEntryName>
|
|
||||||
<ccts:VersionID>1.0</ccts:VersionID>
|
|
||||||
<ccts:Definition>A character string to identify and distinguish uniquely, one instance of an object in
|
|
||||||
an identification scheme from all other objects in the same scheme together with relevant
|
|
||||||
supplementary information.
|
|
||||||
</ccts:Definition>
|
|
||||||
<ccts:RepresentationTermName>Identifier</ccts:RepresentationTermName>
|
|
||||||
<ccts:PrimitiveType>string</ccts:PrimitiveType>
|
|
||||||
</xsd:documentation>
|
|
||||||
</xsd:annotation>
|
|
||||||
<xsd:simpleContent>
|
|
||||||
<xsd:extension base="xsd:normalizedString">
|
|
||||||
<xsd:attribute name="schemeID" type="xsd:normalizedString" use="optional">
|
|
||||||
<xsd:annotation>
|
|
||||||
<xsd:documentation xml:lang="en">
|
|
||||||
<ccts:UniqueID>UNDT000011-SC2</ccts:UniqueID>
|
|
||||||
<ccts:CategoryCode>SC</ccts:CategoryCode>
|
|
||||||
<ccts:DictionaryEntryName>Identification Scheme. Identifier</ccts:DictionaryEntryName>
|
|
||||||
<ccts:Definition>The identification of the identification scheme.</ccts:Definition>
|
|
||||||
<ccts:ObjectClass>Identification Scheme</ccts:ObjectClass>
|
|
||||||
<ccts:PropertyTermName>Identification</ccts:PropertyTermName>
|
|
||||||
<ccts:RepresentationTermName>Identifier</ccts:RepresentationTermName>
|
|
||||||
<ccts:PrimitiveType>string</ccts:PrimitiveType>
|
|
||||||
</xsd:documentation>
|
|
||||||
</xsd:annotation>
|
|
||||||
</xsd:attribute>
|
|
||||||
<xsd:attribute name="schemeName" type="xsd:string" use="optional">
|
|
||||||
<xsd:annotation>
|
|
||||||
<xsd:documentation xml:lang="en">
|
|
||||||
<ccts:UniqueID>UNDT000011-SC3</ccts:UniqueID>
|
|
||||||
<ccts:CategoryCode>SC</ccts:CategoryCode>
|
|
||||||
<ccts:DictionaryEntryName>Identification Scheme. Name. Text</ccts:DictionaryEntryName>
|
|
||||||
<ccts:Definition>The name of the identification scheme.</ccts:Definition>
|
|
||||||
<ccts:ObjectClass>Identification Scheme</ccts:ObjectClass>
|
|
||||||
<ccts:PropertyTermName>Name</ccts:PropertyTermName>
|
|
||||||
<ccts:RepresentationTermName>Text</ccts:RepresentationTermName>
|
|
||||||
<ccts:PrimitiveType>string</ccts:PrimitiveType>
|
|
||||||
</xsd:documentation>
|
|
||||||
</xsd:annotation>
|
|
||||||
</xsd:attribute>
|
|
||||||
<xsd:attribute name="schemeAgencyID" type="xsd:normalizedString" use="optional">
|
|
||||||
<xsd:annotation>
|
|
||||||
<xsd:documentation xml:lang="en">
|
|
||||||
<ccts:UniqueID>UNDT000011-SC4</ccts:UniqueID>
|
|
||||||
<ccts:CategoryCode>SC</ccts:CategoryCode>
|
|
||||||
<ccts:DictionaryEntryName>Identification Scheme Agency. Identifier
|
|
||||||
</ccts:DictionaryEntryName>
|
|
||||||
<ccts:Definition>The identification of the agency that maintains the identification
|
|
||||||
scheme.
|
|
||||||
</ccts:Definition>
|
|
||||||
<ccts:ObjectClass>Identification Scheme Agency</ccts:ObjectClass>
|
|
||||||
<ccts:PropertyTermName>Identification</ccts:PropertyTermName>
|
|
||||||
<ccts:RepresentationTermName>Identifier</ccts:RepresentationTermName>
|
|
||||||
<ccts:PrimitiveType>string</ccts:PrimitiveType>
|
|
||||||
<ccts:UsageRule>Defaults to the UN/EDIFACT data element 3055 code list.</ccts:UsageRule>
|
|
||||||
</xsd:documentation>
|
|
||||||
</xsd:annotation>
|
|
||||||
</xsd:attribute>
|
|
||||||
<xsd:attribute name="schemeAgencyName" type="xsd:string" use="optional">
|
|
||||||
<xsd:annotation>
|
|
||||||
<xsd:documentation xml:lang="en">
|
|
||||||
<ccts:UniqueID>UNDT000011-SC5</ccts:UniqueID>
|
|
||||||
<ccts:CategoryCode>SC</ccts:CategoryCode>
|
|
||||||
<ccts:DictionaryEntryName>Identification Scheme Agency. Name. Text
|
|
||||||
</ccts:DictionaryEntryName>
|
|
||||||
<ccts:Definition>The name of the agency that maintains the identification scheme.
|
|
||||||
</ccts:Definition>
|
|
||||||
<ccts:ObjectClass>Identification Scheme Agency</ccts:ObjectClass>
|
|
||||||
<ccts:PropertyTermName>Agency Name</ccts:PropertyTermName>
|
|
||||||
<ccts:RepresentationTermName>Text</ccts:RepresentationTermName>
|
|
||||||
<ccts:PrimitiveType>string</ccts:PrimitiveType>
|
|
||||||
</xsd:documentation>
|
|
||||||
</xsd:annotation>
|
|
||||||
</xsd:attribute>
|
|
||||||
<xsd:attribute name="schemeVersionID" type="xsd:normalizedString" use="optional">
|
|
||||||
<xsd:annotation>
|
|
||||||
<xsd:documentation xml:lang="en">
|
|
||||||
<ccts:UniqueID>UNDT000011-SC6</ccts:UniqueID>
|
|
||||||
<ccts:CategoryCode>SC</ccts:CategoryCode>
|
|
||||||
<ccts:DictionaryEntryName>Identification Scheme. Version. Identifier
|
|
||||||
</ccts:DictionaryEntryName>
|
|
||||||
<ccts:Definition>The version of the identification scheme.</ccts:Definition>
|
|
||||||
<ccts:ObjectClass>Identification Scheme</ccts:ObjectClass>
|
|
||||||
<ccts:PropertyTermName>Version</ccts:PropertyTermName>
|
|
||||||
<ccts:RepresentationTermName>Identifier</ccts:RepresentationTermName>
|
|
||||||
<ccts:PrimitiveType>string</ccts:PrimitiveType>
|
|
||||||
</xsd:documentation>
|
|
||||||
</xsd:annotation>
|
|
||||||
</xsd:attribute>
|
|
||||||
<xsd:attribute name="schemeDataURI" type="xsd:anyURI" use="optional">
|
|
||||||
<xsd:annotation>
|
|
||||||
<xsd:documentation xml:lang="en">
|
|
||||||
<ccts:UniqueID>UNDT000011-SC7</ccts:UniqueID>
|
|
||||||
<ccts:CategoryCode>SC</ccts:CategoryCode>
|
|
||||||
<ccts:DictionaryEntryName>Identification Scheme Data. Uniform Resource. Identifier
|
|
||||||
</ccts:DictionaryEntryName>
|
|
||||||
<ccts:Definition>The Uniform Resource Identifier that identifies where the identification
|
|
||||||
scheme data is located.
|
|
||||||
</ccts:Definition>
|
|
||||||
<ccts:ObjectClass>Identification Scheme Data</ccts:ObjectClass>
|
|
||||||
<ccts:PropertyTermName>Uniform Resource Identifier</ccts:PropertyTermName>
|
|
||||||
<ccts:RepresentationTermName>Identifier</ccts:RepresentationTermName>
|
|
||||||
<ccts:PrimitiveType>string</ccts:PrimitiveType>
|
|
||||||
</xsd:documentation>
|
|
||||||
</xsd:annotation>
|
|
||||||
</xsd:attribute>
|
|
||||||
<xsd:attribute name="schemeURI" type="xsd:anyURI" use="optional">
|
|
||||||
<xsd:annotation>
|
|
||||||
<xsd:documentation xml:lang="en">
|
|
||||||
<ccts:UniqueID>UNDT000011-SC8</ccts:UniqueID>
|
|
||||||
<ccts:CategoryCode>SC</ccts:CategoryCode>
|
|
||||||
<ccts:DictionaryEntryName>Identification Scheme. Uniform Resource. Identifier
|
|
||||||
</ccts:DictionaryEntryName>
|
|
||||||
<ccts:Definition>The Uniform Resource Identifier that identifies where the identification
|
|
||||||
scheme is located.
|
|
||||||
</ccts:Definition>
|
|
||||||
<ccts:ObjectClass>Identification Scheme</ccts:ObjectClass>
|
|
||||||
<ccts:PropertyTermName>Uniform Resource Identifier</ccts:PropertyTermName>
|
|
||||||
<ccts:RepresentationTermName>Identifier</ccts:RepresentationTermName>
|
|
||||||
<ccts:PrimitiveType>string</ccts:PrimitiveType>
|
|
||||||
</xsd:documentation>
|
|
||||||
</xsd:annotation>
|
|
||||||
</xsd:attribute>
|
|
||||||
</xsd:extension>
|
|
||||||
</xsd:simpleContent>
|
|
||||||
</xsd:complexType>
|
|
||||||
<!-- ===== CCT: IndicatorType ===== -->
|
|
||||||
<!-- =================================================================== -->
|
|
||||||
<xsd:complexType name="IndicatorType">
|
|
||||||
<xsd:annotation>
|
|
||||||
<xsd:documentation xml:lang="en">
|
|
||||||
<ccts:UniqueID>UNDT000012</ccts:UniqueID>
|
|
||||||
<ccts:CategoryCode>CCT</ccts:CategoryCode>
|
|
||||||
<ccts:DictionaryEntryName>Indicator. Type</ccts:DictionaryEntryName>
|
|
||||||
<ccts:VersionID>1.0</ccts:VersionID>
|
|
||||||
<ccts:Definition>A list of two mutually exclusive Boolean values that express the only possible states
|
|
||||||
of a Property.
|
|
||||||
</ccts:Definition>
|
|
||||||
<ccts:RepresentationTermName>Indicator</ccts:RepresentationTermName>
|
|
||||||
<ccts:PrimitiveType>string</ccts:PrimitiveType>
|
|
||||||
</xsd:documentation>
|
|
||||||
</xsd:annotation>
|
|
||||||
<xsd:simpleContent>
|
|
||||||
<xsd:extension base="xsd:string">
|
|
||||||
<xsd:attribute name="format" type="xsd:string" use="optional">
|
|
||||||
<xsd:annotation>
|
|
||||||
<xsd:documentation xml:lang="en">
|
|
||||||
<ccts:UniqueID>UNDT000012-SC2</ccts:UniqueID>
|
|
||||||
<ccts:CategoryCode>SC</ccts:CategoryCode>
|
|
||||||
<ccts:DictionaryEntryName>Indicator. Format. Text</ccts:DictionaryEntryName>
|
|
||||||
<ccts:Definition>Whether the indicator is numeric, textual or binary.</ccts:Definition>
|
|
||||||
<ccts:ObjectClass>Indicator</ccts:ObjectClass>
|
|
||||||
<ccts:PropertyTermName>Format</ccts:PropertyTermName>
|
|
||||||
<ccts:RepresentationTermName>Text</ccts:RepresentationTermName>
|
|
||||||
<ccts:PrimitiveType>string</ccts:PrimitiveType>
|
|
||||||
</xsd:documentation>
|
|
||||||
</xsd:annotation>
|
|
||||||
</xsd:attribute>
|
|
||||||
</xsd:extension>
|
|
||||||
</xsd:simpleContent>
|
|
||||||
</xsd:complexType>
|
|
||||||
<!-- ===== CCT: MeasureType ===== -->
|
|
||||||
<!-- =================================================================== -->
|
|
||||||
<xsd:complexType name="MeasureType">
|
|
||||||
<xsd:annotation>
|
|
||||||
<xsd:documentation xml:lang="en">
|
|
||||||
<ccts:UniqueID>UNDT000013</ccts:UniqueID>
|
|
||||||
<ccts:CategoryCode>CCT</ccts:CategoryCode>
|
|
||||||
<ccts:DictionaryEntryName>Measure. Type</ccts:DictionaryEntryName>
|
|
||||||
<ccts:VersionID>1.0</ccts:VersionID>
|
|
||||||
<ccts:Definition>A numeric value determined by measuring an object along with the specified unit of
|
|
||||||
measure.
|
|
||||||
</ccts:Definition>
|
|
||||||
<ccts:RepresentationTermName>Measure</ccts:RepresentationTermName>
|
|
||||||
<ccts:PrimitiveType>decimal</ccts:PrimitiveType>
|
|
||||||
</xsd:documentation>
|
|
||||||
</xsd:annotation>
|
|
||||||
<xsd:simpleContent>
|
|
||||||
<xsd:extension base="xsd:decimal">
|
|
||||||
<xsd:attribute name="unitCode" type="xsd:normalizedString" use="optional">
|
|
||||||
<xsd:annotation>
|
|
||||||
<xsd:documentation xml:lang="en">
|
|
||||||
<ccts:UniqueID>UNDT000013-SC2</ccts:UniqueID>
|
|
||||||
<ccts:CategoryCode>SC</ccts:CategoryCode>
|
|
||||||
<ccts:DictionaryEntryName>Measure Unit. Code</ccts:DictionaryEntryName>
|
|
||||||
<ccts:Definition>The type of unit of measure.</ccts:Definition>
|
|
||||||
<ccts:ObjectClass>Measure Unit</ccts:ObjectClass>
|
|
||||||
<ccts:PropertyTermName>Code</ccts:PropertyTermName>
|
|
||||||
<ccts:RepresentationTermName>Code</ccts:RepresentationTermName>
|
|
||||||
<ccts:PrimitiveType>string</ccts:PrimitiveType>
|
|
||||||
<ccts:UsageRule>Reference UNECE Rec. 20 and X12 355</ccts:UsageRule>
|
|
||||||
</xsd:documentation>
|
|
||||||
</xsd:annotation>
|
|
||||||
</xsd:attribute>
|
|
||||||
<xsd:attribute name="unitCodeListVersionID" type="xsd:normalizedString" use="optional">
|
|
||||||
<xsd:annotation>
|
|
||||||
<xsd:documentation xml:lang="en">
|
|
||||||
<ccts:UniqueID>UNDT000013-SC3</ccts:UniqueID>
|
|
||||||
<ccts:CategoryCode>SC</ccts:CategoryCode>
|
|
||||||
<ccts:DictionaryEntryName>Measure Unit. Code List Version. Identifier
|
|
||||||
</ccts:DictionaryEntryName>
|
|
||||||
<ccts:Definition>The version of the measure unit code list.</ccts:Definition>
|
|
||||||
<ccts:ObjectClass>Measure Unit</ccts:ObjectClass>
|
|
||||||
<ccts:PropertyTermName>Code List Version</ccts:PropertyTermName>
|
|
||||||
<ccts:RepresentationTermName>Identifier</ccts:RepresentationTermName>
|
|
||||||
<ccts:PrimitiveType>string</ccts:PrimitiveType>
|
|
||||||
</xsd:documentation>
|
|
||||||
</xsd:annotation>
|
|
||||||
</xsd:attribute>
|
|
||||||
</xsd:extension>
|
|
||||||
</xsd:simpleContent>
|
|
||||||
</xsd:complexType>
|
|
||||||
<!-- ===== CCT: NumericType ===== -->
|
|
||||||
<!-- =================================================================== -->
|
|
||||||
<xsd:complexType name="NumericType">
|
|
||||||
<xsd:annotation>
|
|
||||||
<xsd:documentation xml:lang="en">
|
|
||||||
<ccts:UniqueID>UNDT000014</ccts:UniqueID>
|
|
||||||
<ccts:CategoryCode>CCT</ccts:CategoryCode>
|
|
||||||
<ccts:DictionaryEntryName>Numeric. Type</ccts:DictionaryEntryName>
|
|
||||||
<ccts:VersionID>1.0</ccts:VersionID>
|
|
||||||
<ccts:Definition>Numeric information that is assigned or is determined by calculation, counting, or
|
|
||||||
sequencing. It does not require a unit of quantity or unit of measure.
|
|
||||||
</ccts:Definition>
|
|
||||||
<ccts:RepresentationTermName>Numeric</ccts:RepresentationTermName>
|
|
||||||
<ccts:PrimitiveType>string</ccts:PrimitiveType>
|
|
||||||
</xsd:documentation>
|
|
||||||
</xsd:annotation>
|
|
||||||
<xsd:simpleContent>
|
|
||||||
<xsd:extension base="xsd:decimal">
|
|
||||||
<xsd:attribute name="format" type="xsd:string" use="optional">
|
|
||||||
<xsd:annotation>
|
|
||||||
<xsd:documentation xml:lang="en">
|
|
||||||
<ccts:UniqueID>UNDT000014-SC2</ccts:UniqueID>
|
|
||||||
<ccts:CategoryCode>SC</ccts:CategoryCode>
|
|
||||||
<ccts:DictionaryEntryName>Numeric. Format. Text</ccts:DictionaryEntryName>
|
|
||||||
<ccts:Definition>Whether the number is an integer, decimal, real number or percentage.
|
|
||||||
</ccts:Definition>
|
|
||||||
<ccts:ObjectClass>Numeric</ccts:ObjectClass>
|
|
||||||
<ccts:PropertyTermName>Format</ccts:PropertyTermName>
|
|
||||||
<ccts:RepresentationTermName>Text</ccts:RepresentationTermName>
|
|
||||||
<ccts:PrimitiveType>string</ccts:PrimitiveType>
|
|
||||||
</xsd:documentation>
|
|
||||||
</xsd:annotation>
|
|
||||||
</xsd:attribute>
|
|
||||||
</xsd:extension>
|
|
||||||
</xsd:simpleContent>
|
|
||||||
</xsd:complexType>
|
|
||||||
<!-- ===== CCT: QuantityType ===== -->
|
|
||||||
<!-- =================================================================== -->
|
|
||||||
<xsd:complexType name="QuantityType">
|
|
||||||
<xsd:annotation>
|
|
||||||
<xsd:documentation xml:lang="en">
|
|
||||||
<ccts:UniqueID>UNDT000018</ccts:UniqueID>
|
|
||||||
<ccts:CategoryCode>CCT</ccts:CategoryCode>
|
|
||||||
<ccts:DictionaryEntryName>Quantity. Type</ccts:DictionaryEntryName>
|
|
||||||
<ccts:VersionID>1.0</ccts:VersionID>
|
|
||||||
<ccts:Definition>A counted number of non-monetary units possibly including fractions.</ccts:Definition>
|
|
||||||
<ccts:RepresentationTermName>Quantity</ccts:RepresentationTermName>
|
|
||||||
<ccts:PrimitiveType>decimal</ccts:PrimitiveType>
|
|
||||||
</xsd:documentation>
|
|
||||||
</xsd:annotation>
|
|
||||||
<xsd:simpleContent>
|
|
||||||
<xsd:extension base="xsd:decimal">
|
|
||||||
<xsd:attribute name="unitCode" type="xsd:normalizedString" use="optional">
|
|
||||||
<xsd:annotation>
|
|
||||||
<xsd:documentation xml:lang="en">
|
|
||||||
<ccts:UniqueID>UNDT000018-SC2</ccts:UniqueID>
|
|
||||||
<ccts:CategoryCode>SC</ccts:CategoryCode>
|
|
||||||
<ccts:DictionaryEntryName>Quantity. Unit. Code</ccts:DictionaryEntryName>
|
|
||||||
<ccts:Definition>The unit of the quantity</ccts:Definition>
|
|
||||||
<ccts:ObjectClass>Quantity</ccts:ObjectClass>
|
|
||||||
<ccts:PropertyTermName>Unit Code</ccts:PropertyTermName>
|
|
||||||
<ccts:RepresentationTermName>Code</ccts:RepresentationTermName>
|
|
||||||
<ccts:PrimitiveType>string</ccts:PrimitiveType>
|
|
||||||
</xsd:documentation>
|
|
||||||
</xsd:annotation>
|
|
||||||
</xsd:attribute>
|
|
||||||
<xsd:attribute name="unitCodeListID" type="xsd:normalizedString" use="optional">
|
|
||||||
<xsd:annotation>
|
|
||||||
<xsd:documentation xml:lang="en">
|
|
||||||
<ccts:UniqueID>UNDT000018-SC3</ccts:UniqueID>
|
|
||||||
<ccts:CategoryCode>SC</ccts:CategoryCode>
|
|
||||||
<ccts:DictionaryEntryName>Quantity Unit. Code List. Identifier</ccts:DictionaryEntryName>
|
|
||||||
<ccts:Definition>The quantity unit code list.</ccts:Definition>
|
|
||||||
<ccts:ObjectClass>Quantity Unit</ccts:ObjectClass>
|
|
||||||
<ccts:PropertyTermName>Code List</ccts:PropertyTermName>
|
|
||||||
<ccts:RepresentationTermName>Identifier</ccts:RepresentationTermName>
|
|
||||||
<ccts:PrimitiveType>string</ccts:PrimitiveType>
|
|
||||||
</xsd:documentation>
|
|
||||||
</xsd:annotation>
|
|
||||||
</xsd:attribute>
|
|
||||||
<xsd:attribute name="unitCodeListAgencyID" type="xsd:normalizedString" use="optional">
|
|
||||||
<xsd:annotation>
|
|
||||||
<xsd:documentation xml:lang="en">
|
|
||||||
<ccts:UniqueID>UNDT000018-SC4</ccts:UniqueID>
|
|
||||||
<ccts:CategoryCode>SC</ccts:CategoryCode>
|
|
||||||
<ccts:DictionaryEntryName>Quantity Unit. Code List Agency. Identifier
|
|
||||||
</ccts:DictionaryEntryName>
|
|
||||||
<ccts:Definition>The identification of the agency that maintains the quantity unit code
|
|
||||||
list
|
|
||||||
</ccts:Definition>
|
|
||||||
<ccts:ObjectClass>Quantity Unit</ccts:ObjectClass>
|
|
||||||
<ccts:PropertyTermName>Code List Agency</ccts:PropertyTermName>
|
|
||||||
<ccts:RepresentationTermName>Identifier</ccts:RepresentationTermName>
|
|
||||||
<ccts:PrimitiveType>string</ccts:PrimitiveType>
|
|
||||||
<ccts:UsageRule>Defaults to the UN/EDIFACT data element 3055 code list.</ccts:UsageRule>
|
|
||||||
</xsd:documentation>
|
|
||||||
</xsd:annotation>
|
|
||||||
</xsd:attribute>
|
|
||||||
<xsd:attribute name="unitCodeListAgencyName" type="xsd:string" use="optional">
|
|
||||||
<xsd:annotation>
|
|
||||||
<xsd:documentation xml:lang="en">
|
|
||||||
<ccts:UniqueID>UNDT000018-SC5</ccts:UniqueID>
|
|
||||||
<ccts:CategoryCode>SC</ccts:CategoryCode>
|
|
||||||
<ccts:DictionaryEntryName>Quantity Unit. Code List Agency Name. Text
|
|
||||||
</ccts:DictionaryEntryName>
|
|
||||||
<ccts:Definition>The name of the agency which maintains the quantity unit code list.
|
|
||||||
</ccts:Definition>
|
|
||||||
<ccts:ObjectClass>Quantity Unit</ccts:ObjectClass>
|
|
||||||
<ccts:PropertyTermName>Code List Agency Name</ccts:PropertyTermName>
|
|
||||||
<ccts:RepresentationTermName>Text</ccts:RepresentationTermName>
|
|
||||||
<ccts:PrimitiveType>string</ccts:PrimitiveType>
|
|
||||||
</xsd:documentation>
|
|
||||||
</xsd:annotation>
|
|
||||||
</xsd:attribute>
|
|
||||||
</xsd:extension>
|
|
||||||
</xsd:simpleContent>
|
|
||||||
</xsd:complexType>
|
|
||||||
<!-- ===== CCT: TextType ===== -->
|
|
||||||
<!-- =================================================================== -->
|
|
||||||
<xsd:complexType name="TextType">
|
|
||||||
<xsd:annotation>
|
|
||||||
<xsd:documentation xml:lang="en">
|
|
||||||
<ccts:UniqueID>UNDT000019</ccts:UniqueID>
|
|
||||||
<ccts:CategoryCode>CCT</ccts:CategoryCode>
|
|
||||||
<ccts:DictionaryEntryName>Text. Type</ccts:DictionaryEntryName>
|
|
||||||
<ccts:VersionID>1.0</ccts:VersionID>
|
|
||||||
<ccts:Definition>A character string (i.e. a finite set of characters) generally in the form of words of
|
|
||||||
a language.
|
|
||||||
</ccts:Definition>
|
|
||||||
<ccts:RepresentationTermName>Text</ccts:RepresentationTermName>
|
|
||||||
<ccts:PrimitiveType>string</ccts:PrimitiveType>
|
|
||||||
</xsd:documentation>
|
|
||||||
</xsd:annotation>
|
|
||||||
<xsd:simpleContent>
|
|
||||||
<xsd:extension base="xsd:string">
|
|
||||||
<xsd:attribute name="languageID" type="xsd:language" use="optional">
|
|
||||||
<xsd:annotation>
|
|
||||||
<xsd:documentation xml:lang="en">
|
|
||||||
<ccts:UniqueID>UNDT000019-SC2</ccts:UniqueID>
|
|
||||||
<ccts:CategoryCode>SC</ccts:CategoryCode>
|
|
||||||
<ccts:DictionaryEntryName>Language. Identifier</ccts:DictionaryEntryName>
|
|
||||||
<ccts:Definition>The identifier of the language used in the content component.
|
|
||||||
</ccts:Definition>
|
|
||||||
<ccts:ObjectClass>Language</ccts:ObjectClass>
|
|
||||||
<ccts:PropertyTermName>Identification</ccts:PropertyTermName>
|
|
||||||
<ccts:RepresentationTermName>Identifier</ccts:RepresentationTermName>
|
|
||||||
<ccts:PrimitiveType>string</ccts:PrimitiveType>
|
|
||||||
</xsd:documentation>
|
|
||||||
</xsd:annotation>
|
|
||||||
</xsd:attribute>
|
|
||||||
<xsd:attribute name="languageLocaleID" type="xsd:normalizedString" use="optional">
|
|
||||||
<xsd:annotation>
|
|
||||||
<xsd:documentation xml:lang="en">
|
|
||||||
<ccts:UniqueID>UNDT000019-SC3</ccts:UniqueID>
|
|
||||||
<ccts:CategoryCode>SC</ccts:CategoryCode>
|
|
||||||
<ccts:DictionaryEntryName>Language. Locale. Identifier</ccts:DictionaryEntryName>
|
|
||||||
<ccts:Definition>The identification of the locale of the language.</ccts:Definition>
|
|
||||||
<ccts:ObjectClass>Language</ccts:ObjectClass>
|
|
||||||
<ccts:PropertyTermName>Locale</ccts:PropertyTermName>
|
|
||||||
<ccts:RepresentationTermName>Identifier</ccts:RepresentationTermName>
|
|
||||||
<ccts:PrimitiveType>string</ccts:PrimitiveType>
|
|
||||||
</xsd:documentation>
|
|
||||||
</xsd:annotation>
|
|
||||||
</xsd:attribute>
|
|
||||||
</xsd:extension>
|
|
||||||
</xsd:simpleContent>
|
|
||||||
</xsd:complexType>
|
|
||||||
</xsd:schema>
|
|
||||||
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
|
@ -1,235 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!--
|
|
||||||
~ 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.
|
|
||||||
-->
|
|
||||||
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
|
||||||
xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2"
|
|
||||||
xmlns:udt="urn:oasis:names:specification:ubl:schema:xsd:UnqualifiedDataTypes-2"
|
|
||||||
xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonExtensionComponents-2"
|
|
||||||
targetNamespace="urn:oasis:names:specification:ubl:schema:xsd:CommonExtensionComponents-2"
|
|
||||||
elementFormDefault="qualified" attributeFormDefault="unqualified"
|
|
||||||
version="2.1">
|
|
||||||
<!-- ===== Imports ===== -->
|
|
||||||
<xsd:import namespace="urn:oasis:names:specification:ubl:schema:xsd:UnqualifiedDataTypes-2"
|
|
||||||
schemaLocation="UBL-UnqualifiedDataTypes-2.1.xsd" />
|
|
||||||
<xsd:import namespace="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2"
|
|
||||||
schemaLocation="UBL-CommonBasicComponents-2.1.xsd" />
|
|
||||||
<!-- ===== Includes ===== -->
|
|
||||||
<xsd:include schemaLocation="UBL-ExtensionContentDataType-2.1.xsd" />
|
|
||||||
<!-- ===== Aggregate Element and Type Declarations ===== -->
|
|
||||||
<xsd:element name="UBLExtensions" type="UBLExtensionsType">
|
|
||||||
<xsd:annotation>
|
|
||||||
<xsd:documentation>
|
|
||||||
A container for all extensions present in the document.
|
|
||||||
</xsd:documentation>
|
|
||||||
</xsd:annotation>
|
|
||||||
</xsd:element>
|
|
||||||
<xsd:complexType name="UBLExtensionsType">
|
|
||||||
<xsd:annotation>
|
|
||||||
<xsd:documentation>
|
|
||||||
A container for all extensions present in the document.
|
|
||||||
</xsd:documentation>
|
|
||||||
</xsd:annotation>
|
|
||||||
<xsd:sequence>
|
|
||||||
<xsd:element ref="UBLExtension" minOccurs="1" maxOccurs="unbounded">
|
|
||||||
<xsd:annotation>
|
|
||||||
<xsd:documentation>
|
|
||||||
A single extension for private use.
|
|
||||||
</xsd:documentation>
|
|
||||||
</xsd:annotation>
|
|
||||||
</xsd:element>
|
|
||||||
</xsd:sequence>
|
|
||||||
</xsd:complexType>
|
|
||||||
<xsd:element name="UBLExtension" type="UBLExtensionType">
|
|
||||||
<xsd:annotation>
|
|
||||||
<xsd:documentation>
|
|
||||||
A single extension for private use.
|
|
||||||
</xsd:documentation>
|
|
||||||
</xsd:annotation>
|
|
||||||
</xsd:element>
|
|
||||||
<xsd:complexType name="UBLExtensionType">
|
|
||||||
<xsd:annotation>
|
|
||||||
<xsd:documentation>
|
|
||||||
A single extension for private use.
|
|
||||||
</xsd:documentation>
|
|
||||||
</xsd:annotation>
|
|
||||||
<xsd:sequence>
|
|
||||||
<xsd:element ref="cbc:ID" minOccurs="0" maxOccurs="1">
|
|
||||||
<xsd:annotation>
|
|
||||||
<xsd:documentation>
|
|
||||||
An identifier for the Extension assigned by the creator of the extension.
|
|
||||||
</xsd:documentation>
|
|
||||||
</xsd:annotation>
|
|
||||||
</xsd:element>
|
|
||||||
<xsd:element ref="cbc:Name" minOccurs="0" maxOccurs="1">
|
|
||||||
<xsd:annotation>
|
|
||||||
<xsd:documentation>
|
|
||||||
A name for the Extension assigned by the creator of the extension.
|
|
||||||
</xsd:documentation>
|
|
||||||
</xsd:annotation>
|
|
||||||
</xsd:element>
|
|
||||||
<xsd:element ref="ExtensionAgencyID" minOccurs="0" maxOccurs="1">
|
|
||||||
<xsd:annotation>
|
|
||||||
<xsd:documentation>
|
|
||||||
An agency that maintains one or more Extensions.
|
|
||||||
</xsd:documentation>
|
|
||||||
</xsd:annotation>
|
|
||||||
</xsd:element>
|
|
||||||
<xsd:element ref="ExtensionAgencyName" minOccurs="0" maxOccurs="1">
|
|
||||||
<xsd:annotation>
|
|
||||||
<xsd:documentation>
|
|
||||||
The name of the agency that maintains the Extension.
|
|
||||||
</xsd:documentation>
|
|
||||||
</xsd:annotation>
|
|
||||||
</xsd:element>
|
|
||||||
<xsd:element ref="ExtensionVersionID" minOccurs="0" maxOccurs="1">
|
|
||||||
<xsd:annotation>
|
|
||||||
<xsd:documentation>
|
|
||||||
The version of the Extension.
|
|
||||||
</xsd:documentation>
|
|
||||||
</xsd:annotation>
|
|
||||||
</xsd:element>
|
|
||||||
<xsd:element ref="ExtensionAgencyURI" minOccurs="0" maxOccurs="1">
|
|
||||||
<xsd:annotation>
|
|
||||||
<xsd:documentation>
|
|
||||||
A URI for the Agency that maintains the Extension.
|
|
||||||
</xsd:documentation>
|
|
||||||
</xsd:annotation>
|
|
||||||
</xsd:element>
|
|
||||||
<xsd:element ref="ExtensionURI" minOccurs="0" maxOccurs="1">
|
|
||||||
<xsd:annotation>
|
|
||||||
<xsd:documentation>
|
|
||||||
A URI for the Extension.
|
|
||||||
</xsd:documentation>
|
|
||||||
</xsd:annotation>
|
|
||||||
</xsd:element>
|
|
||||||
<xsd:element ref="ExtensionReasonCode" minOccurs="0" maxOccurs="1">
|
|
||||||
<xsd:annotation>
|
|
||||||
<xsd:documentation>
|
|
||||||
A code for reason the Extension is being included.
|
|
||||||
</xsd:documentation>
|
|
||||||
</xsd:annotation>
|
|
||||||
</xsd:element>
|
|
||||||
<xsd:element ref="ExtensionReason" minOccurs="0" maxOccurs="1">
|
|
||||||
<xsd:annotation>
|
|
||||||
<xsd:documentation>
|
|
||||||
A description of the reason for the Extension.
|
|
||||||
</xsd:documentation>
|
|
||||||
</xsd:annotation>
|
|
||||||
</xsd:element>
|
|
||||||
<xsd:element ref="ExtensionContent" minOccurs="1" maxOccurs="1">
|
|
||||||
<xsd:annotation>
|
|
||||||
<xsd:documentation>
|
|
||||||
The definition of the extension content.
|
|
||||||
</xsd:documentation>
|
|
||||||
</xsd:annotation>
|
|
||||||
</xsd:element>
|
|
||||||
</xsd:sequence>
|
|
||||||
</xsd:complexType>
|
|
||||||
<!-- ===== Basic Element and Type Declarations ===== -->
|
|
||||||
<xsd:element name="ExtensionAgencyID" type="ExtensionAgencyIDType" />
|
|
||||||
<xsd:element name="ExtensionAgencyName" type="ExtensionAgencyNameType" />
|
|
||||||
<xsd:element name="ExtensionAgencyURI" type="ExtensionAgencyURIType" />
|
|
||||||
<xsd:element name="ExtensionContent" type="ExtensionContentType" />
|
|
||||||
<xsd:element name="ExtensionReason" type="ExtensionReasonType" />
|
|
||||||
<xsd:element name="ExtensionReasonCode" type="ExtensionReasonCodeType" />
|
|
||||||
<xsd:element name="ExtensionURI" type="ExtensionURIType" />
|
|
||||||
<xsd:element name="ExtensionVersionID" type="ExtensionVersionIDType" />
|
|
||||||
<xsd:complexType name="ExtensionAgencyIDType">
|
|
||||||
<xsd:simpleContent>
|
|
||||||
<xsd:extension base="udt:IdentifierType" />
|
|
||||||
</xsd:simpleContent>
|
|
||||||
</xsd:complexType>
|
|
||||||
<xsd:complexType name="ExtensionAgencyNameType">
|
|
||||||
<xsd:simpleContent>
|
|
||||||
<xsd:extension base="udt:TextType" />
|
|
||||||
</xsd:simpleContent>
|
|
||||||
</xsd:complexType>
|
|
||||||
<xsd:complexType name="ExtensionAgencyURIType">
|
|
||||||
<xsd:simpleContent>
|
|
||||||
<xsd:extension base="udt:IdentifierType" />
|
|
||||||
</xsd:simpleContent>
|
|
||||||
</xsd:complexType>
|
|
||||||
<xsd:complexType name="ExtensionReasonType">
|
|
||||||
<xsd:simpleContent>
|
|
||||||
<xsd:extension base="udt:TextType" />
|
|
||||||
</xsd:simpleContent>
|
|
||||||
</xsd:complexType>
|
|
||||||
<xsd:complexType name="ExtensionReasonCodeType">
|
|
||||||
<xsd:simpleContent>
|
|
||||||
<xsd:extension base="udt:CodeType" />
|
|
||||||
</xsd:simpleContent>
|
|
||||||
</xsd:complexType>
|
|
||||||
<xsd:complexType name="ExtensionURIType">
|
|
||||||
<xsd:simpleContent>
|
|
||||||
<xsd:extension base="udt:IdentifierType" />
|
|
||||||
</xsd:simpleContent>
|
|
||||||
</xsd:complexType>
|
|
||||||
<xsd:complexType name="ExtensionVersionIDType">
|
|
||||||
<xsd:simpleContent>
|
|
||||||
<xsd:extension base="udt:IdentifierType" />
|
|
||||||
</xsd:simpleContent>
|
|
||||||
</xsd:complexType>
|
|
||||||
</xsd:schema>
|
|
||||||
<!-- ===== Copyright Notice ===== -->
|
|
||||||
<!--
|
|
||||||
OASIS takes no position regarding the validity or scope of any
|
|
||||||
intellectual property or other rights that might be claimed to pertain
|
|
||||||
to the implementation or use of the technology described in this
|
|
||||||
document or the extent to which any license under such rights
|
|
||||||
might or might not be available; neither does it represent that it has
|
|
||||||
made any effort to identify any such rights. Information on OASIS's
|
|
||||||
procedures with respect to rights in OASIS specifications can be
|
|
||||||
found at the OASIS website. Copies of claims of rights made
|
|
||||||
available for publication and any assurances of licenses to be made
|
|
||||||
available, or the result of an attempt made to obtain a general
|
|
||||||
license or permission for the use of such proprietary rights by
|
|
||||||
implementors or users of this specification, can be obtained from
|
|
||||||
the OASIS Executive Director.
|
|
||||||
|
|
||||||
OASIS invites any interested party to bring to its attention any
|
|
||||||
copyrights, patents or patent applications, or other proprietary
|
|
||||||
rights which may cover technology that may be required to
|
|
||||||
implement this specification. Please address the information to the
|
|
||||||
OASIS Executive Director.
|
|
||||||
|
|
||||||
This document and translations of it may be copied and furnished to
|
|
||||||
others, and derivative works that comment on or otherwise explain
|
|
||||||
it or assist in its implementation may be prepared, copied,
|
|
||||||
published and distributed, in whole or in part, without restriction of
|
|
||||||
any kind, provided that the above copyright notice and this
|
|
||||||
paragraph are included on all such copies and derivative works.
|
|
||||||
However, this document itself may not be modified in any way,
|
|
||||||
such as by removing the copyright notice or references to OASIS,
|
|
||||||
except as needed for the purpose of developing OASIS
|
|
||||||
specifications, in which case the procedures for copyrights defined
|
|
||||||
in the OASIS Intellectual Property Rights document must be
|
|
||||||
followed, or as required to translate it into languages other than
|
|
||||||
English.
|
|
||||||
|
|
||||||
The limited permissions granted above are perpetual and will not be
|
|
||||||
revoked by OASIS or its successors or assigns.
|
|
||||||
|
|
||||||
This document and the information contained herein is provided on
|
|
||||||
an "AS IS" basis and OASIS DISCLAIMS ALL WARRANTIES,
|
|
||||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY
|
|
||||||
WARRANTY THAT THE USE OF THE INFORMATION HEREIN
|
|
||||||
WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED
|
|
||||||
WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A
|
|
||||||
PARTICULAR PURPOSE.
|
|
||||||
-->
|
|
||||||
|
|
@ -1,81 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!--
|
|
||||||
~ 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.
|
|
||||||
-->
|
|
||||||
<xsd:schema xmlns:sac="urn:oasis:names:specification:ubl:schema:xsd:SignatureAggregateComponents-2"
|
|
||||||
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
|
||||||
xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonSignatureComponents-2"
|
|
||||||
targetNamespace="urn:oasis:names:specification:ubl:schema:xsd:CommonSignatureComponents-2"
|
|
||||||
elementFormDefault="qualified"
|
|
||||||
attributeFormDefault="unqualified"
|
|
||||||
version="2.1">
|
|
||||||
<xsd:import namespace="urn:oasis:names:specification:ubl:schema:xsd:SignatureAggregateComponents-2"
|
|
||||||
schemaLocation="UBL-SignatureAggregateComponents-2.1.xsd" />
|
|
||||||
<xsd:element name="UBLDocumentSignatures" type="UBLDocumentSignaturesType" />
|
|
||||||
<xsd:complexType name="UBLDocumentSignaturesType">
|
|
||||||
<xsd:sequence>
|
|
||||||
<xsd:element ref="sac:SignatureInformation" minOccurs="1" maxOccurs="unbounded" />
|
|
||||||
</xsd:sequence>
|
|
||||||
</xsd:complexType>
|
|
||||||
</xsd:schema>
|
|
||||||
<!-- ===== Copyright Notice ===== --><!--
|
|
||||||
OASIS takes no position regarding the validity or scope of any
|
|
||||||
intellectual property or other rights that might be claimed to pertain
|
|
||||||
to the implementation or use of the technology described in this
|
|
||||||
document or the extent to which any license under such rights
|
|
||||||
might or might not be available; neither does it represent that it has
|
|
||||||
made any effort to identify any such rights. Information on OASIS's
|
|
||||||
procedures with respect to rights in OASIS specifications can be
|
|
||||||
found at the OASIS website. Copies of claims of rights made
|
|
||||||
available for publication and any assurances of licenses to be made
|
|
||||||
available, or the result of an attempt made to obtain a general
|
|
||||||
license or permission for the use of such proprietary rights by
|
|
||||||
implementors or users of this specification, can be obtained from
|
|
||||||
the OASIS Executive Director.
|
|
||||||
|
|
||||||
OASIS invites any interested party to bring to its attention any
|
|
||||||
copyrights, patents or patent applications, or other proprietary
|
|
||||||
rights which may cover technology that may be required to
|
|
||||||
implement this specification. Please address the information to the
|
|
||||||
OASIS Executive Director.
|
|
||||||
|
|
||||||
This document and translations of it may be copied and furnished to
|
|
||||||
others, and derivative works that comment on or otherwise explain
|
|
||||||
it or assist in its implementation may be prepared, copied,
|
|
||||||
published and distributed, in whole or in part, without restriction of
|
|
||||||
any kind, provided that the above copyright notice and this
|
|
||||||
paragraph are included on all such copies and derivative works.
|
|
||||||
However, this document itself may not be modified in any way,
|
|
||||||
such as by removing the copyright notice or references to OASIS,
|
|
||||||
except as needed for the purpose of developing OASIS
|
|
||||||
specifications, in which case the procedures for copyrights defined
|
|
||||||
in the OASIS Intellectual Property Rights document must be
|
|
||||||
followed, or as required to translate it into languages other than
|
|
||||||
English.
|
|
||||||
|
|
||||||
The limited permissions granted above are perpetual and will not be
|
|
||||||
revoked by OASIS or its successors or assigns.
|
|
||||||
|
|
||||||
This document and the information contained herein is provided on
|
|
||||||
an "AS IS" basis and OASIS DISCLAIMS ALL WARRANTIES,
|
|
||||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY
|
|
||||||
WARRANTY THAT THE USE OF THE INFORMATION HEREIN
|
|
||||||
WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED
|
|
||||||
WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A
|
|
||||||
PARTICULAR PURPOSE.
|
|
||||||
-->
|
|
||||||
|
|
@ -1,73 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!--
|
|
||||||
~ 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.
|
|
||||||
-->
|
|
||||||
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
|
||||||
targetNamespace="urn:un:unece:uncefact:documentation:2"
|
|
||||||
xmlns="urn:un:unece:uncefact:documentation:2"
|
|
||||||
elementFormDefault="qualified"
|
|
||||||
attributeFormDefault="unqualified"
|
|
||||||
version="2.1">
|
|
||||||
</xsd:schema>
|
|
||||||
<!-- ===== Copyright Notice ===== -->
|
|
||||||
<!--
|
|
||||||
OASIS takes no position regarding the validity or scope of any
|
|
||||||
intellectual property or other rights that might be claimed to pertain
|
|
||||||
to the implementation or use of the technology described in this
|
|
||||||
document or the extent to which any license under such rights
|
|
||||||
might or might not be available; neither does it represent that it has
|
|
||||||
made any effort to identify any such rights. Information on OASIS's
|
|
||||||
procedures with respect to rights in OASIS specifications can be
|
|
||||||
found at the OASIS website. Copies of claims of rights made
|
|
||||||
available for publication and any assurances of licenses to be made
|
|
||||||
available, or the result of an attempt made to obtain a general
|
|
||||||
license or permission for the use of such proprietary rights by
|
|
||||||
implementors or users of this specification, can be obtained from
|
|
||||||
the OASIS Executive Director.
|
|
||||||
|
|
||||||
OASIS invites any interested party to bring to its attention any
|
|
||||||
copyrights, patents or patent applications, or other proprietary
|
|
||||||
rights which may cover technology that may be required to
|
|
||||||
implement this specification. Please address the information to the
|
|
||||||
OASIS Executive Director.
|
|
||||||
|
|
||||||
This document and translations of it may be copied and furnished to
|
|
||||||
others, and derivative works that comment on or otherwise explain
|
|
||||||
it or assist in its implementation may be prepared, copied,
|
|
||||||
published and distributed, in whole or in part, without restriction of
|
|
||||||
any kind, provided that the above copyright notice and this
|
|
||||||
paragraph are included on all such copies and derivative works.
|
|
||||||
However, this document itself may not be modified in any way,
|
|
||||||
such as by removing the copyright notice or references to OASIS,
|
|
||||||
except as needed for the purpose of developing OASIS
|
|
||||||
specifications, in which case the procedures for copyrights defined
|
|
||||||
in the OASIS Intellectual Property Rights document must be
|
|
||||||
followed, or as required to translate it into languages other than
|
|
||||||
English.
|
|
||||||
|
|
||||||
The limited permissions granted above are perpetual and will not be
|
|
||||||
revoked by OASIS or its successors or assigns.
|
|
||||||
|
|
||||||
This document and the information contained herein is provided on
|
|
||||||
an "AS IS" basis and OASIS DISCLAIMS ALL WARRANTIES,
|
|
||||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY
|
|
||||||
WARRANTY THAT THE USE OF THE INFORMATION HEREIN
|
|
||||||
WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED
|
|
||||||
WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A
|
|
||||||
PARTICULAR PURPOSE.
|
|
||||||
-->
|
|
||||||
|
|
@ -1,99 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!--
|
|
||||||
~ 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.
|
|
||||||
-->
|
|
||||||
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns=
|
|
||||||
"urn:oasis:names:specification:ubl:schema:xsd:CommonExtensionComponents-2"
|
|
||||||
targetNamespace=
|
|
||||||
"urn:oasis:names:specification:ubl:schema:xsd:CommonExtensionComponents-2"
|
|
||||||
elementFormDefault="qualified"
|
|
||||||
attributeFormDefault="unqualified"
|
|
||||||
version="2.1">
|
|
||||||
|
|
||||||
<!--import here all extension schemas-->
|
|
||||||
<xsd:import namespace=
|
|
||||||
"urn:oasis:names:specification:ubl:schema:xsd:CommonSignatureComponents-2"
|
|
||||||
schemaLocation="UBL-CommonSignatureComponents-2.1.xsd" />
|
|
||||||
|
|
||||||
<!-- ===== Type Declaration ===== -->
|
|
||||||
<xsd:complexType name="ExtensionContentType">
|
|
||||||
<xsd:sequence>
|
|
||||||
<xsd:any namespace="##other" processContents="lax"
|
|
||||||
minOccurs="1" maxOccurs="1">
|
|
||||||
<xsd:annotation>
|
|
||||||
<xsd:documentation>
|
|
||||||
Any element in any namespace other than the UBL extension
|
|
||||||
namespace is allowed to be the apex element of an extension.
|
|
||||||
Only those elements found in the UBL schemas and in the
|
|
||||||
trees of schemas imported in this module are validated.
|
|
||||||
Any element for which there is no schema declaration in any
|
|
||||||
of the trees of schemas passes validation and is not
|
|
||||||
treated as a schema constraint violation.
|
|
||||||
</xsd:documentation>
|
|
||||||
</xsd:annotation>
|
|
||||||
</xsd:any>
|
|
||||||
</xsd:sequence>
|
|
||||||
</xsd:complexType>
|
|
||||||
</xsd:schema>
|
|
||||||
<!-- ===== Copyright Notice ===== -->
|
|
||||||
<!--
|
|
||||||
OASIS takes no position regarding the validity or scope of any
|
|
||||||
intellectual property or other rights that might be claimed to pertain
|
|
||||||
to the implementation or use of the technology described in this
|
|
||||||
document or the extent to which any license under such rights
|
|
||||||
might or might not be available; neither does it represent that it has
|
|
||||||
made any effort to identify any such rights. Information on OASIS's
|
|
||||||
procedures with respect to rights in OASIS specifications can be
|
|
||||||
found at the OASIS website. Copies of claims of rights made
|
|
||||||
available for publication and any assurances of licenses to be made
|
|
||||||
available, or the result of an attempt made to obtain a general
|
|
||||||
license or permission for the use of such proprietary rights by
|
|
||||||
implementors or users of this specification, can be obtained from
|
|
||||||
the OASIS Executive Director.
|
|
||||||
|
|
||||||
OASIS invites any interested party to bring to its attention any
|
|
||||||
copyrights, patents or patent applications, or other proprietary
|
|
||||||
rights which may cover technology that may be required to
|
|
||||||
implement this specification. Please address the information to the
|
|
||||||
OASIS Executive Director.
|
|
||||||
|
|
||||||
This document and translations of it may be copied and furnished to
|
|
||||||
others, and derivative works that comment on or otherwise explain
|
|
||||||
it or assist in its implementation may be prepared, copied,
|
|
||||||
published and distributed, in whole or in part, without restriction of
|
|
||||||
any kind, provided that the above copyright notice and this
|
|
||||||
paragraph are included on all such copies and derivative works.
|
|
||||||
However, this document itself may not be modified in any way,
|
|
||||||
such as by removing the copyright notice or references to OASIS,
|
|
||||||
except as needed for the purpose of developing OASIS
|
|
||||||
specifications, in which case the procedures for copyrights defined
|
|
||||||
in the OASIS Intellectual Property Rights document must be
|
|
||||||
followed, or as required to translate it into languages other than
|
|
||||||
English.
|
|
||||||
|
|
||||||
The limited permissions granted above are perpetual and will not be
|
|
||||||
revoked by OASIS or its successors or assigns.
|
|
||||||
|
|
||||||
This document and the information contained herein is provided on
|
|
||||||
an "AS IS" basis and OASIS DISCLAIMS ALL WARRANTIES,
|
|
||||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY
|
|
||||||
WARRANTY THAT THE USE OF THE INFORMATION HEREIN
|
|
||||||
WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED
|
|
||||||
WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A
|
|
||||||
PARTICULAR PURPOSE.
|
|
||||||
-->
|
|
||||||
|
|
@ -1,78 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!--
|
|
||||||
~ 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.
|
|
||||||
-->
|
|
||||||
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
|
||||||
targetNamespace="urn:oasis:names:specification:ubl:schema:xsd:QualifiedDataTypes-2"
|
|
||||||
xmlns="urn:oasis:names:specification:ubl:schema:xsd:QualifiedDataTypes-2"
|
|
||||||
elementFormDefault="qualified"
|
|
||||||
attributeFormDefault="unqualified"
|
|
||||||
version="2.1">
|
|
||||||
<!-- ===== Imports ===== -->
|
|
||||||
<xsd:import namespace="urn:oasis:names:specification:ubl:schema:xsd:UnqualifiedDataTypes-2"
|
|
||||||
schemaLocation="UBL-UnqualifiedDataTypes-2.1.xsd" />
|
|
||||||
<!-- ===== Type Definitions ===== -->
|
|
||||||
<!--no qualified data types defined at this time-->
|
|
||||||
</xsd:schema>
|
|
||||||
<!-- ===== Copyright Notice ===== -->
|
|
||||||
<!--
|
|
||||||
OASIS takes no position regarding the validity or scope of any
|
|
||||||
intellectual property or other rights that might be claimed to pertain
|
|
||||||
to the implementation or use of the technology described in this
|
|
||||||
document or the extent to which any license under such rights
|
|
||||||
might or might not be available; neither does it represent that it has
|
|
||||||
made any effort to identify any such rights. Information on OASIS's
|
|
||||||
procedures with respect to rights in OASIS specifications can be
|
|
||||||
found at the OASIS website. Copies of claims of rights made
|
|
||||||
available for publication and any assurances of licenses to be made
|
|
||||||
available, or the result of an attempt made to obtain a general
|
|
||||||
license or permission for the use of such proprietary rights by
|
|
||||||
implementors or users of this specification, can be obtained from
|
|
||||||
the OASIS Executive Director.
|
|
||||||
|
|
||||||
OASIS invites any interested party to bring to its attention any
|
|
||||||
copyrights, patents or patent applications, or other proprietary
|
|
||||||
rights which may cover technology that may be required to
|
|
||||||
implement this specification. Please address the information to the
|
|
||||||
OASIS Executive Director.
|
|
||||||
|
|
||||||
This document and translations of it may be copied and furnished to
|
|
||||||
others, and derivative works that comment on or otherwise explain
|
|
||||||
it or assist in its implementation may be prepared, copied,
|
|
||||||
published and distributed, in whole or in part, without restriction of
|
|
||||||
any kind, provided that the above copyright notice and this
|
|
||||||
paragraph are included on all such copies and derivative works.
|
|
||||||
However, this document itself may not be modified in any way,
|
|
||||||
such as by removing the copyright notice or references to OASIS,
|
|
||||||
except as needed for the purpose of developing OASIS
|
|
||||||
specifications, in which case the procedures for copyrights defined
|
|
||||||
in the OASIS Intellectual Property Rights document must be
|
|
||||||
followed, or as required to translate it into languages other than
|
|
||||||
English.
|
|
||||||
|
|
||||||
The limited permissions granted above are perpetual and will not be
|
|
||||||
revoked by OASIS or its successors or assigns.
|
|
||||||
|
|
||||||
This document and the information contained herein is provided on
|
|
||||||
an "AS IS" basis and OASIS DISCLAIMS ALL WARRANTIES,
|
|
||||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY
|
|
||||||
WARRANTY THAT THE USE OF THE INFORMATION HEREIN
|
|
||||||
WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED
|
|
||||||
WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A
|
|
||||||
PARTICULAR PURPOSE.
|
|
||||||
-->
|
|
||||||
|
|
@ -1,102 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!--
|
|
||||||
~ 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.
|
|
||||||
-->
|
|
||||||
<xsd:schema xmlns:sbc="urn:oasis:names:specification:ubl:schema:xsd:SignatureBasicComponents-2"
|
|
||||||
xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2"
|
|
||||||
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
|
||||||
xmlns:ds="http://www.w3.org/2000/09/xmldsig#"
|
|
||||||
xmlns="urn:oasis:names:specification:ubl:schema:xsd:SignatureAggregateComponents-2"
|
|
||||||
targetNamespace="urn:oasis:names:specification:ubl:schema:xsd:SignatureAggregateComponents-2"
|
|
||||||
elementFormDefault="qualified"
|
|
||||||
attributeFormDefault="unqualified"
|
|
||||||
version="2.1">
|
|
||||||
<xsd:import namespace="urn:oasis:names:specification:ubl:schema:xsd:SignatureBasicComponents-2"
|
|
||||||
schemaLocation="UBL-SignatureBasicComponents-2.1.xsd" />
|
|
||||||
<xsd:import namespace="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2"
|
|
||||||
schemaLocation="UBL-CommonBasicComponents-2.1.xsd" />
|
|
||||||
|
|
||||||
<!-- ===== Incorporate W3C signature specification-->
|
|
||||||
<xsd:import namespace="http://www.w3.org/2000/09/xmldsig#"
|
|
||||||
schemaLocation="UBL-xmldsig-core-schema-2.1.xsd" />
|
|
||||||
|
|
||||||
<!-- ===== Incorporate ETSI signature specifications-->
|
|
||||||
<xsd:import namespace="http://uri.etsi.org/01903/v1.3.2#"
|
|
||||||
schemaLocation="UBL-XAdESv132-2.1.xsd" />
|
|
||||||
<xsd:import namespace="http://uri.etsi.org/01903/v1.4.1#"
|
|
||||||
schemaLocation="UBL-XAdESv141-2.1.xsd" />
|
|
||||||
<xsd:element name="SignatureInformation" type="SignatureInformationType" />
|
|
||||||
<xsd:complexType name="SignatureInformationType">
|
|
||||||
<xsd:sequence>
|
|
||||||
<xsd:element ref="cbc:ID" minOccurs="0" maxOccurs="1" />
|
|
||||||
<xsd:element ref="sbc:ReferencedSignatureID" minOccurs="0" maxOccurs="1" />
|
|
||||||
<xsd:element ref="ds:Signature" minOccurs="0" maxOccurs="1">
|
|
||||||
<xsd:annotation>
|
|
||||||
<xsd:documentation>This is a single digital signature as defined by the W3C specification.
|
|
||||||
</xsd:documentation>
|
|
||||||
</xsd:annotation>
|
|
||||||
</xsd:element>
|
|
||||||
</xsd:sequence>
|
|
||||||
</xsd:complexType>
|
|
||||||
</xsd:schema>
|
|
||||||
<!-- ===== Copyright Notice ===== --><!--
|
|
||||||
OASIS takes no position regarding the validity or scope of any
|
|
||||||
intellectual property or other rights that might be claimed to pertain
|
|
||||||
to the implementation or use of the technology described in this
|
|
||||||
document or the extent to which any license under such rights
|
|
||||||
might or might not be available; neither does it represent that it has
|
|
||||||
made any effort to identify any such rights. Information on OASIS's
|
|
||||||
procedures with respect to rights in OASIS specifications can be
|
|
||||||
found at the OASIS website. Copies of claims of rights made
|
|
||||||
available for publication and any assurances of licenses to be made
|
|
||||||
available, or the result of an attempt made to obtain a general
|
|
||||||
license or permission for the use of such proprietary rights by
|
|
||||||
implementors or users of this specification, can be obtained from
|
|
||||||
the OASIS Executive Director.
|
|
||||||
|
|
||||||
OASIS invites any interested party to bring to its attention any
|
|
||||||
copyrights, patents or patent applications, or other proprietary
|
|
||||||
rights which may cover technology that may be required to
|
|
||||||
implement this specification. Please address the information to the
|
|
||||||
OASIS Executive Director.
|
|
||||||
|
|
||||||
This document and translations of it may be copied and furnished to
|
|
||||||
others, and derivative works that comment on or otherwise explain
|
|
||||||
it or assist in its implementation may be prepared, copied,
|
|
||||||
published and distributed, in whole or in part, without restriction of
|
|
||||||
any kind, provided that the above copyright notice and this
|
|
||||||
paragraph are included on all such copies and derivative works.
|
|
||||||
However, this document itself may not be modified in any way,
|
|
||||||
such as by removing the copyright notice or references to OASIS,
|
|
||||||
except as needed for the purpose of developing OASIS
|
|
||||||
specifications, in which case the procedures for copyrights defined
|
|
||||||
in the OASIS Intellectual Property Rights document must be
|
|
||||||
followed, or as required to translate it into languages other than
|
|
||||||
English.
|
|
||||||
|
|
||||||
The limited permissions granted above are perpetual and will not be
|
|
||||||
revoked by OASIS or its successors or assigns.
|
|
||||||
|
|
||||||
This document and the information contained herein is provided on
|
|
||||||
an "AS IS" basis and OASIS DISCLAIMS ALL WARRANTIES,
|
|
||||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY
|
|
||||||
WARRANTY THAT THE USE OF THE INFORMATION HEREIN
|
|
||||||
WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED
|
|
||||||
WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A
|
|
||||||
PARTICULAR PURPOSE.
|
|
||||||
-->
|
|
||||||
|
|
@ -1,83 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!--
|
|
||||||
~ 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.
|
|
||||||
-->
|
|
||||||
<xsd:schema xmlns:udt="urn:oasis:names:specification:ubl:schema:xsd:UnqualifiedDataTypes-2"
|
|
||||||
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
|
||||||
xmlns="urn:oasis:names:specification:ubl:schema:xsd:SignatureBasicComponents-2"
|
|
||||||
targetNamespace="urn:oasis:names:specification:ubl:schema:xsd:SignatureBasicComponents-2"
|
|
||||||
elementFormDefault="qualified"
|
|
||||||
attributeFormDefault="unqualified"
|
|
||||||
version="2.1">
|
|
||||||
<xsd:import namespace="urn:oasis:names:specification:ubl:schema:xsd:QualifiedDataTypes-2"
|
|
||||||
schemaLocation="UBL-QualifiedDataTypes-2.1.xsd" />
|
|
||||||
<xsd:import namespace="urn:oasis:names:specification:ubl:schema:xsd:UnqualifiedDataTypes-2"
|
|
||||||
schemaLocation="UBL-UnqualifiedDataTypes-2.1.xsd" />
|
|
||||||
<xsd:element name="ReferencedSignatureID" type="ReferencedSignatureIDType" />
|
|
||||||
<xsd:complexType name="ReferencedSignatureIDType">
|
|
||||||
<xsd:simpleContent>
|
|
||||||
<xsd:extension base="udt:IdentifierType" />
|
|
||||||
</xsd:simpleContent>
|
|
||||||
</xsd:complexType>
|
|
||||||
</xsd:schema>
|
|
||||||
<!-- ===== Copyright Notice ===== --><!--
|
|
||||||
OASIS takes no position regarding the validity or scope of any
|
|
||||||
intellectual property or other rights that might be claimed to pertain
|
|
||||||
to the implementation or use of the technology described in this
|
|
||||||
document or the extent to which any license under such rights
|
|
||||||
might or might not be available; neither does it represent that it has
|
|
||||||
made any effort to identify any such rights. Information on OASIS's
|
|
||||||
procedures with respect to rights in OASIS specifications can be
|
|
||||||
found at the OASIS website. Copies of claims of rights made
|
|
||||||
available for publication and any assurances of licenses to be made
|
|
||||||
available, or the result of an attempt made to obtain a general
|
|
||||||
license or permission for the use of such proprietary rights by
|
|
||||||
implementors or users of this specification, can be obtained from
|
|
||||||
the OASIS Executive Director.
|
|
||||||
|
|
||||||
OASIS invites any interested party to bring to its attention any
|
|
||||||
copyrights, patents or patent applications, or other proprietary
|
|
||||||
rights which may cover technology that may be required to
|
|
||||||
implement this specification. Please address the information to the
|
|
||||||
OASIS Executive Director.
|
|
||||||
|
|
||||||
This document and translations of it may be copied and furnished to
|
|
||||||
others, and derivative works that comment on or otherwise explain
|
|
||||||
it or assist in its implementation may be prepared, copied,
|
|
||||||
published and distributed, in whole or in part, without restriction of
|
|
||||||
any kind, provided that the above copyright notice and this
|
|
||||||
paragraph are included on all such copies and derivative works.
|
|
||||||
However, this document itself may not be modified in any way,
|
|
||||||
such as by removing the copyright notice or references to OASIS,
|
|
||||||
except as needed for the purpose of developing OASIS
|
|
||||||
specifications, in which case the procedures for copyrights defined
|
|
||||||
in the OASIS Intellectual Property Rights document must be
|
|
||||||
followed, or as required to translate it into languages other than
|
|
||||||
English.
|
|
||||||
|
|
||||||
The limited permissions granted above are perpetual and will not be
|
|
||||||
revoked by OASIS or its successors or assigns.
|
|
||||||
|
|
||||||
This document and the information contained herein is provided on
|
|
||||||
an "AS IS" basis and OASIS DISCLAIMS ALL WARRANTIES,
|
|
||||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY
|
|
||||||
WARRANTY THAT THE USE OF THE INFORMATION HEREIN
|
|
||||||
WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED
|
|
||||||
WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A
|
|
||||||
PARTICULAR PURPOSE.
|
|
||||||
-->
|
|
||||||
|
|
@ -1,554 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!--
|
|
||||||
~ 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.
|
|
||||||
-->
|
|
||||||
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
|
||||||
xmlns:ccts-cct="urn:un:unece:uncefact:data:specification:CoreComponentTypeSchemaModule:2"
|
|
||||||
xmlns:ccts="urn:un:unece:uncefact:documentation:2"
|
|
||||||
targetNamespace="urn:oasis:names:specification:ubl:schema:xsd:UnqualifiedDataTypes-2"
|
|
||||||
elementFormDefault="qualified"
|
|
||||||
attributeFormDefault="unqualified"
|
|
||||||
version="2.1">
|
|
||||||
<!-- ===== Imports ===== -->
|
|
||||||
<xsd:import schemaLocation="CCTS_CCT_SchemaModule-2.1.xsd"
|
|
||||||
namespace="urn:un:unece:uncefact:data:specification:CoreComponentTypeSchemaModule:2" />
|
|
||||||
<!-- ===== Type Definitions ===== -->
|
|
||||||
<xsd:complexType name="AmountType">
|
|
||||||
<xsd:annotation>
|
|
||||||
<xsd:documentation xml:lang="en">
|
|
||||||
<ccts:UniqueID>UBLUDT000001</ccts:UniqueID>
|
|
||||||
<ccts:CategoryCode>UDT</ccts:CategoryCode>
|
|
||||||
<ccts:DictionaryEntryName>Amount. Type</ccts:DictionaryEntryName>
|
|
||||||
<ccts:VersionID>1.0</ccts:VersionID>
|
|
||||||
<ccts:Definition>A number of monetary units specified using a given unit of currency.</ccts:Definition>
|
|
||||||
<ccts:RepresentationTermName>Amount</ccts:RepresentationTermName>
|
|
||||||
</xsd:documentation>
|
|
||||||
</xsd:annotation>
|
|
||||||
<xsd:simpleContent>
|
|
||||||
<xsd:restriction base="ccts-cct:AmountType">
|
|
||||||
<xsd:attribute name="currencyID" type="xsd:normalizedString" use="required">
|
|
||||||
<xsd:annotation>
|
|
||||||
<xsd:documentation xml:lang="en">
|
|
||||||
<ccts:UniqueID>UNDT000001-SC2</ccts:UniqueID>
|
|
||||||
<ccts:CategoryCode>SC</ccts:CategoryCode>
|
|
||||||
<ccts:DictionaryEntryName>Amount. Currency. Identifier</ccts:DictionaryEntryName>
|
|
||||||
<ccts:Definition>The currency of the amount.</ccts:Definition>
|
|
||||||
<ccts:ObjectClass>Amount Currency</ccts:ObjectClass>
|
|
||||||
<ccts:PropertyTermName>Identification</ccts:PropertyTermName>
|
|
||||||
<ccts:RepresentationTermName>Identifier</ccts:RepresentationTermName>
|
|
||||||
<ccts:PrimitiveType>string</ccts:PrimitiveType>
|
|
||||||
<ccts:UsageRule>Reference UNECE Rec 9, using 3-letter alphabetic codes.</ccts:UsageRule>
|
|
||||||
</xsd:documentation>
|
|
||||||
</xsd:annotation>
|
|
||||||
</xsd:attribute>
|
|
||||||
</xsd:restriction>
|
|
||||||
</xsd:simpleContent>
|
|
||||||
</xsd:complexType>
|
|
||||||
|
|
||||||
<xsd:complexType name="BinaryObjectType">
|
|
||||||
<xsd:annotation>
|
|
||||||
<xsd:documentation xml:lang="en">
|
|
||||||
<ccts:UniqueID>UBLUDT000002</ccts:UniqueID>
|
|
||||||
<ccts:CategoryCode>UDT</ccts:CategoryCode>
|
|
||||||
<ccts:DictionaryEntryName>Binary Object. Type</ccts:DictionaryEntryName>
|
|
||||||
<ccts:VersionID>1.0</ccts:VersionID>
|
|
||||||
<ccts:Definition>A set of finite-length sequences of binary octets.</ccts:Definition>
|
|
||||||
<ccts:RepresentationTermName>Binary Object</ccts:RepresentationTermName>
|
|
||||||
<ccts:PrimitiveType>binary</ccts:PrimitiveType>
|
|
||||||
</xsd:documentation>
|
|
||||||
</xsd:annotation>
|
|
||||||
<xsd:simpleContent>
|
|
||||||
<xsd:restriction base="ccts-cct:BinaryObjectType">
|
|
||||||
<xsd:attribute name="mimeCode" type="xsd:normalizedString" use="required">
|
|
||||||
<xsd:annotation>
|
|
||||||
<xsd:documentation xml:lang="en">
|
|
||||||
<ccts:UniqueID>UNDT000002-SC3</ccts:UniqueID>
|
|
||||||
<ccts:CategoryCode>SC</ccts:CategoryCode>
|
|
||||||
<ccts:DictionaryEntryName>Binary Object. Mime. Code</ccts:DictionaryEntryName>
|
|
||||||
<ccts:Definition>The mime type of the binary object.</ccts:Definition>
|
|
||||||
<ccts:ObjectClass>Binary Object</ccts:ObjectClass>
|
|
||||||
<ccts:PropertyTermName>Mime</ccts:PropertyTermName>
|
|
||||||
<ccts:RepresentationTermName>Code</ccts:RepresentationTermName>
|
|
||||||
<ccts:PrimitiveType>string</ccts:PrimitiveType>
|
|
||||||
</xsd:documentation>
|
|
||||||
</xsd:annotation>
|
|
||||||
</xsd:attribute>
|
|
||||||
</xsd:restriction>
|
|
||||||
</xsd:simpleContent>
|
|
||||||
</xsd:complexType>
|
|
||||||
|
|
||||||
<xsd:complexType name="GraphicType">
|
|
||||||
<xsd:annotation>
|
|
||||||
<xsd:documentation xml:lang="en">
|
|
||||||
<ccts:UniqueID>UBLUDT000003</ccts:UniqueID>
|
|
||||||
<ccts:CategoryCode>UDT</ccts:CategoryCode>
|
|
||||||
<ccts:DictionaryEntryName>Graphic. Type</ccts:DictionaryEntryName>
|
|
||||||
<ccts:VersionID>1.0</ccts:VersionID>
|
|
||||||
<ccts:Definition>A diagram, graph, mathematical curve, or similar representation.</ccts:Definition>
|
|
||||||
<ccts:RepresentationTermName>Graphic</ccts:RepresentationTermName>
|
|
||||||
<ccts:PrimitiveType>binary</ccts:PrimitiveType>
|
|
||||||
</xsd:documentation>
|
|
||||||
</xsd:annotation>
|
|
||||||
<xsd:simpleContent>
|
|
||||||
<xsd:restriction base="ccts-cct:BinaryObjectType">
|
|
||||||
<xsd:attribute name="mimeCode" type="xsd:normalizedString" use="required">
|
|
||||||
<xsd:annotation>
|
|
||||||
<xsd:documentation xml:lang="en">
|
|
||||||
<ccts:UniqueID>UNDT000003-SC3</ccts:UniqueID>
|
|
||||||
<ccts:CategoryCode>SC</ccts:CategoryCode>
|
|
||||||
<ccts:DictionaryEntryName>Graphic. Mime. Code</ccts:DictionaryEntryName>
|
|
||||||
<ccts:Definition>The mime type of the graphic object.</ccts:Definition>
|
|
||||||
<ccts:ObjectClass>Graphic</ccts:ObjectClass>
|
|
||||||
<ccts:PropertyTermName>Mime</ccts:PropertyTermName>
|
|
||||||
<ccts:RepresentationTermName>Code</ccts:RepresentationTermName>
|
|
||||||
<ccts:PrimitiveType>normalizedString</ccts:PrimitiveType>
|
|
||||||
</xsd:documentation>
|
|
||||||
</xsd:annotation>
|
|
||||||
</xsd:attribute>
|
|
||||||
</xsd:restriction>
|
|
||||||
</xsd:simpleContent>
|
|
||||||
</xsd:complexType>
|
|
||||||
|
|
||||||
<xsd:complexType name="PictureType">
|
|
||||||
<xsd:annotation>
|
|
||||||
<xsd:documentation xml:lang="en">
|
|
||||||
<ccts:UniqueID>UBLUDT000004</ccts:UniqueID>
|
|
||||||
<ccts:CategoryCode>UDT</ccts:CategoryCode>
|
|
||||||
<ccts:DictionaryEntryName>Picture. Type</ccts:DictionaryEntryName>
|
|
||||||
<ccts:VersionID>1.0</ccts:VersionID>
|
|
||||||
<ccts:Definition>A diagram, graph, mathematical curve, or similar representation.</ccts:Definition>
|
|
||||||
<ccts:RepresentationTermName>Picture</ccts:RepresentationTermName>
|
|
||||||
<ccts:PrimitiveType>binary</ccts:PrimitiveType>
|
|
||||||
</xsd:documentation>
|
|
||||||
</xsd:annotation>
|
|
||||||
<xsd:simpleContent>
|
|
||||||
<xsd:restriction base="ccts-cct:BinaryObjectType">
|
|
||||||
<xsd:attribute name="mimeCode" type="xsd:normalizedString" use="required">
|
|
||||||
<xsd:annotation>
|
|
||||||
<xsd:documentation xml:lang="en">
|
|
||||||
<ccts:UniqueID>UNDT000004-SC3</ccts:UniqueID>
|
|
||||||
<ccts:CategoryCode>SC</ccts:CategoryCode>
|
|
||||||
<ccts:DictionaryEntryName>Picture. Mime. Code</ccts:DictionaryEntryName>
|
|
||||||
<ccts:Definition>The mime type of the picture object.</ccts:Definition>
|
|
||||||
<ccts:ObjectClass>Picture</ccts:ObjectClass>
|
|
||||||
<ccts:PropertyTermName>Mime</ccts:PropertyTermName>
|
|
||||||
<ccts:RepresentationTermName>Code</ccts:RepresentationTermName>
|
|
||||||
<ccts:PrimitiveType>normalizedString</ccts:PrimitiveType>
|
|
||||||
</xsd:documentation>
|
|
||||||
</xsd:annotation>
|
|
||||||
</xsd:attribute>
|
|
||||||
</xsd:restriction>
|
|
||||||
</xsd:simpleContent>
|
|
||||||
</xsd:complexType>
|
|
||||||
|
|
||||||
<xsd:complexType name="SoundType">
|
|
||||||
<xsd:annotation>
|
|
||||||
<xsd:documentation xml:lang="en">
|
|
||||||
<ccts:UniqueID>UBLUDT000005</ccts:UniqueID>
|
|
||||||
<ccts:CategoryCode>UDT</ccts:CategoryCode>
|
|
||||||
<ccts:DictionaryEntryName>Sound. Type</ccts:DictionaryEntryName>
|
|
||||||
<ccts:VersionID>1.0</ccts:VersionID>
|
|
||||||
<ccts:Definition>An audio representation.</ccts:Definition>
|
|
||||||
<ccts:RepresentationTermName>Sound</ccts:RepresentationTermName>
|
|
||||||
<ccts:PrimitiveType>binary</ccts:PrimitiveType>
|
|
||||||
</xsd:documentation>
|
|
||||||
</xsd:annotation>
|
|
||||||
<xsd:simpleContent>
|
|
||||||
<xsd:restriction base="ccts-cct:BinaryObjectType">
|
|
||||||
<xsd:attribute name="mimeCode" type="xsd:normalizedString" use="required">
|
|
||||||
<xsd:annotation>
|
|
||||||
<xsd:documentation xml:lang="en">
|
|
||||||
<ccts:UniqueID>UNDT000005-SC3</ccts:UniqueID>
|
|
||||||
<ccts:CategoryCode>SC</ccts:CategoryCode>
|
|
||||||
<ccts:DictionaryEntryName>Sound. Mime. Code</ccts:DictionaryEntryName>
|
|
||||||
<ccts:Definition>The mime type of the sound object.</ccts:Definition>
|
|
||||||
<ccts:ObjectClass>Sound</ccts:ObjectClass>
|
|
||||||
<ccts:PropertyTermName>Mime</ccts:PropertyTermName>
|
|
||||||
<ccts:RepresentationTermName>Code</ccts:RepresentationTermName>
|
|
||||||
<ccts:PrimitiveType>normalizedString</ccts:PrimitiveType>
|
|
||||||
</xsd:documentation>
|
|
||||||
</xsd:annotation>
|
|
||||||
</xsd:attribute>
|
|
||||||
</xsd:restriction>
|
|
||||||
</xsd:simpleContent>
|
|
||||||
</xsd:complexType>
|
|
||||||
|
|
||||||
<xsd:complexType name="VideoType">
|
|
||||||
<xsd:annotation>
|
|
||||||
<xsd:documentation xml:lang="en">
|
|
||||||
<ccts:UniqueID>UBLUDT000006</ccts:UniqueID>
|
|
||||||
<ccts:CategoryCode>UDT</ccts:CategoryCode>
|
|
||||||
<ccts:DictionaryEntryName>Video. Type</ccts:DictionaryEntryName>
|
|
||||||
<ccts:VersionID>1.0</ccts:VersionID>
|
|
||||||
<ccts:Definition>A video representation.</ccts:Definition>
|
|
||||||
<ccts:RepresentationTermName>Video</ccts:RepresentationTermName>
|
|
||||||
<ccts:PrimitiveType>binary</ccts:PrimitiveType>
|
|
||||||
</xsd:documentation>
|
|
||||||
</xsd:annotation>
|
|
||||||
<xsd:simpleContent>
|
|
||||||
<xsd:restriction base="ccts-cct:BinaryObjectType">
|
|
||||||
<xsd:attribute name="mimeCode" type="xsd:normalizedString" use="required">
|
|
||||||
<xsd:annotation>
|
|
||||||
<xsd:documentation xml:lang="en">
|
|
||||||
<ccts:UniqueID>UNDT000006-SC3</ccts:UniqueID>
|
|
||||||
<ccts:CategoryCode>SC</ccts:CategoryCode>
|
|
||||||
<ccts:DictionaryEntryName>Video. Mime. Code</ccts:DictionaryEntryName>
|
|
||||||
<ccts:Definition>The mime type of the video object.</ccts:Definition>
|
|
||||||
<ccts:ObjectClass>Video</ccts:ObjectClass>
|
|
||||||
<ccts:PropertyTermName>Mime</ccts:PropertyTermName>
|
|
||||||
<ccts:RepresentationTermName>Code</ccts:RepresentationTermName>
|
|
||||||
<ccts:PrimitiveType>normalizedString</ccts:PrimitiveType>
|
|
||||||
</xsd:documentation>
|
|
||||||
</xsd:annotation>
|
|
||||||
</xsd:attribute>
|
|
||||||
</xsd:restriction>
|
|
||||||
</xsd:simpleContent>
|
|
||||||
</xsd:complexType>
|
|
||||||
|
|
||||||
<xsd:complexType name="CodeType">
|
|
||||||
<xsd:annotation>
|
|
||||||
<xsd:documentation xml:lang="en">
|
|
||||||
<ccts:UniqueID>UBLUDT000007</ccts:UniqueID>
|
|
||||||
<ccts:CategoryCode>UDT</ccts:CategoryCode>
|
|
||||||
<ccts:DictionaryEntryName>Code. Type</ccts:DictionaryEntryName>
|
|
||||||
<ccts:VersionID>1.0</ccts:VersionID>
|
|
||||||
<ccts:Definition>A character string (letters, figures, or symbols) that for brevity and/or language
|
|
||||||
independence may be used to represent or replace a definitive value or text of an attribute,
|
|
||||||
together with relevant supplementary information.
|
|
||||||
</ccts:Definition>
|
|
||||||
<ccts:RepresentationTermName>Code</ccts:RepresentationTermName>
|
|
||||||
<ccts:PrimitiveType>string</ccts:PrimitiveType>
|
|
||||||
<ccts:UsageRule>Other supplementary components in the CCT are captured as part of the token and name for
|
|
||||||
the schema module containing the code list and thus, are not declared as attributes.
|
|
||||||
</ccts:UsageRule>
|
|
||||||
</xsd:documentation>
|
|
||||||
</xsd:annotation>
|
|
||||||
<xsd:simpleContent>
|
|
||||||
<xsd:extension base="ccts-cct:CodeType" />
|
|
||||||
</xsd:simpleContent>
|
|
||||||
</xsd:complexType>
|
|
||||||
|
|
||||||
<xsd:complexType name="DateTimeType">
|
|
||||||
<xsd:annotation>
|
|
||||||
<xsd:documentation xml:lang="en">
|
|
||||||
<ccts:UniqueID>UBLUDT000008</ccts:UniqueID>
|
|
||||||
<ccts:CategoryCode>UDT</ccts:CategoryCode>
|
|
||||||
<ccts:DictionaryEntryName>Date Time. Type</ccts:DictionaryEntryName>
|
|
||||||
<ccts:VersionID>1.0</ccts:VersionID>
|
|
||||||
<ccts:Definition>A particular point in the progression of time, together with relevant supplementary
|
|
||||||
information.
|
|
||||||
</ccts:Definition>
|
|
||||||
<ccts:RepresentationTermName>Date Time</ccts:RepresentationTermName>
|
|
||||||
<ccts:PrimitiveType>string</ccts:PrimitiveType>
|
|
||||||
<ccts:UsageRule>Can be used for a date and/or time.</ccts:UsageRule>
|
|
||||||
</xsd:documentation>
|
|
||||||
</xsd:annotation>
|
|
||||||
<xsd:simpleContent>
|
|
||||||
<xsd:extension base="xsd:dateTime" />
|
|
||||||
</xsd:simpleContent>
|
|
||||||
</xsd:complexType>
|
|
||||||
|
|
||||||
<xsd:complexType name="DateType">
|
|
||||||
<xsd:annotation>
|
|
||||||
<xsd:documentation xml:lang="en">
|
|
||||||
<ccts:UniqueID>UBLUDT000009</ccts:UniqueID>
|
|
||||||
<ccts:CategoryCode>UDT</ccts:CategoryCode>
|
|
||||||
<ccts:DictionaryEntryName>Date. Type</ccts:DictionaryEntryName>
|
|
||||||
<ccts:VersionID>1.0</ccts:VersionID>
|
|
||||||
<ccts:Definition>One calendar day according the Gregorian calendar.</ccts:Definition>
|
|
||||||
<ccts:RepresentationTermName>Date</ccts:RepresentationTermName>
|
|
||||||
<ccts:PrimitiveType>string</ccts:PrimitiveType>
|
|
||||||
</xsd:documentation>
|
|
||||||
</xsd:annotation>
|
|
||||||
<xsd:simpleContent>
|
|
||||||
<xsd:extension base="xsd:date" />
|
|
||||||
</xsd:simpleContent>
|
|
||||||
</xsd:complexType>
|
|
||||||
|
|
||||||
<xsd:complexType name="TimeType">
|
|
||||||
<xsd:annotation>
|
|
||||||
<xsd:documentation xml:lang="en">
|
|
||||||
<ccts:UniqueID>UBLUDT0000010</ccts:UniqueID>
|
|
||||||
<ccts:CategoryCode>UDT</ccts:CategoryCode>
|
|
||||||
<ccts:DictionaryEntryName>Time. Type</ccts:DictionaryEntryName>
|
|
||||||
<ccts:VersionID>1.0</ccts:VersionID>
|
|
||||||
<ccts:Definition>An instance of time that occurs every day.</ccts:Definition>
|
|
||||||
<ccts:RepresentationTermName>Time</ccts:RepresentationTermName>
|
|
||||||
<ccts:PrimitiveType>string</ccts:PrimitiveType>
|
|
||||||
</xsd:documentation>
|
|
||||||
</xsd:annotation>
|
|
||||||
<xsd:simpleContent>
|
|
||||||
<xsd:extension base="xsd:time" />
|
|
||||||
</xsd:simpleContent>
|
|
||||||
</xsd:complexType>
|
|
||||||
|
|
||||||
<xsd:complexType name="IdentifierType">
|
|
||||||
<xsd:annotation>
|
|
||||||
<xsd:documentation xml:lang="en">
|
|
||||||
<ccts:UniqueID>UBLUDT0000011</ccts:UniqueID>
|
|
||||||
<ccts:CategoryCode>UDT</ccts:CategoryCode>
|
|
||||||
<ccts:DictionaryEntryName>Identifier. Type</ccts:DictionaryEntryName>
|
|
||||||
<ccts:VersionID>1.0</ccts:VersionID>
|
|
||||||
<ccts:Definition>A character string to identify and uniquely distinguish one instance of an object in an
|
|
||||||
identification scheme from all other objects in the same scheme, together with relevant
|
|
||||||
supplementary information.
|
|
||||||
</ccts:Definition>
|
|
||||||
<ccts:RepresentationTermName>Identifier</ccts:RepresentationTermName>
|
|
||||||
<ccts:PrimitiveType>string</ccts:PrimitiveType>
|
|
||||||
<ccts:UsageRule>Other supplementary components in the CCT are captured as part of the token and name for
|
|
||||||
the schema module containing the identifier list and thus, are not declared as attributes.
|
|
||||||
</ccts:UsageRule>
|
|
||||||
</xsd:documentation>
|
|
||||||
</xsd:annotation>
|
|
||||||
<xsd:simpleContent>
|
|
||||||
<xsd:extension base="ccts-cct:IdentifierType" />
|
|
||||||
</xsd:simpleContent>
|
|
||||||
</xsd:complexType>
|
|
||||||
|
|
||||||
<xsd:complexType name="IndicatorType">
|
|
||||||
<xsd:annotation>
|
|
||||||
<xsd:documentation xml:lang="en">
|
|
||||||
<ccts:UniqueID>UBLUDT0000012</ccts:UniqueID>
|
|
||||||
<ccts:CategoryCode>UDT</ccts:CategoryCode>
|
|
||||||
<ccts:DictionaryEntryName>Indicator. Type</ccts:DictionaryEntryName>
|
|
||||||
<ccts:VersionID>1.0</ccts:VersionID>
|
|
||||||
<ccts:Definition>A list of two mutually exclusive Boolean values that express the only possible states
|
|
||||||
of a property.
|
|
||||||
</ccts:Definition>
|
|
||||||
<ccts:RepresentationTermName>Indicator</ccts:RepresentationTermName>
|
|
||||||
<ccts:PrimitiveType>string</ccts:PrimitiveType>
|
|
||||||
</xsd:documentation>
|
|
||||||
</xsd:annotation>
|
|
||||||
<xsd:simpleContent>
|
|
||||||
<xsd:extension base="xsd:boolean" />
|
|
||||||
</xsd:simpleContent>
|
|
||||||
</xsd:complexType>
|
|
||||||
|
|
||||||
<xsd:complexType name="MeasureType">
|
|
||||||
<xsd:annotation>
|
|
||||||
<xsd:documentation xml:lang="en">
|
|
||||||
<ccts:UniqueID>UBLUDT0000013</ccts:UniqueID>
|
|
||||||
<ccts:CategoryCode>UDT</ccts:CategoryCode>
|
|
||||||
<ccts:DictionaryEntryName>Measure. Type</ccts:DictionaryEntryName>
|
|
||||||
<ccts:VersionID>1.0</ccts:VersionID>
|
|
||||||
<ccts:Definition>A numeric value determined by measuring an object using a specified unit of measure.
|
|
||||||
</ccts:Definition>
|
|
||||||
<ccts:RepresentationTermName>Measure</ccts:RepresentationTermName>
|
|
||||||
<ccts:PropertyTermName>Type</ccts:PropertyTermName>
|
|
||||||
<ccts:PrimitiveType>decimal</ccts:PrimitiveType>
|
|
||||||
</xsd:documentation>
|
|
||||||
</xsd:annotation>
|
|
||||||
<xsd:simpleContent>
|
|
||||||
<xsd:restriction base="ccts-cct:MeasureType">
|
|
||||||
<xsd:attribute name="unitCode" type="xsd:normalizedString" use="required">
|
|
||||||
<xsd:annotation>
|
|
||||||
<xsd:documentation xml:lang="en">
|
|
||||||
<ccts:UniqueID>UNDT000013-SC2</ccts:UniqueID>
|
|
||||||
<ccts:CategoryCode>SC</ccts:CategoryCode>
|
|
||||||
<ccts:DictionaryEntryName>Measure. Unit. Code</ccts:DictionaryEntryName>
|
|
||||||
<ccts:Definition>The type of unit of measure.</ccts:Definition>
|
|
||||||
<ccts:ObjectClass>Measure Unit</ccts:ObjectClass>
|
|
||||||
<ccts:PropertyTermName>Code</ccts:PropertyTermName>
|
|
||||||
<ccts:RepresentationTermName>Code</ccts:RepresentationTermName>
|
|
||||||
<ccts:PrimitiveType>normalizedString</ccts:PrimitiveType>
|
|
||||||
<ccts:UsageRule>Reference UNECE Rec. 20 and X12 355</ccts:UsageRule>
|
|
||||||
</xsd:documentation>
|
|
||||||
</xsd:annotation>
|
|
||||||
</xsd:attribute>
|
|
||||||
</xsd:restriction>
|
|
||||||
</xsd:simpleContent>
|
|
||||||
</xsd:complexType>
|
|
||||||
|
|
||||||
<xsd:complexType name="NumericType">
|
|
||||||
<xsd:annotation>
|
|
||||||
<xsd:documentation xml:lang="en">
|
|
||||||
<ccts:UniqueID>UBLUDT0000014</ccts:UniqueID>
|
|
||||||
<ccts:CategoryCode>UDT</ccts:CategoryCode>
|
|
||||||
<ccts:DictionaryEntryName>Numeric. Type</ccts:DictionaryEntryName>
|
|
||||||
<ccts:VersionID>1.0</ccts:VersionID>
|
|
||||||
<ccts:Definition>Numeric information that is assigned or is determined by calculation, counting, or
|
|
||||||
sequencing. It does not require a unit of quantity or unit of measure.
|
|
||||||
</ccts:Definition>
|
|
||||||
<ccts:RepresentationTermName>Numeric</ccts:RepresentationTermName>
|
|
||||||
<ccts:PrimitiveType>string</ccts:PrimitiveType>
|
|
||||||
</xsd:documentation>
|
|
||||||
</xsd:annotation>
|
|
||||||
<xsd:simpleContent>
|
|
||||||
<xsd:extension base="ccts-cct:NumericType" />
|
|
||||||
</xsd:simpleContent>
|
|
||||||
</xsd:complexType>
|
|
||||||
|
|
||||||
<xsd:complexType name="ValueType">
|
|
||||||
<xsd:annotation>
|
|
||||||
<xsd:documentation xml:lang="en">
|
|
||||||
<ccts:UniqueID>UBLUDT0000015</ccts:UniqueID>
|
|
||||||
<ccts:CategoryCode>UDT</ccts:CategoryCode>
|
|
||||||
<ccts:VersionID>1.0</ccts:VersionID>
|
|
||||||
<ccts:DictionaryEntryName>Value. Type</ccts:DictionaryEntryName>
|
|
||||||
<ccts:Definition>Numeric information that is assigned or is determined by calculation, counting, or
|
|
||||||
sequencing. It does not require a unit of quantity or unit of measure.
|
|
||||||
</ccts:Definition>
|
|
||||||
<ccts:RepresentationTermName>Value</ccts:RepresentationTermName>
|
|
||||||
<ccts:PrimitiveType>string</ccts:PrimitiveType>
|
|
||||||
</xsd:documentation>
|
|
||||||
</xsd:annotation>
|
|
||||||
<xsd:simpleContent>
|
|
||||||
<xsd:extension base="ccts-cct:NumericType" />
|
|
||||||
</xsd:simpleContent>
|
|
||||||
</xsd:complexType>
|
|
||||||
|
|
||||||
<xsd:complexType name="PercentType">
|
|
||||||
<xsd:annotation>
|
|
||||||
<xsd:documentation xml:lang="en">
|
|
||||||
<ccts:UniqueID>UBLUDT0000016</ccts:UniqueID>
|
|
||||||
<ccts:CategoryCode>UDT</ccts:CategoryCode>
|
|
||||||
<ccts:VersionID>1.0</ccts:VersionID>
|
|
||||||
<ccts:DictionaryEntryName>Percent. Type</ccts:DictionaryEntryName>
|
|
||||||
<ccts:Definition>Numeric information that is assigned or is determined by calculation, counting, or
|
|
||||||
sequencing and is expressed as a percentage. It does not require a unit of quantity or unit of
|
|
||||||
measure.
|
|
||||||
</ccts:Definition>
|
|
||||||
<ccts:RepresentationTermName>Percent</ccts:RepresentationTermName>
|
|
||||||
<ccts:PrimitiveType>string</ccts:PrimitiveType>
|
|
||||||
</xsd:documentation>
|
|
||||||
</xsd:annotation>
|
|
||||||
<xsd:simpleContent>
|
|
||||||
<xsd:extension base="ccts-cct:NumericType" />
|
|
||||||
</xsd:simpleContent>
|
|
||||||
</xsd:complexType>
|
|
||||||
|
|
||||||
<xsd:complexType name="RateType">
|
|
||||||
<xsd:annotation>
|
|
||||||
<xsd:documentation xml:lang="en">
|
|
||||||
<ccts:UniqueID>UBLUDT0000017</ccts:UniqueID>
|
|
||||||
<ccts:CategoryCode>UDT</ccts:CategoryCode>
|
|
||||||
<ccts:VersionID>1.0</ccts:VersionID>
|
|
||||||
<ccts:DictionaryEntryName>Rate. Type</ccts:DictionaryEntryName>
|
|
||||||
<ccts:Definition>A numeric expression of a rate that is assigned or is determined by calculation,
|
|
||||||
counting, or sequencing. It does not require a unit of quantity or unit of measure.
|
|
||||||
</ccts:Definition>
|
|
||||||
<ccts:RepresentationTermName>Rate</ccts:RepresentationTermName>
|
|
||||||
<ccts:PrimitiveType>string</ccts:PrimitiveType>
|
|
||||||
</xsd:documentation>
|
|
||||||
</xsd:annotation>
|
|
||||||
<xsd:simpleContent>
|
|
||||||
<xsd:extension base="ccts-cct:NumericType" />
|
|
||||||
</xsd:simpleContent>
|
|
||||||
</xsd:complexType>
|
|
||||||
|
|
||||||
<xsd:complexType name="QuantityType">
|
|
||||||
<xsd:annotation>
|
|
||||||
<xsd:documentation xml:lang="en">
|
|
||||||
<ccts:UniqueID>UBLUDT0000018</ccts:UniqueID>
|
|
||||||
<ccts:CategoryCode>UDT</ccts:CategoryCode>
|
|
||||||
<ccts:DictionaryEntryName>Quantity. Type</ccts:DictionaryEntryName>
|
|
||||||
<ccts:VersionID>1.0</ccts:VersionID>
|
|
||||||
<ccts:Definition>A counted number of non-monetary units, possibly including a fractional part.
|
|
||||||
</ccts:Definition>
|
|
||||||
<ccts:RepresentationTermName>Quantity</ccts:RepresentationTermName>
|
|
||||||
<ccts:PrimitiveType>decimal</ccts:PrimitiveType>
|
|
||||||
</xsd:documentation>
|
|
||||||
</xsd:annotation>
|
|
||||||
<xsd:simpleContent>
|
|
||||||
<xsd:extension base="ccts-cct:QuantityType" />
|
|
||||||
</xsd:simpleContent>
|
|
||||||
</xsd:complexType>
|
|
||||||
|
|
||||||
<xsd:complexType name="TextType">
|
|
||||||
<xsd:annotation>
|
|
||||||
<xsd:documentation xml:lang="en">
|
|
||||||
<ccts:UniqueID>UBLUDT0000019</ccts:UniqueID>
|
|
||||||
<ccts:CategoryCode>UDT</ccts:CategoryCode>
|
|
||||||
<ccts:DictionaryEntryName>Text. Type</ccts:DictionaryEntryName>
|
|
||||||
<ccts:VersionID>1.0</ccts:VersionID>
|
|
||||||
<ccts:Definition>A character string (i.e. a finite set of characters), generally in the form of words of
|
|
||||||
a language.
|
|
||||||
</ccts:Definition>
|
|
||||||
<ccts:RepresentationTermName>Text</ccts:RepresentationTermName>
|
|
||||||
<ccts:PrimitiveType>string</ccts:PrimitiveType>
|
|
||||||
</xsd:documentation>
|
|
||||||
</xsd:annotation>
|
|
||||||
<xsd:simpleContent>
|
|
||||||
<xsd:extension base="ccts-cct:TextType" />
|
|
||||||
</xsd:simpleContent>
|
|
||||||
</xsd:complexType>
|
|
||||||
|
|
||||||
<xsd:complexType name="NameType">
|
|
||||||
<xsd:annotation>
|
|
||||||
<xsd:documentation xml:lang="en">
|
|
||||||
<ccts:UniqueID>UBLUDT0000020</ccts:UniqueID>
|
|
||||||
<ccts:CategoryCode>UDT</ccts:CategoryCode>
|
|
||||||
<ccts:DictionaryEntryName>Name. Type</ccts:DictionaryEntryName>
|
|
||||||
<ccts:VersionID>1.0</ccts:VersionID>
|
|
||||||
<ccts:Definition>A character string that constitutes the distinctive designation of a person, place,
|
|
||||||
thing or concept.
|
|
||||||
</ccts:Definition>
|
|
||||||
<ccts:RepresentationTermName>Name</ccts:RepresentationTermName>
|
|
||||||
<ccts:PrimitiveType>string</ccts:PrimitiveType>
|
|
||||||
</xsd:documentation>
|
|
||||||
</xsd:annotation>
|
|
||||||
<xsd:simpleContent>
|
|
||||||
<xsd:extension base="ccts-cct:TextType" />
|
|
||||||
</xsd:simpleContent>
|
|
||||||
</xsd:complexType>
|
|
||||||
</xsd:schema><!-- ===== Copyright Notice ===== --><!--
|
|
||||||
OASIS takes no position regarding the validity or scope of any
|
|
||||||
intellectual property or other rights that might be claimed to pertain
|
|
||||||
to the implementation or use of the technology described in this
|
|
||||||
document or the extent to which any license under such rights
|
|
||||||
might or might not be available; neither does it represent that it has
|
|
||||||
made any effort to identify any such rights. Information on OASIS's
|
|
||||||
procedures with respect to rights in OASIS specifications can be
|
|
||||||
found at the OASIS website. Copies of claims of rights made
|
|
||||||
available for publication and any assurances of licenses to be made
|
|
||||||
available, or the result of an attempt made to obtain a general
|
|
||||||
license or permission for the use of such proprietary rights by
|
|
||||||
implementors or users of this specification, can be obtained from
|
|
||||||
the OASIS Executive Director.
|
|
||||||
|
|
||||||
OASIS invites any interested party to bring to its attention any
|
|
||||||
copyrights, patents or patent applications, or other proprietary
|
|
||||||
rights which may cover technology that may be required to
|
|
||||||
implement this specification. Please address the information to the
|
|
||||||
OASIS Executive Director.
|
|
||||||
|
|
||||||
This document and translations of it may be copied and furnished to
|
|
||||||
others, and derivative works that comment on or otherwise explain
|
|
||||||
it or assist in its implementation may be prepared, copied,
|
|
||||||
published and distributed, in whole or in part, without restriction of
|
|
||||||
any kind, provided that the above copyright notice and this
|
|
||||||
paragraph are included on all such copies and derivative works.
|
|
||||||
However, this document itself may not be modified in any way,
|
|
||||||
such as by removing the copyright notice or references to OASIS,
|
|
||||||
except as needed for the purpose of developing OASIS
|
|
||||||
specifications, in which case the procedures for copyrights defined
|
|
||||||
in the OASIS Intellectual Property Rights document must be
|
|
||||||
followed, or as required to translate it into languages other than
|
|
||||||
English.
|
|
||||||
|
|
||||||
The limited permissions granted above are perpetual and will not be
|
|
||||||
revoked by OASIS or its successors or assigns.
|
|
||||||
|
|
||||||
This document and the information contained herein is provided on
|
|
||||||
an "AS IS" basis and OASIS DISCLAIMS ALL WARRANTIES,
|
|
||||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY
|
|
||||||
WARRANTY THAT THE USE OF THE INFORMATION HEREIN
|
|
||||||
WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED
|
|
||||||
WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A
|
|
||||||
PARTICULAR PURPOSE.
|
|
||||||
-->
|
|
||||||
|
|
@ -1,499 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!--
|
|
||||||
~ 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.
|
|
||||||
-->
|
|
||||||
|
|
||||||
<!--
|
|
||||||
Library: OASIS Universal Business Language (UBL) 2.1 OS
|
|
||||||
http://docs.oasis-open.org/ubl/os-UBL-2.1/
|
|
||||||
Release Date: 04 November 2013
|
|
||||||
Module: UBL-XAdESv132-2.1.xsd
|
|
||||||
Generated on: 2011-02-21 17:20(UTC)
|
|
||||||
|
|
||||||
This is a copy of http://uri.etsi.org/01903/v1.3.2/XAdES.xsd modified
|
|
||||||
only to change the importing URI for the XML DSig schema.
|
|
||||||
-->
|
|
||||||
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ds="http://www.w3.org/2000/09/xmldsig#"
|
|
||||||
targetNamespace="http://uri.etsi.org/01903/v1.3.2#" xmlns="http://uri.etsi.org/01903/v1.3.2#"
|
|
||||||
elementFormDefault="qualified">
|
|
||||||
<xsd:import namespace="http://www.w3.org/2000/09/xmldsig#" schemaLocation="UBL-xmldsig-core-schema-2.1.xsd" />
|
|
||||||
<!-- Start auxiliary types definitions: AnyType, ObjectIdentifierType,
|
|
||||||
EncapsulatedPKIDataType and containers for time-stamp tokens -->
|
|
||||||
<!-- Start AnyType -->
|
|
||||||
<xsd:element name="Any" type="AnyType" />
|
|
||||||
<xsd:complexType name="AnyType" mixed="true">
|
|
||||||
<xsd:sequence minOccurs="0" maxOccurs="unbounded">
|
|
||||||
<xsd:any namespace="##any" processContents="lax" />
|
|
||||||
</xsd:sequence>
|
|
||||||
<xsd:anyAttribute namespace="##any" />
|
|
||||||
</xsd:complexType>
|
|
||||||
<!-- End AnyType -->
|
|
||||||
<!-- Start ObjectIdentifierType-->
|
|
||||||
<xsd:element name="ObjectIdentifier" type="ObjectIdentifierType" />
|
|
||||||
<xsd:complexType name="ObjectIdentifierType">
|
|
||||||
<xsd:sequence>
|
|
||||||
<xsd:element name="Identifier" type="IdentifierType" />
|
|
||||||
<xsd:element name="Description" type="xsd:string" minOccurs="0" />
|
|
||||||
<xsd:element name="DocumentationReferences" type="DocumentationReferencesType" minOccurs="0" />
|
|
||||||
</xsd:sequence>
|
|
||||||
</xsd:complexType>
|
|
||||||
<xsd:complexType name="IdentifierType">
|
|
||||||
<xsd:simpleContent>
|
|
||||||
<xsd:extension base="xsd:anyURI">
|
|
||||||
<xsd:attribute name="Qualifier" type="QualifierType" use="optional" />
|
|
||||||
</xsd:extension>
|
|
||||||
</xsd:simpleContent>
|
|
||||||
</xsd:complexType>
|
|
||||||
<xsd:simpleType name="QualifierType">
|
|
||||||
<xsd:restriction base="xsd:string">
|
|
||||||
<xsd:enumeration value="OIDAsURI" />
|
|
||||||
<xsd:enumeration value="OIDAsURN" />
|
|
||||||
</xsd:restriction>
|
|
||||||
</xsd:simpleType>
|
|
||||||
<xsd:complexType name="DocumentationReferencesType">
|
|
||||||
<xsd:sequence maxOccurs="unbounded">
|
|
||||||
<xsd:element name="DocumentationReference" type="xsd:anyURI" />
|
|
||||||
</xsd:sequence>
|
|
||||||
</xsd:complexType>
|
|
||||||
<!-- End ObjectIdentifierType-->
|
|
||||||
<!-- Start EncapsulatedPKIDataType-->
|
|
||||||
<xsd:element name="EncapsulatedPKIData" type="EncapsulatedPKIDataType" />
|
|
||||||
<xsd:complexType name="EncapsulatedPKIDataType">
|
|
||||||
<xsd:simpleContent>
|
|
||||||
<xsd:extension base="xsd:base64Binary">
|
|
||||||
<xsd:attribute name="Id" type="xsd:ID" use="optional" />
|
|
||||||
<xsd:attribute name="Encoding" type="xsd:anyURI" use="optional" />
|
|
||||||
</xsd:extension>
|
|
||||||
</xsd:simpleContent>
|
|
||||||
</xsd:complexType>
|
|
||||||
<!-- End EncapsulatedPKIDataType -->
|
|
||||||
<!-- Start time-stamp containers types -->
|
|
||||||
<!-- Start GenericTimeStampType -->
|
|
||||||
<xsd:element name="Include" type="IncludeType" />
|
|
||||||
<xsd:complexType name="IncludeType">
|
|
||||||
<xsd:attribute name="URI" type="xsd:anyURI" use="required" />
|
|
||||||
<xsd:attribute name="referencedData" type="xsd:boolean" use="optional" />
|
|
||||||
</xsd:complexType>
|
|
||||||
<xsd:element name="ReferenceInfo" type="ReferenceInfoType" />
|
|
||||||
<xsd:complexType name="ReferenceInfoType">
|
|
||||||
<xsd:sequence>
|
|
||||||
<xsd:element ref="ds:DigestMethod" />
|
|
||||||
<xsd:element ref="ds:DigestValue" />
|
|
||||||
</xsd:sequence>
|
|
||||||
<xsd:attribute name="Id" type="xsd:ID" use="optional" />
|
|
||||||
<xsd:attribute name="URI" type="xsd:anyURI" use="optional" />
|
|
||||||
</xsd:complexType>
|
|
||||||
<xsd:complexType name="GenericTimeStampType" abstract="true">
|
|
||||||
<xsd:sequence>
|
|
||||||
<xsd:choice minOccurs="0">
|
|
||||||
<xsd:element ref="Include" minOccurs="0" maxOccurs="unbounded" />
|
|
||||||
<xsd:element ref="ReferenceInfo" maxOccurs="unbounded" />
|
|
||||||
</xsd:choice>
|
|
||||||
<xsd:element ref="ds:CanonicalizationMethod" minOccurs="0" />
|
|
||||||
<xsd:choice maxOccurs="unbounded">
|
|
||||||
<xsd:element name="EncapsulatedTimeStamp" type="EncapsulatedPKIDataType" />
|
|
||||||
<xsd:element name="XMLTimeStamp" type="AnyType" />
|
|
||||||
</xsd:choice>
|
|
||||||
</xsd:sequence>
|
|
||||||
<xsd:attribute name="Id" type="xsd:ID" use="optional" />
|
|
||||||
</xsd:complexType>
|
|
||||||
<!-- End GenericTimeStampType -->
|
|
||||||
<!-- Start XAdESTimeStampType -->
|
|
||||||
<xsd:element name="XAdESTimeStamp" type="XAdESTimeStampType" />
|
|
||||||
<xsd:complexType name="XAdESTimeStampType">
|
|
||||||
<xsd:complexContent>
|
|
||||||
<xsd:restriction base="GenericTimeStampType">
|
|
||||||
<xsd:sequence>
|
|
||||||
<xsd:element ref="Include" minOccurs="0" maxOccurs="unbounded" />
|
|
||||||
<xsd:element ref="ds:CanonicalizationMethod" minOccurs="0" />
|
|
||||||
<xsd:choice maxOccurs="unbounded">
|
|
||||||
<xsd:element name="EncapsulatedTimeStamp" type="EncapsulatedPKIDataType" />
|
|
||||||
<xsd:element name="XMLTimeStamp" type="AnyType" />
|
|
||||||
</xsd:choice>
|
|
||||||
</xsd:sequence>
|
|
||||||
<xsd:attribute name="Id" type="xsd:ID" use="optional" />
|
|
||||||
</xsd:restriction>
|
|
||||||
</xsd:complexContent>
|
|
||||||
</xsd:complexType>
|
|
||||||
<!-- End XAdESTimeStampType -->
|
|
||||||
<!-- Start OtherTimeStampType -->
|
|
||||||
<xsd:element name="OtherTimeStamp" type="OtherTimeStampType" />
|
|
||||||
<xsd:complexType name="OtherTimeStampType">
|
|
||||||
<xsd:complexContent>
|
|
||||||
<xsd:restriction base="GenericTimeStampType">
|
|
||||||
<xsd:sequence>
|
|
||||||
<xsd:element ref="ReferenceInfo" maxOccurs="unbounded" />
|
|
||||||
<xsd:element ref="ds:CanonicalizationMethod" minOccurs="0" />
|
|
||||||
<xsd:choice>
|
|
||||||
<xsd:element name="EncapsulatedTimeStamp" type="EncapsulatedPKIDataType" />
|
|
||||||
<xsd:element name="XMLTimeStamp" type="AnyType" />
|
|
||||||
</xsd:choice>
|
|
||||||
</xsd:sequence>
|
|
||||||
<xsd:attribute name="Id" type="xsd:ID" use="optional" />
|
|
||||||
</xsd:restriction>
|
|
||||||
</xsd:complexContent>
|
|
||||||
</xsd:complexType>
|
|
||||||
<!-- End OtherTimeStampType -->
|
|
||||||
<!-- End time-stamp containers types -->
|
|
||||||
<!-- End auxiliary types definitions-->
|
|
||||||
<!-- Start container types -->
|
|
||||||
<!-- Start QualifyingProperties -->
|
|
||||||
<xsd:element name="QualifyingProperties" type="QualifyingPropertiesType" />
|
|
||||||
<xsd:complexType name="QualifyingPropertiesType">
|
|
||||||
<xsd:sequence>
|
|
||||||
<xsd:element name="SignedProperties" type="SignedPropertiesType" minOccurs="0" />
|
|
||||||
<xsd:element name="UnsignedProperties" type="UnsignedPropertiesType" minOccurs="0" />
|
|
||||||
</xsd:sequence>
|
|
||||||
<xsd:attribute name="Target" type="xsd:anyURI" use="required" />
|
|
||||||
<xsd:attribute name="Id" type="xsd:ID" use="optional" />
|
|
||||||
</xsd:complexType>
|
|
||||||
<!-- End QualifyingProperties -->
|
|
||||||
<!-- Start SignedProperties-->
|
|
||||||
<xsd:element name="SignedProperties" type="SignedPropertiesType" />
|
|
||||||
<xsd:complexType name="SignedPropertiesType">
|
|
||||||
<xsd:sequence>
|
|
||||||
<xsd:element name="SignedSignatureProperties" type="SignedSignaturePropertiesType" minOccurs="0" />
|
|
||||||
<xsd:element name="SignedDataObjectProperties" type="SignedDataObjectPropertiesType" minOccurs="0" />
|
|
||||||
</xsd:sequence>
|
|
||||||
<xsd:attribute name="Id" type="xsd:ID" use="optional" />
|
|
||||||
</xsd:complexType>
|
|
||||||
<!-- End SignedProperties-->
|
|
||||||
<!-- Start UnsignedProperties-->
|
|
||||||
<xsd:element name="UnsignedProperties" type="UnsignedPropertiesType" />
|
|
||||||
<xsd:complexType name="UnsignedPropertiesType">
|
|
||||||
<xsd:sequence>
|
|
||||||
<xsd:element name="UnsignedSignatureProperties" type="UnsignedSignaturePropertiesType" minOccurs="0" />
|
|
||||||
<xsd:element name="UnsignedDataObjectProperties" type="UnsignedDataObjectPropertiesType" minOccurs="0" />
|
|
||||||
</xsd:sequence>
|
|
||||||
<xsd:attribute name="Id" type="xsd:ID" use="optional" />
|
|
||||||
</xsd:complexType>
|
|
||||||
<!-- End UnsignedProperties-->
|
|
||||||
<!-- Start SignedSignatureProperties-->
|
|
||||||
<xsd:element name="SignedSignatureProperties" type="SignedSignaturePropertiesType" />
|
|
||||||
<xsd:complexType name="SignedSignaturePropertiesType">
|
|
||||||
<xsd:sequence>
|
|
||||||
<xsd:element name="SigningTime" type="xsd:dateTime" minOccurs="0" />
|
|
||||||
<xsd:element name="SigningCertificate" type="CertIDListType" minOccurs="0" />
|
|
||||||
<xsd:element name="SignaturePolicyIdentifier" type="SignaturePolicyIdentifierType" minOccurs="0" />
|
|
||||||
<xsd:element name="SignatureProductionPlace" type="SignatureProductionPlaceType" minOccurs="0" />
|
|
||||||
<xsd:element name="SignerRole" type="SignerRoleType" minOccurs="0" />
|
|
||||||
</xsd:sequence>
|
|
||||||
<xsd:attribute name="Id" type="xsd:ID" use="optional" />
|
|
||||||
</xsd:complexType>
|
|
||||||
<!-- End SignedSignatureProperties-->
|
|
||||||
<!-- Start SignedDataObjectProperties-->
|
|
||||||
<xsd:element name="SignedDataObjectProperties" type="SignedDataObjectPropertiesType" />
|
|
||||||
<xsd:complexType name="SignedDataObjectPropertiesType">
|
|
||||||
<xsd:sequence>
|
|
||||||
<xsd:element name="DataObjectFormat" type="DataObjectFormatType" minOccurs="0" maxOccurs="unbounded" />
|
|
||||||
<xsd:element name="CommitmentTypeIndication" type="CommitmentTypeIndicationType" minOccurs="0"
|
|
||||||
maxOccurs="unbounded" />
|
|
||||||
<xsd:element name="AllDataObjectsTimeStamp" type="XAdESTimeStampType" minOccurs="0" maxOccurs="unbounded" />
|
|
||||||
<xsd:element name="IndividualDataObjectsTimeStamp" type="XAdESTimeStampType" minOccurs="0"
|
|
||||||
maxOccurs="unbounded" />
|
|
||||||
</xsd:sequence>
|
|
||||||
<xsd:attribute name="Id" type="xsd:ID" use="optional" />
|
|
||||||
</xsd:complexType>
|
|
||||||
<!-- End SignedDataObjectProperties-->
|
|
||||||
<!-- Start UnsignedSignatureProperties-->
|
|
||||||
<xsd:element name="UnsignedSignatureProperties" type="UnsignedSignaturePropertiesType" />
|
|
||||||
<xsd:complexType name="UnsignedSignaturePropertiesType">
|
|
||||||
<xsd:choice maxOccurs="unbounded">
|
|
||||||
<xsd:element name="CounterSignature" type="CounterSignatureType" />
|
|
||||||
<xsd:element name="SignatureTimeStamp" type="XAdESTimeStampType" />
|
|
||||||
<xsd:element name="CompleteCertificateRefs" type="CompleteCertificateRefsType" />
|
|
||||||
<xsd:element name="CompleteRevocationRefs" type="CompleteRevocationRefsType" />
|
|
||||||
<xsd:element name="AttributeCertificateRefs" type="CompleteCertificateRefsType" />
|
|
||||||
<xsd:element name="AttributeRevocationRefs" type="CompleteRevocationRefsType" />
|
|
||||||
<xsd:element name="SigAndRefsTimeStamp" type="XAdESTimeStampType" />
|
|
||||||
<xsd:element name="RefsOnlyTimeStamp" type="XAdESTimeStampType" />
|
|
||||||
<xsd:element name="CertificateValues" type="CertificateValuesType" />
|
|
||||||
<xsd:element name="RevocationValues" type="RevocationValuesType" />
|
|
||||||
<xsd:element name="AttrAuthoritiesCertValues" type="CertificateValuesType" />
|
|
||||||
<xsd:element name="AttributeRevocationValues" type="RevocationValuesType" />
|
|
||||||
<xsd:element name="ArchiveTimeStamp" type="XAdESTimeStampType" />
|
|
||||||
<xsd:any namespace="##other" />
|
|
||||||
</xsd:choice>
|
|
||||||
<xsd:attribute name="Id" type="xsd:ID" use="optional" />
|
|
||||||
</xsd:complexType>
|
|
||||||
<!-- End UnsignedSignatureProperties-->
|
|
||||||
<!-- Start UnsignedDataObjectProperties-->
|
|
||||||
<xsd:element name="UnsignedDataObjectProperties" type="UnsignedDataObjectPropertiesType" />
|
|
||||||
<xsd:complexType name="UnsignedDataObjectPropertiesType">
|
|
||||||
<xsd:sequence>
|
|
||||||
<xsd:element name="UnsignedDataObjectProperty" type="AnyType" maxOccurs="unbounded" />
|
|
||||||
</xsd:sequence>
|
|
||||||
<xsd:attribute name="Id" type="xsd:ID" use="optional" />
|
|
||||||
</xsd:complexType>
|
|
||||||
<!-- End UnsignedDataObjectProperties-->
|
|
||||||
<!-- Start QualifyingPropertiesReference-->
|
|
||||||
<xsd:element name="QualifyingPropertiesReference" type="QualifyingPropertiesReferenceType" />
|
|
||||||
<xsd:complexType name="QualifyingPropertiesReferenceType">
|
|
||||||
<xsd:attribute name="URI" type="xsd:anyURI" use="required" />
|
|
||||||
<xsd:attribute name="Id" type="xsd:ID" use="optional" />
|
|
||||||
</xsd:complexType>
|
|
||||||
<!-- End QualifyingPropertiesReference-->
|
|
||||||
<!-- End container types -->
|
|
||||||
<!-- Start SigningTime element -->
|
|
||||||
<xsd:element name="SigningTime" type="xsd:dateTime" />
|
|
||||||
<!-- End SigningTime element -->
|
|
||||||
<!-- Start SigningCertificate -->
|
|
||||||
<xsd:element name="SigningCertificate" type="CertIDListType" />
|
|
||||||
<xsd:complexType name="CertIDListType">
|
|
||||||
<xsd:sequence>
|
|
||||||
<xsd:element name="Cert" type="CertIDType" maxOccurs="unbounded" />
|
|
||||||
</xsd:sequence>
|
|
||||||
</xsd:complexType>
|
|
||||||
<xsd:complexType name="CertIDType">
|
|
||||||
<xsd:sequence>
|
|
||||||
<xsd:element name="CertDigest" type="DigestAlgAndValueType" />
|
|
||||||
<xsd:element name="IssuerSerial" type="ds:X509IssuerSerialType" />
|
|
||||||
</xsd:sequence>
|
|
||||||
<xsd:attribute name="URI" type="xsd:anyURI" use="optional" />
|
|
||||||
</xsd:complexType>
|
|
||||||
<xsd:complexType name="DigestAlgAndValueType">
|
|
||||||
<xsd:sequence>
|
|
||||||
<xsd:element ref="ds:DigestMethod" />
|
|
||||||
<xsd:element ref="ds:DigestValue" />
|
|
||||||
</xsd:sequence>
|
|
||||||
</xsd:complexType>
|
|
||||||
<!-- End SigningCertificate -->
|
|
||||||
<!-- Start SignaturePolicyIdentifier -->
|
|
||||||
<xsd:element name="SignaturePolicyIdentifier" type="SignaturePolicyIdentifierType" />
|
|
||||||
<xsd:complexType name="SignaturePolicyIdentifierType">
|
|
||||||
<xsd:choice>
|
|
||||||
<xsd:element name="SignaturePolicyId" type="SignaturePolicyIdType" />
|
|
||||||
<xsd:element name="SignaturePolicyImplied" />
|
|
||||||
</xsd:choice>
|
|
||||||
</xsd:complexType>
|
|
||||||
<xsd:complexType name="SignaturePolicyIdType">
|
|
||||||
<xsd:sequence>
|
|
||||||
<xsd:element name="SigPolicyId" type="ObjectIdentifierType" />
|
|
||||||
<xsd:element ref="ds:Transforms" minOccurs="0" />
|
|
||||||
<xsd:element name="SigPolicyHash" type="DigestAlgAndValueType" />
|
|
||||||
<xsd:element name="SigPolicyQualifiers" type="SigPolicyQualifiersListType" minOccurs="0" />
|
|
||||||
</xsd:sequence>
|
|
||||||
</xsd:complexType>
|
|
||||||
<xsd:complexType name="SigPolicyQualifiersListType">
|
|
||||||
<xsd:sequence>
|
|
||||||
<xsd:element name="SigPolicyQualifier" type="AnyType" maxOccurs="unbounded" />
|
|
||||||
</xsd:sequence>
|
|
||||||
</xsd:complexType>
|
|
||||||
<xsd:element name="SPURI" type="xsd:anyURI" />
|
|
||||||
<xsd:element name="SPUserNotice" type="SPUserNoticeType" />
|
|
||||||
<xsd:complexType name="SPUserNoticeType">
|
|
||||||
<xsd:sequence>
|
|
||||||
<xsd:element name="NoticeRef" type="NoticeReferenceType" minOccurs="0" />
|
|
||||||
<xsd:element name="ExplicitText" type="xsd:string" minOccurs="0" />
|
|
||||||
</xsd:sequence>
|
|
||||||
</xsd:complexType>
|
|
||||||
<xsd:complexType name="NoticeReferenceType">
|
|
||||||
<xsd:sequence>
|
|
||||||
<xsd:element name="Organization" type="xsd:string" />
|
|
||||||
<xsd:element name="NoticeNumbers" type="IntegerListType" />
|
|
||||||
</xsd:sequence>
|
|
||||||
</xsd:complexType>
|
|
||||||
<xsd:complexType name="IntegerListType">
|
|
||||||
<xsd:sequence>
|
|
||||||
<xsd:element name="int" type="xsd:integer" minOccurs="0" maxOccurs="unbounded" />
|
|
||||||
</xsd:sequence>
|
|
||||||
</xsd:complexType>
|
|
||||||
<!-- End SignaturePolicyIdentifier -->
|
|
||||||
<!-- Start CounterSignature -->
|
|
||||||
<xsd:element name="CounterSignature" type="CounterSignatureType" />
|
|
||||||
<xsd:complexType name="CounterSignatureType">
|
|
||||||
<xsd:sequence>
|
|
||||||
<xsd:element ref="ds:Signature" />
|
|
||||||
</xsd:sequence>
|
|
||||||
</xsd:complexType>
|
|
||||||
<!-- End CounterSignature -->
|
|
||||||
<!-- Start DataObjectFormat -->
|
|
||||||
<xsd:element name="DataObjectFormat" type="DataObjectFormatType" />
|
|
||||||
<xsd:complexType name="DataObjectFormatType">
|
|
||||||
<xsd:sequence>
|
|
||||||
<xsd:element name="Description" type="xsd:string" minOccurs="0" />
|
|
||||||
<xsd:element name="ObjectIdentifier" type="ObjectIdentifierType" minOccurs="0" />
|
|
||||||
<xsd:element name="MimeType" type="xsd:string" minOccurs="0" />
|
|
||||||
<xsd:element name="Encoding" type="xsd:anyURI" minOccurs="0" />
|
|
||||||
</xsd:sequence>
|
|
||||||
<xsd:attribute name="ObjectReference" type="xsd:anyURI" use="required" />
|
|
||||||
</xsd:complexType>
|
|
||||||
<!-- End DataObjectFormat -->
|
|
||||||
<!-- Start CommitmentTypeIndication -->
|
|
||||||
<xsd:element name="CommitmentTypeIndication" type="CommitmentTypeIndicationType" />
|
|
||||||
<xsd:complexType name="CommitmentTypeIndicationType">
|
|
||||||
<xsd:sequence>
|
|
||||||
<xsd:element name="CommitmentTypeId" type="ObjectIdentifierType" />
|
|
||||||
<xsd:choice>
|
|
||||||
<xsd:element name="ObjectReference" type="xsd:anyURI" maxOccurs="unbounded" />
|
|
||||||
<xsd:element name="AllSignedDataObjects" />
|
|
||||||
</xsd:choice>
|
|
||||||
<xsd:element name="CommitmentTypeQualifiers" type="CommitmentTypeQualifiersListType" minOccurs="0" />
|
|
||||||
</xsd:sequence>
|
|
||||||
</xsd:complexType>
|
|
||||||
<xsd:complexType name="CommitmentTypeQualifiersListType">
|
|
||||||
<xsd:sequence>
|
|
||||||
<xsd:element name="CommitmentTypeQualifier" type="AnyType" minOccurs="0" maxOccurs="unbounded" />
|
|
||||||
</xsd:sequence>
|
|
||||||
</xsd:complexType>
|
|
||||||
<!-- End CommitmentTypeIndication -->
|
|
||||||
<!-- Start SignatureProductionPlace -->
|
|
||||||
<xsd:element name="SignatureProductionPlace" type="SignatureProductionPlaceType" />
|
|
||||||
<xsd:complexType name="SignatureProductionPlaceType">
|
|
||||||
<xsd:sequence>
|
|
||||||
<xsd:element name="City" type="xsd:string" minOccurs="0" />
|
|
||||||
<xsd:element name="StateOrProvince" type="xsd:string" minOccurs="0" />
|
|
||||||
<xsd:element name="PostalCode" type="xsd:string" minOccurs="0" />
|
|
||||||
<xsd:element name="CountryName" type="xsd:string" minOccurs="0" />
|
|
||||||
</xsd:sequence>
|
|
||||||
</xsd:complexType>
|
|
||||||
<!-- End SignatureProductionPlace -->
|
|
||||||
<!-- Start SignerRole -->
|
|
||||||
<xsd:element name="SignerRole" type="SignerRoleType" />
|
|
||||||
<xsd:complexType name="SignerRoleType">
|
|
||||||
<xsd:sequence>
|
|
||||||
<xsd:element name="ClaimedRoles" type="ClaimedRolesListType" minOccurs="0" />
|
|
||||||
<xsd:element name="CertifiedRoles" type="CertifiedRolesListType" minOccurs="0" />
|
|
||||||
</xsd:sequence>
|
|
||||||
</xsd:complexType>
|
|
||||||
<xsd:complexType name="ClaimedRolesListType">
|
|
||||||
<xsd:sequence>
|
|
||||||
<xsd:element name="ClaimedRole" type="AnyType" maxOccurs="unbounded" />
|
|
||||||
</xsd:sequence>
|
|
||||||
</xsd:complexType>
|
|
||||||
<xsd:complexType name="CertifiedRolesListType">
|
|
||||||
<xsd:sequence>
|
|
||||||
<xsd:element name="CertifiedRole" type="EncapsulatedPKIDataType" maxOccurs="unbounded" />
|
|
||||||
</xsd:sequence>
|
|
||||||
</xsd:complexType>
|
|
||||||
<!-- End SignerRole -->
|
|
||||||
<xsd:element name="AllDataObjectsTimeStamp" type="XAdESTimeStampType" />
|
|
||||||
<xsd:element name="IndividualDataObjectsTimeStamp" type="XAdESTimeStampType" />
|
|
||||||
<xsd:element name="SignatureTimeStamp" type="XAdESTimeStampType" />
|
|
||||||
<!-- Start CompleteCertificateRefs -->
|
|
||||||
<xsd:element name="CompleteCertificateRefs" type="CompleteCertificateRefsType" />
|
|
||||||
<xsd:complexType name="CompleteCertificateRefsType">
|
|
||||||
<xsd:sequence>
|
|
||||||
<xsd:element name="CertRefs" type="CertIDListType" />
|
|
||||||
</xsd:sequence>
|
|
||||||
<xsd:attribute name="Id" type="xsd:ID" use="optional" />
|
|
||||||
</xsd:complexType>
|
|
||||||
<!-- End CompleteCertificateRefs -->
|
|
||||||
<!-- Start CompleteRevocationRefs-->
|
|
||||||
<xsd:element name="CompleteRevocationRefs" type="CompleteRevocationRefsType" />
|
|
||||||
<xsd:complexType name="CompleteRevocationRefsType">
|
|
||||||
<xsd:sequence>
|
|
||||||
<xsd:element name="CRLRefs" type="CRLRefsType" minOccurs="0" />
|
|
||||||
<xsd:element name="OCSPRefs" type="OCSPRefsType" minOccurs="0" />
|
|
||||||
<xsd:element name="OtherRefs" type="OtherCertStatusRefsType" minOccurs="0" />
|
|
||||||
</xsd:sequence>
|
|
||||||
<xsd:attribute name="Id" type="xsd:ID" use="optional" />
|
|
||||||
</xsd:complexType>
|
|
||||||
<xsd:complexType name="CRLRefsType">
|
|
||||||
<xsd:sequence>
|
|
||||||
<xsd:element name="CRLRef" type="CRLRefType" maxOccurs="unbounded" />
|
|
||||||
</xsd:sequence>
|
|
||||||
</xsd:complexType>
|
|
||||||
<xsd:complexType name="CRLRefType">
|
|
||||||
<xsd:sequence>
|
|
||||||
<xsd:element name="DigestAlgAndValue" type="DigestAlgAndValueType" />
|
|
||||||
<xsd:element name="CRLIdentifier" type="CRLIdentifierType" minOccurs="0" />
|
|
||||||
</xsd:sequence>
|
|
||||||
</xsd:complexType>
|
|
||||||
<xsd:complexType name="CRLIdentifierType">
|
|
||||||
<xsd:sequence>
|
|
||||||
<xsd:element name="Issuer" type="xsd:string" />
|
|
||||||
<xsd:element name="IssueTime" type="xsd:dateTime" />
|
|
||||||
<xsd:element name="Number" type="xsd:integer" minOccurs="0" />
|
|
||||||
</xsd:sequence>
|
|
||||||
<xsd:attribute name="URI" type="xsd:anyURI" use="optional" />
|
|
||||||
</xsd:complexType>
|
|
||||||
<xsd:complexType name="OCSPRefsType">
|
|
||||||
<xsd:sequence>
|
|
||||||
<xsd:element name="OCSPRef" type="OCSPRefType" maxOccurs="unbounded" />
|
|
||||||
</xsd:sequence>
|
|
||||||
</xsd:complexType>
|
|
||||||
<xsd:complexType name="OCSPRefType">
|
|
||||||
<xsd:sequence>
|
|
||||||
<xsd:element name="OCSPIdentifier" type="OCSPIdentifierType" />
|
|
||||||
<xsd:element name="DigestAlgAndValue" type="DigestAlgAndValueType" minOccurs="0" />
|
|
||||||
</xsd:sequence>
|
|
||||||
</xsd:complexType>
|
|
||||||
<xsd:complexType name="ResponderIDType">
|
|
||||||
<xsd:choice>
|
|
||||||
<xsd:element name="ByName" type="xsd:string" />
|
|
||||||
<xsd:element name="ByKey" type="xsd:base64Binary" />
|
|
||||||
</xsd:choice>
|
|
||||||
</xsd:complexType>
|
|
||||||
<xsd:complexType name="OCSPIdentifierType">
|
|
||||||
<xsd:sequence>
|
|
||||||
<xsd:element name="ResponderID" type="ResponderIDType" />
|
|
||||||
<xsd:element name="ProducedAt" type="xsd:dateTime" />
|
|
||||||
</xsd:sequence>
|
|
||||||
<xsd:attribute name="URI" type="xsd:anyURI" use="optional" />
|
|
||||||
</xsd:complexType>
|
|
||||||
<xsd:complexType name="OtherCertStatusRefsType">
|
|
||||||
<xsd:sequence>
|
|
||||||
<xsd:element name="OtherRef" type="AnyType" maxOccurs="unbounded" />
|
|
||||||
</xsd:sequence>
|
|
||||||
</xsd:complexType>
|
|
||||||
<!-- End CompleteRevocationRefs-->
|
|
||||||
<xsd:element name="AttributeCertificateRefs" type="CompleteCertificateRefsType" />
|
|
||||||
<xsd:element name="AttributeRevocationRefs" type="CompleteRevocationRefsType" />
|
|
||||||
<xsd:element name="SigAndRefsTimeStamp" type="XAdESTimeStampType" />
|
|
||||||
<xsd:element name="RefsOnlyTimeStamp" type="XAdESTimeStampType" />
|
|
||||||
<!-- Start CertificateValues -->
|
|
||||||
<xsd:element name="CertificateValues" type="CertificateValuesType" />
|
|
||||||
<xsd:complexType name="CertificateValuesType">
|
|
||||||
<xsd:choice minOccurs="0" maxOccurs="unbounded">
|
|
||||||
<xsd:element name="EncapsulatedX509Certificate" type="EncapsulatedPKIDataType" />
|
|
||||||
<xsd:element name="OtherCertificate" type="AnyType" />
|
|
||||||
</xsd:choice>
|
|
||||||
<xsd:attribute name="Id" type="xsd:ID" use="optional" />
|
|
||||||
</xsd:complexType>
|
|
||||||
<!-- End CertificateValues -->
|
|
||||||
<!-- Start RevocationValues-->
|
|
||||||
<xsd:element name="RevocationValues" type="RevocationValuesType" />
|
|
||||||
<xsd:complexType name="RevocationValuesType">
|
|
||||||
<xsd:sequence>
|
|
||||||
<xsd:element name="CRLValues" type="CRLValuesType" minOccurs="0" />
|
|
||||||
<xsd:element name="OCSPValues" type="OCSPValuesType" minOccurs="0" />
|
|
||||||
<xsd:element name="OtherValues" type="OtherCertStatusValuesType" minOccurs="0" />
|
|
||||||
</xsd:sequence>
|
|
||||||
<xsd:attribute name="Id" type="xsd:ID" use="optional" />
|
|
||||||
</xsd:complexType>
|
|
||||||
<xsd:complexType name="CRLValuesType">
|
|
||||||
<xsd:sequence>
|
|
||||||
<xsd:element name="EncapsulatedCRLValue" type="EncapsulatedPKIDataType" maxOccurs="unbounded" />
|
|
||||||
</xsd:sequence>
|
|
||||||
</xsd:complexType>
|
|
||||||
<xsd:complexType name="OCSPValuesType">
|
|
||||||
<xsd:sequence>
|
|
||||||
<xsd:element name="EncapsulatedOCSPValue" type="EncapsulatedPKIDataType" maxOccurs="unbounded" />
|
|
||||||
</xsd:sequence>
|
|
||||||
</xsd:complexType>
|
|
||||||
<xsd:complexType name="OtherCertStatusValuesType">
|
|
||||||
<xsd:sequence>
|
|
||||||
<xsd:element name="OtherValue" type="AnyType" maxOccurs="unbounded" />
|
|
||||||
</xsd:sequence>
|
|
||||||
</xsd:complexType>
|
|
||||||
<!-- End RevocationValues-->
|
|
||||||
<xsd:element name="AttrAuthoritiesCertValues" type="CertificateValuesType" />
|
|
||||||
<xsd:element name="AttributeRevocationValues" type="RevocationValuesType" />
|
|
||||||
<xsd:element name="ArchiveTimeStamp" type="XAdESTimeStampType" />
|
|
||||||
</xsd:schema>
|
|
||||||
|
|
@ -1,46 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!--
|
|
||||||
~ 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.
|
|
||||||
-->
|
|
||||||
|
|
||||||
<!--
|
|
||||||
Library: OASIS Universal Business Language (UBL) 2.1 OS
|
|
||||||
http://docs.oasis-open.org/ubl/os-UBL-2.1/
|
|
||||||
Release Date: 04 November 2013
|
|
||||||
Module: UBL-XAdESv141-2.1.xsd
|
|
||||||
Generated on: 2011-02-21 17:20(UTC)
|
|
||||||
|
|
||||||
This is a copy of http://uri.etsi.org/01903/v1.4.1/XAdESv141.xsd modified
|
|
||||||
only to change the importing URI for the XAdES v1.3.2 schema.
|
|
||||||
-->
|
|
||||||
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xades="http://uri.etsi.org/01903/v1.3.2#"
|
|
||||||
targetNamespace="http://uri.etsi.org/01903/v1.4.1#" xmlns="http://uri.etsi.org/01903/v1.4.1#"
|
|
||||||
elementFormDefault="qualified">
|
|
||||||
<xsd:import namespace="http://uri.etsi.org/01903/v1.3.2#" schemaLocation="UBL-XAdESv132-2.1.xsd" />
|
|
||||||
<!-- Start CertificateValues -->
|
|
||||||
<xsd:element name="TimeStampValidationData" type="ValidationDataType" />
|
|
||||||
<xsd:complexType name="ValidationDataType">
|
|
||||||
<xsd:sequence>
|
|
||||||
<xsd:element ref="xades:CertificateValues" minOccurs="0" />
|
|
||||||
<xsd:element ref="xades:RevocationValues" minOccurs="0" />
|
|
||||||
</xsd:sequence>
|
|
||||||
<xsd:attribute name="Id" type="xsd:ID" use="optional" />
|
|
||||||
<xsd:attribute name="UR" type="xsd:anyURI" use="optional" />
|
|
||||||
</xsd:complexType>
|
|
||||||
<xsd:element name="ArchiveTimeStampV2" type="xades:XAdESTimeStampType" />
|
|
||||||
</xsd:schema>
|
|
||||||
|
|
@ -1,332 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<!--
|
|
||||||
~ 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.
|
|
||||||
-->
|
|
||||||
|
|
||||||
<!--
|
|
||||||
Library: OASIS Universal Business Language (UBL) 2.1 OS
|
|
||||||
http://docs.oasis-open.org/ubl/os-UBL-2.1/
|
|
||||||
Release Date: 04 November 2013
|
|
||||||
Module: UBL-xmldsig-core-schema-2.1.xsd
|
|
||||||
Generated on: 2010-08-13 19:10(UTC)
|
|
||||||
|
|
||||||
This is a copy of http://www.w3.org/TR/xmldsig-core/xmldsig-core-schema.xsd
|
|
||||||
modified only to remove these PUBLIC and SYSTEM identifiers from the DOCTYPE:
|
|
||||||
|
|
||||||
PUBLIC "-//W3C//DTD XMLSchema 200102//EN"
|
|
||||||
"http://www.w3.org/2001/XMLSchema.dtd"
|
|
||||||
-->
|
|
||||||
<!DOCTYPE schema
|
|
||||||
[
|
|
||||||
<!ATTLIST schema
|
|
||||||
xmlns:ds CDATA #FIXED "http://www.w3.org/2000/09/xmldsig#">
|
|
||||||
<!ENTITY dsig 'http://www.w3.org/2000/09/xmldsig#'>
|
|
||||||
<!ENTITY % p ''>
|
|
||||||
<!ENTITY % s ''>
|
|
||||||
]>
|
|
||||||
|
|
||||||
<schema xmlns:ds="http://www.w3.org/2000/09/xmldsig#"
|
|
||||||
xmlns="http://www.w3.org/2001/XMLSchema"
|
|
||||||
targetNamespace="http://www.w3.org/2000/09/xmldsig#"
|
|
||||||
version="0.1" elementFormDefault="qualified">
|
|
||||||
|
|
||||||
<!-- Basic Types Defined for Signatures -->
|
|
||||||
|
|
||||||
<simpleType name="CryptoBinary">
|
|
||||||
<restriction base="base64Binary">
|
|
||||||
</restriction>
|
|
||||||
</simpleType>
|
|
||||||
|
|
||||||
<!-- Start Signature -->
|
|
||||||
|
|
||||||
<element name="Signature" type="ds:SignatureType" />
|
|
||||||
<complexType name="SignatureType">
|
|
||||||
<sequence>
|
|
||||||
<element ref="ds:SignedInfo" />
|
|
||||||
<element ref="ds:SignatureValue" />
|
|
||||||
<element ref="ds:KeyInfo" minOccurs="0" />
|
|
||||||
<element ref="ds:Object" minOccurs="0" maxOccurs="unbounded" />
|
|
||||||
</sequence>
|
|
||||||
<attribute name="Id" type="ID" use="optional" />
|
|
||||||
</complexType>
|
|
||||||
|
|
||||||
<element name="SignatureValue" type="ds:SignatureValueType" />
|
|
||||||
<complexType name="SignatureValueType">
|
|
||||||
<simpleContent>
|
|
||||||
<extension base="base64Binary">
|
|
||||||
<attribute name="Id" type="ID" use="optional" />
|
|
||||||
</extension>
|
|
||||||
</simpleContent>
|
|
||||||
</complexType>
|
|
||||||
|
|
||||||
<!-- Start SignedInfo -->
|
|
||||||
|
|
||||||
<element name="SignedInfo" type="ds:SignedInfoType" />
|
|
||||||
<complexType name="SignedInfoType">
|
|
||||||
<sequence>
|
|
||||||
<element ref="ds:CanonicalizationMethod" />
|
|
||||||
<element ref="ds:SignatureMethod" />
|
|
||||||
<element ref="ds:Reference" maxOccurs="unbounded" />
|
|
||||||
</sequence>
|
|
||||||
<attribute name="Id" type="ID" use="optional" />
|
|
||||||
</complexType>
|
|
||||||
|
|
||||||
<element name="CanonicalizationMethod" type="ds:CanonicalizationMethodType" />
|
|
||||||
<complexType name="CanonicalizationMethodType" mixed="true">
|
|
||||||
<sequence>
|
|
||||||
<any namespace="##any" minOccurs="0" maxOccurs="unbounded" />
|
|
||||||
<!-- (0,unbounded) elements from (1,1) namespace -->
|
|
||||||
</sequence>
|
|
||||||
<attribute name="Algorithm" type="anyURI" use="required" />
|
|
||||||
</complexType>
|
|
||||||
|
|
||||||
<element name="SignatureMethod" type="ds:SignatureMethodType" />
|
|
||||||
<complexType name="SignatureMethodType" mixed="true">
|
|
||||||
<sequence>
|
|
||||||
<element name="HMACOutputLength" minOccurs="0" type="ds:HMACOutputLengthType" />
|
|
||||||
<any namespace="##other" minOccurs="0" maxOccurs="unbounded" />
|
|
||||||
<!-- (0,unbounded) elements from (1,1) external namespace -->
|
|
||||||
</sequence>
|
|
||||||
<attribute name="Algorithm" type="anyURI" use="required" />
|
|
||||||
</complexType>
|
|
||||||
|
|
||||||
<!-- Start Reference -->
|
|
||||||
|
|
||||||
<element name="Reference" type="ds:ReferenceType" />
|
|
||||||
<complexType name="ReferenceType">
|
|
||||||
<sequence>
|
|
||||||
<element ref="ds:Transforms" minOccurs="0" />
|
|
||||||
<element ref="ds:DigestMethod" />
|
|
||||||
<element ref="ds:DigestValue" />
|
|
||||||
</sequence>
|
|
||||||
<attribute name="Id" type="ID" use="optional" />
|
|
||||||
<attribute name="URI" type="anyURI" use="optional" />
|
|
||||||
<attribute name="Type" type="anyURI" use="optional" />
|
|
||||||
</complexType>
|
|
||||||
|
|
||||||
<element name="Transforms" type="ds:TransformsType" />
|
|
||||||
<complexType name="TransformsType">
|
|
||||||
<sequence>
|
|
||||||
<element ref="ds:Transform" maxOccurs="unbounded" />
|
|
||||||
</sequence>
|
|
||||||
</complexType>
|
|
||||||
|
|
||||||
<element name="Transform" type="ds:TransformType" />
|
|
||||||
<complexType name="TransformType" mixed="true">
|
|
||||||
<choice minOccurs="0" maxOccurs="unbounded">
|
|
||||||
<any namespace="##other" processContents="lax" />
|
|
||||||
<!-- (1,1) elements from (0,unbounded) namespaces -->
|
|
||||||
<element name="XPath" type="string" />
|
|
||||||
</choice>
|
|
||||||
<attribute name="Algorithm" type="anyURI" use="required" />
|
|
||||||
</complexType>
|
|
||||||
|
|
||||||
<!-- End Reference -->
|
|
||||||
|
|
||||||
<element name="DigestMethod" type="ds:DigestMethodType" />
|
|
||||||
<complexType name="DigestMethodType" mixed="true">
|
|
||||||
<sequence>
|
|
||||||
<any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded" />
|
|
||||||
</sequence>
|
|
||||||
<attribute name="Algorithm" type="anyURI" use="required" />
|
|
||||||
</complexType>
|
|
||||||
|
|
||||||
<element name="DigestValue" type="ds:DigestValueType" />
|
|
||||||
<simpleType name="DigestValueType">
|
|
||||||
<restriction base="base64Binary" />
|
|
||||||
</simpleType>
|
|
||||||
|
|
||||||
<!-- End SignedInfo -->
|
|
||||||
|
|
||||||
<!-- Start KeyInfo -->
|
|
||||||
|
|
||||||
<element name="KeyInfo" type="ds:KeyInfoType" />
|
|
||||||
<complexType name="KeyInfoType" mixed="true">
|
|
||||||
<choice maxOccurs="unbounded">
|
|
||||||
<element ref="ds:KeyName" />
|
|
||||||
<element ref="ds:KeyValue" />
|
|
||||||
<element ref="ds:RetrievalMethod" />
|
|
||||||
<element ref="ds:X509Data" />
|
|
||||||
<element ref="ds:PGPData" />
|
|
||||||
<element ref="ds:SPKIData" />
|
|
||||||
<element ref="ds:MgmtData" />
|
|
||||||
<any processContents="lax" namespace="##other" />
|
|
||||||
<!-- (1,1) elements from (0,unbounded) namespaces -->
|
|
||||||
</choice>
|
|
||||||
<attribute name="Id" type="ID" use="optional" />
|
|
||||||
</complexType>
|
|
||||||
|
|
||||||
<element name="KeyName" type="string" />
|
|
||||||
<element name="MgmtData" type="string" />
|
|
||||||
|
|
||||||
<element name="KeyValue" type="ds:KeyValueType" />
|
|
||||||
<complexType name="KeyValueType" mixed="true">
|
|
||||||
<choice>
|
|
||||||
<element ref="ds:DSAKeyValue" />
|
|
||||||
<element ref="ds:RSAKeyValue" />
|
|
||||||
<any namespace="##other" processContents="lax" />
|
|
||||||
</choice>
|
|
||||||
</complexType>
|
|
||||||
|
|
||||||
<element name="RetrievalMethod" type="ds:RetrievalMethodType" />
|
|
||||||
<complexType name="RetrievalMethodType">
|
|
||||||
<sequence>
|
|
||||||
<element ref="ds:Transforms" minOccurs="0" />
|
|
||||||
</sequence>
|
|
||||||
<attribute name="URI" type="anyURI" />
|
|
||||||
<attribute name="Type" type="anyURI" use="optional" />
|
|
||||||
</complexType>
|
|
||||||
|
|
||||||
<!-- Start X509Data -->
|
|
||||||
|
|
||||||
<element name="X509Data" type="ds:X509DataType" />
|
|
||||||
<complexType name="X509DataType">
|
|
||||||
<sequence maxOccurs="unbounded">
|
|
||||||
<choice>
|
|
||||||
<element name="X509IssuerSerial" type="ds:X509IssuerSerialType" />
|
|
||||||
<element name="X509SKI" type="base64Binary" />
|
|
||||||
<element name="X509SubjectName" type="string" />
|
|
||||||
<element name="X509Certificate" type="base64Binary" />
|
|
||||||
<element name="X509CRL" type="base64Binary" />
|
|
||||||
<any namespace="##other" processContents="lax" />
|
|
||||||
</choice>
|
|
||||||
</sequence>
|
|
||||||
</complexType>
|
|
||||||
|
|
||||||
<complexType name="X509IssuerSerialType">
|
|
||||||
<sequence>
|
|
||||||
<element name="X509IssuerName" type="string" />
|
|
||||||
<element name="X509SerialNumber" type="integer" />
|
|
||||||
</sequence>
|
|
||||||
</complexType>
|
|
||||||
|
|
||||||
<!-- End X509Data -->
|
|
||||||
|
|
||||||
<!-- Begin PGPData -->
|
|
||||||
|
|
||||||
<element name="PGPData" type="ds:PGPDataType" />
|
|
||||||
<complexType name="PGPDataType">
|
|
||||||
<choice>
|
|
||||||
<sequence>
|
|
||||||
<element name="PGPKeyID" type="base64Binary" />
|
|
||||||
<element name="PGPKeyPacket" type="base64Binary" minOccurs="0" />
|
|
||||||
<any namespace="##other" processContents="lax" minOccurs="0"
|
|
||||||
maxOccurs="unbounded" />
|
|
||||||
</sequence>
|
|
||||||
<sequence>
|
|
||||||
<element name="PGPKeyPacket" type="base64Binary" />
|
|
||||||
<any namespace="##other" processContents="lax" minOccurs="0"
|
|
||||||
maxOccurs="unbounded" />
|
|
||||||
</sequence>
|
|
||||||
</choice>
|
|
||||||
</complexType>
|
|
||||||
|
|
||||||
<!-- End PGPData -->
|
|
||||||
|
|
||||||
<!-- Begin SPKIData -->
|
|
||||||
|
|
||||||
<element name="SPKIData" type="ds:SPKIDataType" />
|
|
||||||
<complexType name="SPKIDataType">
|
|
||||||
<sequence maxOccurs="unbounded">
|
|
||||||
<element name="SPKISexp" type="base64Binary" />
|
|
||||||
<any namespace="##other" processContents="lax" minOccurs="0" />
|
|
||||||
</sequence>
|
|
||||||
</complexType>
|
|
||||||
|
|
||||||
<!-- End SPKIData -->
|
|
||||||
|
|
||||||
<!-- End KeyInfo -->
|
|
||||||
|
|
||||||
<!-- Start Object (Manifest, SignatureProperty) -->
|
|
||||||
|
|
||||||
<element name="Object" type="ds:ObjectType" />
|
|
||||||
<complexType name="ObjectType" mixed="true">
|
|
||||||
<sequence minOccurs="0" maxOccurs="unbounded">
|
|
||||||
<any namespace="##any" processContents="lax" />
|
|
||||||
</sequence>
|
|
||||||
<attribute name="Id" type="ID" use="optional" />
|
|
||||||
<attribute name="MimeType" type="string" use="optional" /> <!-- add a grep facet -->
|
|
||||||
<attribute name="Encoding" type="anyURI" use="optional" />
|
|
||||||
</complexType>
|
|
||||||
|
|
||||||
<element name="Manifest" type="ds:ManifestType" />
|
|
||||||
<complexType name="ManifestType">
|
|
||||||
<sequence>
|
|
||||||
<element ref="ds:Reference" maxOccurs="unbounded" />
|
|
||||||
</sequence>
|
|
||||||
<attribute name="Id" type="ID" use="optional" />
|
|
||||||
</complexType>
|
|
||||||
|
|
||||||
<element name="SignatureProperties" type="ds:SignaturePropertiesType" />
|
|
||||||
<complexType name="SignaturePropertiesType">
|
|
||||||
<sequence>
|
|
||||||
<element ref="ds:SignatureProperty" maxOccurs="unbounded" />
|
|
||||||
</sequence>
|
|
||||||
<attribute name="Id" type="ID" use="optional" />
|
|
||||||
</complexType>
|
|
||||||
|
|
||||||
<element name="SignatureProperty" type="ds:SignaturePropertyType" />
|
|
||||||
<complexType name="SignaturePropertyType" mixed="true">
|
|
||||||
<choice maxOccurs="unbounded">
|
|
||||||
<any namespace="##other" processContents="lax" />
|
|
||||||
<!-- (1,1) elements from (1,unbounded) namespaces -->
|
|
||||||
</choice>
|
|
||||||
<attribute name="Target" type="anyURI" use="required" />
|
|
||||||
<attribute name="Id" type="ID" use="optional" />
|
|
||||||
</complexType>
|
|
||||||
|
|
||||||
<!-- End Object (Manifest, SignatureProperty) -->
|
|
||||||
|
|
||||||
<!-- Start Algorithm Parameters -->
|
|
||||||
|
|
||||||
<simpleType name="HMACOutputLengthType">
|
|
||||||
<restriction base="integer" />
|
|
||||||
</simpleType>
|
|
||||||
|
|
||||||
<!-- Start KeyValue Element-types -->
|
|
||||||
|
|
||||||
<element name="DSAKeyValue" type="ds:DSAKeyValueType" />
|
|
||||||
<complexType name="DSAKeyValueType">
|
|
||||||
<sequence>
|
|
||||||
<sequence minOccurs="0">
|
|
||||||
<element name="P" type="ds:CryptoBinary" />
|
|
||||||
<element name="Q" type="ds:CryptoBinary" />
|
|
||||||
</sequence>
|
|
||||||
<element name="G" type="ds:CryptoBinary" minOccurs="0" />
|
|
||||||
<element name="Y" type="ds:CryptoBinary" />
|
|
||||||
<element name="J" type="ds:CryptoBinary" minOccurs="0" />
|
|
||||||
<sequence minOccurs="0">
|
|
||||||
<element name="Seed" type="ds:CryptoBinary" />
|
|
||||||
<element name="PgenCounter" type="ds:CryptoBinary" />
|
|
||||||
</sequence>
|
|
||||||
</sequence>
|
|
||||||
</complexType>
|
|
||||||
|
|
||||||
<element name="RSAKeyValue" type="ds:RSAKeyValueType" />
|
|
||||||
<complexType name="RSAKeyValueType">
|
|
||||||
<sequence>
|
|
||||||
<element name="Modulus" type="ds:CryptoBinary" />
|
|
||||||
<element name="Exponent" type="ds:CryptoBinary" />
|
|
||||||
</sequence>
|
|
||||||
</complexType>
|
|
||||||
|
|
||||||
<!-- End KeyValue Element-types -->
|
|
||||||
|
|
||||||
<!-- End Signature -->
|
|
||||||
|
|
||||||
</schema>
|
|
||||||
|
|
@ -1,153 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!--
|
|
||||||
~ 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.
|
|
||||||
-->
|
|
||||||
<xsd:schema xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2"
|
|
||||||
xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2"
|
|
||||||
xmlns:ext="urn:oasis:names:specification:ubl:schema:xsd:CommonExtensionComponents-2"
|
|
||||||
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
|
||||||
xmlns="urn:oasis:names:specification:ubl:schema:xsd:CreditNote-2"
|
|
||||||
targetNamespace="urn:oasis:names:specification:ubl:schema:xsd:CreditNote-2"
|
|
||||||
elementFormDefault="qualified"
|
|
||||||
attributeFormDefault="unqualified"
|
|
||||||
version="2.1">
|
|
||||||
<xsd:import namespace="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2"
|
|
||||||
schemaLocation="../common/UBL-CommonAggregateComponents-2.1.xsd" />
|
|
||||||
<xsd:import namespace="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2"
|
|
||||||
schemaLocation="../common/UBL-CommonBasicComponents-2.1.xsd" />
|
|
||||||
<xsd:import namespace="urn:oasis:names:specification:ubl:schema:xsd:CommonExtensionComponents-2"
|
|
||||||
schemaLocation="../common/UBL-CommonExtensionComponents-2.1.xsd" />
|
|
||||||
<xsd:element name="CreditNote" type="CreditNoteType" />
|
|
||||||
<xsd:complexType name="CreditNoteType">
|
|
||||||
<xsd:sequence>
|
|
||||||
<xsd:element ref="ext:UBLExtensions" minOccurs="0" maxOccurs="1" />
|
|
||||||
<xsd:element ref="cbc:UBLVersionID" minOccurs="0" maxOccurs="1" />
|
|
||||||
<xsd:element ref="cbc:CustomizationID" minOccurs="0" maxOccurs="1" />
|
|
||||||
<xsd:element ref="cbc:ProfileID" minOccurs="0" maxOccurs="1" />
|
|
||||||
<xsd:element ref="cbc:ProfileExecutionID" minOccurs="0" maxOccurs="1" />
|
|
||||||
<xsd:element ref="cbc:ID" minOccurs="1" maxOccurs="1" />
|
|
||||||
<xsd:element ref="cbc:CopyIndicator" minOccurs="0" maxOccurs="1" />
|
|
||||||
<xsd:element ref="cbc:UUID" minOccurs="0" maxOccurs="1" />
|
|
||||||
<xsd:element ref="cbc:IssueDate" minOccurs="1" maxOccurs="1" />
|
|
||||||
<xsd:element ref="cbc:IssueTime" minOccurs="0" maxOccurs="1" />
|
|
||||||
<xsd:element ref="cbc:TaxPointDate" minOccurs="0" maxOccurs="1" />
|
|
||||||
<xsd:element ref="cbc:CreditNoteTypeCode" minOccurs="0" maxOccurs="1" />
|
|
||||||
<xsd:element ref="cbc:Note" minOccurs="0" maxOccurs="unbounded" />
|
|
||||||
<xsd:element ref="cbc:DocumentCurrencyCode" minOccurs="0" maxOccurs="1" />
|
|
||||||
<xsd:element ref="cbc:TaxCurrencyCode" minOccurs="0" maxOccurs="1" />
|
|
||||||
<xsd:element ref="cbc:PricingCurrencyCode" minOccurs="0" maxOccurs="1" />
|
|
||||||
<xsd:element ref="cbc:PaymentCurrencyCode" minOccurs="0" maxOccurs="1" />
|
|
||||||
<xsd:element ref="cbc:PaymentAlternativeCurrencyCode"
|
|
||||||
minOccurs="0"
|
|
||||||
maxOccurs="1" />
|
|
||||||
<xsd:element ref="cbc:AccountingCostCode" minOccurs="0" maxOccurs="1" />
|
|
||||||
<xsd:element ref="cbc:AccountingCost" minOccurs="0" maxOccurs="1" />
|
|
||||||
<xsd:element ref="cbc:LineCountNumeric" minOccurs="0" maxOccurs="1" />
|
|
||||||
<xsd:element ref="cbc:BuyerReference" minOccurs="0" maxOccurs="1" />
|
|
||||||
<xsd:element ref="cac:InvoicePeriod" minOccurs="0" maxOccurs="unbounded" />
|
|
||||||
<xsd:element ref="cac:DiscrepancyResponse" minOccurs="0" maxOccurs="unbounded" />
|
|
||||||
<xsd:element ref="cac:OrderReference" minOccurs="0" maxOccurs="1" />
|
|
||||||
<xsd:element ref="cac:BillingReference" minOccurs="0" maxOccurs="unbounded" />
|
|
||||||
<xsd:element ref="cac:DespatchDocumentReference"
|
|
||||||
minOccurs="0"
|
|
||||||
maxOccurs="unbounded" />
|
|
||||||
<xsd:element ref="cac:ReceiptDocumentReference"
|
|
||||||
minOccurs="0"
|
|
||||||
maxOccurs="unbounded" />
|
|
||||||
<xsd:element ref="cac:ContractDocumentReference"
|
|
||||||
minOccurs="0"
|
|
||||||
maxOccurs="unbounded" />
|
|
||||||
<xsd:element ref="cac:AdditionalDocumentReference"
|
|
||||||
minOccurs="0"
|
|
||||||
maxOccurs="unbounded" />
|
|
||||||
<xsd:element ref="cac:StatementDocumentReference"
|
|
||||||
minOccurs="0"
|
|
||||||
maxOccurs="unbounded" />
|
|
||||||
<xsd:element ref="cac:OriginatorDocumentReference"
|
|
||||||
minOccurs="0"
|
|
||||||
maxOccurs="unbounded" />
|
|
||||||
<xsd:element ref="cac:Signature" minOccurs="0" maxOccurs="unbounded" />
|
|
||||||
<xsd:element ref="cac:AccountingSupplierParty" minOccurs="1" maxOccurs="1" />
|
|
||||||
<xsd:element ref="cac:AccountingCustomerParty" minOccurs="1" maxOccurs="1" />
|
|
||||||
<xsd:element ref="cac:PayeeParty" minOccurs="0" maxOccurs="1" />
|
|
||||||
<xsd:element ref="cac:BuyerCustomerParty" minOccurs="0" maxOccurs="1" />
|
|
||||||
<xsd:element ref="cac:SellerSupplierParty" minOccurs="0" maxOccurs="1" />
|
|
||||||
<xsd:element ref="cac:TaxRepresentativeParty" minOccurs="0" maxOccurs="1" />
|
|
||||||
<xsd:element ref="cac:Delivery" minOccurs="0" maxOccurs="unbounded" />
|
|
||||||
<xsd:element ref="cac:DeliveryTerms" minOccurs="0" maxOccurs="unbounded" />
|
|
||||||
<xsd:element ref="cac:PaymentMeans" minOccurs="0" maxOccurs="unbounded" />
|
|
||||||
<xsd:element ref="cac:PaymentTerms" minOccurs="0" maxOccurs="unbounded" />
|
|
||||||
<xsd:element ref="cac:TaxExchangeRate" minOccurs="0" maxOccurs="1" />
|
|
||||||
<xsd:element ref="cac:PricingExchangeRate" minOccurs="0" maxOccurs="1" />
|
|
||||||
<xsd:element ref="cac:PaymentExchangeRate" minOccurs="0" maxOccurs="1" />
|
|
||||||
<xsd:element ref="cac:PaymentAlternativeExchangeRate"
|
|
||||||
minOccurs="0"
|
|
||||||
maxOccurs="1" />
|
|
||||||
<xsd:element ref="cac:AllowanceCharge" minOccurs="0" maxOccurs="unbounded" />
|
|
||||||
<xsd:element ref="cac:TaxTotal" minOccurs="0" maxOccurs="unbounded" />
|
|
||||||
<xsd:element ref="cac:LegalMonetaryTotal" minOccurs="1" maxOccurs="1" />
|
|
||||||
<xsd:element ref="cac:CreditNoteLine" minOccurs="1" maxOccurs="unbounded" />
|
|
||||||
</xsd:sequence>
|
|
||||||
</xsd:complexType>
|
|
||||||
</xsd:schema>
|
|
||||||
<!-- ===== Copyright Notice ===== --><!--
|
|
||||||
OASIS takes no position regarding the validity or scope of any
|
|
||||||
intellectual property or other rights that might be claimed to pertain
|
|
||||||
to the implementation or use of the technology described in this
|
|
||||||
document or the extent to which any license under such rights
|
|
||||||
might or might not be available; neither does it represent that it has
|
|
||||||
made any effort to identify any such rights. Information on OASIS's
|
|
||||||
procedures with respect to rights in OASIS specifications can be
|
|
||||||
found at the OASIS website. Copies of claims of rights made
|
|
||||||
available for publication and any assurances of licenses to be made
|
|
||||||
available, or the result of an attempt made to obtain a general
|
|
||||||
license or permission for the use of such proprietary rights by
|
|
||||||
implementors or users of this specification, can be obtained from
|
|
||||||
the OASIS Executive Director.
|
|
||||||
|
|
||||||
OASIS invites any interested party to bring to its attention any
|
|
||||||
copyrights, patents or patent applications, or other proprietary
|
|
||||||
rights which may cover technology that may be required to
|
|
||||||
implement this specification. Please address the information to the
|
|
||||||
OASIS Executive Director.
|
|
||||||
|
|
||||||
This document and translations of it may be copied and furnished to
|
|
||||||
others, and derivative works that comment on or otherwise explain
|
|
||||||
it or assist in its implementation may be prepared, copied,
|
|
||||||
published and distributed, in whole or in part, without restriction of
|
|
||||||
any kind, provided that the above copyright notice and this
|
|
||||||
paragraph are included on all such copies and derivative works.
|
|
||||||
However, this document itself may not be modified in any way,
|
|
||||||
such as by removing the copyright notice or references to OASIS,
|
|
||||||
except as needed for the purpose of developing OASIS
|
|
||||||
specifications, in which case the procedures for copyrights defined
|
|
||||||
in the OASIS Intellectual Property Rights document must be
|
|
||||||
followed, or as required to translate it into languages other than
|
|
||||||
English.
|
|
||||||
|
|
||||||
The limited permissions granted above are perpetual and will not be
|
|
||||||
revoked by OASIS or its successors or assigns.
|
|
||||||
|
|
||||||
This document and the information contained herein is provided on
|
|
||||||
an "AS IS" basis and OASIS DISCLAIMS ALL WARRANTIES,
|
|
||||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY
|
|
||||||
WARRANTY THAT THE USE OF THE INFORMATION HEREIN
|
|
||||||
WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED
|
|
||||||
WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A
|
|
||||||
PARTICULAR PURPOSE.
|
|
||||||
-->
|
|
||||||
|
|
@ -1,156 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!--
|
|
||||||
~ 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.
|
|
||||||
-->
|
|
||||||
<xsd:schema xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2"
|
|
||||||
xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2"
|
|
||||||
xmlns:ext="urn:oasis:names:specification:ubl:schema:xsd:CommonExtensionComponents-2"
|
|
||||||
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
|
||||||
xmlns="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2"
|
|
||||||
targetNamespace="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2"
|
|
||||||
elementFormDefault="qualified"
|
|
||||||
attributeFormDefault="unqualified"
|
|
||||||
version="2.1">
|
|
||||||
<xsd:import namespace="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2"
|
|
||||||
schemaLocation="../common/UBL-CommonAggregateComponents-2.1.xsd" />
|
|
||||||
<xsd:import namespace="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2"
|
|
||||||
schemaLocation="../common/UBL-CommonBasicComponents-2.1.xsd" />
|
|
||||||
<xsd:import namespace="urn:oasis:names:specification:ubl:schema:xsd:CommonExtensionComponents-2"
|
|
||||||
schemaLocation="../common/UBL-CommonExtensionComponents-2.1.xsd" />
|
|
||||||
<xsd:element name="Invoice" type="InvoiceType" />
|
|
||||||
<xsd:complexType name="InvoiceType">
|
|
||||||
<xsd:sequence>
|
|
||||||
<xsd:element ref="ext:UBLExtensions" minOccurs="0" maxOccurs="1" />
|
|
||||||
<xsd:element ref="cbc:UBLVersionID" minOccurs="0" maxOccurs="1" />
|
|
||||||
<xsd:element ref="cbc:CustomizationID" minOccurs="0" maxOccurs="1" />
|
|
||||||
<xsd:element ref="cbc:ProfileID" minOccurs="0" maxOccurs="1" />
|
|
||||||
<xsd:element ref="cbc:ProfileExecutionID" minOccurs="0" maxOccurs="1" />
|
|
||||||
<xsd:element ref="cbc:ID" minOccurs="1" maxOccurs="1" />
|
|
||||||
<xsd:element ref="cbc:CopyIndicator" minOccurs="0" maxOccurs="1" />
|
|
||||||
<xsd:element ref="cbc:UUID" minOccurs="0" maxOccurs="1" />
|
|
||||||
<xsd:element ref="cbc:IssueDate" minOccurs="1" maxOccurs="1" />
|
|
||||||
<xsd:element ref="cbc:IssueTime" minOccurs="0" maxOccurs="1" />
|
|
||||||
<xsd:element ref="cbc:DueDate" minOccurs="0" maxOccurs="1" />
|
|
||||||
<xsd:element ref="cbc:InvoiceTypeCode" minOccurs="0" maxOccurs="1" />
|
|
||||||
<xsd:element ref="cbc:Note" minOccurs="0" maxOccurs="unbounded" />
|
|
||||||
<xsd:element ref="cbc:TaxPointDate" minOccurs="0" maxOccurs="1" />
|
|
||||||
<xsd:element ref="cbc:DocumentCurrencyCode" minOccurs="0" maxOccurs="1" />
|
|
||||||
<xsd:element ref="cbc:TaxCurrencyCode" minOccurs="0" maxOccurs="1" />
|
|
||||||
<xsd:element ref="cbc:PricingCurrencyCode" minOccurs="0" maxOccurs="1" />
|
|
||||||
<xsd:element ref="cbc:PaymentCurrencyCode" minOccurs="0" maxOccurs="1" />
|
|
||||||
<xsd:element ref="cbc:PaymentAlternativeCurrencyCode"
|
|
||||||
minOccurs="0"
|
|
||||||
maxOccurs="1" />
|
|
||||||
<xsd:element ref="cbc:AccountingCostCode" minOccurs="0" maxOccurs="1" />
|
|
||||||
<xsd:element ref="cbc:AccountingCost" minOccurs="0" maxOccurs="1" />
|
|
||||||
<xsd:element ref="cbc:LineCountNumeric" minOccurs="0" maxOccurs="1" />
|
|
||||||
<xsd:element ref="cbc:BuyerReference" minOccurs="0" maxOccurs="1" />
|
|
||||||
<xsd:element ref="cac:InvoicePeriod" minOccurs="0" maxOccurs="unbounded" />
|
|
||||||
<xsd:element ref="cac:OrderReference" minOccurs="0" maxOccurs="1" />
|
|
||||||
<xsd:element ref="cac:BillingReference" minOccurs="0" maxOccurs="unbounded" />
|
|
||||||
<xsd:element ref="cac:DespatchDocumentReference"
|
|
||||||
minOccurs="0"
|
|
||||||
maxOccurs="unbounded" />
|
|
||||||
<xsd:element ref="cac:ReceiptDocumentReference"
|
|
||||||
minOccurs="0"
|
|
||||||
maxOccurs="unbounded" />
|
|
||||||
<xsd:element ref="cac:StatementDocumentReference"
|
|
||||||
minOccurs="0"
|
|
||||||
maxOccurs="unbounded" />
|
|
||||||
<xsd:element ref="cac:OriginatorDocumentReference"
|
|
||||||
minOccurs="0"
|
|
||||||
maxOccurs="unbounded" />
|
|
||||||
<xsd:element ref="cac:ContractDocumentReference"
|
|
||||||
minOccurs="0"
|
|
||||||
maxOccurs="unbounded" />
|
|
||||||
<xsd:element ref="cac:AdditionalDocumentReference"
|
|
||||||
minOccurs="0"
|
|
||||||
maxOccurs="unbounded" />
|
|
||||||
<xsd:element ref="cac:ProjectReference" minOccurs="0" maxOccurs="unbounded" />
|
|
||||||
<xsd:element ref="cac:Signature" minOccurs="0" maxOccurs="unbounded" />
|
|
||||||
<xsd:element ref="cac:AccountingSupplierParty" minOccurs="1" maxOccurs="1" />
|
|
||||||
<xsd:element ref="cac:AccountingCustomerParty" minOccurs="1" maxOccurs="1" />
|
|
||||||
<xsd:element ref="cac:PayeeParty" minOccurs="0" maxOccurs="1" />
|
|
||||||
<xsd:element ref="cac:BuyerCustomerParty" minOccurs="0" maxOccurs="1" />
|
|
||||||
<xsd:element ref="cac:SellerSupplierParty" minOccurs="0" maxOccurs="1" />
|
|
||||||
<xsd:element ref="cac:TaxRepresentativeParty" minOccurs="0" maxOccurs="1" />
|
|
||||||
<xsd:element ref="cac:Delivery" minOccurs="0" maxOccurs="unbounded" />
|
|
||||||
<xsd:element ref="cac:DeliveryTerms" minOccurs="0" maxOccurs="1" />
|
|
||||||
<xsd:element ref="cac:PaymentMeans" minOccurs="0" maxOccurs="unbounded" />
|
|
||||||
<xsd:element ref="cac:PaymentTerms" minOccurs="0" maxOccurs="unbounded" />
|
|
||||||
<xsd:element ref="cac:PrepaidPayment" minOccurs="0" maxOccurs="unbounded" />
|
|
||||||
<xsd:element ref="cac:AllowanceCharge" minOccurs="0" maxOccurs="unbounded" />
|
|
||||||
<xsd:element ref="cac:TaxExchangeRate" minOccurs="0" maxOccurs="1" />
|
|
||||||
<xsd:element ref="cac:PricingExchangeRate" minOccurs="0" maxOccurs="1" />
|
|
||||||
<xsd:element ref="cac:PaymentExchangeRate" minOccurs="0" maxOccurs="1" />
|
|
||||||
<xsd:element ref="cac:PaymentAlternativeExchangeRate"
|
|
||||||
minOccurs="0"
|
|
||||||
maxOccurs="1" />
|
|
||||||
<xsd:element ref="cac:TaxTotal" minOccurs="0" maxOccurs="unbounded" />
|
|
||||||
<xsd:element ref="cac:WithholdingTaxTotal" minOccurs="0" maxOccurs="unbounded" />
|
|
||||||
<xsd:element ref="cac:LegalMonetaryTotal" minOccurs="1" maxOccurs="1" />
|
|
||||||
<xsd:element ref="cac:InvoiceLine" minOccurs="1" maxOccurs="unbounded" />
|
|
||||||
</xsd:sequence>
|
|
||||||
</xsd:complexType>
|
|
||||||
</xsd:schema>
|
|
||||||
<!-- ===== Copyright Notice ===== --><!--
|
|
||||||
OASIS takes no position regarding the validity or scope of any
|
|
||||||
intellectual property or other rights that might be claimed to pertain
|
|
||||||
to the implementation or use of the technology described in this
|
|
||||||
document or the extent to which any license under such rights
|
|
||||||
might or might not be available; neither does it represent that it has
|
|
||||||
made any effort to identify any such rights. Information on OASIS's
|
|
||||||
procedures with respect to rights in OASIS specifications can be
|
|
||||||
found at the OASIS website. Copies of claims of rights made
|
|
||||||
available for publication and any assurances of licenses to be made
|
|
||||||
available, or the result of an attempt made to obtain a general
|
|
||||||
license or permission for the use of such proprietary rights by
|
|
||||||
implementors or users of this specification, can be obtained from
|
|
||||||
the OASIS Executive Director.
|
|
||||||
|
|
||||||
OASIS invites any interested party to bring to its attention any
|
|
||||||
copyrights, patents or patent applications, or other proprietary
|
|
||||||
rights which may cover technology that may be required to
|
|
||||||
implement this specification. Please address the information to the
|
|
||||||
OASIS Executive Director.
|
|
||||||
|
|
||||||
This document and translations of it may be copied and furnished to
|
|
||||||
others, and derivative works that comment on or otherwise explain
|
|
||||||
it or assist in its implementation may be prepared, copied,
|
|
||||||
published and distributed, in whole or in part, without restriction of
|
|
||||||
any kind, provided that the above copyright notice and this
|
|
||||||
paragraph are included on all such copies and derivative works.
|
|
||||||
However, this document itself may not be modified in any way,
|
|
||||||
such as by removing the copyright notice or references to OASIS,
|
|
||||||
except as needed for the purpose of developing OASIS
|
|
||||||
specifications, in which case the procedures for copyrights defined
|
|
||||||
in the OASIS Intellectual Property Rights document must be
|
|
||||||
followed, or as required to translate it into languages other than
|
|
||||||
English.
|
|
||||||
|
|
||||||
The limited permissions granted above are perpetual and will not be
|
|
||||||
revoked by OASIS or its successors or assigns.
|
|
||||||
|
|
||||||
This document and the information contained herein is provided on
|
|
||||||
an "AS IS" basis and OASIS DISCLAIMS ALL WARRANTIES,
|
|
||||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY
|
|
||||||
WARRANTY THAT THE USE OF THE INFORMATION HEREIN
|
|
||||||
WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED
|
|
||||||
WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A
|
|
||||||
PARTICULAR PURPOSE.
|
|
||||||
-->
|
|
||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -1,756 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!--
|
|
||||||
~ 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.
|
|
||||||
-->
|
|
||||||
|
|
||||||
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
|
||||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
||||||
xmlns:xs="http://www.w3.org/2001/XMLSchema"
|
|
||||||
xmlns:rep="http://www.xoev.de/de/validator/varl/1 "
|
|
||||||
xmlns:s="http://www.xoev.de/de/validator/framework/1/scenarios"
|
|
||||||
xmlns:in="http://www.xoev.de/de/validator/framework/1/createreportinput"
|
|
||||||
xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
|
||||||
xmlns:xd="http://www.oxygenxml.com/ns/doc/xsl"
|
|
||||||
xmlns:html="http://www.w3.org/1999/xhtml"
|
|
||||||
exclude-result-prefixes="xs"
|
|
||||||
version="2.0">
|
|
||||||
|
|
||||||
<xsl:output method="xml" indent="yes" />
|
|
||||||
|
|
||||||
<xsl:param name="input-document" required="yes" />
|
|
||||||
|
|
||||||
<xsl:variable name="custom-levels" as="element(s:customLevel)*" select="//s:customLevel" />
|
|
||||||
|
|
||||||
|
|
||||||
<xsl:template match="in:createReportInput">
|
|
||||||
|
|
||||||
<xsl:variable name="validationStepResults" as="element(rep:validationStepResult)*">
|
|
||||||
<xsl:apply-templates select="in:validationResultsWellformedness" />
|
|
||||||
<xsl:apply-templates select="in:validationResultsXmlSchema" />
|
|
||||||
<xsl:apply-templates select="in:validationResultsSchematron" />
|
|
||||||
</xsl:variable>
|
|
||||||
|
|
||||||
<xsl:variable name="report" as="document-node(element(rep:report))">
|
|
||||||
<xsl:document>
|
|
||||||
<rep:report>
|
|
||||||
<xsl:attribute name="valid">
|
|
||||||
<xsl:choose>
|
|
||||||
<xsl:when test="s:noScenarioMatched">false</xsl:when>
|
|
||||||
<xsl:when test="$validationStepResults[@valid = 'false']">false</xsl:when>
|
|
||||||
<xsl:otherwise>true</xsl:otherwise>
|
|
||||||
</xsl:choose>
|
|
||||||
</xsl:attribute>
|
|
||||||
<xsl:apply-templates select="in:engine" mode="copy-to-report-ns" />
|
|
||||||
<xsl:apply-templates select="in:timestamp" mode="copy-to-report-ns" />
|
|
||||||
<xsl:apply-templates select="in:documentIdentification" mode="copy-to-report-ns" />
|
|
||||||
|
|
||||||
<xsl:choose>
|
|
||||||
<xsl:when test="s:scenario">
|
|
||||||
<rep:scenarioMatched>
|
|
||||||
<xsl:sequence select="s:scenario" />
|
|
||||||
<xsl:call-template name="document-data" />
|
|
||||||
<rep:validationResult>
|
|
||||||
<xsl:sequence select="$validationStepResults" />
|
|
||||||
</rep:validationResult>
|
|
||||||
</rep:scenarioMatched>
|
|
||||||
</xsl:when>
|
|
||||||
<xsl:otherwise>
|
|
||||||
<rep:noScenarioMatched>
|
|
||||||
|
|
||||||
</rep:noScenarioMatched>
|
|
||||||
</xsl:otherwise>
|
|
||||||
</xsl:choose>
|
|
||||||
</rep:report>
|
|
||||||
</xsl:document>
|
|
||||||
</xsl:variable>
|
|
||||||
|
|
||||||
<rep:report varlVersion="1.0.0">
|
|
||||||
<xsl:copy-of select="$report/rep:report/(node()|@*)" />
|
|
||||||
<xsl:apply-templates select="$report" mode="assessment" />
|
|
||||||
</rep:report>
|
|
||||||
|
|
||||||
</xsl:template>
|
|
||||||
|
|
||||||
<!-- Overwrite this template in customisation layer to generate a documentData element -->
|
|
||||||
<xsl:template name="document-data" />
|
|
||||||
|
|
||||||
|
|
||||||
<!-- ************************************************************************************** -->
|
|
||||||
<!-- * * -->
|
|
||||||
<!-- * Syntax checks (well-formedness and XML Schema * -->
|
|
||||||
<!-- * * -->
|
|
||||||
<!-- ************************************************************************************** -->
|
|
||||||
|
|
||||||
<xsl:template match="in:validationResultsWellformedness|in:validationResultsXmlSchema">
|
|
||||||
<xsl:variable name="id" as="xs:string"
|
|
||||||
select="if (self::inValidationResultsWellformedness) then 'val-xml' else 'val-xsd'" />
|
|
||||||
<xsl:variable name="messages" as="element(rep:message)*">
|
|
||||||
<xsl:apply-templates select="in:xmlSyntaxError">
|
|
||||||
<xsl:with-param name="parent-id" select="$id" />
|
|
||||||
</xsl:apply-templates>
|
|
||||||
</xsl:variable>
|
|
||||||
<!-- Skip output for implicit validation steps (i. e., wellformedness implemenation) unless there is anything to tell -->
|
|
||||||
<xsl:if test="exists($messages) or exists(s:resource)">
|
|
||||||
<rep:validationStepResult id="{$id}"
|
|
||||||
valid="{if ($messages[@level = ('warning', 'error')]) then false() else true()}">
|
|
||||||
<xsl:sequence select="s:resource" />
|
|
||||||
<xsl:sequence select="$messages" />
|
|
||||||
</rep:validationStepResult>
|
|
||||||
</xsl:if>
|
|
||||||
</xsl:template>
|
|
||||||
|
|
||||||
<xsl:template match="in:xmlSyntaxError">
|
|
||||||
<xsl:param name="parent-id" as="xs:string" required="yes" />
|
|
||||||
<xsl:variable name="id" select="concat($parent-id, '.', count(preceding-sibling::xmlSyntaxError) + 1)" />
|
|
||||||
<xsl:variable name="level" select="if (@severity = 'SEVERITY_WARNING') then 'warning' else 'error'" />
|
|
||||||
<rep:message id="{$id}" level="{$level}">
|
|
||||||
<xsl:apply-templates select="*" />
|
|
||||||
<xsl:value-of select="in:message" />
|
|
||||||
</rep:message>
|
|
||||||
</xsl:template>
|
|
||||||
|
|
||||||
<xsl:template match="in:xmlSyntaxError/in:*" priority="-1" />
|
|
||||||
|
|
||||||
|
|
||||||
<xsl:template match="in:xmlSyntaxError/in:rowNumber[. != '-1']">
|
|
||||||
<xsl:attribute name="lineNumber" select="." />
|
|
||||||
</xsl:template>
|
|
||||||
|
|
||||||
<xsl:template match="in:xmlSyntaxError/in:columnNumber[. != '-1']">
|
|
||||||
<xsl:attribute name="columnNumber" select="." />
|
|
||||||
</xsl:template>
|
|
||||||
|
|
||||||
<!-- ************************************************************************************** -->
|
|
||||||
<!-- * * -->
|
|
||||||
<!-- * Schematron (SVRL) * -->
|
|
||||||
<!-- * * -->
|
|
||||||
<!-- ************************************************************************************** -->
|
|
||||||
|
|
||||||
|
|
||||||
<xsl:template match="in:validationResultsSchematron">
|
|
||||||
<xsl:variable name="schematron-output" as="element(svrl:schematron-output)?"
|
|
||||||
select="in:results/svrl:schematron-output" />
|
|
||||||
<xsl:if test="empty($schematron-output)">
|
|
||||||
<xsl:message terminate="yes">Unexpected result from schematron validation - there is no
|
|
||||||
svrl:schematron-output element!
|
|
||||||
</xsl:message>
|
|
||||||
</xsl:if>
|
|
||||||
<xsl:variable name="id" as="xs:string"
|
|
||||||
select="concat('val-sch.',1 + count(preceding-sibling::in:validationResultsSchematron))" />
|
|
||||||
<xsl:variable name="messages" as="element(rep:message)*">
|
|
||||||
<xsl:apply-templates select="$schematron-output/(svrl:failed-assert|svrl:successful-report)">
|
|
||||||
<xsl:with-param name="parent-id" select="$id" />
|
|
||||||
</xsl:apply-templates>
|
|
||||||
</xsl:variable>
|
|
||||||
<rep:validationStepResult id="{$id}"
|
|
||||||
valid="{if ($messages[@level = ('warning', 'error')]) then false() else true()}">
|
|
||||||
<xsl:sequence select="s:resource" />
|
|
||||||
<xsl:sequence select="$messages" />
|
|
||||||
</rep:validationStepResult>
|
|
||||||
</xsl:template>
|
|
||||||
|
|
||||||
|
|
||||||
<xsl:template match="svrl:failed-assert|svrl:successful-report">
|
|
||||||
<xsl:param name="parent-id" as="xs:string" required="yes" />
|
|
||||||
<xsl:variable name="id"
|
|
||||||
select="concat($parent-id, '.', count(preceding-sibling::failed-assert | preceding-sibling::successful-report) + 1)" />
|
|
||||||
<rep:message id="{$id}">
|
|
||||||
<xsl:apply-templates select="in:location/*" />
|
|
||||||
<xsl:attribute name="level">
|
|
||||||
<xsl:choose>
|
|
||||||
<xsl:when test="(@flag,@role) = ('fatal', 'error')">error</xsl:when>
|
|
||||||
<xsl:when test="(@flag,@role) = ('warning', 'warn')">warning</xsl:when>
|
|
||||||
<xsl:when test="(@flag,@role) = ('information', 'info')">information</xsl:when>
|
|
||||||
<xsl:when test="@role = ('information', 'info')">warning</xsl:when>
|
|
||||||
<xsl:otherwise>error</xsl:otherwise>
|
|
||||||
</xsl:choose>
|
|
||||||
</xsl:attribute>
|
|
||||||
<xsl:apply-templates select="@location" />
|
|
||||||
<xsl:apply-templates select="@id" />
|
|
||||||
<xsl:value-of select="svrl:text" />
|
|
||||||
</rep:message>
|
|
||||||
</xsl:template>
|
|
||||||
|
|
||||||
<xsl:template match="svrl:*/@location">
|
|
||||||
<xsl:attribute name="xpathLocation" select="." />
|
|
||||||
</xsl:template>
|
|
||||||
|
|
||||||
<xsl:template match="svrl:failed-assert/@id">
|
|
||||||
<xsl:attribute name="code" select="." />
|
|
||||||
</xsl:template>
|
|
||||||
|
|
||||||
<xsl:template match="svrl:successful-report/@id">
|
|
||||||
<xsl:attribute name="code" select="." />
|
|
||||||
</xsl:template>
|
|
||||||
|
|
||||||
<!-- ************************************************************************************** -->
|
|
||||||
<!-- * Validation helpers * -->
|
|
||||||
<!-- ************************************************************************************** -->
|
|
||||||
|
|
||||||
<!-- Identity template -->
|
|
||||||
<xsl:template mode="copy-to-report-ns" match="@*">
|
|
||||||
<xsl:copy />
|
|
||||||
</xsl:template>
|
|
||||||
|
|
||||||
<xsl:template mode="copy-to-report-ns" match="element()" priority="5">
|
|
||||||
<xsl:element name="rep:{local-name()}">
|
|
||||||
<xsl:apply-templates mode="copy-to-report-ns" select="node()|@*" />
|
|
||||||
</xsl:element>
|
|
||||||
</xsl:template>
|
|
||||||
|
|
||||||
<!-- ************************************************************************************** -->
|
|
||||||
<!-- * * -->
|
|
||||||
<!-- * Assessment * -->
|
|
||||||
<!-- * * -->
|
|
||||||
<!-- ************************************************************************************** -->
|
|
||||||
|
|
||||||
<xd:doc>
|
|
||||||
<xd:desc>
|
|
||||||
<xd:p>Dies ist das zentrale Template des Skripts. Angewandt auf ein
|
|
||||||
report-Dokument ergänzt es dieses um eine Handlungsempfehlung in Form eines
|
|
||||||
<xd:i>accept</xd:i>
|
|
||||||
oder <xd:i>reject</xd:i> Elements.
|
|
||||||
</xd:p>
|
|
||||||
</xd:desc>
|
|
||||||
</xd:doc>
|
|
||||||
<xsl:template match="rep:report" mode="assessment">
|
|
||||||
<rep:assessment>
|
|
||||||
<xsl:variable name="element-name" as="xs:string">
|
|
||||||
<xsl:choose>
|
|
||||||
<xsl:when test="empty(s:scenario)">reject</xsl:when>
|
|
||||||
<xsl:when test="//rep:message[rep:custom-level(.) = 'error']">reject</xsl:when>
|
|
||||||
<xsl:otherwise>accept</xsl:otherwise>
|
|
||||||
</xsl:choose>
|
|
||||||
</xsl:variable>
|
|
||||||
<xsl:element name="rep:{$element-name}" exclude-result-prefixes="#all">
|
|
||||||
<xsl:call-template name="explanations" />
|
|
||||||
</xsl:element>
|
|
||||||
</rep:assessment>
|
|
||||||
</xsl:template>
|
|
||||||
|
|
||||||
<xd:doc>
|
|
||||||
<xd:desc>
|
|
||||||
<xd:p>Ermittelt für eine während der Validierung ausgegebene Fehlernachricht deren
|
|
||||||
Fehlerlevel <xd:i>(error, warning, information)</xd:i> gemäß der
|
|
||||||
benutzerspezifischen Qualifizierung.
|
|
||||||
</xd:p>
|
|
||||||
<xd:p>Jede Fehlernachricht hat im Rahmen der Validierung ein solches Fehlerlevel
|
|
||||||
erhalten (siehe Attribut <xd:i>@level</xd:i>). Im Regelfall entspricht die
|
|
||||||
benutzerspezifische Qualifizierung unverändert diesem Level. Nutzer können jedoch im
|
|
||||||
Rahmen der Bewertung eigene Qualifizierungen vereinbaren und in dem als Parameter
|
|
||||||
<xd:ref name="assessment" type="parameter" />
|
|
||||||
übergebenen
|
|
||||||
<xd:i>assessment</xd:i>
|
|
||||||
Element für bestimmte, anhand des Fehlercodes identifizierten Fehlermeldungen eine
|
|
||||||
eigene Qualifizierung als <xd:i>customLevel</xd:i> festlegen.
|
|
||||||
</xd:p>
|
|
||||||
<xd:p>Dies kann z. B. genutzt werden, um einen <xd:i>error</xd:i>, der ansonsten zur
|
|
||||||
Rückweisung der Nachricht führen würde, zumindest zeitweilig als
|
|
||||||
<xd:i>warning</xd:i>
|
|
||||||
zu qualifizieren, so dass eine entsprechende
|
|
||||||
Dokumenteninstanz trotz einer Warnung angenommen und verarbeitet würde.
|
|
||||||
</xd:p>
|
|
||||||
<xd:p>Die Funktion prüft für eine Fehlernachricht, ob deren <xd:i>@code</xd:i> Attribut
|
|
||||||
Bestandteil der für ein bestimmtes <xd:i>customLevel</xd:i> des
|
|
||||||
<xd:ref
|
|
||||||
name="assessment" type="parameter" />
|
|
||||||
Parameters angegebenen Fehlercodes ist.
|
|
||||||
Falls ja, dann gilt das jeweilige <xd:i>customLevel</xd:i>. Andernfalls wird der im
|
|
||||||
Rahmen der Validierung ermittelte Fehlerlevel unverändert übernommen.
|
|
||||||
</xd:p>
|
|
||||||
</xd:desc>
|
|
||||||
<xd:param name="message">Eine im Rahmen der Validierung ausgegebene
|
|
||||||
Fehlernachricht
|
|
||||||
</xd:param>
|
|
||||||
<xd:return />
|
|
||||||
</xd:doc>
|
|
||||||
<xsl:function name="rep:custom-level" as="xs:string">
|
|
||||||
<xsl:param name="message" as="element(rep:message)" />
|
|
||||||
<xsl:variable name="cl" as="element(s:customLevel)?"
|
|
||||||
select="$custom-levels[tokenize(., '\s+') = $message/@code]" />
|
|
||||||
<xsl:value-of select="if ($cl) then $cl/@level else $message/@level" />
|
|
||||||
</xsl:function>
|
|
||||||
|
|
||||||
<xsl:template name="explanations">
|
|
||||||
<rep:explanation>
|
|
||||||
<xsl:call-template name="html:html" />
|
|
||||||
</rep:explanation>
|
|
||||||
</xsl:template>
|
|
||||||
|
|
||||||
<xsl:template name="html:html">
|
|
||||||
<html xmlns="http://www.w3.org/1999/xhtml" data-report-type="report">
|
|
||||||
<xsl:call-template name="html:head" />
|
|
||||||
<body>
|
|
||||||
<xsl:call-template name="html:document" />
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
</xsl:template>
|
|
||||||
|
|
||||||
<xd:doc>
|
|
||||||
<xd:desc>
|
|
||||||
<xd:p>Generiert das <xd:i>head</xd:i> Element eines eingebetteten HTML Dokuments,
|
|
||||||
welches den Prüf- und Bewertungsbericht visualisiert und die Handlungsempfehlung
|
|
||||||
begründet
|
|
||||||
</xd:p>
|
|
||||||
</xd:desc>
|
|
||||||
</xd:doc>
|
|
||||||
<xsl:template name="html:head" as="element(html:head)">
|
|
||||||
<head xmlns="http://www.w3.org/1999/xhtml">
|
|
||||||
<title>Prüfbericht</title>
|
|
||||||
<style>
|
|
||||||
body{
|
|
||||||
font-family: Calibri;
|
|
||||||
width: 230mm;
|
|
||||||
}
|
|
||||||
|
|
||||||
.metadata dt {
|
|
||||||
float: left;
|
|
||||||
width: 230px;
|
|
||||||
clear: left;
|
|
||||||
}
|
|
||||||
|
|
||||||
.metadata dd {
|
|
||||||
margin-left: 250px;
|
|
||||||
}
|
|
||||||
|
|
||||||
table{
|
|
||||||
border-collapse: collapse;
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
table.tbl-errors{
|
|
||||||
font-size: smaller;
|
|
||||||
}
|
|
||||||
|
|
||||||
table.document{
|
|
||||||
font-size: smaller;
|
|
||||||
}
|
|
||||||
|
|
||||||
table.document td {vertical-align:top;}
|
|
||||||
|
|
||||||
.tbl-errors td{
|
|
||||||
border: 1px solid lightgray;
|
|
||||||
padding: 2px;
|
|
||||||
vertical-align: top;
|
|
||||||
}
|
|
||||||
|
|
||||||
thead{
|
|
||||||
font-weight: bold;
|
|
||||||
background-color: #f0f0f0;
|
|
||||||
padding-top: 6pt;
|
|
||||||
padding-bottom: 2pt;
|
|
||||||
}
|
|
||||||
|
|
||||||
.tbl-meta td{
|
|
||||||
padding-right: 1em;
|
|
||||||
}
|
|
||||||
|
|
||||||
td.pos{
|
|
||||||
padding-left: 3pt;
|
|
||||||
width: 5%;
|
|
||||||
color: gray
|
|
||||||
}
|
|
||||||
|
|
||||||
td.element{
|
|
||||||
width: 95%;
|
|
||||||
word-wrap: break-word;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
td.element:before{
|
|
||||||
content: attr(title);
|
|
||||||
color: gray;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
div.attribute{
|
|
||||||
display: inline;
|
|
||||||
font-style: italic;
|
|
||||||
color: gray;
|
|
||||||
}
|
|
||||||
div.attribute:before{
|
|
||||||
content: attr(title) '=';
|
|
||||||
}
|
|
||||||
div.val{
|
|
||||||
display: inline;
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
|
||||||
|
|
||||||
td.level1{
|
|
||||||
padding-left: 2mm;
|
|
||||||
}
|
|
||||||
|
|
||||||
td.level2{
|
|
||||||
padding-left: 5mm;
|
|
||||||
}
|
|
||||||
|
|
||||||
td.level3{
|
|
||||||
padding-left: 10mm;
|
|
||||||
}
|
|
||||||
|
|
||||||
td.level4{
|
|
||||||
padding-left: 15mm;
|
|
||||||
}
|
|
||||||
|
|
||||||
td.level5{
|
|
||||||
padding-left: 20mm;
|
|
||||||
}
|
|
||||||
td.level6{
|
|
||||||
padding-left: 25mm;
|
|
||||||
}
|
|
||||||
|
|
||||||
tr{
|
|
||||||
vertical-align: bottom;
|
|
||||||
border-bottom: 1px solid #c0c0c0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.error{
|
|
||||||
color: red;
|
|
||||||
}
|
|
||||||
|
|
||||||
.warning{
|
|
||||||
}
|
|
||||||
|
|
||||||
p.important{
|
|
||||||
font-weight: bold;
|
|
||||||
text-align: left;
|
|
||||||
background-color: #e0e0e0;
|
|
||||||
padding: 3pt;
|
|
||||||
}
|
|
||||||
|
|
||||||
td.right{
|
|
||||||
text-align: right
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
</head>
|
|
||||||
</xsl:template>
|
|
||||||
|
|
||||||
<xsl:template name="html:document" xmlns="http://www.w3.org/1999/xhtml">
|
|
||||||
<h1>Prüfbericht</h1>
|
|
||||||
|
|
||||||
<xsl:call-template name="html:document-metadata" />
|
|
||||||
|
|
||||||
<xsl:call-template name="html:conformance" />
|
|
||||||
|
|
||||||
<xsl:if test="//rep:message">
|
|
||||||
<xsl:call-template name="html:validationresults" />
|
|
||||||
</xsl:if>
|
|
||||||
<xsl:call-template name="html:assessment" />
|
|
||||||
|
|
||||||
<!-- this is the extension -->
|
|
||||||
<xsl:if test="$input-document instance of document-node(element())">
|
|
||||||
<xsl:call-template name="html:contentdoc">
|
|
||||||
<xsl:with-param name="invoice" select="$input-document" />
|
|
||||||
</xsl:call-template>
|
|
||||||
</xsl:if>
|
|
||||||
|
|
||||||
<xsl:call-template name="html:epilog" />
|
|
||||||
</xsl:template>
|
|
||||||
|
|
||||||
|
|
||||||
<xd:doc>
|
|
||||||
<xd:desc>
|
|
||||||
<xd:p>Generiert am Beginn eines eingebetteten HTML Dokuments, welches den Prüf- und
|
|
||||||
Bewertungsbericht visualisiert und die Handlungsempfehlung begründet, eine Übersicht
|
|
||||||
mit Metadaten des geprüften Dokuments.
|
|
||||||
</xd:p>
|
|
||||||
</xd:desc>
|
|
||||||
</xd:doc>
|
|
||||||
<xsl:template name="html:document-metadata" as="element()+">
|
|
||||||
<div class="metadata">
|
|
||||||
<p class="important">
|
|
||||||
<xsl:text>Angaben zum geprüften Dokument</xsl:text>
|
|
||||||
</p>
|
|
||||||
<dl>
|
|
||||||
<dt>Referenz:</dt>
|
|
||||||
<dd>
|
|
||||||
<xsl:value-of select="rep:documentIdentification/rep:documentReference" />
|
|
||||||
</dd>
|
|
||||||
|
|
||||||
<dt>Zeitpunkt der Prüfung:</dt>
|
|
||||||
<dd>
|
|
||||||
<xsl:value-of select="format-dateTime(rep:timestamp, '[D].[M].[Y] [H]:[m]:[s]')" />
|
|
||||||
</dd>
|
|
||||||
|
|
||||||
<dt>Erkannter Dokumenttyp:</dt>
|
|
||||||
<dd>
|
|
||||||
<xsl:choose>
|
|
||||||
<xsl:when test="rep:scenarioMatched">
|
|
||||||
<xsl:value-of select="rep:scenarioMatched/s:scenario/s:name" />
|
|
||||||
</xsl:when>
|
|
||||||
<xsl:otherwise>
|
|
||||||
<b class="error">unbekannt</b>
|
|
||||||
</xsl:otherwise>
|
|
||||||
</xsl:choose>
|
|
||||||
</dd>
|
|
||||||
</dl>
|
|
||||||
<xsl:call-template name="html:documentdata" />
|
|
||||||
</div>
|
|
||||||
</xsl:template>
|
|
||||||
|
|
||||||
<xsl:template name="html:documentdata" />
|
|
||||||
|
|
||||||
<xd:doc>
|
|
||||||
<xd:desc>
|
|
||||||
<xd:p>Generiert am Ende eines eingebetteten HTML Dokuments, welches den Prüf- und
|
|
||||||
Bewertungsbericht visualisiert und die Handlungsempfehlung begründet, eine Übersicht
|
|
||||||
mit Metadaten zum Prüfmodul.
|
|
||||||
</xd:p>
|
|
||||||
</xd:desc>
|
|
||||||
</xd:doc>
|
|
||||||
<xsl:template name="html:epilog" as="element()+">
|
|
||||||
<p class="info" xmlns="http://www.w3.org/1999/xhtml">
|
|
||||||
<xsl:text>Dieser Prüfbericht wurde erstellt mit </xsl:text>
|
|
||||||
<xsl:value-of select="rep:engine/rep:name" />
|
|
||||||
<xsl:text>.</xsl:text>
|
|
||||||
</p>
|
|
||||||
</xsl:template>
|
|
||||||
|
|
||||||
<xd:doc>
|
|
||||||
<xd:desc>
|
|
||||||
<xd:p>Generiert in dem eingebetetteten HTML Dokument eine Tabelle mit den während der
|
|
||||||
Validierung ausgegebenen Daten.
|
|
||||||
</xd:p>
|
|
||||||
</xd:desc>
|
|
||||||
</xd:doc>
|
|
||||||
<xsl:template name="html:validationresults" as="element()*">
|
|
||||||
<p>Übersicht der Validierungsergebnisse:</p>
|
|
||||||
<table class="tbl-errors">
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th>Prüfschritt</th>
|
|
||||||
<th>Fehler</th>
|
|
||||||
<th>Warnungen</th>
|
|
||||||
<th>Informationen</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
<xsl:for-each select="//rep:validationResult/rep:validationStepResult">
|
|
||||||
<xsl:variable name="step-id" select="@id" />
|
|
||||||
<tr>
|
|
||||||
<td>
|
|
||||||
<xsl:value-of select="s:resource/s:name" />
|
|
||||||
<xsl:text> (</xsl:text>
|
|
||||||
<xsl:value-of select="@id" />
|
|
||||||
<xsl:text>)</xsl:text>
|
|
||||||
</td>
|
|
||||||
<td style="width: 30mm;">
|
|
||||||
<xsl:value-of
|
|
||||||
select="count(rep:message[@level eq 'error'])" />
|
|
||||||
</td>
|
|
||||||
<td style="width: 30mm;">
|
|
||||||
<xsl:value-of
|
|
||||||
select="count(rep:message[@level eq 'warning'])" />
|
|
||||||
</td>
|
|
||||||
<td style="width: 30mm;">
|
|
||||||
<xsl:value-of
|
|
||||||
select="count(rep:message[@level eq 'information'])"
|
|
||||||
/>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</xsl:for-each>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
|
|
||||||
<p>Validierungsergebnisse im Detail:</p>
|
|
||||||
<table xmlns="http://www.w3.org/1999/xhtml" class="tbl-errors">
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th style="width: 30mm;">Pos</th>
|
|
||||||
<th style="width: 25mm;">Code</th>
|
|
||||||
<th style="width: 25mm;">Adj. Grad (Grad)</th>
|
|
||||||
<th>Text</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
<xsl:for-each select="//rep:message">
|
|
||||||
<tr>
|
|
||||||
<xsl:attribute name="class">
|
|
||||||
<xsl:value-of select="rep:custom-level(.)" />
|
|
||||||
</xsl:attribute>
|
|
||||||
<td rowspan="2">
|
|
||||||
<xsl:value-of select="@id" />
|
|
||||||
</td>
|
|
||||||
<td rowspan="2">
|
|
||||||
<xsl:value-of select="@code" />
|
|
||||||
</td>
|
|
||||||
<td rowspan="2">
|
|
||||||
<xsl:value-of select="rep:custom-level(.)" />
|
|
||||||
<xsl:if test="not(rep:custom-level(.) eq @level)">
|
|
||||||
<xsl:value-of select="concat(' (', @level, ')')" />
|
|
||||||
</xsl:if>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<xsl:value-of select="normalize-space(.)" />
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<xsl:attribute name="class">
|
|
||||||
<xsl:value-of select="rep:custom-level(.)" />
|
|
||||||
</xsl:attribute>
|
|
||||||
<td>
|
|
||||||
<xsl:if test="@xpathLocation">
|
|
||||||
<xsl:text>Pfad: </xsl:text><xsl:value-of select="@xpathLocation" />
|
|
||||||
</xsl:if>
|
|
||||||
<xsl:if test="@lineNumber">
|
|
||||||
<xsl:text> Zeile: </xsl:text><xsl:value-of select="@lineNumber" />
|
|
||||||
</xsl:if>
|
|
||||||
<xsl:if test="@columnNumber">
|
|
||||||
<xsl:text> Spalte: </xsl:text><xsl:value-of select="@columnNumber" />
|
|
||||||
</xsl:if>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</xsl:for-each>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
</xsl:template>
|
|
||||||
|
|
||||||
<xd:doc>
|
|
||||||
<xd:desc>
|
|
||||||
<xd:p>Generiert in dem eingebetteten HTML Dokument eine Aussage zur Konformität des
|
|
||||||
geprüften Dokuments zu den formalen Vorgaben.
|
|
||||||
</xd:p>
|
|
||||||
</xd:desc>
|
|
||||||
</xd:doc>
|
|
||||||
<xsl:template name="html:conformance">
|
|
||||||
<xsl:variable name="e" as="xs:integer" select="count(//rep:message[@level eq 'error'])" />
|
|
||||||
<xsl:variable name="w" as="xs:integer" select="count(//rep:message[@level eq 'warning'])" />
|
|
||||||
<xsl:choose>
|
|
||||||
<xsl:when test="rep:scenarioMatched">
|
|
||||||
<p class="important" xmlns="http://www.w3.org/1999/xhtml">
|
|
||||||
<b>Konformitätsprüfung:</b>
|
|
||||||
<xsl:text>Das geprüfte Dokument enthält </xsl:text>
|
|
||||||
<xsl:choose>
|
|
||||||
<xsl:when test="$e + $w eq 0">
|
|
||||||
<xsl:text>weder Fehler noch Warnungen. Es ist konform zu den formalen Vorgaben.</xsl:text>
|
|
||||||
</xsl:when>
|
|
||||||
<xsl:otherwise>
|
|
||||||
<xsl:value-of select="concat($e, ' Fehler / ', $w, ' Warnungen. Es ist ')" />
|
|
||||||
<b>nicht konform</b>
|
|
||||||
<xsl:text> zu den formalen Vorgaben.</xsl:text>
|
|
||||||
</xsl:otherwise>
|
|
||||||
</xsl:choose>
|
|
||||||
</p>
|
|
||||||
</xsl:when>
|
|
||||||
<xsl:otherwise>
|
|
||||||
<p class="important" xmlns="http://www.w3.org/1999/xhtml">
|
|
||||||
<b>Konformitätsprüfung:</b>
|
|
||||||
<xsl:text>Das geprüfte Dokument entspricht keinen zulässigen Dokumenttyp und ist damit </xsl:text>
|
|
||||||
<b>nicht konform</b>
|
|
||||||
<xsl:text> zu den formalen Vorgaben.</xsl:text>
|
|
||||||
</p>
|
|
||||||
</xsl:otherwise>
|
|
||||||
</xsl:choose>
|
|
||||||
|
|
||||||
</xsl:template>
|
|
||||||
|
|
||||||
<xd:doc>
|
|
||||||
<xd:desc>
|
|
||||||
<xd:p>Generiert in dem eingebetteten HTML Dokument die Aussage zur
|
|
||||||
Handlungsempfehlung.
|
|
||||||
</xd:p>
|
|
||||||
</xd:desc>
|
|
||||||
</xd:doc>
|
|
||||||
<xsl:template name="html:assessment" xmlns="http://www.w3.org/1999/xhtml">
|
|
||||||
<xsl:variable name="e1" as="xs:integer" select="count(//message[@level eq 'error'])" />
|
|
||||||
<xsl:variable name="e2" as="xs:integer"
|
|
||||||
select="count(//rep:message[rep:custom-level(.) eq 'error'])" />
|
|
||||||
<xsl:choose>
|
|
||||||
<xsl:when test="empty(rep:scenarioMatched)">
|
|
||||||
<p class="important error">Bewertung: Es wird empfohlen das Dokument zurückzuweisen.</p>
|
|
||||||
</xsl:when>
|
|
||||||
<xsl:when test="$e1 eq 0 and $e2 eq 0">
|
|
||||||
<p class="important">Bewertung: Es wird empfohlen das Dokument anzunehmen und weiter zu verarbeiten.</p>
|
|
||||||
</xsl:when>
|
|
||||||
<xsl:when test="$e1 gt 0 and $e2 eq 0">
|
|
||||||
<p class="important">Bewertung: Es wird empfohlen das Dokument anzunehmen und zu verarbeiten, da die
|
|
||||||
vorhandenen Fehler derzeit toleriert werden.
|
|
||||||
</p>
|
|
||||||
</xsl:when>
|
|
||||||
<xsl:otherwise>
|
|
||||||
<p class="important error">Bewertung: Es wird empfohlen das Dokument zurückzuweisen.</p>
|
|
||||||
</xsl:otherwise>
|
|
||||||
</xsl:choose>
|
|
||||||
</xsl:template>
|
|
||||||
|
|
||||||
|
|
||||||
<xsl:template name="html:contentdoc">
|
|
||||||
<xsl:param name="invoice" as="document-node(element())" />
|
|
||||||
<p class="important">
|
|
||||||
<xsl:text>Inhalt des Rechnungsdokuments:</xsl:text>
|
|
||||||
</p>
|
|
||||||
<table class="document" xmlns="http://www.w3.org/1999/xhtml">
|
|
||||||
<xsl:apply-templates select="$invoice/*" mode="html:contentdoc" />
|
|
||||||
</table>
|
|
||||||
</xsl:template>
|
|
||||||
|
|
||||||
<xd:doc>
|
|
||||||
<xd:desc>
|
|
||||||
<xd:p>Eine Element wird als eine Zeile in einer Tabelle visualisiert. Die erste Spalte
|
|
||||||
enthält die Zeilennummer, die zweite Attribute und Text des Elements
|
|
||||||
</xd:p>
|
|
||||||
</xd:desc>
|
|
||||||
</xd:doc>
|
|
||||||
<xsl:template match="*" mode="html:contentdoc">
|
|
||||||
<xsl:variable name="line-number" as="xs:string">
|
|
||||||
<xsl:number select="." count="*" level="any" format="0001" />
|
|
||||||
</xsl:variable>
|
|
||||||
<tr class="row" xmlns="http://www.w3.org/1999/xhtml" id="{$line-number}">
|
|
||||||
<td class="pos">
|
|
||||||
<xsl:value-of select="$line-number" />
|
|
||||||
</td>
|
|
||||||
<td class="element {concat('level',count(ancestor-or-self::*))}" title="{local-name()}">
|
|
||||||
<xsl:apply-templates select="text()" mode="html:contentdoc" />
|
|
||||||
<xsl:apply-templates select="@*" mode="html:contentdoc" />
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<xsl:apply-templates select="*" mode="html:contentdoc" />
|
|
||||||
</xsl:template>
|
|
||||||
|
|
||||||
<xd:doc>
|
|
||||||
<xd:desc>
|
|
||||||
<xd:p>Ein Textbereich (in der Zeile des Elements)</xd:p>
|
|
||||||
</xd:desc>
|
|
||||||
</xd:doc>
|
|
||||||
<xsl:template match="text()" mode="html:contentdoc">
|
|
||||||
<div class="val" xmlns="http://www.w3.org/1999/xhtml">
|
|
||||||
<xsl:value-of select="." />
|
|
||||||
</div>
|
|
||||||
</xsl:template>
|
|
||||||
|
|
||||||
<xsl:template match="element(*, xs:base64Binary)/text()" priority="10" mode="html:contentdoc">
|
|
||||||
<div class="val" xmlns="http://www.w3.org/1999/xhtml">
|
|
||||||
<xsl:text>[ … ]</xsl:text>
|
|
||||||
</div>
|
|
||||||
</xsl:template>
|
|
||||||
|
|
||||||
<xsl:template match="@xsi:schemaLocation" mode="html:contentdoc" />
|
|
||||||
|
|
||||||
<xd:doc>
|
|
||||||
<xd:desc>
|
|
||||||
<xd:p>Ein Attributbereich (in der Zeile des Elements)</xd:p>
|
|
||||||
</xd:desc>
|
|
||||||
</xd:doc>
|
|
||||||
<xsl:template match="@*" mode="html:contentdoc">
|
|
||||||
<div class="attribute" title="{local-name(.)}" xmlns="http://www.w3.org/1999/xhtml">
|
|
||||||
<xsl:value-of select="." />
|
|
||||||
</div>
|
|
||||||
</xsl:template>
|
|
||||||
|
|
||||||
|
|
||||||
</xsl:stylesheet>
|
|
||||||
|
|
@ -1,631 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!--
|
|
||||||
~ 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.
|
|
||||||
-->
|
|
||||||
|
|
||||||
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
|
||||||
xmlns:xs="http://www.w3.org/2001/XMLSchema"
|
|
||||||
xmlns:rep="http://www.xoev.de/de/validator/varl/1 "
|
|
||||||
xmlns:s="http://www.xoev.de/de/validator/framework/1/scenarios"
|
|
||||||
xmlns:in="http://www.xoev.de/de/validator/framework/1/createreportinput"
|
|
||||||
xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
|
||||||
xmlns:xd="http://www.oxygenxml.com/ns/doc/xsl"
|
|
||||||
xmlns:html="http://www.w3.org/1999/xhtml"
|
|
||||||
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:variable name="custom-levels" as="element(s:customLevel)*" select="//s:customLevel" />
|
|
||||||
|
|
||||||
|
|
||||||
<xsl:template match="in:createReportInput">
|
|
||||||
|
|
||||||
<xsl:variable name="validationStepResults" as="element(rep:validationStepResult)*">
|
|
||||||
<xsl:apply-templates select="in:validationResultsWellformedness" />
|
|
||||||
<xsl:apply-templates select="in:validationResultsXmlSchema" />
|
|
||||||
<xsl:apply-templates select="in:validationResultsSchematron" />
|
|
||||||
</xsl:variable>
|
|
||||||
|
|
||||||
<xsl:variable name="report" as="document-node(element(rep:report))">
|
|
||||||
<xsl:document>
|
|
||||||
<rep:report valid="{if ($validationStepResults[@valid = 'false']) then false() else true()}">
|
|
||||||
<xsl:apply-templates select="in:engine" mode="copy-to-report-ns" />
|
|
||||||
<xsl:apply-templates select="in:timestamp" mode="copy-to-report-ns" />
|
|
||||||
<xsl:apply-templates select="in:documentIdentification" mode="copy-to-report-ns" />
|
|
||||||
<xsl:apply-templates select="s:scenario" mode="copy-to-report-ns" />
|
|
||||||
<xsl:call-template name="document-data" />
|
|
||||||
|
|
||||||
<rep:validationResult>
|
|
||||||
<xsl:sequence select="$validationStepResults" />
|
|
||||||
</rep:validationResult>
|
|
||||||
</rep:report>
|
|
||||||
</xsl:document>
|
|
||||||
</xsl:variable>
|
|
||||||
|
|
||||||
<xsl:variable name="report-with-ids" as="document-node(element(rep:report))">
|
|
||||||
<xsl:document>
|
|
||||||
<xsl:apply-templates select="$report" mode="add-ids" />
|
|
||||||
</xsl:document>
|
|
||||||
</xsl:variable>
|
|
||||||
|
|
||||||
<rep:report varlVersion="1.0.0">
|
|
||||||
<xsl:copy-of select="$report-with-ids/rep:report/(node()|@*)" />
|
|
||||||
<xsl:apply-templates select="$report-with-ids" />
|
|
||||||
</rep:report>
|
|
||||||
|
|
||||||
</xsl:template>
|
|
||||||
|
|
||||||
<!-- Overwrite in customisation layer to generate a documentData element -->
|
|
||||||
<xsl:template name="document-data" />
|
|
||||||
|
|
||||||
|
|
||||||
<!-- ************************************************************************************** -->
|
|
||||||
<!-- * * -->
|
|
||||||
<!-- * Syntax checks (well-formedness and XML Schema * -->
|
|
||||||
<!-- * * -->
|
|
||||||
<!-- ************************************************************************************** -->
|
|
||||||
|
|
||||||
<xsl:template match="in:validationResultsWellformedness|in:validationResultsXmlSchema">
|
|
||||||
<xsl:variable name="messages" as="element(rep:message)*">
|
|
||||||
<xsl:apply-templates select="in:xmlSyntaxError" />
|
|
||||||
</xsl:variable>
|
|
||||||
<!-- Skip output for implicit validation steps (i. e., wellformedness implemenation) unless there is anything to tell -->
|
|
||||||
<xsl:if test="exists($messages) or exists(s:resource)">
|
|
||||||
<rep:validationStepResult valid="{if ($messages[@level = ('warning', 'error')]) then false() else true()}">
|
|
||||||
<xsl:apply-templates mode="copy-to-report-ns" select="s:resource" />
|
|
||||||
<xsl:sequence select="$messages" />
|
|
||||||
</rep:validationStepResult>
|
|
||||||
</xsl:if>
|
|
||||||
</xsl:template>
|
|
||||||
|
|
||||||
<xsl:template match="in:xmlSyntaxError">
|
|
||||||
<rep:message level="{if (@severity = 'SEVERITY_WARNING') then 'warning' else 'error'}">
|
|
||||||
<xsl:apply-templates select="in:location/*" />
|
|
||||||
<xsl:value-of select="in:message" />
|
|
||||||
</rep:message>
|
|
||||||
</xsl:template>
|
|
||||||
|
|
||||||
<xsl:template match="in:xmlSyntaxError/in:rowNumber">
|
|
||||||
<xsl:attribute name="lineNumber" select="." />
|
|
||||||
</xsl:template>
|
|
||||||
|
|
||||||
<xsl:template match="in:xmlSyntaxError/in:columnNumber">
|
|
||||||
<xsl:attribute name="columnNumber" select="." />
|
|
||||||
</xsl:template>
|
|
||||||
|
|
||||||
<!-- ************************************************************************************** -->
|
|
||||||
<!-- * * -->
|
|
||||||
<!-- * Schematron (SVRL) * -->
|
|
||||||
<!-- * * -->
|
|
||||||
<!-- ************************************************************************************** -->
|
|
||||||
|
|
||||||
|
|
||||||
<xsl:template match="in:validationResultsSchematron">
|
|
||||||
<xsl:variable name="schematron-output" as="element(svrl:schematron-output)?" select="in:results/svrl:schematron-output" />
|
|
||||||
<xsl:if test="empty($schematron-output)">
|
|
||||||
<xsl:message terminate="yes">Unexpected result from schematron validation - there is no svrl:schematron-output element!
|
|
||||||
</xsl:message>
|
|
||||||
</xsl:if>
|
|
||||||
<xsl:variable name="messages" as="element(rep:message)*">
|
|
||||||
<xsl:apply-templates select="$schematron-output/(svrl:failed-assert|svrl:successful-report)" />
|
|
||||||
</xsl:variable>
|
|
||||||
<rep:validationStepResult valid="{if ($messages[@level = ('warning', 'error')]) then false() else true()}">
|
|
||||||
<xsl:apply-templates mode="copy-to-report-ns" select="s:resource" />
|
|
||||||
<xsl:sequence select="$messages" />
|
|
||||||
</rep:validationStepResult>
|
|
||||||
</xsl:template>
|
|
||||||
|
|
||||||
|
|
||||||
<xsl:template match="svrl:failed-assert|svrl:successful-report">
|
|
||||||
<rep:message>
|
|
||||||
<xsl:apply-templates select="in:location/*" />
|
|
||||||
<xsl:attribute name="level">
|
|
||||||
<xsl:choose>
|
|
||||||
<xsl:when test="(@flag,@role) = ('fatal', 'error')">error</xsl:when>
|
|
||||||
<xsl:when test="(@flag,@role) = ('warning', 'warn')">warning</xsl:when>
|
|
||||||
<xsl:when test="(@flag,@role) = ('information', 'info')">information</xsl:when>
|
|
||||||
<xsl:when test="@role = ('information', 'info')">warning</xsl:when>
|
|
||||||
<xsl:otherwise>error</xsl:otherwise>
|
|
||||||
</xsl:choose>
|
|
||||||
</xsl:attribute>
|
|
||||||
<xsl:apply-templates select="@location" />
|
|
||||||
<xsl:apply-templates select="@id" />
|
|
||||||
<xsl:value-of select="svrl:text" />
|
|
||||||
</rep:message>
|
|
||||||
</xsl:template>
|
|
||||||
|
|
||||||
<xsl:template match="svrl:*/@location">
|
|
||||||
<xsl:attribute name="xpathLocation" select="." />
|
|
||||||
</xsl:template>
|
|
||||||
|
|
||||||
<xsl:template match="svrl:failed-assert/@id">
|
|
||||||
<xsl:attribute name="code" select="." />
|
|
||||||
</xsl:template>
|
|
||||||
|
|
||||||
<xsl:template match="svrl:successful-report/@id">
|
|
||||||
<xsl:attribute name="code" select="." />
|
|
||||||
</xsl:template>
|
|
||||||
|
|
||||||
<!-- ************************************************************************************** -->
|
|
||||||
<!-- * Validation helpers * -->
|
|
||||||
<!-- ************************************************************************************** -->
|
|
||||||
|
|
||||||
<!-- Identity template -->
|
|
||||||
<xsl:template mode="copy-to-report-ns" match="element()|@*">
|
|
||||||
<xsl:copy>
|
|
||||||
<xsl:apply-templates mode="copy-to-report-ns" select="node()|@*" />
|
|
||||||
</xsl:copy>
|
|
||||||
</xsl:template>
|
|
||||||
|
|
||||||
<xsl:template mode="copy-to-report-ns" match="element()" priority="5">
|
|
||||||
<xsl:element name="rep:{local-name()}">
|
|
||||||
<xsl:apply-templates mode="copy-to-report-ns" select="node()|@*" />
|
|
||||||
</xsl:element>
|
|
||||||
</xsl:template>
|
|
||||||
|
|
||||||
<xsl:template mode="copy-to-report-ns" match="s:*" priority="10">
|
|
||||||
<xsl:copy>
|
|
||||||
<xsl:apply-templates mode="copy-to-report-ns" select="node()|@*" />
|
|
||||||
</xsl:copy>
|
|
||||||
</xsl:template>
|
|
||||||
|
|
||||||
<xsl:template match="node()|@*" mode="add-ids">
|
|
||||||
<xsl:copy>
|
|
||||||
<xsl:apply-templates select="node()|@*" mode="add-ids" />
|
|
||||||
</xsl:copy>
|
|
||||||
</xsl:template>
|
|
||||||
|
|
||||||
<xsl:template match="rep:validationStepResult" mode="add-ids">
|
|
||||||
<xsl:copy>
|
|
||||||
<xsl:attribute name="id">
|
|
||||||
<xsl:text>step_</xsl:text>
|
|
||||||
<xsl:number level="multiple" count="rep:validationStepResult" />
|
|
||||||
</xsl:attribute>
|
|
||||||
<xsl:apply-templates select="node()|@*" mode="add-ids" />
|
|
||||||
</xsl:copy>
|
|
||||||
</xsl:template>
|
|
||||||
|
|
||||||
<xsl:template match="rep:message" mode="add-ids">
|
|
||||||
<xsl:copy>
|
|
||||||
<xsl:attribute name="id">
|
|
||||||
<xsl:text>message_</xsl:text>
|
|
||||||
<xsl:number level="multiple" count="rep:message | rep:validationStepResult" />
|
|
||||||
</xsl:attribute>
|
|
||||||
<xsl:apply-templates select="node()|@*" mode="add-ids" />
|
|
||||||
</xsl:copy>
|
|
||||||
</xsl:template>
|
|
||||||
|
|
||||||
<!-- ************************************************************************************** -->
|
|
||||||
<!-- * * -->
|
|
||||||
<!-- * Assessment (ohne HTML) * -->
|
|
||||||
<!-- * * -->
|
|
||||||
<!-- ************************************************************************************** -->
|
|
||||||
|
|
||||||
<xd:doc>
|
|
||||||
<xd:desc>
|
|
||||||
<xd:p>Dies ist das zentrale Template des Skripts. Angewandt auf ein
|
|
||||||
validationReport-Dokument, und unter Nutzung des
|
|
||||||
<xd:ref name="assessment"
|
|
||||||
type="parameter" />
|
|
||||||
Parameters wird eine Handlungsempfehlung in Form eines
|
|
||||||
<xd:i>accept</xd:i>
|
|
||||||
oder <xd:i>reject</xd:i> Elements erstellt, welches eine
|
|
||||||
Begründung der jeweiligen Empfehlung enthalten kann.
|
|
||||||
</xd:p>
|
|
||||||
<xd:p>Das Template realisiert eine Funktion f:validationReport, assessment →
|
|
||||||
suggestion
|
|
||||||
</xd:p>
|
|
||||||
</xd:desc>
|
|
||||||
</xd:doc>
|
|
||||||
<xsl:template match="rep:report">
|
|
||||||
<xsl:variable name="element-name" select="if (//rep:message[rep:custom-level(.) = 'error']) then 'reject' else 'accept'" />
|
|
||||||
<rep:assessment>
|
|
||||||
<xsl:element name="rep:{$element-name}" exclude-result-prefixes="#all">
|
|
||||||
<rep:explanation>
|
|
||||||
<html xmlns="http://www.w3.org/1999/xhtml" data-report-type="devreport-{$element-name}">
|
|
||||||
<xsl:call-template name="html:head" />
|
|
||||||
<body>
|
|
||||||
<xsl:call-template name="html:document" />
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
</rep:explanation>
|
|
||||||
</xsl:element>
|
|
||||||
</rep:assessment>
|
|
||||||
</xsl:template>
|
|
||||||
|
|
||||||
<xd:doc>
|
|
||||||
<xd:desc>
|
|
||||||
<xd:p>Ermittelt für eine während der Validierung ausgegebene Fehlernachricht deren
|
|
||||||
Fehlerlevel <xd:i>(error, warning, information)</xd:i> gemäß der
|
|
||||||
benutzerspezifischen Qualifizierung.
|
|
||||||
</xd:p>
|
|
||||||
<xd:p>Jede Fehlernachricht hat im Rahmen der Validierung ein solches Fehlerlevel
|
|
||||||
erhalten (siehe Attribut <xd:i>@level</xd:i>). Im Regelfall entspricht die
|
|
||||||
benutzerspezifische Qualifizierung unverändert diesem Level. Nutzer können jedoch im
|
|
||||||
Rahmen der Bewertung eigene Qualifizierungen vereinbaren und in dem als Parameter
|
|
||||||
<xd:ref name="assessment" type="parameter" />
|
|
||||||
übergebenen
|
|
||||||
<xd:i>assessment</xd:i>
|
|
||||||
Element für bestimmte, anhand des Fehlercodes identifizierten Fehlermeldungen eine
|
|
||||||
eigene Qualifizierung als <xd:i>customLevel</xd:i> festlegen.
|
|
||||||
</xd:p>
|
|
||||||
<xd:p>Dies kann z. B. genutzt werden, um einen <xd:i>error</xd:i>, der ansonsten zur
|
|
||||||
Rückweisung der Nachricht führen würde, zumindest zeitweilig als
|
|
||||||
<xd:i>warning</xd:i>
|
|
||||||
zu qualifizieren, so dass eine entsprechende
|
|
||||||
Dokumenteninstanz trotz einer Warnung angenommen und verarbeitet würde.
|
|
||||||
</xd:p>
|
|
||||||
<xd:p>Die Funktion prüft für eine Fehlernachricht, ob deren <xd:i>@code</xd:i> Attribut
|
|
||||||
Bestandteil der für ein bestimmtes <xd:i>customLevel</xd:i> des
|
|
||||||
<xd:ref
|
|
||||||
name="assessment" type="parameter" />
|
|
||||||
Parameters angegebenen Fehlercodes ist.
|
|
||||||
Falls ja, dann gilt das jeweilige <xd:i>customLevel</xd:i>. Andernfalls wird der im
|
|
||||||
Rahmen der Validierung ermittelte Fehlerlevel unverändert übernommen.
|
|
||||||
</xd:p>
|
|
||||||
</xd:desc>
|
|
||||||
<xd:param name="message">Eine im Rahmen der Validierung ausgegebene
|
|
||||||
Fehlernachricht
|
|
||||||
</xd:param>
|
|
||||||
<xd:return />
|
|
||||||
</xd:doc>
|
|
||||||
<xsl:function name="rep:custom-level">
|
|
||||||
<xsl:param name="message" as="element(rep:message)" />
|
|
||||||
<xsl:variable name="cl" as="element(s:customLevel)?"
|
|
||||||
select="$custom-levels[tokenize(., '\s+') = $message/@code]" />
|
|
||||||
<xsl:value-of select="if ($cl) then $cl/@level else $message/@level" />
|
|
||||||
</xsl:function>
|
|
||||||
|
|
||||||
|
|
||||||
<!-- ************************************************************************************** -->
|
|
||||||
<!-- * * -->
|
|
||||||
<!-- * HTML * -->
|
|
||||||
<!-- * * -->
|
|
||||||
<!-- ************************************************************************************** -->
|
|
||||||
|
|
||||||
<xsl:template name="html:document">
|
|
||||||
<xsl:call-template name="html:report-header" />
|
|
||||||
<xsl:call-template name="html:prolog" />
|
|
||||||
<!-- TODO: documentData -->
|
|
||||||
<xsl:call-template name="html:conformance" />
|
|
||||||
<xsl:if test="//rep:message">
|
|
||||||
<xsl:call-template name="html:messagetable" />
|
|
||||||
</xsl:if>
|
|
||||||
<xsl:call-template name="html:assessment" />
|
|
||||||
<xsl:call-template name="html:epilog" />
|
|
||||||
</xsl:template>
|
|
||||||
|
|
||||||
<xd:doc>
|
|
||||||
<xd:desc>
|
|
||||||
<xd:p>Generiert das <xd:i>head</xd:i> Element eines eingebetteten HTML Dokuments,
|
|
||||||
welches den Prüf- und Bewertungsbericht visualisiert und die Handlungsempfehlung
|
|
||||||
begründet
|
|
||||||
</xd:p>
|
|
||||||
</xd:desc>
|
|
||||||
</xd:doc>
|
|
||||||
<xsl:template name="html:head" as="element(html:head)">
|
|
||||||
<head xmlns="http://www.w3.org/1999/xhtml">
|
|
||||||
<title>Pruefbericht der KoSIT</title>
|
|
||||||
<style>
|
|
||||||
body{
|
|
||||||
font-family: Calibri;
|
|
||||||
width: 230mm;
|
|
||||||
}
|
|
||||||
|
|
||||||
table{
|
|
||||||
border-collapse: collapse;
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
table.tbl-errors{
|
|
||||||
font-size: 10pt;
|
|
||||||
}
|
|
||||||
|
|
||||||
.tbl-errors td{
|
|
||||||
border: 1px solid lightgray;
|
|
||||||
padding: 2px;
|
|
||||||
vertical-align: top;
|
|
||||||
}
|
|
||||||
|
|
||||||
thead{
|
|
||||||
font-weight: bold;
|
|
||||||
background-color: #f0f0f0;
|
|
||||||
padding-top: 6pt;
|
|
||||||
padding-bottom: 2pt;
|
|
||||||
}
|
|
||||||
|
|
||||||
.tbl-meta td{
|
|
||||||
padding-right: 1em;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
tr{
|
|
||||||
vertical-align: bottom;
|
|
||||||
border-bottom: 1px solid #c0c0c0;
|
|
||||||
}
|
|
||||||
|
|
||||||
tr.error{
|
|
||||||
font-weight: bold;
|
|
||||||
color: red;
|
|
||||||
}
|
|
||||||
|
|
||||||
tr.warning{
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
tr.pos{
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
|
||||||
|
|
||||||
p.important{
|
|
||||||
font-weight: bold;
|
|
||||||
text-align: left;
|
|
||||||
background-color: #e0e0e0;
|
|
||||||
padding: 3pt;
|
|
||||||
}
|
|
||||||
|
|
||||||
td.right{
|
|
||||||
text-align: right
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
</head>
|
|
||||||
</xsl:template>
|
|
||||||
|
|
||||||
<xd:doc>
|
|
||||||
<xd:desc>
|
|
||||||
<xd:p>Generiert die Überschrift des eines eingebetteten HTML Dokuments, welches den
|
|
||||||
Prüf- und Bewertungsbericht visualisiert und die Handlungsempfehlung
|
|
||||||
begründet
|
|
||||||
</xd:p>
|
|
||||||
</xd:desc>
|
|
||||||
</xd:doc>
|
|
||||||
<xsl:template name="html:report-header" as="element()+">
|
|
||||||
<h1 xmlns="http://www.w3.org/1999/xhtml">Prüfbericht der KoSIT</h1>
|
|
||||||
</xsl:template>
|
|
||||||
|
|
||||||
<xd:doc>
|
|
||||||
<xd:desc>
|
|
||||||
<xd:p>Generiert am Beginn eines eingebetteten HTML Dokuments, welches den Prüf- und
|
|
||||||
Bewertungsbericht visualisiert und die Handlungsempfehlung begründet, eine Übersicht
|
|
||||||
mit Metadaten des geprüften Dokuments.
|
|
||||||
</xd:p>
|
|
||||||
</xd:desc>
|
|
||||||
</xd:doc>
|
|
||||||
<xsl:template name="html:prolog" as="element()+">
|
|
||||||
<h2 xmlns="http://www.w3.org/1999/xhtml">
|
|
||||||
<xsl:text>Angaben zum geprüften Dokument</xsl:text>
|
|
||||||
</h2>
|
|
||||||
<table class="tbl-meta" xmlns="http://www.w3.org/1999/xhtml">
|
|
||||||
<xsl:if test="/*/@id">
|
|
||||||
<tr>
|
|
||||||
<td colspan="2">Prüfbericht Nr.</td>
|
|
||||||
<td colspan="3">
|
|
||||||
<xsl:value-of select="/*/@id" />
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</xsl:if>
|
|
||||||
<tr>
|
|
||||||
<td colspan="2">Dokument:</td>
|
|
||||||
<td colspan="3">
|
|
||||||
<xsl:value-of select="rep:documentIdentification/rep:documentReference" />
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td colspan="2">Szenario:</td>
|
|
||||||
<td colspan="3">
|
|
||||||
<xsl:value-of select="s:scenario/@name" />
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td colspan="2">Zeitpunkt:</td>
|
|
||||||
<td colspan="3">
|
|
||||||
<xsl:value-of select="format-dateTime(rep:timestamp, '[D].[M].[Y] [H]:[m]:[s]')"
|
|
||||||
/>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td colspan="2">Validierungsschritte:</td>
|
|
||||||
<td>Fehler</td>
|
|
||||||
<td>Warnung</td>
|
|
||||||
<td>Information</td>
|
|
||||||
</tr>
|
|
||||||
<xsl:for-each select="/rep:validationResults/rep:validationStepResult">
|
|
||||||
<xsl:variable name="step-id" select="@id" />
|
|
||||||
<tr>
|
|
||||||
<td>
|
|
||||||
<xsl:value-of select="@id" />
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<xsl:value-of select="s:resource/s:resouceName" />
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<xsl:value-of
|
|
||||||
select="count(//rep:message[@step eq $step-id and @level eq 'error'])" />
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<xsl:value-of
|
|
||||||
select="count(//rep:message[@step eq $step-id and @level eq 'warning'])" />
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<xsl:value-of
|
|
||||||
select="count(//rep:message[@step eq $step-id and @level eq 'information'])"
|
|
||||||
/>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</xsl:for-each>
|
|
||||||
</table>
|
|
||||||
</xsl:template>
|
|
||||||
|
|
||||||
<xd:doc>
|
|
||||||
<xd:desc>
|
|
||||||
<xd:p>Generiert am Ende eines eingebetteten HTML Dokuments, welches den Prüf- und
|
|
||||||
Bewertungsbericht visualisiert und die Handlungsempfehlung begründet, eine Übersicht
|
|
||||||
mit Metadaten zum Prüfmodul.
|
|
||||||
</xd:p>
|
|
||||||
</xd:desc>
|
|
||||||
</xd:doc>
|
|
||||||
<xsl:template name="html:epilog" as="element()+">
|
|
||||||
<p class="info" xmlns="http://www.w3.org/1999/xhtml">
|
|
||||||
<xsl:text>Erstellt mit: </xsl:text>
|
|
||||||
<xsl:value-of select="rep:engine/rep:name" />
|
|
||||||
<xsl:text> für das InstructionSet </xsl:text>
|
|
||||||
<em>
|
|
||||||
<xsl:value-of select="rep:engine/rep:info[@key eq 'title']" />
|
|
||||||
</em>
|
|
||||||
<xsl:text> vom </xsl:text>
|
|
||||||
<xsl:value-of
|
|
||||||
select="format-dateTime(xs:dateTime(rep:engine/rep:info[@key eq 'version']), '[D].[M].[Y]')" />
|
|
||||||
<xsl:text>.</xsl:text>
|
|
||||||
</p>
|
|
||||||
</xsl:template>
|
|
||||||
|
|
||||||
<xd:doc>
|
|
||||||
<xd:desc>
|
|
||||||
<xd:p>Generiert in dem eingebetetteten HTML Dokument eine Tabelle mit den während der
|
|
||||||
Validierung ausgegebenen Daten.
|
|
||||||
</xd:p>
|
|
||||||
</xd:desc>
|
|
||||||
</xd:doc>
|
|
||||||
<xsl:template name="html:messagetable" as="element()">
|
|
||||||
<table xmlns="http://www.w3.org/1999/xhtml" class="tbl-errors">
|
|
||||||
<xsl:call-template name="html:messagetable.head" />
|
|
||||||
<tbody>
|
|
||||||
<xsl:for-each select="//rep:message">
|
|
||||||
<xsl:call-template name="html:messagetable.row" />
|
|
||||||
</xsl:for-each>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
</xsl:template>
|
|
||||||
|
|
||||||
<xd:doc>
|
|
||||||
<xd:desc>
|
|
||||||
<xd:p>Generiert in der HTML-Tabelle der Validierungsnachtichten in dem eingebetteten
|
|
||||||
HTML Dokument dn Tabellenkopf
|
|
||||||
</xd:p>
|
|
||||||
</xd:desc>
|
|
||||||
</xd:doc>
|
|
||||||
<xsl:template name="html:messagetable.head" xmlns="http://www.w3.org/1999/xhtml">
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th>Pos</th>
|
|
||||||
<th>Code</th>
|
|
||||||
<th>CustomLevel (Level)</th>
|
|
||||||
<th>Step</th>
|
|
||||||
<th>Text</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
</xsl:template>
|
|
||||||
|
|
||||||
<xd:doc>
|
|
||||||
<xd:desc>
|
|
||||||
<xd:p>Generiert in der HTML-Tabelle der Validierungsnachtichten in dem eingebetteten
|
|
||||||
HTML Dokument eine oder mehrere Zeilen pro Validierungsnachricht
|
|
||||||
</xd:p>
|
|
||||||
</xd:desc>
|
|
||||||
</xd:doc>
|
|
||||||
<xsl:template name="html:messagetable.row" xmlns="http://www.w3.org/1999/xhtml">
|
|
||||||
<tr>
|
|
||||||
<xsl:attribute name="class">
|
|
||||||
<xsl:value-of select="rep:custom-level(.)" />
|
|
||||||
</xsl:attribute>
|
|
||||||
<td>
|
|
||||||
<xsl:value-of select="position()" />
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<xsl:value-of select="@code" />
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<xsl:value-of select="rep:custom-level(.)" />
|
|
||||||
<xsl:if test="not(rep:custom-level(.) eq @level)">
|
|
||||||
<xsl:value-of select="concat(' (', @level, ')')" />
|
|
||||||
</xsl:if>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<xsl:value-of select="@step" />
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<xsl:value-of select="normalize-space(.)" />
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td colspan="4" />
|
|
||||||
<td>
|
|
||||||
<xsl:value-of select="@location" />
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</xsl:template>
|
|
||||||
|
|
||||||
<xd:doc>
|
|
||||||
<xd:desc>
|
|
||||||
<xd:p>Generiert in dem eingebetteten HTML Dokument eine Aussage zur Konformität des
|
|
||||||
geprüften Dokuments zu den formalen Vorgaben.
|
|
||||||
</xd:p>
|
|
||||||
</xd:desc>
|
|
||||||
</xd:doc>
|
|
||||||
<xsl:template name="html:conformance">
|
|
||||||
<xsl:variable name="e" as="xs:integer" select="count(//rep:message[@level eq 'error'])" />
|
|
||||||
<xsl:variable name="w" as="xs:integer" select="count(//rep:message[@level eq 'warning'])" />
|
|
||||||
<p class="important" xmlns="http://www.w3.org/1999/xhtml">
|
|
||||||
<b>Konformitätsprüfung:</b>
|
|
||||||
<xsl:text>Das geprüfte Dokument enthält </xsl:text>
|
|
||||||
<xsl:choose>
|
|
||||||
<xsl:when test="$e + $w eq 0">
|
|
||||||
<xsl:text>weder Fehler noch Warnungen. Es ist konform zu den formalen Vorgaben.</xsl:text>
|
|
||||||
</xsl:when>
|
|
||||||
<xsl:otherwise>
|
|
||||||
<xsl:value-of select="concat($e, ' Fehler / ', $w, ' Warnungen. Es ist ')" />
|
|
||||||
<b>nicht konform</b>
|
|
||||||
<xsl:text> zu den formalen Vorgaben.</xsl:text>
|
|
||||||
</xsl:otherwise>
|
|
||||||
</xsl:choose>
|
|
||||||
</p>
|
|
||||||
</xsl:template>
|
|
||||||
|
|
||||||
<xd:doc>
|
|
||||||
<xd:desc>
|
|
||||||
<xd:p>Generiert in dem eingebetteten HTML Dokument die Aussage zur
|
|
||||||
Handlungsempfehlung.
|
|
||||||
</xd:p>
|
|
||||||
</xd:desc>
|
|
||||||
</xd:doc>
|
|
||||||
<xsl:template name="html:assessment">
|
|
||||||
<xsl:variable name="e1" as="xs:integer" select="count(//message[@level eq 'error'])" />
|
|
||||||
<xsl:variable name="e2" as="xs:integer"
|
|
||||||
select="count(//rep:message[rep:custom-level(.) eq 'error'])" />
|
|
||||||
<p class="important" xmlns="http://www.w3.org/1999/xhtml">
|
|
||||||
<b>Bewertung:</b>
|
|
||||||
<xsl:choose>
|
|
||||||
<xsl:when test="$e1 eq 0 and $e2 eq 0">
|
|
||||||
<xsl:text>Es wird empfohlen das Dokument anzunehmen un weiter zu verarbeiten.</xsl:text>
|
|
||||||
</xsl:when>
|
|
||||||
<xsl:when test="$e1 gt 0 and $e2 eq 0">
|
|
||||||
<xsl:text>Es wird empfohlen das Dokument anzunehmen und zu verarbeiten, da die vorhandenen Fehler derzeit toleriert werden.</xsl:text>
|
|
||||||
</xsl:when>
|
|
||||||
<xsl:otherwise>
|
|
||||||
<xsl:text>Es wird empfohlen das Dokument zurückzuweisen.</xsl:text>
|
|
||||||
</xsl:otherwise>
|
|
||||||
</xsl:choose>
|
|
||||||
</p>
|
|
||||||
</xsl:template>
|
|
||||||
|
|
||||||
|
|
||||||
</xsl:stylesheet>
|
|
||||||
|
|
@ -1,3 +0,0 @@
|
||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
cd /opt/validationtool && java -jar validationtool-standalone.jar -s scenarios.xml -D -H 0.0.0.0
|
|
||||||
|
|
@ -0,0 +1,21 @@
|
||||||
|
package de.kosit.validationtool.api;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Status der Empfehlung.
|
||||||
|
*/
|
||||||
|
public enum AcceptRecommendation {
|
||||||
|
/**
|
||||||
|
* Nicht definiert, weil eine Evaluierung nicht durchgeführt wurde, oder nicht durchgeführt werden konnte.
|
||||||
|
*/
|
||||||
|
UNDEFINED,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Das Dokument ist gemäß Konfiguration valide und kann akzeptiert werden.
|
||||||
|
*/
|
||||||
|
ACCEPTABLE,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Das Dokuemnt ist gemäß Konfiguration invalide und sollte NICHT akzeptiert werden.
|
||||||
|
*/
|
||||||
|
REJECT
|
||||||
|
}
|
||||||
|
|
@ -24,9 +24,6 @@ import java.util.stream.Collectors;
|
||||||
|
|
||||||
import org.w3c.dom.Document;
|
import org.w3c.dom.Document;
|
||||||
|
|
||||||
import net.sf.saxon.dom.NodeOverNodeInfo;
|
|
||||||
import net.sf.saxon.s9api.XdmNode;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Zentrale Schnittstellendefinition für das Prüf-Tool.
|
* Zentrale Schnittstellendefinition für das Prüf-Tool.
|
||||||
|
|
@ -42,10 +39,10 @@ public interface Check {
|
||||||
* @param input die Resource / XML-Datei, die geprüft werden soll.
|
* @param input die Resource / XML-Datei, die geprüft werden soll.
|
||||||
* @return ein Ergebnis-{@link Document} (readonly)
|
* @return ein Ergebnis-{@link Document} (readonly)
|
||||||
*/
|
*/
|
||||||
default Document check(Input input) {
|
default Document check(final Input input) {
|
||||||
final XdmNode node = checkInput(input);
|
final Result result = checkInput(input);
|
||||||
// readonly view of the document!!!
|
// readonly view of the document!!!
|
||||||
return (Document) NodeOverNodeInfo.wrap(node.getUnderlyingNode());
|
return result.getReportDocument();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -54,7 +51,7 @@ public interface Check {
|
||||||
* @param input die Resource / XML-Datei, die geprüft werden soll.
|
* @param input die Resource / XML-Datei, die geprüft werden soll.
|
||||||
* @return ein Ergebnis-{@link Document}
|
* @return ein Ergebnis-{@link Document}
|
||||||
*/
|
*/
|
||||||
XdmNode checkInput(Input input);
|
Result checkInput(Input input);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Führt eine Prüfung im Batch-Mode durch. Die Default-Implementierung führt die Prüfung sequentiell aus. Die Ergebnis
|
* Führt eine Prüfung im Batch-Mode durch. Die Default-Implementierung führt die Prüfung sequentiell aus. Die Ergebnis
|
||||||
|
|
@ -63,7 +60,7 @@ public interface Check {
|
||||||
* @param input die Eingabe
|
* @param input die Eingabe
|
||||||
* @return Liste mit Ergebnis-Dokumenten (readonly)
|
* @return Liste mit Ergebnis-Dokumenten (readonly)
|
||||||
*/
|
*/
|
||||||
default List<Document> check(List<Input> input) {
|
default List<Document> check(final List<Input> input) {
|
||||||
return input.stream().map(this::check).collect(Collectors.toList());
|
return input.stream().map(this::check).collect(Collectors.toList());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -73,8 +70,9 @@ public interface Check {
|
||||||
* @param input die Eingabe
|
* @param input die Eingabe
|
||||||
* @return Liste mit Ergebnis-Dokumenten
|
* @return Liste mit Ergebnis-Dokumenten
|
||||||
*/
|
*/
|
||||||
default List<XdmNode> checkInput(List<Input> input) {
|
default List<Result> checkInput(final List<Input> input) {
|
||||||
return input.stream().map(this::checkInput).collect(Collectors.toList());
|
return input.stream().map(this::checkInput).collect(Collectors.toList());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
51
src/main/java/de/kosit/validationtool/api/Result.java
Normal file
51
src/main/java/de/kosit/validationtool/api/Result.java
Normal file
|
|
@ -0,0 +1,51 @@
|
||||||
|
package de.kosit.validationtool.api;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.oclc.purl.dsdl.svrl.SchematronOutput;
|
||||||
|
import org.w3c.dom.Document;
|
||||||
|
|
||||||
|
import net.sf.saxon.s9api.XdmNode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* API Rückgabe Objekt des Ergebnisses des Validierungsprozesses.
|
||||||
|
*
|
||||||
|
* @author Andreas Penski
|
||||||
|
*/
|
||||||
|
|
||||||
|
public interface Result {
|
||||||
|
|
||||||
|
/** Der generierte Report. */
|
||||||
|
XdmNode getReport();
|
||||||
|
|
||||||
|
/** Das evaluierte Ergebnis. */
|
||||||
|
AcceptRecommendation getAcceptRecommendation();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gibt den Report als W3C-{@link Document} zurück.
|
||||||
|
*
|
||||||
|
* @return der Report
|
||||||
|
*/
|
||||||
|
Document getReportDocument();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Schnellzugriff auf die Empfehlung zur Weiterverarbeitung des Dokuments.
|
||||||
|
*
|
||||||
|
* @return true wenn {@link AcceptRecommendation#ACCEPTABLE}
|
||||||
|
*/
|
||||||
|
boolean isAcceptable();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gibt eine Liste mit gefundenen Schema-Validation-Fehler zurück. Diese Liste ist leer, wenn keine Fehler gefunden
|
||||||
|
* wurden.
|
||||||
|
*/
|
||||||
|
List<XmlError> getSchemaViolations();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Liefert die Ergebnisse der Schematron-Prüfungen, in der Reihenfolge der Szenario-Konfiguration.
|
||||||
|
*
|
||||||
|
* @return Liste mit Schematron-Ergebnissen
|
||||||
|
*/
|
||||||
|
List<SchematronOutput> getSchematronResult();
|
||||||
|
|
||||||
|
}
|
||||||
43
src/main/java/de/kosit/validationtool/api/XmlError.java
Normal file
43
src/main/java/de/kosit/validationtool/api/XmlError.java
Normal file
|
|
@ -0,0 +1,43 @@
|
||||||
|
package de.kosit.validationtool.api;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Fehlerobjekt für die Bereitstellung von Fehlern aus der internen Verarbeitung, bspw. Schema-Validation-Fehler.
|
||||||
|
*
|
||||||
|
* @author Andreas Penski
|
||||||
|
*/
|
||||||
|
public interface XmlError {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gibt die Fehlermeldung zurück.
|
||||||
|
*
|
||||||
|
* @return die Fehlermeldung
|
||||||
|
*/
|
||||||
|
String getMessage();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Zeigt den Schweregrad der Fehlermeldung an
|
||||||
|
*
|
||||||
|
* @return der Schweregrad
|
||||||
|
* @see Severity
|
||||||
|
*/
|
||||||
|
Severity getSeverity();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gibt optional eine Zeilennummer an, aus der der Fehler resultiert.
|
||||||
|
*
|
||||||
|
* @return die Zeitelnnummer
|
||||||
|
*/
|
||||||
|
Integer getRowNumber();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gibt optional eine Spaltennummer an, aus der der Fehler resultiert.
|
||||||
|
*
|
||||||
|
* @return die Spaltennummer
|
||||||
|
*/
|
||||||
|
Integer getColumnNumber();
|
||||||
|
|
||||||
|
enum Severity {
|
||||||
|
SEVERITY_WARNING, SEVERITY_ERROR, SEVERITY_FATAL_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -28,6 +28,7 @@ import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import org.apache.commons.cli.CommandLine;
|
import org.apache.commons.cli.CommandLine;
|
||||||
|
|
@ -45,6 +46,7 @@ import lombok.extern.slf4j.Slf4j;
|
||||||
import de.kosit.validationtool.api.CheckConfiguration;
|
import de.kosit.validationtool.api.CheckConfiguration;
|
||||||
import de.kosit.validationtool.api.Input;
|
import de.kosit.validationtool.api.Input;
|
||||||
import de.kosit.validationtool.api.InputFactory;
|
import de.kosit.validationtool.api.InputFactory;
|
||||||
|
import de.kosit.validationtool.api.Result;
|
||||||
import de.kosit.validationtool.cmd.assertions.Assertions;
|
import de.kosit.validationtool.cmd.assertions.Assertions;
|
||||||
import de.kosit.validationtool.impl.ConversionService;
|
import de.kosit.validationtool.impl.ConversionService;
|
||||||
import de.kosit.validationtool.impl.ObjectFactory;
|
import de.kosit.validationtool.impl.ObjectFactory;
|
||||||
|
|
@ -101,7 +103,7 @@ public class CommandLineApplication {
|
||||||
*
|
*
|
||||||
* @param args die Eingabe-Argumente
|
* @param args die Eingabe-Argumente
|
||||||
*/
|
*/
|
||||||
public static void main(String[] args) {
|
public static void main(final String[] args) {
|
||||||
final int resultStatus = mainProgram(args);
|
final int resultStatus = mainProgram(args);
|
||||||
if (DAEMON_SIGNAL != resultStatus) {
|
if (DAEMON_SIGNAL != resultStatus) {
|
||||||
System.exit(resultStatus);
|
System.exit(resultStatus);
|
||||||
|
|
@ -114,14 +116,14 @@ public class CommandLineApplication {
|
||||||
*
|
*
|
||||||
* @param args die Eingabe-Argumente
|
* @param args die Eingabe-Argumente
|
||||||
*/
|
*/
|
||||||
static int mainProgram(String[] args) {
|
static int mainProgram(final String[] args) {
|
||||||
int returnValue = 0;
|
int returnValue = 0;
|
||||||
Options options = createOptions();
|
final Options options = createOptions();
|
||||||
if (isHelpRequested(args)) {
|
if (isHelpRequested(args)) {
|
||||||
printHelp(options);
|
printHelp(options);
|
||||||
} else {
|
} else {
|
||||||
try {
|
try {
|
||||||
CommandLineParser parser = new DefaultParser();
|
final CommandLineParser parser = new DefaultParser();
|
||||||
final CommandLine cmd = parser.parse(options, args);
|
final CommandLine cmd = parser.parse(options, args);
|
||||||
if (cmd.hasOption(SERVER.getOpt())) {
|
if (cmd.hasOption(SERVER.getOpt())) {
|
||||||
returnValue = startDaemonMode(cmd);
|
returnValue = startDaemonMode(cmd);
|
||||||
|
|
@ -130,7 +132,7 @@ public class CommandLineApplication {
|
||||||
} else {
|
} else {
|
||||||
returnValue = processActions(cmd);
|
returnValue = processActions(cmd);
|
||||||
}
|
}
|
||||||
} catch (ParseException e) {
|
} catch (final ParseException e) {
|
||||||
log.error("Error processing command line arguments: " + e.getMessage());
|
log.error("Error processing command line arguments: " + e.getMessage());
|
||||||
printHelp(options);
|
printHelp(options);
|
||||||
}
|
}
|
||||||
|
|
@ -138,7 +140,7 @@ public class CommandLineApplication {
|
||||||
return returnValue;
|
return returnValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static int determinePort(CommandLine cmd) {
|
private static int determinePort(final CommandLine cmd) {
|
||||||
int port = 8080;
|
int port = 8080;
|
||||||
if (checkOptionWithValue(PORT, cmd)) {
|
if (checkOptionWithValue(PORT, cmd)) {
|
||||||
port = Integer.parseInt(cmd.getOptionValue(PORT.getOpt()));
|
port = Integer.parseInt(cmd.getOptionValue(PORT.getOpt()));
|
||||||
|
|
@ -146,7 +148,7 @@ public class CommandLineApplication {
|
||||||
return port;
|
return port;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static int determineThreads(CommandLine cmd) {
|
private static int determineThreads(final CommandLine cmd) {
|
||||||
int threads = Runtime.getRuntime().availableProcessors();
|
int threads = Runtime.getRuntime().availableProcessors();
|
||||||
if (checkOptionWithValue(WORKER_COUNT, cmd)) {
|
if (checkOptionWithValue(WORKER_COUNT, cmd)) {
|
||||||
threads = Integer.parseInt(cmd.getOptionValue(WORKER_COUNT.getOpt()));
|
threads = Integer.parseInt(cmd.getOptionValue(WORKER_COUNT.getOpt()));
|
||||||
|
|
@ -154,7 +156,7 @@ public class CommandLineApplication {
|
||||||
return threads;
|
return threads;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static String determineHost(CommandLine cmd) {
|
private static String determineHost(final CommandLine cmd) {
|
||||||
String host = "localhost";
|
String host = "localhost";
|
||||||
if (checkOptionWithValue(HOST, cmd)) {
|
if (checkOptionWithValue(HOST, cmd)) {
|
||||||
host = cmd.getOptionValue(HOST.getOpt());
|
host = cmd.getOptionValue(HOST.getOpt());
|
||||||
|
|
@ -162,15 +164,15 @@ public class CommandLineApplication {
|
||||||
return host;
|
return host;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static int startDaemonMode(CommandLine cmd) {
|
private static int startDaemonMode(final CommandLine cmd) {
|
||||||
Option[] unavailable = new Option[]{PRINT, CHECK_ASSERTIONS, DEBUG, OUTPUT, EXTRACT_HTML};
|
final Option[] unavailable = new Option[]{PRINT, CHECK_ASSERTIONS, DEBUG, OUTPUT, EXTRACT_HTML};
|
||||||
warnUnusedOptions(cmd, unavailable, true);
|
warnUnusedOptions(cmd, unavailable, true);
|
||||||
Daemon validDaemon = new Daemon(determineDefinition(cmd), determineRepository(cmd), determineHost(cmd), determinePort(cmd), determineThreads(cmd));
|
final Daemon validDaemon = new Daemon(determineDefinition(cmd), determineRepository(cmd), determineHost(cmd), determinePort(cmd), determineThreads(cmd));
|
||||||
validDaemon.startServer();
|
validDaemon.startServer();
|
||||||
return DAEMON_SIGNAL;
|
return DAEMON_SIGNAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void warnUnusedOptions(CommandLine cmd, Option[] unavailable, boolean daemon) {
|
private static void warnUnusedOptions(final CommandLine cmd, final Option[] unavailable, final boolean daemon) {
|
||||||
Arrays.stream(cmd.getOptions()).filter(o -> ArrayUtils.contains(unavailable, o)).map(o -> "The option " + o.getLongOpt() + " is not available in daemon mode").forEach(log::error);
|
Arrays.stream(cmd.getOptions()).filter(o -> ArrayUtils.contains(unavailable, o)).map(o -> "The option " + o.getLongOpt() + " is not available in daemon mode").forEach(log::error);
|
||||||
if (daemon && !cmd.getArgList().isEmpty()) {
|
if (daemon && !cmd.getArgList().isEmpty()) {
|
||||||
log.info("Ignoring test targets in daemon mode");
|
log.info("Ignoring test targets in daemon mode");
|
||||||
|
|
@ -178,30 +180,30 @@ public class CommandLineApplication {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private static boolean isHelpRequested(String[] args) {
|
private static boolean isHelpRequested(final String[] args) {
|
||||||
Options helpOptions = createHelpOptions();
|
final Options helpOptions = createHelpOptions();
|
||||||
try {
|
try {
|
||||||
CommandLineParser parser = new DefaultParser();
|
final CommandLineParser parser = new DefaultParser();
|
||||||
CommandLine cmd = parser.parse(helpOptions, args, true);
|
final CommandLine cmd = parser.parse(helpOptions, args, true);
|
||||||
if (cmd.hasOption(HELP.getOpt()) || args.length == 0) {
|
if (cmd.hasOption(HELP.getOpt()) || args.length == 0) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
} catch (ParseException e) {
|
} catch (final ParseException e) {
|
||||||
// we can ignore that, we just look for the help parameters
|
// we can ignore that, we just look for the help parameters
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static int processActions(CommandLine cmd) {
|
private static int processActions(final CommandLine cmd) {
|
||||||
try {
|
try {
|
||||||
|
|
||||||
long start = System.currentTimeMillis();
|
long start = System.currentTimeMillis();
|
||||||
Option[] unavailable = new Option[]{HOST, PORT, WORKER_COUNT};
|
final Option[] unavailable = new Option[]{HOST, PORT, WORKER_COUNT};
|
||||||
warnUnusedOptions(cmd, unavailable, false);
|
warnUnusedOptions(cmd, unavailable, false);
|
||||||
CheckConfiguration d = new CheckConfiguration(determineDefinition(cmd));
|
final CheckConfiguration d = new CheckConfiguration(determineDefinition(cmd));
|
||||||
d.setScenarioRepository(determineRepository(cmd));
|
d.setScenarioRepository(determineRepository(cmd));
|
||||||
InternalCheck check = new InternalCheck(d);
|
final InternalCheck check = new InternalCheck(d);
|
||||||
Path outputDirectory = determineOutputDirectory(cmd);
|
final Path outputDirectory = determineOutputDirectory(cmd);
|
||||||
|
|
||||||
if (cmd.hasOption(EXTRACT_HTML.getOpt())) {
|
if (cmd.hasOption(EXTRACT_HTML.getOpt())) {
|
||||||
check.getCheckSteps().add(new ExtractHtmlContentAction(check.getContentRepository(), outputDirectory));
|
check.getCheckSteps().add(new ExtractHtmlContentAction(check.getContentRepository(), outputDirectory));
|
||||||
|
|
@ -212,7 +214,7 @@ public class CommandLineApplication {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cmd.hasOption(CHECK_ASSERTIONS.getOpt())) {
|
if (cmd.hasOption(CHECK_ASSERTIONS.getOpt())) {
|
||||||
Assertions assertions = loadAssertions(cmd.getOptionValue(CHECK_ASSERTIONS.getOpt()));
|
final Assertions assertions = loadAssertions(cmd.getOptionValue(CHECK_ASSERTIONS.getOpt()));
|
||||||
check.getCheckSteps().add(new CheckAssertionAction(assertions, ObjectFactory.createProcessor()));
|
check.getCheckSteps().add(new CheckAssertionAction(assertions, ObjectFactory.createProcessor()));
|
||||||
}
|
}
|
||||||
if (cmd.hasOption(PRINT_MEM_STATS.getOpt())) {
|
if (cmd.hasOption(PRINT_MEM_STATS.getOpt())) {
|
||||||
|
|
@ -222,16 +224,17 @@ public class CommandLineApplication {
|
||||||
log.info("Setup completed in {}ms\n", System.currentTimeMillis() - start);
|
log.info("Setup completed in {}ms\n", System.currentTimeMillis() - start);
|
||||||
|
|
||||||
final Collection<Path> targets = determineTestTargets(cmd);
|
final Collection<Path> targets = determineTestTargets(cmd);
|
||||||
|
final List<Result> results = new ArrayList<>();
|
||||||
start = System.currentTimeMillis();
|
start = System.currentTimeMillis();
|
||||||
for (Path p : targets) {
|
for (final Path p : targets) {
|
||||||
final Input input = InputFactory.read(p);
|
final Input input = InputFactory.read(p);
|
||||||
check.checkInput(input);
|
results.add(check.checkInput(input));
|
||||||
}
|
}
|
||||||
boolean result = check.printAndEvaluate();
|
final boolean result = check.printAndEvaluate();
|
||||||
log.info("Processing {} object(s) completed in {}ms", targets.size(), System.currentTimeMillis() - start);
|
log.info("Processing {} object(s) completed in {}ms", targets.size(), System.currentTimeMillis() - start);
|
||||||
return result ? 0 : 1;
|
return result ? 0 : 1;
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (final Exception e) {
|
||||||
if (cmd.hasOption(DEBUG.getOpt())) {
|
if (cmd.hasOption(DEBUG.getOpt())) {
|
||||||
log.error(e.getMessage(), e);
|
log.error(e.getMessage(), e);
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -241,20 +244,20 @@ public class CommandLineApplication {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static Assertions loadAssertions(String optionValue) {
|
private static Assertions loadAssertions(final String optionValue) {
|
||||||
Path p = Paths.get(optionValue);
|
final Path p = Paths.get(optionValue);
|
||||||
Assertions a = null;
|
Assertions a = null;
|
||||||
if (Files.exists(p)) {
|
if (Files.exists(p)) {
|
||||||
ConversionService c = new ConversionService();
|
final ConversionService c = new ConversionService();
|
||||||
c.initialize(de.kosit.validationtool.cmd.assertions.ObjectFactory.class.getPackage());
|
c.initialize(de.kosit.validationtool.cmd.assertions.ObjectFactory.class.getPackage());
|
||||||
a = c.readXml(p.toUri(), Assertions.class);
|
a = c.readXml(p.toUri(), Assertions.class);
|
||||||
}
|
}
|
||||||
return a;
|
return a;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static Path determineOutputDirectory(CommandLine cmd) {
|
private static Path determineOutputDirectory(final CommandLine cmd) {
|
||||||
final String value = cmd.getOptionValue(OUTPUT.getOpt());
|
final String value = cmd.getOptionValue(OUTPUT.getOpt());
|
||||||
Path fir;
|
final Path fir;
|
||||||
if (StringUtils.isNotBlank(value)) {
|
if (StringUtils.isNotBlank(value)) {
|
||||||
fir = Paths.get(value);
|
fir = Paths.get(value);
|
||||||
if ((!Files.exists(fir) && !fir.toFile().mkdirs()) || !Files.isDirectory(fir)) {
|
if ((!Files.exists(fir) && !fir.toFile().mkdirs()) || !Files.isDirectory(fir)) {
|
||||||
|
|
@ -266,8 +269,8 @@ public class CommandLineApplication {
|
||||||
return fir;
|
return fir;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static Collection<Path> determineTestTargets(CommandLine cmd) {
|
private static Collection<Path> determineTestTargets(final CommandLine cmd) {
|
||||||
Collection<Path> targets = new ArrayList<>();
|
final Collection<Path> targets = new ArrayList<>();
|
||||||
if (!cmd.getArgList().isEmpty()) {
|
if (!cmd.getArgList().isEmpty()) {
|
||||||
cmd.getArgList().forEach(e -> targets.addAll(determineTestTarget(e)));
|
cmd.getArgList().forEach(e -> targets.addAll(determineTestTarget(e)));
|
||||||
}
|
}
|
||||||
|
|
@ -277,8 +280,8 @@ public class CommandLineApplication {
|
||||||
return targets;
|
return targets;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static Collection<Path> determineTestTarget(String s) {
|
private static Collection<Path> determineTestTarget(final String s) {
|
||||||
Path d = Paths.get(s);
|
final Path d = Paths.get(s);
|
||||||
if (Files.isDirectory(d)) {
|
if (Files.isDirectory(d)) {
|
||||||
return listDirectoryTargets(d);
|
return listDirectoryTargets(d);
|
||||||
} else if (Files.exists(d)) {
|
} else if (Files.exists(d)) {
|
||||||
|
|
@ -289,31 +292,31 @@ public class CommandLineApplication {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static Collection<Path> listDirectoryTargets(Path d) {
|
private static Collection<Path> listDirectoryTargets(final Path d) {
|
||||||
try {
|
try {
|
||||||
return Files.list(d).filter(path -> path.toString().endsWith(".xml")).collect(Collectors.toList());
|
return Files.list(d).filter(path -> path.toString().endsWith(".xml")).collect(Collectors.toList());
|
||||||
} catch (IOException e) {
|
} catch (final IOException e) {
|
||||||
throw new IllegalStateException("IOException while list directory content. Can not determine test targets.", e);
|
throw new IllegalStateException("IOException while list directory content. Can not determine test targets.", e);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static URI determineRepository(CommandLine cmd) {
|
private static URI determineRepository(final CommandLine cmd) {
|
||||||
if (checkOptionWithValue(REPOSITORY, cmd)) {
|
if (checkOptionWithValue(REPOSITORY, cmd)) {
|
||||||
Path d = Paths.get(cmd.getOptionValue(REPOSITORY.getOpt()));
|
final Path d = Paths.get(cmd.getOptionValue(REPOSITORY.getOpt()));
|
||||||
if (Files.isDirectory(d)) {
|
if (Files.isDirectory(d)) {
|
||||||
return d.toUri();
|
return d.toUri();
|
||||||
} else {
|
} else {
|
||||||
throw new IllegalArgumentException(
|
throw new IllegalArgumentException(
|
||||||
String.format("Not a valid path for scenario definition specified: '%s'", d.toAbsolutePath()));
|
String.format("Not a valid path for repository definition specified: '%s'", d.toAbsolutePath()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static URI determineDefinition(CommandLine cmd) {
|
private static URI determineDefinition(final CommandLine cmd) {
|
||||||
checkOptionWithValue(SCENARIOS, cmd);
|
checkOptionWithValue(SCENARIOS, cmd);
|
||||||
Path f = Paths.get(cmd.getOptionValue(SCENARIOS.getOpt()));
|
final Path f = Paths.get(cmd.getOptionValue(SCENARIOS.getOpt()));
|
||||||
if (Files.isRegularFile(f)) {
|
if (Files.isRegularFile(f)) {
|
||||||
return f.toAbsolutePath().toUri();
|
return f.toAbsolutePath().toUri();
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -322,10 +325,10 @@ public class CommandLineApplication {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static boolean checkOptionWithValue(Option option, CommandLine cmd) {
|
private static boolean checkOptionWithValue(final Option option, final CommandLine cmd) {
|
||||||
String opt = option.getOpt();
|
final String opt = option.getOpt();
|
||||||
if (cmd.hasOption(opt)) {
|
if (cmd.hasOption(opt)) {
|
||||||
String value = cmd.getOptionValue(opt);
|
final String value = cmd.getOptionValue(opt);
|
||||||
if (StringUtils.isNoneBlank(value)) {
|
if (StringUtils.isNoneBlank(value)) {
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -338,20 +341,20 @@ public class CommandLineApplication {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void printHelp(Options options) {
|
private static void printHelp(final Options options) {
|
||||||
// automatically generate the help statement
|
// automatically generate the help statement
|
||||||
HelpFormatter formatter = new HelpFormatter();
|
final HelpFormatter formatter = new HelpFormatter();
|
||||||
formatter.printHelp("check-tool -s <scenario-config-file> [OPTIONS] [FILE]... ", options, false);
|
formatter.printHelp("check-tool -s <scenario-config-file> [OPTIONS] [FILE]... ", options, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static Options createHelpOptions() {
|
private static Options createHelpOptions() {
|
||||||
Options options = new Options();
|
final Options options = new Options();
|
||||||
options.addOption(HELP);
|
options.addOption(HELP);
|
||||||
return options;
|
return options;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static Options createOptions() {
|
private static Options createOptions() {
|
||||||
Options options = new Options();
|
final Options options = new Options();
|
||||||
options.addOption(HELP);
|
options.addOption(HELP);
|
||||||
options.addOption(SERVER);
|
options.addOption(SERVER);
|
||||||
options.addOption(HOST);
|
options.addOption(HOST);
|
||||||
|
|
|
||||||
|
|
@ -20,20 +20,17 @@
|
||||||
package de.kosit.validationtool.cmd;
|
package de.kosit.validationtool.cmd;
|
||||||
|
|
||||||
import java.nio.file.Path;
|
import java.nio.file.Path;
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
import de.kosit.validationtool.impl.ContentRepository;
|
import de.kosit.validationtool.impl.ContentRepository;
|
||||||
|
import de.kosit.validationtool.impl.HtmlExtraction;
|
||||||
import de.kosit.validationtool.impl.tasks.CheckAction;
|
import de.kosit.validationtool.impl.tasks.CheckAction;
|
||||||
|
|
||||||
import net.sf.saxon.s9api.QName;
|
import net.sf.saxon.s9api.QName;
|
||||||
import net.sf.saxon.s9api.SaxonApiException;
|
import net.sf.saxon.s9api.SaxonApiException;
|
||||||
import net.sf.saxon.s9api.Serializer;
|
import net.sf.saxon.s9api.Serializer;
|
||||||
import net.sf.saxon.s9api.XPathExecutable;
|
|
||||||
import net.sf.saxon.s9api.XPathSelector;
|
|
||||||
import net.sf.saxon.s9api.XdmItem;
|
import net.sf.saxon.s9api.XdmItem;
|
||||||
import net.sf.saxon.s9api.XdmNode;
|
import net.sf.saxon.s9api.XdmNode;
|
||||||
|
|
||||||
|
|
@ -48,49 +45,38 @@ class ExtractHtmlContentAction implements CheckAction {
|
||||||
|
|
||||||
private static final QName NAME_ATTRIBUTE = new QName("data-report-type");
|
private static final QName NAME_ATTRIBUTE = new QName("data-report-type");
|
||||||
|
|
||||||
private final ContentRepository repository;
|
|
||||||
|
|
||||||
private final Path outputDirectory;
|
private final Path outputDirectory;
|
||||||
|
|
||||||
private XPathExecutable executable;
|
private HtmlExtraction htmlExtraction;
|
||||||
|
|
||||||
|
private ContentRepository repository;
|
||||||
|
|
||||||
|
public ExtractHtmlContentAction(final ContentRepository repository, final Path outputDirectory) {
|
||||||
|
this.outputDirectory = outputDirectory;
|
||||||
|
this.htmlExtraction = new HtmlExtraction(repository);
|
||||||
|
this.repository = repository;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void check(Bag results) {
|
public void check(final Bag results) {
|
||||||
try {
|
this.htmlExtraction.extract(results.getReport()).forEach(i -> print(results.getName(), i));
|
||||||
final XPathSelector selector = getSelector();
|
|
||||||
final XdmNode xdmSource = results.getReport();
|
|
||||||
selector.setContextItem(xdmSource);
|
|
||||||
selector.forEach(m -> print(results.getName(), m));
|
|
||||||
|
|
||||||
} catch (SaxonApiException e) {
|
|
||||||
throw new IllegalStateException("Can not extract html content", e);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void print(String origName, XdmItem xdmItem) {
|
private void print(final String origName, final XdmItem xdmItem) {
|
||||||
XdmNode node = (XdmNode) xdmItem;
|
final XdmNode node = (XdmNode) xdmItem;
|
||||||
final String name = origName + "-" + node.getAttributeValue(NAME_ATTRIBUTE);
|
final String name = origName + "-" + node.getAttributeValue(NAME_ATTRIBUTE);
|
||||||
final Path file = outputDirectory.resolve(name + ".html");
|
final Path file = this.outputDirectory.resolve(name + ".html");
|
||||||
final Serializer serializer = repository.getProcessor().newSerializer(file.toFile());
|
final Serializer serializer = this.repository.getProcessor().newSerializer(file.toFile());
|
||||||
try {
|
try {
|
||||||
log.info("Writing report html '{}' to {}", name, file.toAbsolutePath());
|
log.info("Writing report html '{}' to {}", name, file.toAbsolutePath());
|
||||||
serializer.serializeNode(node);
|
serializer.serializeNode(node);
|
||||||
} catch (SaxonApiException e) {
|
} catch (final SaxonApiException e) {
|
||||||
log.info("Error extracting html content to {}", file.toAbsolutePath(), e);
|
log.info("Error extracting html content to {}", file.toAbsolutePath(), e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private XPathSelector getSelector() {
|
|
||||||
if (executable == null) {
|
|
||||||
Map<String, String> ns = new HashMap<>();
|
|
||||||
ns.put("html", "http://www.w3.org/1999/xhtml");
|
|
||||||
executable = repository.createXPath("//html:html", ns);
|
|
||||||
}
|
|
||||||
return executable.load();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isSkipped(Bag results) {
|
public boolean isSkipped(final Bag results) {
|
||||||
if (results.getReport() == null) {
|
if (results.getReport() == null) {
|
||||||
log.warn("Can not extract html content. No report document found");
|
log.warn("Can not extract html content. No report document found");
|
||||||
return true;
|
return true;
|
||||||
|
|
|
||||||
|
|
@ -23,11 +23,10 @@ import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
import de.kosit.validationtool.api.CheckConfiguration;
|
import de.kosit.validationtool.api.CheckConfiguration;
|
||||||
import de.kosit.validationtool.api.Input;
|
import de.kosit.validationtool.api.Input;
|
||||||
|
import de.kosit.validationtool.api.Result;
|
||||||
import de.kosit.validationtool.impl.DefaultCheck;
|
import de.kosit.validationtool.impl.DefaultCheck;
|
||||||
import de.kosit.validationtool.impl.tasks.CheckAction;
|
import de.kosit.validationtool.impl.tasks.CheckAction;
|
||||||
|
|
||||||
import net.sf.saxon.s9api.XdmNode;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Simple Erweiterung der Klasse {@link DefaultCheck} um das Ergebnis der Assertion-Prüfung auszwerten und auszugeben.
|
* Simple Erweiterung der Klasse {@link DefaultCheck} um das Ergebnis der Assertion-Prüfung auszwerten und auszugeben.
|
||||||
* Diese Klasse stellt keine fachlicher Erweiterung des eigentlichen Prüfvorganges dar!
|
* Diese Klasse stellt keine fachlicher Erweiterung des eigentlichen Prüfvorganges dar!
|
||||||
|
|
@ -46,7 +45,7 @@ class InternalCheck extends DefaultCheck {
|
||||||
*
|
*
|
||||||
* @param configuration die Konfiguration
|
* @param configuration die Konfiguration
|
||||||
*/
|
*/
|
||||||
InternalCheck(CheckConfiguration configuration) {
|
InternalCheck(final CheckConfiguration configuration) {
|
||||||
super(configuration);
|
super(configuration);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -56,23 +55,26 @@ class InternalCheck extends DefaultCheck {
|
||||||
* @param input die Prüflinge
|
* @param input die Prüflinge
|
||||||
* @return false wenn es Assertion-Fehler gibt, sonst true
|
* @return false wenn es Assertion-Fehler gibt, sonst true
|
||||||
*/
|
*/
|
||||||
public XdmNode checkInput(Input input) {
|
@Override
|
||||||
CheckAction.Bag bag = new CheckAction.Bag(input, createReport());
|
public Result checkInput(final Input input) {
|
||||||
XdmNode result = runCheckInternal(bag);
|
final CheckAction.Bag bag = new CheckAction.Bag(input, createReport());
|
||||||
|
final Result result = runCheckInternal(bag);
|
||||||
if (bag.getAssertionResult() != null) {
|
if (bag.getAssertionResult() != null) {
|
||||||
checkAssertions += bag.getAssertionResult().getObject();
|
this.checkAssertions += bag.getAssertionResult().getObject();
|
||||||
failedAssertions += bag.getAssertionResult().getErrors().size();
|
this.failedAssertions += bag.getAssertionResult().getErrors().size();
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean printAndEvaluate() {
|
boolean printAndEvaluate() {
|
||||||
if (failedAssertions > 0) {
|
if (this.failedAssertions > 0) {
|
||||||
log.error("Assertion check failed.\n\nAssertions run: {}, Assertions failed: {}\n", checkAssertions, failedAssertions);
|
log.error("Assertion check failed.\n\nAssertions run: {}, Assertions failed: {}\n", this.checkAssertions,
|
||||||
} else if (checkAssertions > 0) {
|
this.failedAssertions);
|
||||||
log.info("Assertion check successful.\n\nAssertions run: {}, Assertions failed: {}\n", checkAssertions, failedAssertions);
|
} else if (this.checkAssertions > 0) {
|
||||||
|
log.info("Assertion check successful.\n\nAssertions run: {}, Assertions failed: {}\n", this.checkAssertions,
|
||||||
|
this.failedAssertions);
|
||||||
}
|
}
|
||||||
return failedAssertions == 0;
|
return this.failedAssertions == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -42,38 +42,6 @@ import lombok.extern.slf4j.Slf4j;
|
||||||
@Slf4j
|
@Slf4j
|
||||||
class ClassPathResourceResolver implements LSResourceResolver {
|
class ClassPathResourceResolver implements LSResourceResolver {
|
||||||
|
|
||||||
private final URI base;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Instantiiert einen neuen resolver mit angegebenen Basispfad
|
|
||||||
*
|
|
||||||
* @param basePath der Basispfad
|
|
||||||
*/
|
|
||||||
public ClassPathResourceResolver(String basePath) {
|
|
||||||
if (!StringUtils.startsWith(basePath, "/")) {
|
|
||||||
throw new IllegalArgumentException("Base path must start with a slash");
|
|
||||||
}
|
|
||||||
base = URI.create(basePath + (basePath.endsWith("/") == basePath.length() > 1 ? "" : "/"));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public LSInput resolveResource(String type, String namespaceURI, String publicId, String systemId, String baseURI) {
|
|
||||||
final URL resource = ClassPathResourceResolver.class.getResource(base.resolve(systemId).toASCIIString());
|
|
||||||
if (resource != null) {
|
|
||||||
try {
|
|
||||||
InputStream in = resource.openStream();
|
|
||||||
final LSInputImpl input = new LSInputImpl(publicId, systemId, baseURI);
|
|
||||||
input.setByteStream(in);
|
|
||||||
return input;
|
|
||||||
|
|
||||||
} catch (IOException e) {
|
|
||||||
log.error("Error loading schema resource from {}", resource, e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// not found
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Simple {@link LSInput}-Implementierung, die einen Stream liefern kann
|
* Simple {@link LSInput}-Implementierung, die einen Stream liefern kann
|
||||||
*/
|
*/
|
||||||
|
|
@ -100,11 +68,12 @@ class ClassPathResourceResolver implements LSResourceResolver {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Instantiierung einer neue Instanz.
|
* Instantiierung einer neue Instanz.
|
||||||
|
*
|
||||||
* @param publicId die publicId
|
* @param publicId die publicId
|
||||||
* @param systemId die systemId
|
* @param systemId die systemId
|
||||||
* @param baseURI die baseURI
|
* @param baseURI die baseURI
|
||||||
*/
|
*/
|
||||||
public LSInputImpl(String publicId, String systemId, String baseURI) {
|
public LSInputImpl(final String publicId, final String systemId, final String baseURI) {
|
||||||
this.publicId = publicId;
|
this.publicId = publicId;
|
||||||
this.systemId = systemId;
|
this.systemId = systemId;
|
||||||
this.baseURI = baseURI;
|
this.baseURI = baseURI;
|
||||||
|
|
@ -112,7 +81,48 @@ class ClassPathResourceResolver implements LSResourceResolver {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean getCertifiedText() {
|
public boolean getCertifiedText() {
|
||||||
return certifiedText;
|
return this.certifiedText;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private final URI base;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Instantiiert einen neuen resolver mit angegebenen Basispfad
|
||||||
|
*
|
||||||
|
* @param basePath der Basispfad
|
||||||
|
*/
|
||||||
|
public ClassPathResourceResolver(final String basePath) {
|
||||||
|
if (!StringUtils.startsWith(basePath, "/")) {
|
||||||
|
throw new IllegalArgumentException("Base path must start with a slash");
|
||||||
|
}
|
||||||
|
this.base = URI.create(basePath + (basePath.endsWith("/") == basePath.length() > 1 ? "" : "/"));
|
||||||
|
}
|
||||||
|
|
||||||
|
public ClassPathResourceResolver(final URI jarUri) {
|
||||||
|
this.base = jarUri;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public LSInput resolveResource(final String type, final String namespaceURI, final String publicId, final String systemId,
|
||||||
|
final String baseURI) {
|
||||||
|
|
||||||
|
final URI resolved = RelativeUriResolver.resolve(URI.create(systemId), this.base);
|
||||||
|
if (resolved != null) {
|
||||||
|
try {
|
||||||
|
final URL resource = resolved.isAbsolute() ? resolved.toURL()
|
||||||
|
: ClassPathResourceResolver.class.getResource(resolved.toASCIIString());
|
||||||
|
final InputStream in = resource.openStream();
|
||||||
|
final LSInputImpl input = new LSInputImpl(publicId, systemId, resolved.toASCIIString());
|
||||||
|
input.setByteStream(in);
|
||||||
|
return input;
|
||||||
|
|
||||||
|
} catch (final IOException e) {
|
||||||
|
log.error("Error loading schema resource from {}", resolved, e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// not found
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -51,26 +51,26 @@ public class CollectingErrorEventHandler implements ValidationEventHandler, Erro
|
||||||
|
|
||||||
private static final int DEFAULT_ABORT_COUNT = 50;
|
private static final int DEFAULT_ABORT_COUNT = 50;
|
||||||
|
|
||||||
private Collection<XMLSyntaxError> errors = new ArrayList<>();
|
private final Collection<XMLSyntaxError> errors = new ArrayList<>();
|
||||||
|
|
||||||
private int stopProcessCount = DEFAULT_ABORT_COUNT;
|
private final int stopProcessCount = DEFAULT_ABORT_COUNT;
|
||||||
|
|
||||||
private static XMLSyntaxError createError(XMLSyntaxErrorSeverity severity, String message) {
|
private static XMLSyntaxError createError(final XMLSyntaxErrorSeverity severity, final String message) {
|
||||||
XMLSyntaxError e = new XMLSyntaxError();
|
final XMLSyntaxError e = new XMLSyntaxError();
|
||||||
e.setSeverity(severity);
|
e.setSeverityCode(severity);
|
||||||
e.setMessage(message);
|
e.setMessage(message);
|
||||||
return e;
|
return e;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static XMLSyntaxError createError(XMLSyntaxErrorSeverity severity, SAXParseException exception) {
|
private static XMLSyntaxError createError(final XMLSyntaxErrorSeverity severity, final SAXParseException exception) {
|
||||||
XMLSyntaxError e = createError(severity, exception.getMessage());
|
final XMLSyntaxError e = createError(severity, exception.getMessage());
|
||||||
e.setRowNumber(exception.getLineNumber());
|
e.setRowNumber(exception.getLineNumber());
|
||||||
e.setColumnNumber(exception.getColumnNumber());
|
e.setColumnNumber(exception.getColumnNumber());
|
||||||
return e;
|
return e;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static XMLSyntaxError createError(XMLSyntaxErrorSeverity severity, TransformerException exception) {
|
private static XMLSyntaxError createError(final XMLSyntaxErrorSeverity severity, final TransformerException exception) {
|
||||||
XMLSyntaxError e = createError(severity, exception.getMessage());
|
final XMLSyntaxError e = createError(severity, exception.getMessage());
|
||||||
if (exception.getLocator() != null) {
|
if (exception.getLocator() != null) {
|
||||||
e.setRowNumber(exception.getLocator().getLineNumber());
|
e.setRowNumber(exception.getLocator().getLineNumber());
|
||||||
e.setColumnNumber(exception.getLocator().getColumnNumber());
|
e.setColumnNumber(exception.getLocator().getColumnNumber());
|
||||||
|
|
@ -78,7 +78,7 @@ public class CollectingErrorEventHandler implements ValidationEventHandler, Erro
|
||||||
return e;
|
return e;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static XMLSyntaxErrorSeverity translateSeverity(int severity) {
|
private static XMLSyntaxErrorSeverity translateSeverity(final int severity) {
|
||||||
switch (severity) {
|
switch (severity) {
|
||||||
case ValidationEvent.WARNING:
|
case ValidationEvent.WARNING:
|
||||||
return XMLSyntaxErrorSeverity.SEVERITY_WARNING;
|
return XMLSyntaxErrorSeverity.SEVERITY_WARNING;
|
||||||
|
|
@ -92,12 +92,12 @@ public class CollectingErrorEventHandler implements ValidationEventHandler, Erro
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean handleEvent(ValidationEvent event) {
|
public boolean handleEvent(final ValidationEvent event) {
|
||||||
XMLSyntaxError e = createError(translateSeverity(event.getSeverity()), event.getMessage());
|
final XMLSyntaxError e = createError(translateSeverity(event.getSeverity()), event.getMessage());
|
||||||
e.setColumnNumber(event.getLocator().getColumnNumber());
|
e.setColumnNumber(event.getLocator().getColumnNumber());
|
||||||
e.setRowNumber(event.getLocator().getLineNumber());
|
e.setRowNumber(event.getLocator().getLineNumber());
|
||||||
errors.add(e);
|
this.errors.add(e);
|
||||||
return stopProcessCount != errors.size();
|
return this.stopProcessCount != this.errors.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -106,7 +106,7 @@ public class CollectingErrorEventHandler implements ValidationEventHandler, Erro
|
||||||
* @return true wenn mindestens ein Fehler vorhanden ist.
|
* @return true wenn mindestens ein Fehler vorhanden ist.
|
||||||
*/
|
*/
|
||||||
public boolean hasErrors() {
|
public boolean hasErrors() {
|
||||||
return hasEvents() && errors.stream().anyMatch(e -> e.getSeverity() != XMLSyntaxErrorSeverity.SEVERITY_WARNING);
|
return hasEvents() && this.errors.stream().anyMatch(e -> e.getSeverityCode() != XMLSyntaxErrorSeverity.SEVERITY_WARNING);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -115,54 +115,55 @@ public class CollectingErrorEventHandler implements ValidationEventHandler, Erro
|
||||||
* @return true wenn mindestens ein Validierungsereignis aufgetreten ist
|
* @return true wenn mindestens ein Validierungsereignis aufgetreten ist
|
||||||
*/
|
*/
|
||||||
public boolean hasEvents() {
|
public boolean hasEvents() {
|
||||||
return !errors.isEmpty();
|
return !this.errors.isEmpty();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void warning(SAXParseException exception) throws SAXException {
|
public void warning(final SAXParseException exception) throws SAXException {
|
||||||
errors.add(createError(XMLSyntaxErrorSeverity.SEVERITY_WARNING, exception));
|
this.errors.add(createError(XMLSyntaxErrorSeverity.SEVERITY_WARNING, exception));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void error(SAXParseException exception) throws SAXException {
|
public void error(final SAXParseException exception) throws SAXException {
|
||||||
errors.add(createError(XMLSyntaxErrorSeverity.SEVERITY_ERROR, exception));
|
this.errors.add(createError(XMLSyntaxErrorSeverity.SEVERITY_ERROR, exception));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void fatalError(SAXParseException exception) throws SAXException {
|
public void fatalError(final SAXParseException exception) throws SAXException {
|
||||||
errors.add(createError(XMLSyntaxErrorSeverity.SEVERITY_FATAL_ERROR, exception));
|
this.errors.add(createError(XMLSyntaxErrorSeverity.SEVERITY_FATAL_ERROR, exception));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void message(XdmNode content, boolean terminate, SourceLocator locator) {
|
public void message(final XdmNode content, final boolean terminate, final SourceLocator locator) {
|
||||||
XMLSyntaxError e = new XMLSyntaxError();
|
final XMLSyntaxError e = new XMLSyntaxError();
|
||||||
if (locator != null) {
|
if (locator != null) {
|
||||||
e.setColumnNumber(locator.getColumnNumber());
|
e.setColumnNumber(locator.getColumnNumber());
|
||||||
e.setRowNumber(locator.getLineNumber());
|
e.setRowNumber(locator.getLineNumber());
|
||||||
}
|
}
|
||||||
e.setMessage("Error procesing" + content.getStringValue());
|
e.setMessage("Error procesing" + content.getStringValue());
|
||||||
e.setSeverity(terminate ? XMLSyntaxErrorSeverity.SEVERITY_FATAL_ERROR : XMLSyntaxErrorSeverity.SEVERITY_WARNING);
|
e.setSeverityCode(terminate ? XMLSyntaxErrorSeverity.SEVERITY_FATAL_ERROR : XMLSyntaxErrorSeverity.SEVERITY_WARNING);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void warning(TransformerException exception) throws TransformerException {
|
public void warning(final TransformerException exception) throws TransformerException {
|
||||||
errors.add(createError(XMLSyntaxErrorSeverity.SEVERITY_WARNING, exception));
|
this.errors.add(createError(XMLSyntaxErrorSeverity.SEVERITY_WARNING, exception));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void error(TransformerException exception) throws TransformerException {
|
public void error(final TransformerException exception) throws TransformerException {
|
||||||
errors.add(createError(XMLSyntaxErrorSeverity.SEVERITY_ERROR, exception));
|
this.errors.add(createError(XMLSyntaxErrorSeverity.SEVERITY_ERROR, exception));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void fatalError(TransformerException exception) throws TransformerException {
|
public void fatalError(final TransformerException exception) throws TransformerException {
|
||||||
errors.add(createError(XMLSyntaxErrorSeverity.SEVERITY_FATAL_ERROR, exception));
|
this.errors.add(createError(XMLSyntaxErrorSeverity.SEVERITY_FATAL_ERROR, exception));
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getErrorDescription() {
|
public String getErrorDescription() {
|
||||||
final StringJoiner joiner = new StringJoiner("\n");
|
final StringJoiner joiner = new StringJoiner("\n");
|
||||||
errors.forEach(e -> joiner
|
this.errors.forEach(e -> joiner
|
||||||
.add(e.getSeverity().value() + " " + e.getMessage() + " At row " + e.getRowNumber() + " at pos " + e.getColumnNumber()));
|
.add(e.getSeverityCode().value() + " " + e.getMessage() + " At row " + e.getRowNumber() + " at pos "
|
||||||
|
+ e.getColumnNumber()));
|
||||||
return joiner.toString();
|
return joiner.toString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -39,7 +39,12 @@ import lombok.Getter;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
import net.sf.saxon.s9api.*;
|
import net.sf.saxon.s9api.Processor;
|
||||||
|
import net.sf.saxon.s9api.SaxonApiException;
|
||||||
|
import net.sf.saxon.s9api.XPathCompiler;
|
||||||
|
import net.sf.saxon.s9api.XPathExecutable;
|
||||||
|
import net.sf.saxon.s9api.XsltCompiler;
|
||||||
|
import net.sf.saxon.s9api.XsltExecutable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Repository für verschiedene XML Artefakte zur Vearbeitung der Prüfszenarien.
|
* Repository für verschiedene XML Artefakte zur Vearbeitung der Prüfszenarien.
|
||||||
|
|
@ -57,25 +62,25 @@ public class ContentRepository {
|
||||||
|
|
||||||
private Schema reportInputSchema;
|
private Schema reportInputSchema;
|
||||||
|
|
||||||
private static Source resolve(URL resource) {
|
private static Source resolve(final URL resource) {
|
||||||
try {
|
try {
|
||||||
return new StreamSource(resource.openStream(), resource.toURI().getRawPath());
|
return new StreamSource(resource.openStream(), resource.toURI().getRawPath());
|
||||||
} catch (IOException | URISyntaxException e) {
|
} catch (final IOException | URISyntaxException e) {
|
||||||
throw new IllegalStateException("Can not load schema for resource " + resource.getPath(), e);
|
throw new IllegalStateException("Can not load schema for resource " + resource.getPath(), e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static Schema createSchema(Source[] schemaSources, LSResourceResolver resourceResolver) {
|
private static Schema createSchema(final Source[] schemaSources, final LSResourceResolver resourceResolver) {
|
||||||
try {
|
try {
|
||||||
SchemaFactory sf = ObjectFactory.createSchemaFactory();
|
final SchemaFactory sf = ObjectFactory.createSchemaFactory();
|
||||||
sf.setResourceResolver(resourceResolver);
|
sf.setResourceResolver(resourceResolver);
|
||||||
return sf.newSchema(schemaSources);
|
return sf.newSchema(schemaSources);
|
||||||
} catch (SAXException e) {
|
} catch (final SAXException e) {
|
||||||
throw new IllegalArgumentException("Can not load schema from sources " + schemaSources[0].getSystemId(), e);
|
throw new IllegalArgumentException("Can not load schema from sources " + schemaSources[0].getSystemId(), e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static Schema createSchema(Source[] schemaSources) {
|
private static Schema createSchema(final Source[] schemaSources) {
|
||||||
return createSchema(schemaSources, null);
|
return createSchema(schemaSources, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -85,16 +90,16 @@ public class ContentRepository {
|
||||||
* @param uri die URI der XSL Definition
|
* @param uri die URI der XSL Definition
|
||||||
* @return ein XSLT Executable
|
* @return ein XSLT Executable
|
||||||
*/
|
*/
|
||||||
public XsltExecutable loadXsltScript(URI uri) {
|
public XsltExecutable loadXsltScript(final URI uri) {
|
||||||
log.info("Loading XSLT script from {}", uri);
|
log.info("Loading XSLT script from {}", uri);
|
||||||
final XsltCompiler xsltCompiler = getProcessor().newXsltCompiler();
|
final XsltCompiler xsltCompiler = getProcessor().newXsltCompiler();
|
||||||
final CollectingErrorEventHandler listener = new CollectingErrorEventHandler();
|
final CollectingErrorEventHandler listener = new CollectingErrorEventHandler();
|
||||||
try {
|
try {
|
||||||
xsltCompiler.setErrorListener(listener);
|
xsltCompiler.setErrorListener(listener);
|
||||||
xsltCompiler.setURIResolver(new RelativeUriResolver(repository));
|
xsltCompiler.setURIResolver(new RelativeUriResolver(this.repository));
|
||||||
|
|
||||||
return xsltCompiler.compile(resolve(uri));
|
return xsltCompiler.compile(resolve(uri));
|
||||||
} catch (SaxonApiException e) {
|
} catch (final SaxonApiException e) {
|
||||||
listener.getErrors().forEach(event -> event.log(log));
|
listener.getErrors().forEach(event -> event.log(log));
|
||||||
throw new IllegalStateException("Can not compile xslt executable for uri " + uri, e);
|
throw new IllegalStateException("Can not compile xslt executable for uri " + uri, e);
|
||||||
} finally {
|
} finally {
|
||||||
|
|
@ -111,9 +116,13 @@ public class ContentRepository {
|
||||||
* @param url die url
|
* @param url die url
|
||||||
* @return das erzeugte Schema
|
* @return das erzeugte Schema
|
||||||
*/
|
*/
|
||||||
public Schema createSchema(URL url) {
|
public static Schema createSchema(final URL url) {
|
||||||
|
return createSchema(url, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Schema createSchema(final URL url, final LSResourceResolver resourceResolver) {
|
||||||
log.info("Load schema from source {}", url.getPath());
|
log.info("Load schema from source {}", url.getPath());
|
||||||
return createSchema(new Source[] { resolve(url) });
|
return createSchema(new Source[] { resolve(url) }, resourceResolver);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -121,7 +130,7 @@ public class ContentRepository {
|
||||||
*
|
*
|
||||||
* @return Scenario-Schema
|
* @return Scenario-Schema
|
||||||
*/
|
*/
|
||||||
public Schema getScenarioSchema() {
|
public static Schema getScenarioSchema() {
|
||||||
return createSchema(ContentRepository.class.getResource("/xsd/scenarios.xsd"));
|
return createSchema(ContentRepository.class.getResource("/xsd/scenarios.xsd"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -131,11 +140,11 @@ public class ContentRepository {
|
||||||
* @return ReportInput-Schema
|
* @return ReportInput-Schema
|
||||||
*/
|
*/
|
||||||
public Schema getReportInputSchema() {
|
public Schema getReportInputSchema() {
|
||||||
if (reportInputSchema == null) {
|
if (this.reportInputSchema == null) {
|
||||||
final Source source = resolve(ContentRepository.class.getResource("/xsd/createReportInput.xsd"));
|
final Source source = resolve(ContentRepository.class.getResource("/xsd/createReportInput.xsd"));
|
||||||
reportInputSchema = createSchema(new Source[] { source }, new ClassPathResourceResolver("/xsd"));
|
this.reportInputSchema = createSchema(new Source[] { source }, new ClassPathResourceResolver("/xsd"));
|
||||||
}
|
}
|
||||||
return reportInputSchema;
|
return this.reportInputSchema;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -144,12 +153,13 @@ public class ContentRepository {
|
||||||
* @param uris die uris in String-Repräsentation
|
* @param uris die uris in String-Repräsentation
|
||||||
* @return das Schema
|
* @return das Schema
|
||||||
*/
|
*/
|
||||||
public Schema createSchema(Collection<String> uris) {
|
public Schema createSchema(final Collection<String> uris) {
|
||||||
return createSchema(uris.stream().map(s -> resolve(URI.create(s))).toArray(Source[]::new));
|
return createSchema(uris.stream().map(s -> resolve(URI.create(s))).toArray(Source[]::new));
|
||||||
}
|
}
|
||||||
|
|
||||||
private Source resolve(URI source) {
|
private Source resolve(final URI source) {
|
||||||
return new StreamSource(repository.resolve(source).toASCIIString());
|
final URI resolved = RelativeUriResolver.resolve(source, this.repository);
|
||||||
|
return new StreamSource(resolved.toASCIIString());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -159,17 +169,37 @@ public class ContentRepository {
|
||||||
* @param namespaces optionale Namespace-Mappings
|
* @param namespaces optionale Namespace-Mappings
|
||||||
* @return ein kompiliertes Executable
|
* @return ein kompiliertes Executable
|
||||||
*/
|
*/
|
||||||
public XPathExecutable createXPath(String expression, Map<String, String> namespaces) {
|
public XPathExecutable createXPath(final String expression, final Map<String, String> namespaces) {
|
||||||
try {
|
try {
|
||||||
final XPathCompiler compiler = getProcessor().newXPathCompiler();
|
final XPathCompiler compiler = getProcessor().newXPathCompiler();
|
||||||
if (namespaces != null) {
|
if (namespaces != null) {
|
||||||
namespaces.entrySet().forEach(n -> compiler.declareNamespace(n.getKey(), n.getValue()));
|
namespaces.forEach(compiler::declareNamespace);
|
||||||
}
|
}
|
||||||
return compiler.compile(expression);
|
return compiler.compile(expression);
|
||||||
} catch (SaxonApiException e) {
|
} catch (final SaxonApiException e) {
|
||||||
throw new IllegalStateException(String.format("Can not compile xpath match expression '%s'",
|
throw new IllegalStateException(String.format("Can not compile xpath match expression '%s'",
|
||||||
StringUtils.isNotBlank(expression) ? expression : "EMPTY EXPRESSION"), e);
|
StringUtils.isNotBlank(expression) ? expression : "EMPTY EXPRESSION"), e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Zeigt an, ob diese URI in ein JAR zeigt.
|
||||||
|
*
|
||||||
|
* @param uri der URI
|
||||||
|
* @return true wenn innerhalb eines JARs
|
||||||
|
*/
|
||||||
|
public static boolean isJarResource(final URI uri) {
|
||||||
|
return isJarResource(uri.toString());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Zeigt an, ob dieser Pfad in ein JAR zeigt.
|
||||||
|
*
|
||||||
|
* @param path der Pfad (URI-Format)
|
||||||
|
* @return true wenn innerhalb eines JARs
|
||||||
|
*/
|
||||||
|
public static boolean isJarResource(final String path) {
|
||||||
|
return StringUtils.startsWithIgnoreCase(path, "jar:") && path.split("!").length == 2;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -27,14 +27,26 @@ import java.util.Arrays;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.StringJoiner;
|
import java.util.StringJoiner;
|
||||||
|
|
||||||
import javax.xml.bind.*;
|
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.bind.annotation.XmlRegistry;
|
||||||
import javax.xml.namespace.QName;
|
import javax.xml.namespace.QName;
|
||||||
import javax.xml.parsers.DocumentBuilder;
|
import javax.xml.parsers.DocumentBuilder;
|
||||||
import javax.xml.stream.*;
|
import javax.xml.stream.XMLInputFactory;
|
||||||
|
import javax.xml.stream.XMLOutputFactory;
|
||||||
|
import javax.xml.stream.XMLStreamException;
|
||||||
|
import javax.xml.stream.XMLStreamReader;
|
||||||
|
import javax.xml.stream.XMLStreamWriter;
|
||||||
|
import javax.xml.transform.Source;
|
||||||
import javax.xml.transform.stream.StreamSource;
|
import javax.xml.transform.stream.StreamSource;
|
||||||
import javax.xml.validation.Schema;
|
import javax.xml.validation.Schema;
|
||||||
|
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.w3c.dom.Document;
|
import org.w3c.dom.Document;
|
||||||
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
@ -45,6 +57,32 @@ import lombok.extern.slf4j.Slf4j;
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class ConversionService {
|
public class ConversionService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Exception while serializing/deserializing with jaxb.
|
||||||
|
*/
|
||||||
|
public class ConversionExeption extends RuntimeException {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor.
|
||||||
|
*
|
||||||
|
* @param message the message.
|
||||||
|
* @param cause the cause
|
||||||
|
*/
|
||||||
|
public ConversionExeption(final String message, final Exception cause) {
|
||||||
|
super(message, cause);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor.
|
||||||
|
*
|
||||||
|
* @param message the message.
|
||||||
|
*/
|
||||||
|
public ConversionExeption(final String message) {
|
||||||
|
super(message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static final int MAX_LOG_CONTENT = 50;
|
||||||
// context setup
|
// context setup
|
||||||
private JAXBContext jaxbContext;
|
private JAXBContext jaxbContext;
|
||||||
|
|
||||||
|
|
@ -68,7 +106,7 @@ public class ConversionService {
|
||||||
* Initialisiert den default context; Alle Packages mit {@link XmlRegistry XmlRegistries}.
|
* Initialisiert den default context; Alle Packages mit {@link XmlRegistry XmlRegistries}.
|
||||||
*/
|
*/
|
||||||
public void initialize() {
|
public void initialize() {
|
||||||
Collection<Package> p = new ArrayList<>();
|
final Collection<Package> p = new ArrayList<>();
|
||||||
p.add(de.kosit.validationtool.model.reportInput.ObjectFactory.class.getPackage());
|
p.add(de.kosit.validationtool.model.reportInput.ObjectFactory.class.getPackage());
|
||||||
p.add(de.kosit.validationtool.model.scenarios.ObjectFactory.class.getPackage());
|
p.add(de.kosit.validationtool.model.scenarios.ObjectFactory.class.getPackage());
|
||||||
initialize(p);
|
initialize(p);
|
||||||
|
|
@ -77,6 +115,7 @@ public class ConversionService {
|
||||||
public void initialize(final Package... context) {
|
public void initialize(final Package... context) {
|
||||||
initialize(Arrays.asList(context));
|
initialize(Arrays.asList(context));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialisiert den conversion service mit den angegegebenen Packages.
|
* Initialisiert den conversion service mit den angegegebenen Packages.
|
||||||
*
|
*
|
||||||
|
|
@ -84,7 +123,7 @@ public class ConversionService {
|
||||||
*/
|
*/
|
||||||
public void initialize(final Collection<Package> context) {
|
public void initialize(final Collection<Package> context) {
|
||||||
final String[] packages = context != null ? context.stream().map(Package::getName).toArray(String[]::new) : new String[0];
|
final String[] packages = context != null ? context.stream().map(Package::getName).toArray(String[]::new) : new String[0];
|
||||||
StringJoiner joiner = new StringJoiner(":");
|
final StringJoiner joiner = new StringJoiner(":");
|
||||||
Arrays.stream(packages).forEach(p -> joiner.add(p));
|
Arrays.stream(packages).forEach(p -> joiner.add(p));
|
||||||
initialize(joiner.toString());
|
initialize(joiner.toString());
|
||||||
}
|
}
|
||||||
|
|
@ -121,11 +160,11 @@ public class ConversionService {
|
||||||
return readXml(xml, type, null, null);
|
return readXml(xml, type, null, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public <T> T readXml(final URI xml, final Class<T> type, Schema schema) {
|
public <T> T readXml(final URI xml, final Class<T> type, final Schema schema) {
|
||||||
return readXml(xml, type, schema, null);
|
return readXml(xml, type, schema, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public <T> T readXml(final URI xml, final Class<T> type, Schema schema, ValidationEventHandler handler) {
|
public <T> T readXml(final URI xml, final Class<T> type, final Schema schema, final ValidationEventHandler handler) {
|
||||||
checkInputEmpty(xml);
|
checkInputEmpty(xml);
|
||||||
checkTypeEmpty(type);
|
checkTypeEmpty(type);
|
||||||
CollectingErrorEventHandler defaultHandler = null;
|
CollectingErrorEventHandler defaultHandler = null;
|
||||||
|
|
@ -167,11 +206,11 @@ public class ConversionService {
|
||||||
return writeXml(model, null, null);
|
return writeXml(model, null, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public <T> String writeXml(final T model, Schema schema, ValidationEventHandler handler) {
|
public <T> String writeXml(final T model, final Schema schema, final ValidationEventHandler handler) {
|
||||||
if (model == null) {
|
if (model == null) {
|
||||||
throw new ConversionExeption("Can not serialize null");
|
throw new ConversionExeption("Can not serialize null");
|
||||||
}
|
}
|
||||||
try ( StringWriter w = new StringWriter() ) {
|
try ( final StringWriter w = new StringWriter() ) {
|
||||||
final JAXBIntrospector introspector = getJaxbContext().createJAXBIntrospector();
|
final JAXBIntrospector introspector = getJaxbContext().createJAXBIntrospector();
|
||||||
final Marshaller marshaller = getJaxbContext().createMarshaller();
|
final Marshaller marshaller = getJaxbContext().createMarshaller();
|
||||||
marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
|
marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
|
||||||
|
|
@ -189,17 +228,17 @@ public class ConversionService {
|
||||||
}
|
}
|
||||||
xmlStreamWriter.flush();
|
xmlStreamWriter.flush();
|
||||||
return w.toString();
|
return w.toString();
|
||||||
} catch (JAXBException | IOException | XMLStreamException e) {
|
} catch (final JAXBException | IOException | XMLStreamException e) {
|
||||||
throw new ConversionExeption(String.format("Error serializing Object %s", model.getClass().getName()), e);
|
throw new ConversionExeption(String.format("Error serializing Object %s", model.getClass().getName()), e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public <T> Document writeDocument(T input) {
|
public <T> Document writeDocument(final T input) {
|
||||||
if (input == null) {
|
if (input == null) {
|
||||||
throw new ConversionExeption("Can not serialize null");
|
throw new ConversionExeption("Can not serialize null");
|
||||||
}
|
}
|
||||||
DocumentBuilder builder = ObjectFactory.createDocumentBuilder(false);
|
final DocumentBuilder builder = ObjectFactory.createDocumentBuilder(false);
|
||||||
Document document = builder.newDocument();
|
final Document document = builder.newDocument();
|
||||||
|
|
||||||
// Marshal the Object to a Document
|
// Marshal the Object to a Document
|
||||||
Marshaller marshaller = null;
|
Marshaller marshaller = null;
|
||||||
|
|
@ -208,34 +247,20 @@ public class ConversionService {
|
||||||
marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
|
marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
|
||||||
marshaller.marshal(input, document);
|
marshaller.marshal(input, document);
|
||||||
return document;
|
return document;
|
||||||
} catch (JAXBException e) {
|
} catch (final JAXBException e) {
|
||||||
throw new ConversionExeption(String.format("Error serializing Object %s to document", input.getClass().getName()), e);
|
throw new ConversionExeption(String.format("Error serializing Object %s to document", input.getClass().getName()), e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public <T> T readDocument(final Source source, final Class<T> type) {
|
||||||
* Exception while serializing/deserializing with jaxb.
|
try {
|
||||||
*/
|
final Unmarshaller u = getJaxbContext().createUnmarshaller();
|
||||||
public class ConversionExeption extends RuntimeException {
|
|
||||||
|
|
||||||
/**
|
return u.unmarshal(source, type).getValue();
|
||||||
* Constructor.
|
|
||||||
*
|
|
||||||
* @param message the message.
|
|
||||||
* @param cause the cause
|
|
||||||
*/
|
|
||||||
public ConversionExeption(final String message, final Exception cause) {
|
|
||||||
super(message, cause);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
} catch (final JAXBException e) {
|
||||||
* Constructor.
|
throw new ConversionExeption(String.format("Can not unmarshal to type %s: %s", type.getSimpleName(),
|
||||||
*
|
StringUtils.abbreviate(source.getSystemId(), MAX_LOG_CONTENT)), e);
|
||||||
* @param message the message.
|
|
||||||
*/
|
|
||||||
public ConversionExeption(final String message) {
|
|
||||||
super(message);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,9 @@
|
||||||
package de.kosit.validationtool.impl;
|
package de.kosit.validationtool.impl;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collection;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
@ -28,7 +30,11 @@ import lombok.extern.slf4j.Slf4j;
|
||||||
import de.kosit.validationtool.api.Check;
|
import de.kosit.validationtool.api.Check;
|
||||||
import de.kosit.validationtool.api.CheckConfiguration;
|
import de.kosit.validationtool.api.CheckConfiguration;
|
||||||
import de.kosit.validationtool.api.Input;
|
import de.kosit.validationtool.api.Input;
|
||||||
|
import de.kosit.validationtool.api.Result;
|
||||||
|
import de.kosit.validationtool.api.XmlError;
|
||||||
import de.kosit.validationtool.impl.tasks.CheckAction;
|
import de.kosit.validationtool.impl.tasks.CheckAction;
|
||||||
|
import de.kosit.validationtool.impl.tasks.CheckAction.Bag;
|
||||||
|
import de.kosit.validationtool.impl.tasks.ComputeAcceptanceAction;
|
||||||
import de.kosit.validationtool.impl.tasks.CreateReportAction;
|
import de.kosit.validationtool.impl.tasks.CreateReportAction;
|
||||||
import de.kosit.validationtool.impl.tasks.DocumentParseAction;
|
import de.kosit.validationtool.impl.tasks.DocumentParseAction;
|
||||||
import de.kosit.validationtool.impl.tasks.ScenarioSelectionAction;
|
import de.kosit.validationtool.impl.tasks.ScenarioSelectionAction;
|
||||||
|
|
@ -39,9 +45,9 @@ import de.kosit.validationtool.model.reportInput.CreateReportInput;
|
||||||
import de.kosit.validationtool.model.reportInput.DocumentIdentificationType;
|
import de.kosit.validationtool.model.reportInput.DocumentIdentificationType;
|
||||||
import de.kosit.validationtool.model.reportInput.EngineType;
|
import de.kosit.validationtool.model.reportInput.EngineType;
|
||||||
import de.kosit.validationtool.model.reportInput.ProcessingError;
|
import de.kosit.validationtool.model.reportInput.ProcessingError;
|
||||||
|
import de.kosit.validationtool.model.reportInput.XMLSyntaxError;
|
||||||
|
|
||||||
import net.sf.saxon.s9api.Processor;
|
import net.sf.saxon.s9api.Processor;
|
||||||
import net.sf.saxon.s9api.XdmNode;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Die Referenz-Implementierung für den Prüfprozess. Nach initialer Konfiguration ist diese Klasse threadsafe und kann
|
* Die Referenz-Implementierung für den Prüfprozess. Nach initialer Konfiguration ist diese Klasse threadsafe und kann
|
||||||
|
|
@ -64,7 +70,6 @@ public class DefaultCheck implements Check {
|
||||||
|
|
||||||
private final ConversionService conversionService;
|
private final ConversionService conversionService;
|
||||||
|
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
private final List<CheckAction> checkSteps;
|
private final List<CheckAction> checkSteps;
|
||||||
|
|
||||||
|
|
@ -77,17 +82,18 @@ public class DefaultCheck implements Check {
|
||||||
final Processor processor = ObjectFactory.createProcessor();
|
final Processor processor = ObjectFactory.createProcessor();
|
||||||
this.conversionService = new ConversionService();
|
this.conversionService = new ConversionService();
|
||||||
this.contentRepository = new ContentRepository(processor, configuration.getScenarioRepository());
|
this.contentRepository = new ContentRepository(processor, configuration.getScenarioRepository());
|
||||||
this.repository = new ScenarioRepository(processor, this.contentRepository);
|
this.repository = new ScenarioRepository(this.contentRepository);
|
||||||
this.repository.initialize(configuration);
|
this.repository.initialize(configuration);
|
||||||
this.checkSteps = new ArrayList<>();
|
this.checkSteps = new ArrayList<>();
|
||||||
this.checkSteps.add(DefaultCheck::createDocumentIdentification);
|
this.checkSteps.add(DefaultCheck::createDocumentIdentification);
|
||||||
this.checkSteps.add(new DocumentParseAction());
|
this.checkSteps.add(new DocumentParseAction());
|
||||||
this.checkSteps.add(new ScenarioSelectionAction(this.repository));
|
this.checkSteps.add(new ScenarioSelectionAction(this.repository));
|
||||||
this.checkSteps.add(new SchemaValidationAction());
|
this.checkSteps.add(new SchemaValidationAction());
|
||||||
this.checkSteps.add(new SchematronValidationAction(configuration.getScenarioRepository()));
|
this.checkSteps.add(new SchematronValidationAction(configuration.getScenarioRepository(), this.conversionService));
|
||||||
this.checkSteps.add(new ValidateReportInputAction(this.conversionService, this.contentRepository.getReportInputSchema()));
|
this.checkSteps.add(new ValidateReportInputAction(this.conversionService, this.contentRepository.getReportInputSchema()));
|
||||||
this.checkSteps
|
this.checkSteps
|
||||||
.add(new CreateReportAction(processor, this.conversionService, this.repository, configuration.getScenarioRepository()));
|
.add(new CreateReportAction(processor, this.conversionService, this.repository, configuration.getScenarioRepository()));
|
||||||
|
this.checkSteps.add(new ComputeAcceptanceAction());
|
||||||
}
|
}
|
||||||
|
|
||||||
protected static CreateReportInput createReport() {
|
protected static CreateReportInput createReport() {
|
||||||
|
|
@ -101,12 +107,12 @@ public class DefaultCheck implements Check {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public XdmNode checkInput(final Input input) {
|
public Result checkInput(final Input input) {
|
||||||
final CheckAction.Bag t = new CheckAction.Bag(input, createReport());
|
final CheckAction.Bag t = new CheckAction.Bag(input, createReport());
|
||||||
return runCheckInternal(t);
|
return runCheckInternal(t);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected XdmNode runCheckInternal(final CheckAction.Bag t) {
|
protected Result runCheckInternal(final CheckAction.Bag t) {
|
||||||
final long started = System.currentTimeMillis();
|
final long started = System.currentTimeMillis();
|
||||||
log.info("Checking content of {}", t.getInput().getName());
|
log.info("Checking content of {}", t.getInput().getName());
|
||||||
for (final CheckAction action : this.checkSteps) {
|
for (final CheckAction action : this.checkSteps) {
|
||||||
|
|
@ -124,10 +130,25 @@ public class DefaultCheck implements Check {
|
||||||
}
|
}
|
||||||
t.setFinished(true);
|
t.setFinished(true);
|
||||||
log.info("Finished check of {} in {}ms\n", t.getInput().getName(), System.currentTimeMillis() - started);
|
log.info("Finished check of {} in {}ms\n", t.getInput().getName(), System.currentTimeMillis() - started);
|
||||||
return t.getReport();
|
return createResult(t);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static boolean createDocumentIdentification(final CheckAction.Bag transporter) {
|
private Result createResult(final Bag t) {
|
||||||
|
final DefaultResult result = new DefaultResult(t.getReport(), t.getAcceptStatus(), this.contentRepository);
|
||||||
|
if (t.getSchemaValidationResult() != null) {
|
||||||
|
result.setSchemaViolations(convertErrors(t.getSchemaValidationResult().getErrors()));
|
||||||
|
}
|
||||||
|
result.setSchematronResult(t.getReportInput().getValidationResultsSchematron().stream()
|
||||||
|
.map(e -> e.getResults().getSchematronOutput()).collect(Collectors.toList()));
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static List<XmlError> convertErrors(final Collection<XMLSyntaxError> errors) {
|
||||||
|
// noinspection unchecked
|
||||||
|
return (List<XmlError>) (List<?>) errors;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void createDocumentIdentification(final CheckAction.Bag transporter) {
|
||||||
final DocumentIdentificationType i = new DocumentIdentificationType();
|
final DocumentIdentificationType i = new DocumentIdentificationType();
|
||||||
final DocumentIdentificationType.DocumentHash h = new DocumentIdentificationType.DocumentHash();
|
final DocumentIdentificationType.DocumentHash h = new DocumentIdentificationType.DocumentHash();
|
||||||
h.setHashAlgorithm(transporter.getInput().getDigestAlgorithm());
|
h.setHashAlgorithm(transporter.getInput().getDigestAlgorithm());
|
||||||
|
|
@ -135,6 +156,5 @@ public class DefaultCheck implements Check {
|
||||||
i.setDocumentHash(h);
|
i.setDocumentHash(h);
|
||||||
i.setDocumentReference(transporter.getInput().getName());
|
i.setDocumentReference(transporter.getInput().getName());
|
||||||
transporter.getReportInput().setDocumentIdentification(i);
|
transporter.getReportInput().setDocumentIdentification(i);
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
103
src/main/java/de/kosit/validationtool/impl/DefaultResult.java
Normal file
103
src/main/java/de/kosit/validationtool/impl/DefaultResult.java
Normal file
|
|
@ -0,0 +1,103 @@
|
||||||
|
package de.kosit.validationtool.impl;
|
||||||
|
|
||||||
|
import java.io.StringWriter;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
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 net.sf.saxon.dom.NodeOverNodeInfo;
|
||||||
|
import net.sf.saxon.s9api.SaxonApiException;
|
||||||
|
import net.sf.saxon.s9api.Serializer;
|
||||||
|
import net.sf.saxon.s9api.XdmNode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Andreas Penski
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class DefaultResult implements Result {
|
||||||
|
|
||||||
|
/** Der generierte Report. */
|
||||||
|
@Getter
|
||||||
|
private final XdmNode report;
|
||||||
|
|
||||||
|
/** Das evaluierte Ergebnis. */
|
||||||
|
@Getter
|
||||||
|
private final AcceptRecommendation acceptRecommendation;
|
||||||
|
|
||||||
|
private final HtmlExtraction htmlExtraction;
|
||||||
|
|
||||||
|
@Setter(AccessLevel.PACKAGE)
|
||||||
|
@Getter
|
||||||
|
private List<XmlError> schemaViolations = new ArrayList<>();
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
@Setter(AccessLevel.PACKAGE)
|
||||||
|
private List<SchematronOutput> schematronResult;
|
||||||
|
|
||||||
|
public DefaultResult(final XdmNode report, final AcceptRecommendation recommendation, final ContentRepository repository) {
|
||||||
|
this.report = report;
|
||||||
|
this.acceptRecommendation = recommendation;
|
||||||
|
this.htmlExtraction = new HtmlExtraction(repository);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gibt den Report als W3C-{@link Document} zurück.
|
||||||
|
*
|
||||||
|
* @return der Report
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Document getReportDocument() {
|
||||||
|
return (Document) NodeOverNodeInfo.wrap(getReport().getUnderlyingNode());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Schnellzugriff auf die Empfehlung zur Weiterverarbeitung des Dokuments.
|
||||||
|
*
|
||||||
|
* @return true wenn {@link AcceptRecommendation#ACCEPTABLE}
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public boolean isAcceptable() {
|
||||||
|
return AcceptRecommendation.ACCEPTABLE.equals(this.acceptRecommendation);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public List<String> extractHtmlAsString() {
|
||||||
|
return extractHtml().stream().map(DefaultResult::convertToString).collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
|
||||||
|
private static String convertToString(final XdmNode element) {
|
||||||
|
try {
|
||||||
|
final StringWriter writer = new StringWriter();
|
||||||
|
final Serializer serializer = ObjectFactory.createProcessor().newSerializer(writer);
|
||||||
|
serializer.serializeNode(element);
|
||||||
|
return writer.toString();
|
||||||
|
} catch (final SaxonApiException e) {
|
||||||
|
throw new IllegalStateException("Can not convert to string", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<Element> extractHtmlAsElement() {
|
||||||
|
return extractHtml().stream().map(DefaultResult::convertToElement).collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
|
||||||
|
private static Element convertToElement(final XdmNode xdmItem) {
|
||||||
|
return (Element) NodeOverNodeInfo.wrap(xdmItem.getUnderlyingNode());
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<XdmNode> extractHtml() {
|
||||||
|
return this.htmlExtraction.extract(getReport());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,51 @@
|
||||||
|
package de.kosit.validationtool.impl;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
|
||||||
|
import net.sf.saxon.s9api.SaxonApiException;
|
||||||
|
import net.sf.saxon.s9api.XPathExecutable;
|
||||||
|
import net.sf.saxon.s9api.XPathSelector;
|
||||||
|
import net.sf.saxon.s9api.XdmItem;
|
||||||
|
import net.sf.saxon.s9api.XdmNode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Funktion zum Extrahieren von HTML-Artefakten / Knoten aus einem XML-Dokument.
|
||||||
|
*
|
||||||
|
* @author Andreas Penski
|
||||||
|
*/
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class HtmlExtraction {
|
||||||
|
|
||||||
|
private final ContentRepository repository;
|
||||||
|
|
||||||
|
private XPathExecutable executable;
|
||||||
|
|
||||||
|
public List<XdmNode> extract(XdmNode xdmSource) {
|
||||||
|
try {
|
||||||
|
final XPathSelector selector = getSelector();
|
||||||
|
selector.setContextItem(xdmSource);
|
||||||
|
return selector.stream().map(this::castToNode).collect(Collectors.toList());
|
||||||
|
|
||||||
|
} catch (SaxonApiException e) {
|
||||||
|
throw new IllegalStateException("Can not extract html content", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private XdmNode castToNode(final XdmItem xdmItem) {
|
||||||
|
return (XdmNode) xdmItem;
|
||||||
|
}
|
||||||
|
|
||||||
|
private XPathSelector getSelector() {
|
||||||
|
if (executable == null) {
|
||||||
|
Map<String, String> ns = new HashMap<>();
|
||||||
|
ns.put("html", "http://www.w3.org/1999/xhtml");
|
||||||
|
executable = repository.createXPath("//html:html", ns);
|
||||||
|
}
|
||||||
|
return executable.load();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -25,7 +25,6 @@ import java.io.Reader;
|
||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
|
|
||||||
import javax.xml.transform.Source;
|
import javax.xml.transform.Source;
|
||||||
import javax.xml.transform.TransformerException;
|
|
||||||
import javax.xml.transform.URIResolver;
|
import javax.xml.transform.URIResolver;
|
||||||
import javax.xml.transform.stream.StreamSource;
|
import javax.xml.transform.stream.StreamSource;
|
||||||
|
|
||||||
|
|
@ -48,38 +47,49 @@ public class RelativeUriResolver implements URIResolver, UnparsedTextURIResolver
|
||||||
private final URI baseUri;
|
private final URI baseUri;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Source resolve(final String href, final String base) throws TransformerException {
|
public Source resolve(final String href, final String base) {
|
||||||
final URI resolved = URI.create(base).resolve(href);
|
final URI resolved = resolve(URI.create(href), URI.create(base));
|
||||||
if (isUnderBaseUri(resolved)) {
|
if (isUnderBaseUri(resolved)) {
|
||||||
try {
|
try {
|
||||||
return new StreamSource(resolved.toURL().openStream());
|
return new StreamSource(resolved.toURL().openStream(), resolved.toASCIIString());
|
||||||
} catch (final IOException e) {
|
} catch (final IOException e) {
|
||||||
|
|
||||||
throw new IllegalStateException(String.format("Can not resolve required %s", href), e);
|
throw new IllegalStateException(String.format("Can not resolve required %s", href), e);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
throw new IllegalStateException(
|
throw new IllegalStateException(String
|
||||||
String.format("The resolved transformation artifact %s is not within the configured repository %s", resolved, baseUri));
|
.format("The resolved transformation artifact %s is not within the configured repository %s", resolved, this.baseUri));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean isUnderBaseUri(URI resolved) {
|
static URI resolve(final URI href, final URI base) {
|
||||||
String base = baseUri.toASCIIString().replaceAll("file:/+", "");
|
final boolean jarURI = isJarURI(base);
|
||||||
String r = resolved.toASCIIString().replaceAll("file:/+", "");
|
final URI tmpBase = jarURI ? URI.create(base.toASCIIString().substring(4)) : base;
|
||||||
|
final URI result = tmpBase.resolve(href);
|
||||||
|
return jarURI ? URI.create("jar:" + result.toString()) : result;
|
||||||
|
}
|
||||||
|
|
||||||
|
static boolean isJarURI(final URI uri) {
|
||||||
|
return uri.isOpaque() && uri.getScheme().equals("jar");
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean isUnderBaseUri(final URI resolved) {
|
||||||
|
final String base = this.baseUri.toASCIIString().replaceAll("file:/+", "");
|
||||||
|
final String r = resolved.toASCIIString().replaceAll("file:/+", "");
|
||||||
return r.startsWith(base);
|
return r.startsWith(base);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Reader resolve(URI absoluteURI, String encoding, Configuration config) throws XPathException {
|
public Reader resolve(final URI absoluteURI, final String encoding, final Configuration config) throws XPathException {
|
||||||
if (isUnderBaseUri(absoluteURI)) {
|
if (isUnderBaseUri(absoluteURI)) {
|
||||||
try {
|
try {
|
||||||
return new InputStreamReader(absoluteURI.toURL().openStream(), encoding);
|
return new InputStreamReader(absoluteURI.toURL().openStream(), encoding);
|
||||||
} catch (IOException e) {
|
} catch (final IOException e) {
|
||||||
throw new IllegalStateException(String.format("Can not resolve required %s", absoluteURI), e);
|
throw new IllegalStateException(String.format("Can not resolve required %s", absoluteURI), e);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
throw new IllegalStateException(
|
throw new IllegalStateException(String.format(
|
||||||
String.format("The resolved transformation artifact %s is not within the configured repository %s", absoluteURI, baseUri));
|
"The resolved transformation artifact %s is not within the configured repository %s", absoluteURI, this.baseUri));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -23,13 +23,14 @@ import static org.apache.commons.lang3.StringUtils.startsWith;
|
||||||
|
|
||||||
import java.net.MalformedURLException;
|
import java.net.MalformedURLException;
|
||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
import java.util.Iterator;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import lombok.AccessLevel;
|
import lombok.AccessLevel;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.Setter;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
import de.kosit.validationtool.api.CheckConfiguration;
|
import de.kosit.validationtool.api.CheckConfiguration;
|
||||||
|
|
@ -37,16 +38,15 @@ import de.kosit.validationtool.api.InputFactory;
|
||||||
import de.kosit.validationtool.impl.model.Result;
|
import de.kosit.validationtool.impl.model.Result;
|
||||||
import de.kosit.validationtool.impl.tasks.DocumentParseAction;
|
import de.kosit.validationtool.impl.tasks.DocumentParseAction;
|
||||||
import de.kosit.validationtool.model.reportInput.XMLSyntaxError;
|
import de.kosit.validationtool.model.reportInput.XMLSyntaxError;
|
||||||
|
import de.kosit.validationtool.model.scenarios.CreateReportType;
|
||||||
import de.kosit.validationtool.model.scenarios.ScenarioType;
|
import de.kosit.validationtool.model.scenarios.ScenarioType;
|
||||||
import de.kosit.validationtool.model.scenarios.Scenarios;
|
import de.kosit.validationtool.model.scenarios.Scenarios;
|
||||||
|
|
||||||
import net.sf.saxon.s9api.Processor;
|
|
||||||
import net.sf.saxon.s9api.QName;
|
import net.sf.saxon.s9api.QName;
|
||||||
import net.sf.saxon.s9api.SaxonApiException;
|
import net.sf.saxon.s9api.SaxonApiException;
|
||||||
import net.sf.saxon.s9api.XPathSelector;
|
import net.sf.saxon.s9api.XPathSelector;
|
||||||
import net.sf.saxon.s9api.XdmNode;
|
import net.sf.saxon.s9api.XdmNode;
|
||||||
import net.sf.saxon.s9api.XdmNodeKind;
|
import net.sf.saxon.s9api.XdmNodeKind;
|
||||||
import net.sf.saxon.s9api.XsltExecutable;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Repository for die aktiven Szenario einer Prüfinstanz.
|
* Repository for die aktiven Szenario einer Prüfinstanz.
|
||||||
|
|
@ -61,19 +61,18 @@ public class ScenarioRepository {
|
||||||
|
|
||||||
private static final String SUPPORTED_MAJOR_VERSION_SCHEMA = "http://www.xoev.de/de/validator/framework/1/scenarios";
|
private static final String SUPPORTED_MAJOR_VERSION_SCHEMA = "http://www.xoev.de/de/validator/framework/1/scenarios";
|
||||||
|
|
||||||
@Getter(value = AccessLevel.PRIVATE)
|
|
||||||
|
|
||||||
private final Processor processor;
|
|
||||||
|
|
||||||
@Getter(value = AccessLevel.PRIVATE)
|
@Getter(value = AccessLevel.PRIVATE)
|
||||||
private final ContentRepository repository;
|
private final ContentRepository repository;
|
||||||
|
|
||||||
private XsltExecutable noScenarioReport;
|
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
private Scenarios scenarios;
|
private Scenarios scenarios;
|
||||||
|
|
||||||
private static boolean isSupportedDocument(XdmNode doc) {
|
@Setter(AccessLevel.PACKAGE)
|
||||||
|
@Getter
|
||||||
|
private ScenarioType fallbackScenario;
|
||||||
|
|
||||||
|
private static boolean isSupportedDocument(final XdmNode doc) {
|
||||||
final XdmNode root = findRoot(doc);
|
final XdmNode root = findRoot(doc);
|
||||||
final String frameworkVersion = root.getAttributeValue(new QName("frameworkVersion"));
|
final String frameworkVersion = root.getAttributeValue(new QName("frameworkVersion"));
|
||||||
return startsWith(frameworkVersion, SUPPORTED_MAJOR_VERSION)
|
return startsWith(frameworkVersion, SUPPORTED_MAJOR_VERSION)
|
||||||
|
|
@ -81,9 +80,7 @@ public class ScenarioRepository {
|
||||||
}
|
}
|
||||||
|
|
||||||
private static XdmNode findRoot(final XdmNode doc) {
|
private static XdmNode findRoot(final XdmNode doc) {
|
||||||
final Iterator<XdmNode> it = doc.children().iterator();
|
for (final XdmNode node : doc.children()) {
|
||||||
while (it.hasNext()) {
|
|
||||||
final XdmNode node = it.next();
|
|
||||||
if (node.getNodeKind() == XdmNodeKind.ELEMENT) {
|
if (node.getNodeKind() == XdmNodeKind.ELEMENT) {
|
||||||
return node;
|
return node;
|
||||||
}
|
}
|
||||||
|
|
@ -91,57 +88,51 @@ public class ScenarioRepository {
|
||||||
throw new IllegalArgumentException("Kein root element gefunden");
|
throw new IllegalArgumentException("Kein root element gefunden");
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void checkVersion(URI scenarioDefinition) {
|
private static void checkVersion(final URI scenarioDefinition) {
|
||||||
DocumentParseAction p = new DocumentParseAction();
|
|
||||||
try {
|
try {
|
||||||
final Result<XdmNode, XMLSyntaxError> result = p.parseDocument(InputFactory.read(scenarioDefinition.toURL()));
|
final Result<XdmNode, XMLSyntaxError> result = DocumentParseAction.parseDocument(InputFactory.read(scenarioDefinition.toURL()));
|
||||||
if (result.isValid() && !isSupportedDocument(result.getObject())) {
|
if (result.isValid() && !isSupportedDocument(result.getObject())) {
|
||||||
throw new IllegalStateException(String.format(
|
throw new IllegalStateException(String.format(
|
||||||
"Specified scenario configuration %s is not supported.%nThis version only supports definitions of '%s'",
|
"Specified scenario configuration %s is not supported.%nThis version only supports definitions of '%s'",
|
||||||
scenarioDefinition, SUPPORTED_MAJOR_VERSION_SCHEMA));
|
scenarioDefinition, SUPPORTED_MAJOR_VERSION_SCHEMA));
|
||||||
|
|
||||||
}
|
}
|
||||||
} catch (MalformedURLException e) {
|
} catch (final MalformedURLException e) {
|
||||||
throw new IllegalStateException("Error reading definition file");
|
throw new IllegalStateException("Error reading definition file");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public XsltExecutable getNoScenarioReport() {
|
|
||||||
if (noScenarioReport == null) {
|
|
||||||
noScenarioReport = repository.loadXsltScript(URI.create(scenarios.getNoScenarioReport().getResource().getLocation()));
|
|
||||||
}
|
|
||||||
return noScenarioReport;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialisiert das Repository mit der angegebenen Konfiguration.
|
* Initialisiert das Repository mit der angegebenen Konfiguration.
|
||||||
*
|
*
|
||||||
* @param config die Konfiguration
|
* @param config die Konfiguration
|
||||||
*/
|
*/
|
||||||
public void initialize(CheckConfiguration config) {
|
public void initialize(final CheckConfiguration config) {
|
||||||
ConversionService conversionService = new ConversionService();
|
final ConversionService conversionService = new ConversionService();
|
||||||
checkVersion(config.getScenarioDefinition());
|
checkVersion(config.getScenarioDefinition());
|
||||||
log.info("Loading scenarios from {}", config.getScenarioDefinition());
|
log.info("Loading scenarios from {}", config.getScenarioDefinition());
|
||||||
CollectingErrorEventHandler handler = new CollectingErrorEventHandler();
|
final CollectingErrorEventHandler handler = new CollectingErrorEventHandler();
|
||||||
this.scenarios = conversionService.readXml(config.getScenarioDefinition(), Scenarios.class, repository.getScenarioSchema(),
|
this.scenarios = conversionService.readXml(config.getScenarioDefinition(), Scenarios.class, ContentRepository.getScenarioSchema(),
|
||||||
handler);
|
handler);
|
||||||
if (!handler.hasErrors()) {
|
if (!handler.hasErrors()) {
|
||||||
log.info("Loaded scenarios for {} by {} from {}. The following scenarios are available:\n\n{}", scenarios.getName(),
|
log.info("Loaded scenarios for {} by {} from {}. The following scenarios are available:\n\n{}", this.scenarios.getName(),
|
||||||
scenarios.getAuthor(), scenarios.getDate(), summarizeScenarios());
|
this.scenarios.getAuthor(), this.scenarios.getDate(), summarizeScenarios());
|
||||||
log.info("Loading scenario content from {}", config.getScenarioRepository());
|
log.info("Loading scenario content from {}", config.getScenarioRepository());
|
||||||
getScenarios().getScenario().forEach(s -> s.initialize(repository, false));
|
getScenarios().getScenario().forEach(s -> s.initialize(this.repository, false));
|
||||||
} else {
|
} else {
|
||||||
throw new IllegalStateException(String.format("Can not load scenarios from %s due to %s", config.getScenarioDefinition(),
|
throw new IllegalStateException(String.format("Can not load scenarios from %s due to %s", config.getScenarioDefinition(),
|
||||||
handler.getErrorDescription()));
|
handler.getErrorDescription()));
|
||||||
}
|
}
|
||||||
// initialize fallback report eager
|
// initialize fallback report eager
|
||||||
getNoScenarioReport();
|
this.fallbackScenario = createFallback();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private String summarizeScenarios() {
|
private String summarizeScenarios() {
|
||||||
StringBuilder b = new StringBuilder();
|
final StringBuilder b = new StringBuilder();
|
||||||
scenarios.getScenario().forEach(s -> {
|
this.scenarios.getScenario().forEach(s -> {
|
||||||
b.append(s.getName());
|
b.append(s.getName());
|
||||||
b.append("\n");
|
b.append("\n");
|
||||||
});
|
});
|
||||||
|
|
@ -149,38 +140,51 @@ public class ScenarioRepository {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Ermittelt für das angegebene Dokument das passende Szenario.
|
* Ermittelt für das gegebene Dokument das passende Szenario.
|
||||||
*
|
*
|
||||||
* @param document das Eingabedokument
|
* @param document das Eingabedokument
|
||||||
* @return ein Ergebnis-Objekt zur weiteren Verarbeitung
|
* @return ein Ergebnis-Objekt zur weiteren Verarbeitung
|
||||||
*/
|
*/
|
||||||
public Result<ScenarioType, String> selectScenario(XdmNode document) {
|
public Result<ScenarioType, String> selectScenario(final XdmNode document) {
|
||||||
Result<ScenarioType, String> result = new Result<>();
|
final Result<ScenarioType, String> result;
|
||||||
final List<ScenarioType> collect = scenarios.getScenario().stream().filter(s -> match(document, s)).collect(Collectors.toList());
|
final List<ScenarioType> collect = this.scenarios.getScenario().stream().filter(s -> match(document, s))
|
||||||
|
.collect(Collectors.toList());
|
||||||
if (collect.size() == 1) {
|
if (collect.size() == 1) {
|
||||||
result = new Result<>(collect.get(0));
|
result = new Result<>(collect.get(0));
|
||||||
} else if (collect.isEmpty()) {
|
} else if (collect.isEmpty()) {
|
||||||
result.getErrors().add("None of the loaded scenarios matches the specified document");
|
result = new Result<>(getFallbackScenario(),
|
||||||
|
Collections.singleton("None of the loaded scenarios matches the specified document"));
|
||||||
} else {
|
} else {
|
||||||
result.getErrors().add("More than on scenario matches the specified document");
|
result = new Result<>(getFallbackScenario(), Collections.singleton("More than on scenario matches the specified document"));
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean match(XdmNode document, ScenarioType scenario) {
|
private ScenarioType createFallback() {
|
||||||
|
final ScenarioType t = new ScenarioType();
|
||||||
|
t.setName("Fallback-Scenario");
|
||||||
|
final CreateReportType reportType = new CreateReportType();
|
||||||
|
reportType.setResource(this.scenarios.getNoScenarioReport().getResource());
|
||||||
|
t.initialize(this.repository, true);
|
||||||
|
// always reject
|
||||||
|
t.setAcceptMatch("count(/)<0");
|
||||||
|
t.setCreateReport(reportType);
|
||||||
|
return t;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static boolean match(final XdmNode document, final ScenarioType scenario) {
|
||||||
try {
|
try {
|
||||||
final XPathSelector selector = scenario.getSelector();
|
final XPathSelector selector = scenario.getSelector();
|
||||||
selector.setContextItem(document);
|
selector.setContextItem(document);
|
||||||
return selector.effectiveBooleanValue();
|
return selector.effectiveBooleanValue();
|
||||||
} catch (SaxonApiException e) {
|
} catch (final SaxonApiException e) {
|
||||||
log.error("Error evaluating xpath expression", e);
|
log.error("Error evaluating xpath expression", e);
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void initialize(Scenarios def) {
|
void initialize(final Scenarios def) {
|
||||||
this.scenarios = def;
|
this.scenarios = def;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,72 @@
|
||||||
|
package de.kosit.validationtool.impl.model;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Optional;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
import org.oclc.purl.dsdl.svrl.ActivePattern;
|
||||||
|
import org.oclc.purl.dsdl.svrl.FailedAssert;
|
||||||
|
import org.oclc.purl.dsdl.svrl.FiredRule;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Basis-Klasse um spezifische Erweiterungen an der generierten Klasse {@link org.oclc.purl.dsdl.svrl.SchematronOutput}
|
||||||
|
* umzusetzen.
|
||||||
|
*
|
||||||
|
* @author Andreas Penski
|
||||||
|
*/
|
||||||
|
public abstract class BaseOutput {
|
||||||
|
|
||||||
|
public abstract List<Serializable> getActivePatternAndFiredRuleAndFailedAssert();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gibt die Liste der {@link FailedAssert} zurück
|
||||||
|
*
|
||||||
|
* @return Liste mit {@link FailedAssert}
|
||||||
|
*/
|
||||||
|
public List<FailedAssert> getFailedAsserts() {
|
||||||
|
return filter(FailedAssert.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gibt die Liste der {@link FailedAssert} zurück
|
||||||
|
*
|
||||||
|
* @return Liste mit {@link FailedAssert}
|
||||||
|
*/
|
||||||
|
public List<FiredRule> getFiredRules() {
|
||||||
|
return filter(FiredRule.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Ermittelt, ob es bei der Validierung {@link FailedAssert}s gab.
|
||||||
|
*
|
||||||
|
* @return true wenn mindestens ein {@link FailedAssert} vorhanden ist
|
||||||
|
*/
|
||||||
|
public boolean hasFailedAsserts() {
|
||||||
|
return getFailedAsserts().size() > 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gibt die Liste der {@link ActivePattern} zurück
|
||||||
|
*
|
||||||
|
* @return Liste mit {@link ActivePattern}
|
||||||
|
*/
|
||||||
|
public List<ActivePattern> getActivePatterns() {
|
||||||
|
return filter(ActivePattern.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
private <T> List<T> filter(final Class<T> type) {
|
||||||
|
return getActivePatternAndFiredRuleAndFailedAssert().stream().filter(type::isInstance).map(type::cast).collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sucht nach einem {@link FailedAssert} mit einem definierten Namen.
|
||||||
|
*
|
||||||
|
* @param name der Name
|
||||||
|
* @return Optional mit dem {@link FailedAssert}
|
||||||
|
*/
|
||||||
|
public Optional<FailedAssert> findFailedAssert(final String name) {
|
||||||
|
return getFailedAsserts().stream().filter(e -> e.getId().equals(name)).findAny();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -36,7 +36,11 @@ import lombok.Setter;
|
||||||
|
|
||||||
import de.kosit.validationtool.impl.ContentRepository;
|
import de.kosit.validationtool.impl.ContentRepository;
|
||||||
import de.kosit.validationtool.impl.ScenarioRepository;
|
import de.kosit.validationtool.impl.ScenarioRepository;
|
||||||
import de.kosit.validationtool.model.scenarios.*;
|
import de.kosit.validationtool.model.scenarios.CreateReportType;
|
||||||
|
import de.kosit.validationtool.model.scenarios.NamespaceType;
|
||||||
|
import de.kosit.validationtool.model.scenarios.ResourceType;
|
||||||
|
import de.kosit.validationtool.model.scenarios.ValidateWithSchematron;
|
||||||
|
import de.kosit.validationtool.model.scenarios.ValidateWithXmlSchema;
|
||||||
|
|
||||||
import net.sf.saxon.s9api.XPathExecutable;
|
import net.sf.saxon.s9api.XPathExecutable;
|
||||||
import net.sf.saxon.s9api.XPathSelector;
|
import net.sf.saxon.s9api.XPathSelector;
|
||||||
|
|
@ -50,50 +54,63 @@ import net.sf.saxon.s9api.XsltExecutable;
|
||||||
*/
|
*/
|
||||||
public abstract class BaseScenario {
|
public abstract class BaseScenario {
|
||||||
|
|
||||||
private XPathExecutable xPathExecutable;
|
/**
|
||||||
|
* Laufzeitinformationen über eine Transformation.
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class Transformation {
|
||||||
|
|
||||||
|
private XsltExecutable executable;
|
||||||
|
|
||||||
|
private ResourceType resourceType;
|
||||||
|
}
|
||||||
|
|
||||||
|
private XPathExecutable matchExecutable;
|
||||||
|
|
||||||
|
private XPathExecutable acceptExecutable;
|
||||||
private Schema schema;
|
private Schema schema;
|
||||||
|
|
||||||
private List<Transformation> schematronValidations;
|
private List<Transformation> schematronValidations;
|
||||||
|
|
||||||
private ContentRepository repository;
|
private ContentRepository repository;
|
||||||
|
|
||||||
private Transformation reportTransformation;
|
private Transformation reportTransformation;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gibt eine Transformation zurück.
|
* Gibt eine Transformation zurück.
|
||||||
|
*
|
||||||
* @return initialisierte Transformation
|
* @return initialisierte Transformation
|
||||||
*/
|
*/
|
||||||
public Transformation getReportTransformation() {
|
public Transformation getReportTransformation() {
|
||||||
if (reportTransformation == null) {
|
if (this.reportTransformation == null) {
|
||||||
final ResourceType resource = getCreateReport().getResource();
|
final ResourceType resource = getCreateReport().getResource();
|
||||||
final XsltExecutable executable = repository.loadXsltScript(URI.create(resource.getLocation()));
|
final XsltExecutable executable = this.repository.loadXsltScript(URI.create(resource.getLocation()));
|
||||||
reportTransformation = new Transformation(executable, resource);
|
this.reportTransformation = new Transformation(executable, resource);
|
||||||
}
|
}
|
||||||
return reportTransformation;
|
return this.reportTransformation;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Lieferrt das Schema zu diesem Szenario.
|
* Lieferrt das Schema zu diesem Szenario.
|
||||||
|
*
|
||||||
* @return das passende Schema
|
* @return das passende Schema
|
||||||
*/
|
*/
|
||||||
public Schema getSchema() {
|
public Schema getSchema() {
|
||||||
if (schema == null) {
|
if (this.schema == null) {
|
||||||
final List<String> schemaResources = getValidateWithXmlSchema().getResource().stream().map(ResourceType::getLocation)
|
final List<String> schemaResources = getValidateWithXmlSchema().getResource().stream().map(ResourceType::getLocation)
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
schema = repository.createSchema(schemaResources);
|
this.schema = this.repository.createSchema(schemaResources);
|
||||||
}
|
}
|
||||||
return schema;
|
return this.schema;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialisiert das Szenario auf Basis eines [@link ContentRepository}
|
* Initialisiert das Szenario auf Basis eines [@link ContentRepository}
|
||||||
|
*
|
||||||
* @param repository das Repository mit den Szenario-Artefakten
|
* @param repository das Repository mit den Szenario-Artefakten
|
||||||
* @param lazy optionales lazy loading der XML-Artefakte
|
* @param lazy optionales lazy loading der XML-Artefakte
|
||||||
* @return true wenn erfolgreich
|
* @return true wenn erfolgreich
|
||||||
*/
|
*/
|
||||||
public boolean initialize(ContentRepository repository, boolean lazy) {
|
public boolean initialize(final ContentRepository repository, final boolean lazy) {
|
||||||
this.repository = repository;
|
this.repository = repository;
|
||||||
if (!lazy) {
|
if (!lazy) {
|
||||||
getSchema();
|
getSchema();
|
||||||
|
|
@ -106,20 +123,21 @@ public abstract class BaseScenario {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Liefer eine Liste mit Schematron Validierungs-Transformationen
|
* Liefer eine Liste mit Schematron Validierungs-Transformationen
|
||||||
|
*
|
||||||
* @return liste mit initialisierten Transformationsinformationen
|
* @return liste mit initialisierten Transformationsinformationen
|
||||||
*/
|
*/
|
||||||
public List<Transformation> getSchematronValidations() {
|
public List<Transformation> getSchematronValidations() {
|
||||||
if (schematronValidations == null) {
|
if (this.schematronValidations == null) {
|
||||||
schematronValidations = new ArrayList<>();
|
this.schematronValidations = new ArrayList<>();
|
||||||
getValidateWithSchematron().forEach(v -> {
|
getValidateWithSchematron().forEach(v -> {
|
||||||
if (v.isPsvi()) {
|
if (v.isPsvi()) {
|
||||||
throw new NotImplementedException("This implemenation does not support PSVI usage");
|
throw new NotImplementedException("This implemenation does not support PSVI usage");
|
||||||
}
|
}
|
||||||
final XsltExecutable xsltExecutable = repository.loadXsltScript(URI.create(v.getResource().getLocation()));
|
final XsltExecutable xsltExecutable = this.repository.loadXsltScript(URI.create(v.getResource().getLocation()));
|
||||||
schematronValidations.add(new Transformation(xsltExecutable, v.getResource()));
|
this.schematronValidations.add(new Transformation(xsltExecutable, v.getResource()));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
return schematronValidations;
|
return this.schematronValidations;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -129,11 +147,26 @@ public abstract class BaseScenario {
|
||||||
* @see {@link ScenarioRepository#selectScenario(Document)}.
|
* @see {@link ScenarioRepository#selectScenario(Document)}.
|
||||||
*/
|
*/
|
||||||
public XPathSelector getSelector() {
|
public XPathSelector getSelector() {
|
||||||
if (xPathExecutable == null) {
|
if (this.matchExecutable == null) {
|
||||||
final Map<String, String> namespaces = getNamespace().stream().collect(Collectors.toMap(NamespaceType::getPrefix, NamespaceType::getValue));
|
this.matchExecutable = this.repository.createXPath(getMatch(), prepareNamespaces());
|
||||||
xPathExecutable = repository.createXPath(getMatch(), namespaces);
|
|
||||||
}
|
}
|
||||||
return xPathExecutable.load();
|
return this.matchExecutable.load();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Liefert einen neuen XPath-Selector zur Evaluierung der {@link de.kosit.validationtool.api.AcceptRecommendation}.
|
||||||
|
*
|
||||||
|
* @return neuer Selector
|
||||||
|
*/
|
||||||
|
public XPathSelector getAcceptSelector() {
|
||||||
|
if (this.acceptExecutable == null) {
|
||||||
|
this.acceptExecutable = this.repository.createXPath(getAcceptMatch(), prepareNamespaces());
|
||||||
|
}
|
||||||
|
return this.acceptExecutable.load();
|
||||||
|
}
|
||||||
|
|
||||||
|
private Map<String, String> prepareNamespaces() {
|
||||||
|
return getNamespace().stream().collect(Collectors.toMap(NamespaceType::getPrefix, NamespaceType::getValue));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -143,6 +176,8 @@ public abstract class BaseScenario {
|
||||||
*/
|
*/
|
||||||
public abstract String getMatch();
|
public abstract String getMatch();
|
||||||
|
|
||||||
|
public abstract String getAcceptMatch();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Getter aus dem schema.
|
* Getter aus dem schema.
|
||||||
*
|
*
|
||||||
|
|
@ -171,17 +206,4 @@ public abstract class BaseScenario {
|
||||||
*/
|
*/
|
||||||
public abstract CreateReportType getCreateReport();
|
public abstract CreateReportType getCreateReport();
|
||||||
|
|
||||||
/**
|
|
||||||
* Laufzeitinformationen über eine Transformation.
|
|
||||||
*/
|
|
||||||
@Getter
|
|
||||||
@Setter
|
|
||||||
@AllArgsConstructor
|
|
||||||
public class Transformation {
|
|
||||||
|
|
||||||
private XsltExecutable executable;
|
|
||||||
|
|
||||||
private ResourceType resourceType;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,7 @@ package de.kosit.validationtool.impl.model;
|
||||||
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
|
|
||||||
|
import de.kosit.validationtool.api.XmlError;
|
||||||
import de.kosit.validationtool.model.reportInput.XMLSyntaxErrorSeverity;
|
import de.kosit.validationtool.model.reportInput.XMLSyntaxErrorSeverity;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -29,17 +30,17 @@ import de.kosit.validationtool.model.reportInput.XMLSyntaxErrorSeverity;
|
||||||
*
|
*
|
||||||
* @author Andreas Penski
|
* @author Andreas Penski
|
||||||
*/
|
*/
|
||||||
public abstract class BaseXMLSyntaxError {
|
public abstract class BaseXMLSyntaxError implements XmlError {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Logged den Syntax-Fehler über einen definierten Logger.
|
* Logged den Syntax-Fehler über einen definierten Logger.
|
||||||
*
|
*
|
||||||
* @param logger der Logger
|
* @param logger der Logger
|
||||||
*/
|
*/
|
||||||
public void log(Logger logger) {
|
public void log(final Logger logger) {
|
||||||
String msgTemplate = "{} At row {} at pos {}";
|
final String msgTemplate = "{} At row {} at pos {}";
|
||||||
Object[] params = { getMessage(), getRowNumber(), getColumnNumber() };
|
final Object[] params = { getMessage(), getRowNumber(), getColumnNumber() };
|
||||||
if (getSeverity() == XMLSyntaxErrorSeverity.SEVERITY_WARNING) {
|
if (getSeverityCode() == XMLSyntaxErrorSeverity.SEVERITY_WARNING) {
|
||||||
logger.warn(msgTemplate, params);
|
logger.warn(msgTemplate, params);
|
||||||
} else {
|
} else {
|
||||||
logger.error(msgTemplate, params);
|
logger.error(msgTemplate, params);
|
||||||
|
|
@ -57,6 +58,7 @@ public abstract class BaseXMLSyntaxError {
|
||||||
*
|
*
|
||||||
* @return Spalte des Fehlers
|
* @return Spalte des Fehlers
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public abstract Integer getColumnNumber();
|
public abstract Integer getColumnNumber();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -64,6 +66,7 @@ public abstract class BaseXMLSyntaxError {
|
||||||
*
|
*
|
||||||
* @return Zeile des Fehlers
|
* @return Zeile des Fehlers
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public abstract Integer getRowNumber();
|
public abstract Integer getRowNumber();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -71,6 +74,7 @@ public abstract class BaseXMLSyntaxError {
|
||||||
*
|
*
|
||||||
* @return Fehlermeldung
|
* @return Fehlermeldung
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public abstract String getMessage();
|
public abstract String getMessage();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -78,5 +82,16 @@ public abstract class BaseXMLSyntaxError {
|
||||||
*
|
*
|
||||||
* @return severity
|
* @return severity
|
||||||
*/
|
*/
|
||||||
public abstract XMLSyntaxErrorSeverity getSeverity();
|
public abstract XMLSyntaxErrorSeverity getSeverityCode();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Dies ist der API-Zugriff. Es gibt zwei Methoden, weil es für die API einen abweichenden Typ gibt.
|
||||||
|
*
|
||||||
|
* @return der Schweregrad
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Severity getSeverity() {
|
||||||
|
final XMLSyntaxErrorSeverity code = getSeverityCode();
|
||||||
|
return code != null ? Severity.valueOf(code.name()) : null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,7 @@ import java.util.regex.Pattern;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
|
|
||||||
|
import de.kosit.validationtool.api.AcceptRecommendation;
|
||||||
import de.kosit.validationtool.api.Input;
|
import de.kosit.validationtool.api.Input;
|
||||||
import de.kosit.validationtool.impl.model.Result;
|
import de.kosit.validationtool.impl.model.Result;
|
||||||
import de.kosit.validationtool.model.reportInput.CreateReportInput;
|
import de.kosit.validationtool.model.reportInput.CreateReportInput;
|
||||||
|
|
@ -43,25 +44,6 @@ import net.sf.saxon.s9api.XdmNode;
|
||||||
@FunctionalInterface
|
@FunctionalInterface
|
||||||
public interface CheckAction {
|
public interface CheckAction {
|
||||||
|
|
||||||
/**
|
|
||||||
* Ausfürhung des Prüfschrittes und Erweiterung der gesammelten Informationen.
|
|
||||||
*
|
|
||||||
* @param results die Informationssammlung
|
|
||||||
*/
|
|
||||||
void check(Bag results);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Ermittlung, ob ein Schritt u.U. ausgelassen werden kann. Die Funktion wird vor der eigentlichen Prüfaktion aufgerufen
|
|
||||||
* und kann somit eine Ausführung des Prüfschrittes verhindern. Entwickler können diese Funktion überschreiben, um den
|
|
||||||
* Prüfschritt bedingt auszuführen.
|
|
||||||
*
|
|
||||||
* @param results die bisher gesammelten Information
|
|
||||||
* @return <tt>true</tt> wenn der Schritt ausgelassen werden soll
|
|
||||||
*/
|
|
||||||
default boolean isSkipped(Bag results) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Transport-Klasse für Eingabe und Ausgabe-Objekte für die einzelnen Prüfschritte.
|
* Transport-Klasse für Eingabe und Ausgabe-Objekte für die einzelnen Prüfschritte.
|
||||||
*/
|
*/
|
||||||
|
|
@ -80,6 +62,8 @@ public interface CheckAction {
|
||||||
|
|
||||||
private boolean stopped;
|
private boolean stopped;
|
||||||
|
|
||||||
|
private AcceptRecommendation acceptStatus = AcceptRecommendation.UNDEFINED;
|
||||||
|
|
||||||
/** Das zu prüfende Dokument */
|
/** Das zu prüfende Dokument */
|
||||||
private Input input;
|
private Input input;
|
||||||
|
|
||||||
|
|
@ -89,15 +73,16 @@ public interface CheckAction {
|
||||||
|
|
||||||
private Result<Boolean, XMLSyntaxError> schemaValidationResult;
|
private Result<Boolean, XMLSyntaxError> schemaValidationResult;
|
||||||
|
|
||||||
public Bag(Input input) {
|
public Bag(final Input input) {
|
||||||
this(input, new CreateReportInput());
|
this(input, new CreateReportInput());
|
||||||
}
|
}
|
||||||
|
|
||||||
public Bag(Input input, CreateReportInput reportInput) {
|
public Bag(final Input input, final CreateReportInput reportInput) {
|
||||||
this.input = input;
|
this.input = input;
|
||||||
this.reportInput = reportInput;
|
this.reportInput = reportInput;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Signalisiert einen vorzeitigen Stop der Vearbeitung.
|
* Signalisiert einen vorzeitigen Stop der Vearbeitung.
|
||||||
*/
|
*/
|
||||||
|
|
@ -119,4 +104,24 @@ public interface CheckAction {
|
||||||
return fileName;
|
return fileName;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Ausfürhung des Prüfschrittes und Erweiterung der gesammelten Informationen.
|
||||||
|
*
|
||||||
|
* @param results die Informationssammlung
|
||||||
|
*/
|
||||||
|
void check(Bag results);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Ermittlung, ob ein Schritt u.U. ausgelassen werden kann. Die Funktion wird vor der eigentlichen Prüfaktion aufgerufen
|
||||||
|
* und kann somit eine Ausführung des Prüfschrittes verhindern. Entwickler können diese Funktion überschreiben, um den
|
||||||
|
* Prüfschritt bedingt auszuführen.
|
||||||
|
*
|
||||||
|
* @param results die bisher gesammelten Information
|
||||||
|
* @return <tt>true</tt> wenn der Schritt ausgelassen werden soll
|
||||||
|
*/
|
||||||
|
default boolean isSkipped(final Bag results) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,42 @@
|
||||||
|
package de.kosit.validationtool.impl.tasks;
|
||||||
|
|
||||||
|
import static org.apache.commons.lang3.StringUtils.isNotBlank;
|
||||||
|
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
import de.kosit.validationtool.api.AcceptRecommendation;
|
||||||
|
|
||||||
|
import net.sf.saxon.s9api.XPathSelector;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Berechnet die Akzeptanz-Empfehlung gemäß konfigurierten 'acceptMatch' des aktuellen Szenarios.
|
||||||
|
*
|
||||||
|
* @author Andreas Penski
|
||||||
|
*/
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@Slf4j
|
||||||
|
public class ComputeAcceptanceAction implements CheckAction {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void check(final Bag results) {
|
||||||
|
final String acceptMatch = results.getScenarioSelectionResult().getObject().getAcceptMatch();
|
||||||
|
if (isNotBlank(acceptMatch)) {
|
||||||
|
|
||||||
|
try {
|
||||||
|
|
||||||
|
final XPathSelector selector = results.getScenarioSelectionResult().getObject().getAcceptSelector();
|
||||||
|
selector.setContextItem(results.getReport());
|
||||||
|
results.setAcceptStatus(selector.effectiveBooleanValue() ? AcceptRecommendation.ACCEPTABLE : AcceptRecommendation.REJECT);
|
||||||
|
} catch (final Exception e) {
|
||||||
|
log.error("Fehler bei Evaluierung des Accept-Status: {}", e.getMessage(), e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isSkipped(final Bag results) {
|
||||||
|
return results.getReport() == null;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -61,24 +61,24 @@ public class CreateReportAction implements CheckAction {
|
||||||
|
|
||||||
private final URI contentRepository;
|
private final URI contentRepository;
|
||||||
|
|
||||||
private static XsltExecutable loadFromScenario(ScenarioType object) {
|
private static XsltExecutable loadFromScenario(final ScenarioType object) {
|
||||||
return object.getReportTransformation().getExecutable();
|
return object.getReportTransformation().getExecutable();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void check(Bag results) {
|
public void check(final Bag results) {
|
||||||
final DocumentBuilder documentBuilder = processor.newDocumentBuilder();
|
final DocumentBuilder documentBuilder = this.processor.newDocumentBuilder();
|
||||||
try {
|
try {
|
||||||
|
|
||||||
final XdmNode parsedDocument = results.getParserResult().isValid() ? results.getParserResult().getObject()
|
final XdmNode parsedDocument = results.getParserResult().isValid() ? results.getParserResult().getObject()
|
||||||
: ObjectFactory.createProcessor().newDocumentBuilder().newBuildingContentHandler().getDocumentNode();
|
: ObjectFactory.createProcessor().newDocumentBuilder().newBuildingContentHandler().getDocumentNode();
|
||||||
|
|
||||||
final Document reportInput = conversionService.writeDocument(results.getReportInput());
|
final Document reportInput = this.conversionService.writeDocument(results.getReportInput());
|
||||||
final XdmNode root = documentBuilder.build(new DOMSource(reportInput));
|
final XdmNode root = documentBuilder.build(new DOMSource(reportInput));
|
||||||
final XsltTransformer transformer = getTransformation(results).load();
|
final XsltTransformer transformer = getTransformation(results).load();
|
||||||
transformer.setInitialContextNode(root);
|
transformer.setInitialContextNode(root);
|
||||||
CollectingErrorEventHandler e = new CollectingErrorEventHandler();
|
final CollectingErrorEventHandler e = new CollectingErrorEventHandler();
|
||||||
RelativeUriResolver resolver = new RelativeUriResolver(contentRepository);
|
final RelativeUriResolver resolver = new RelativeUriResolver(this.contentRepository);
|
||||||
transformer.setMessageListener(e);
|
transformer.setMessageListener(e);
|
||||||
transformer.setURIResolver(resolver);
|
transformer.setURIResolver(resolver);
|
||||||
transformer.getUnderlyingController().setUnparsedTextURIResolver(resolver);
|
transformer.getUnderlyingController().setUnparsedTextURIResolver(resolver);
|
||||||
|
|
@ -88,17 +88,15 @@ public class CreateReportAction implements CheckAction {
|
||||||
transformer.transform();
|
transformer.transform();
|
||||||
results.setReport(destination.getXdmNode());
|
results.setReport(destination.getXdmNode());
|
||||||
|
|
||||||
} catch (SaxonApiException e) {
|
} catch (final SaxonApiException e) {
|
||||||
throw new IllegalStateException("Can not create final report", e);
|
throw new IllegalStateException("Can not create final report", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private XsltExecutable getTransformation(Bag results) {
|
private static XsltExecutable getTransformation(final Bag results) {
|
||||||
final Result<ScenarioType, String> scenario = results.getScenarioSelectionResult();
|
final Result<ScenarioType, String> scenario = results.getScenarioSelectionResult();
|
||||||
return scenario != null && scenario.isValid() ? loadFromScenario(scenario.getObject()) : loadFallback();
|
return loadFromScenario(scenario.getObject());
|
||||||
}
|
}
|
||||||
|
|
||||||
private XsltExecutable loadFallback() {
|
|
||||||
return repository.getNoScenarioReport();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -56,20 +56,20 @@ public class DocumentParseAction implements CheckAction {
|
||||||
* @param content ein Dokument
|
* @param content ein Dokument
|
||||||
* @return Ergebnis des Parsings inklusive etwaiger Fehler
|
* @return Ergebnis des Parsings inklusive etwaiger Fehler
|
||||||
*/
|
*/
|
||||||
public Result<XdmNode, XMLSyntaxError> parseDocument(Input content) {
|
public static Result<XdmNode, XMLSyntaxError> parseDocument(final Input content) {
|
||||||
if (content == null) {
|
if (content == null) {
|
||||||
throw new IllegalArgumentException("Input may not be null");
|
throw new IllegalArgumentException("Input may not be null");
|
||||||
}
|
}
|
||||||
Result<XdmNode, XMLSyntaxError> result;
|
Result<XdmNode, XMLSyntaxError> result;
|
||||||
try ( InputStream input = new ByteArrayInputStream(content.getContent()) ) {
|
try ( final InputStream input = new ByteArrayInputStream(content.getContent()) ) {
|
||||||
final DocumentBuilder builder = ObjectFactory.createProcessor().newDocumentBuilder();
|
final DocumentBuilder builder = ObjectFactory.createProcessor().newDocumentBuilder();
|
||||||
builder.setLineNumbering(true);
|
builder.setLineNumbering(true);
|
||||||
XdmNode doc = builder.build(new StreamSource(input));
|
final XdmNode doc = builder.build(new StreamSource(input));
|
||||||
result = new Result<>(doc, Collections.emptyList());
|
result = new Result<>(doc, Collections.emptyList());
|
||||||
} catch (SaxonApiException | IOException e) {
|
} catch (final SaxonApiException | IOException e) {
|
||||||
log.debug("Exception while parsing {}", content.getName(), e);
|
log.debug("Exception while parsing {}", content.getName(), e);
|
||||||
XMLSyntaxError error = new XMLSyntaxError();
|
final XMLSyntaxError error = new XMLSyntaxError();
|
||||||
error.setSeverity(XMLSyntaxErrorSeverity.SEVERITY_FATAL_ERROR);
|
error.setSeverityCode(XMLSyntaxErrorSeverity.SEVERITY_FATAL_ERROR);
|
||||||
error.setMessage(String.format("IOException while reading resource %s: %s", content.getName(), e.getMessage()));
|
error.setMessage(String.format("IOException while reading resource %s: %s", content.getName(), e.getMessage()));
|
||||||
result = new Result<>(Collections.singleton(error));
|
result = new Result<>(Collections.singleton(error));
|
||||||
}
|
}
|
||||||
|
|
@ -78,9 +78,9 @@ public class DocumentParseAction implements CheckAction {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void check(Bag results) {
|
public void check(final Bag results) {
|
||||||
Result<XdmNode, XMLSyntaxError> parserResult = parseDocument(results.getInput());
|
final Result<XdmNode, XMLSyntaxError> parserResult = parseDocument(results.getInput());
|
||||||
ValidationResultsWellformedness v = new ValidationResultsWellformedness();
|
final ValidationResultsWellformedness v = new ValidationResultsWellformedness();
|
||||||
results.setParserResult(parserResult);
|
results.setParserResult(parserResult);
|
||||||
v.getXmlSyntaxError().addAll(parserResult.getErrors());
|
v.getXmlSyntaxError().addAll(parserResult.getErrors());
|
||||||
results.getReportInput().setValidationResultsWellformedness(v);
|
results.getReportInput().setValidationResultsWellformedness(v);
|
||||||
|
|
|
||||||
|
|
@ -23,11 +23,15 @@ import java.net.URI;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
import javax.xml.transform.dom.DOMSource;
|
||||||
|
|
||||||
|
import org.oclc.purl.dsdl.svrl.SchematronOutput;
|
||||||
import org.w3c.dom.Document;
|
import org.w3c.dom.Document;
|
||||||
|
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
|
|
||||||
import de.kosit.validationtool.impl.CollectingErrorEventHandler;
|
import de.kosit.validationtool.impl.CollectingErrorEventHandler;
|
||||||
|
import de.kosit.validationtool.impl.ConversionService;
|
||||||
import de.kosit.validationtool.impl.ObjectFactory;
|
import de.kosit.validationtool.impl.ObjectFactory;
|
||||||
import de.kosit.validationtool.impl.RelativeUriResolver;
|
import de.kosit.validationtool.impl.RelativeUriResolver;
|
||||||
import de.kosit.validationtool.impl.model.BaseScenario;
|
import de.kosit.validationtool.impl.model.BaseScenario;
|
||||||
|
|
@ -50,37 +54,39 @@ public class SchematronValidationAction implements CheckAction {
|
||||||
|
|
||||||
private final URI repository;
|
private final URI repository;
|
||||||
|
|
||||||
private List<ValidationResultsSchematron> validate(XdmNode document, ScenarioType scenario) {
|
private final ConversionService conversionService;
|
||||||
|
|
||||||
|
private List<ValidationResultsSchematron> validate(final XdmNode document, final ScenarioType scenario) {
|
||||||
return scenario.getSchematronValidations().stream().map(v -> validate(document, v)).collect(Collectors.toList());
|
return scenario.getSchematronValidations().stream().map(v -> validate(document, v)).collect(Collectors.toList());
|
||||||
}
|
}
|
||||||
|
|
||||||
private ValidationResultsSchematron validate(XdmNode document, BaseScenario.Transformation validation) {
|
private ValidationResultsSchematron validate(final XdmNode document, final BaseScenario.Transformation validation) {
|
||||||
try {
|
try {
|
||||||
final XsltTransformer transformer = validation.getExecutable().load();
|
final XsltTransformer transformer = validation.getExecutable().load();
|
||||||
// resolving nur relative zum Repository
|
// resolving nur relative zum Repository
|
||||||
final RelativeUriResolver resolver = new RelativeUriResolver(repository);
|
final RelativeUriResolver resolver = new RelativeUriResolver(this.repository);
|
||||||
transformer.setURIResolver(resolver);
|
transformer.setURIResolver(resolver);
|
||||||
CollectingErrorEventHandler e = new CollectingErrorEventHandler();
|
final CollectingErrorEventHandler e = new CollectingErrorEventHandler();
|
||||||
transformer.setMessageListener(e);
|
transformer.setMessageListener(e);
|
||||||
|
|
||||||
Document result = ObjectFactory.createDocumentBuilder(false).newDocument();
|
final Document result = ObjectFactory.createDocumentBuilder(false).newDocument();
|
||||||
transformer.setDestination(new DOMDestination(result));
|
transformer.setDestination(new DOMDestination(result));
|
||||||
transformer.setInitialContextNode(document);
|
transformer.setInitialContextNode(document);
|
||||||
transformer.transform();
|
transformer.transform();
|
||||||
ValidationResultsSchematron s = new ValidationResultsSchematron();
|
final ValidationResultsSchematron s = new ValidationResultsSchematron();
|
||||||
s.setResource(validation.getResourceType());
|
s.setResource(validation.getResourceType());
|
||||||
ValidationResultsSchematron.Results r = new ValidationResultsSchematron.Results();
|
final ValidationResultsSchematron.Results r = new ValidationResultsSchematron.Results();
|
||||||
r.setAny(result.getDocumentElement());
|
r.setSchematronOutput(this.conversionService.readDocument(new DOMSource(result), SchematronOutput.class));
|
||||||
s.setResults(r);
|
s.setResults(r);
|
||||||
return s;
|
return s;
|
||||||
|
|
||||||
} catch (SaxonApiException e) {
|
} catch (final SaxonApiException e) {
|
||||||
throw new IllegalStateException("Can not run schematron validation", e);
|
throw new IllegalStateException("Can not run schematron validation", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void check(Bag results) {
|
public void check(final Bag results) {
|
||||||
final CreateReportInput report = results.getReportInput();
|
final CreateReportInput report = results.getReportInput();
|
||||||
final List<ValidationResultsSchematron> validationResult = validate(results.getParserResult().getObject(),
|
final List<ValidationResultsSchematron> validationResult = validate(results.getParserResult().getObject(),
|
||||||
results.getScenarioSelectionResult().getObject());
|
results.getScenarioSelectionResult().getObject());
|
||||||
|
|
@ -88,7 +94,7 @@ public class SchematronValidationAction implements CheckAction {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isSkipped(Bag results) {
|
public boolean isSkipped(final Bag results) {
|
||||||
return results.getSchemaValidationResult() == null || results.getSchemaValidationResult().isInvalid();
|
return results.getSchemaValidationResult() == null || results.getSchemaValidationResult().isInvalid();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,7 @@ public class ValidateReportInputAction implements CheckAction {
|
||||||
private final Schema schema;
|
private final Schema schema;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void check(Bag bag) {
|
public void check(final Bag bag) {
|
||||||
final Result<Boolean, XMLSyntaxError> results = validate(bag.getReportInput());
|
final Result<Boolean, XMLSyntaxError> results = validate(bag.getReportInput());
|
||||||
if (!results.isValid()) {
|
if (!results.isValid()) {
|
||||||
log.error("Report input has errors {}", results.getErrors());
|
log.error("Report input has errors {}", results.getErrors());
|
||||||
|
|
@ -60,9 +60,9 @@ public class ValidateReportInputAction implements CheckAction {
|
||||||
* @param <T> der Typ des Objekts
|
* @param <T> der Typ des Objekts
|
||||||
* @return ein Validierungsergebnis
|
* @return ein Validierungsergebnis
|
||||||
*/
|
*/
|
||||||
private <T> Result<Boolean, XMLSyntaxError> validate(T object) {
|
private <T> Result<Boolean, XMLSyntaxError> validate(final T object) {
|
||||||
CollectingErrorEventHandler h = new CollectingErrorEventHandler();
|
final CollectingErrorEventHandler h = new CollectingErrorEventHandler();
|
||||||
final String result = conversionService.writeXml(object, schema, h);
|
final String result = this.conversionService.writeXml(object, this.schema, h);
|
||||||
return new Result<>(StringUtils.isNotBlank(result), h.getErrors());
|
return new Result<>(StringUtils.isNotBlank(result), h.getErrors());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -52,4 +52,11 @@
|
||||||
</jaxb:schemaBindings>
|
</jaxb:schemaBindings>
|
||||||
</jaxb:bindings>
|
</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>
|
</jaxb:bindings>
|
||||||
|
|
@ -20,10 +20,12 @@
|
||||||
|
|
||||||
<!-- $Id$ -->
|
<!-- $Id$ -->
|
||||||
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:in="http://www.xoev.de/de/validator/framework/1/createreportinput"
|
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:in="http://www.xoev.de/de/validator/framework/1/createreportinput"
|
||||||
xmlns:s="http://www.xoev.de/de/validator/framework/1/scenarios" targetNamespace="http://www.xoev.de/de/validator/framework/1/createreportinput" version="1.0.0"
|
xmlns:s="http://www.xoev.de/de/validator/framework/1/scenarios" xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
||||||
|
targetNamespace="http://www.xoev.de/de/validator/framework/1/createreportinput" version="1.0.0"
|
||||||
elementFormDefault="qualified" attributeFormDefault="unqualified">
|
elementFormDefault="qualified" attributeFormDefault="unqualified">
|
||||||
|
|
||||||
<xs:import namespace="http://www.xoev.de/de/validator/framework/1/scenarios" schemaLocation="scenarios.xsd"/>
|
<xs:import namespace="http://www.xoev.de/de/validator/framework/1/scenarios" schemaLocation="scenarios.xsd"/>
|
||||||
|
<xs:import namespace="http://purl.oclc.org/dsdl/svrl" schemaLocation="svrl-kosit.xsd" />
|
||||||
|
|
||||||
<xs:element name="createReportInput">
|
<xs:element name="createReportInput">
|
||||||
<xs:complexType>
|
<xs:complexType>
|
||||||
|
|
@ -68,7 +70,7 @@
|
||||||
<xs:complexType name="XMLSyntaxError">
|
<xs:complexType name="XMLSyntaxError">
|
||||||
<xs:sequence>
|
<xs:sequence>
|
||||||
<xs:element name="message" type="xs:normalizedString"/>
|
<xs:element name="message" type="xs:normalizedString"/>
|
||||||
<xs:element name="severity" type="in:XMLSyntaxErrorSeverity"/>
|
<xs:element name="severityCode" type="in:XMLSyntaxErrorSeverity" />
|
||||||
<xs:element name="rowNumber" type="xs:int" minOccurs="0"/>
|
<xs:element name="rowNumber" type="xs:int" minOccurs="0"/>
|
||||||
<xs:element name="columnNumber" type="xs:int" minOccurs="0"/>
|
<xs:element name="columnNumber" type="xs:int" minOccurs="0"/>
|
||||||
</xs:sequence>
|
</xs:sequence>
|
||||||
|
|
@ -88,7 +90,7 @@
|
||||||
<xs:element name="results">
|
<xs:element name="results">
|
||||||
<xs:complexType>
|
<xs:complexType>
|
||||||
<xs:sequence>
|
<xs:sequence>
|
||||||
<xs:any namespace="##any" processContents="skip"/>
|
<xs:element ref="svrl:schematron-output" />
|
||||||
</xs:sequence>
|
</xs:sequence>
|
||||||
</xs:complexType>
|
</xs:complexType>
|
||||||
</xs:element>
|
</xs:element>
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,8 @@
|
||||||
|
|
||||||
<!-- $Id$ -->
|
<!-- $Id$ -->
|
||||||
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:s="http://www.xoev.de/de/validator/framework/1/scenarios"
|
<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.0.0" elementFormDefault="qualified" attributeFormDefault="unqualified">
|
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">
|
||||||
<xs:complexType>
|
<xs:complexType>
|
||||||
|
|
@ -86,6 +87,8 @@
|
||||||
<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"/>
|
<xs:element name="createReport" type="s:CreateReportType"/>
|
||||||
|
<!-- Optional da nachträglich eingeführt -->
|
||||||
|
<xs:element name="acceptMatch" type="xs:string" minOccurs="0" />
|
||||||
</xs:sequence>
|
</xs:sequence>
|
||||||
</xs:complexType>
|
</xs:complexType>
|
||||||
|
|
||||||
|
|
|
||||||
161
src/main/model/xsd/svrl-kosit.xsd
Normal file
161
src/main/model/xsd/svrl-kosit.xsd
Normal file
|
|
@ -0,0 +1,161 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
||||||
|
targetNamespace="http://purl.oclc.org/dsdl/svrl" version="0.1" elementFormDefault="qualified" attributeFormDefault="unqualified">
|
||||||
|
<xs:import schemaLocation="xml.xsd" namespace="http://www.w3.org/XML/1998/namespace" />
|
||||||
|
<xs:simpleType name="FailedAssertRoleType">
|
||||||
|
<xs:restriction base="xs:token">
|
||||||
|
<xs:enumeration value="error" />
|
||||||
|
<xs:enumeration value="fatal" />
|
||||||
|
<xs:enumeration value="information" />
|
||||||
|
<xs:enumeration value="warning" />
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:complexType name="rich-text" mixed="true">
|
||||||
|
<xs:sequence>
|
||||||
|
|
||||||
|
<xs:choice minOccurs="0" maxOccurs="unbounded">
|
||||||
|
<xs:group ref="svrl:foreign" />
|
||||||
|
<xs:element ref="svrl:dir" />
|
||||||
|
<xs:element ref="svrl:span" />
|
||||||
|
<xs:element ref="svrl:emph" />
|
||||||
|
</xs:choice>
|
||||||
|
</xs:sequence>
|
||||||
|
<xs:attributeGroup ref="svrl:foreign" />
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:attributeGroup name="attlist.assert-and-report">
|
||||||
|
<xs:attribute name="flag" type="xs:NMTOKEN" use="optional" />
|
||||||
|
<xs:attribute name="id" type="xs:NMTOKEN" use="required" />
|
||||||
|
<xs:attribute name="location" use="required" />
|
||||||
|
<xs:attribute name="role" type="svrl:FailedAssertRoleType" use="optional" />
|
||||||
|
<xs:attribute name="test" use="required" />
|
||||||
|
</xs:attributeGroup>
|
||||||
|
<xs:attributeGroup name="foreign">
|
||||||
|
<xs:attributeGroup ref="svrl:foreign-attributes" />
|
||||||
|
</xs:attributeGroup>
|
||||||
|
<xs:group name="foreign">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:group ref="svrl:foreign-element" minOccurs="0" />
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:group>
|
||||||
|
<xs:attributeGroup name="foreign-attributes">
|
||||||
|
<xs:anyAttribute />
|
||||||
|
</xs:attributeGroup>
|
||||||
|
<xs:group name="foreign-element">
|
||||||
|
<xs:choice>
|
||||||
|
<xs:any namespace="##other" processContents="skip" />
|
||||||
|
<xs:any namespace="##local" processContents="skip" />
|
||||||
|
</xs:choice>
|
||||||
|
</xs:group>
|
||||||
|
<xs:element name="active-pattern">
|
||||||
|
<xs:complexType>
|
||||||
|
<xs:attribute name="documents" use="optional" />
|
||||||
|
<xs:attribute name="id" type="xs:NMTOKEN" use="optional" />
|
||||||
|
<xs:attribute name="name" use="optional" />
|
||||||
|
<xs:attribute name="role" type="xs:NMTOKEN" use="optional" />
|
||||||
|
</xs:complexType>
|
||||||
|
</xs:element>
|
||||||
|
<xs:element name="diagnostic-reference">
|
||||||
|
<xs:complexType>
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element ref="svrl:text" />
|
||||||
|
</xs:sequence>
|
||||||
|
<xs:attribute name="diagnostic" type="xs:NMTOKEN" use="required" />
|
||||||
|
</xs:complexType>
|
||||||
|
</xs:element>
|
||||||
|
<xs:element name="dir">
|
||||||
|
<xs:complexType mixed="true">
|
||||||
|
<xs:attribute name="class" use="optional" />
|
||||||
|
<xs:attribute name="dir" use="optional" />
|
||||||
|
</xs:complexType>
|
||||||
|
</xs:element>
|
||||||
|
<xs:element name="emph">
|
||||||
|
<xs:complexType mixed="true">
|
||||||
|
<xs:attribute name="class" use="optional" />
|
||||||
|
</xs:complexType>
|
||||||
|
</xs:element>
|
||||||
|
<xs:element name="failed-assert">
|
||||||
|
<xs:complexType>
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element ref="svrl:diagnostic-reference" minOccurs="0" maxOccurs="unbounded" />
|
||||||
|
<xs:element ref="svrl:property-reference" minOccurs="0" maxOccurs="unbounded" />
|
||||||
|
<xs:element ref="svrl:text" />
|
||||||
|
</xs:sequence>
|
||||||
|
<xs:attributeGroup ref="svrl:attlist.assert-and-report" />
|
||||||
|
</xs:complexType>
|
||||||
|
</xs:element>
|
||||||
|
<xs:element name="fired-rule">
|
||||||
|
<xs:complexType>
|
||||||
|
<xs:attribute name="context" use="required" />
|
||||||
|
<xs:attribute name="flag" type="xs:NMTOKEN" use="optional" />
|
||||||
|
<xs:attribute name="id" type="xs:NMTOKEN" use="optional" />
|
||||||
|
<xs:attribute name="name" use="optional" />
|
||||||
|
<xs:attribute name="role" type="xs:NMTOKEN" use="optional" />
|
||||||
|
</xs:complexType>
|
||||||
|
</xs:element>
|
||||||
|
<xs:element name="ns-prefix-in-attribute-values">
|
||||||
|
<xs:complexType>
|
||||||
|
<xs:attribute name="prefix" type="xs:NMTOKEN" use="required" />
|
||||||
|
<xs:attribute name="uri" use="required" />
|
||||||
|
</xs:complexType>
|
||||||
|
</xs:element>
|
||||||
|
<xs:element name="property-reference">
|
||||||
|
<xs:complexType>
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element ref="svrl:text" />
|
||||||
|
</xs:sequence>
|
||||||
|
<xs:attribute name="property" type="xs:NMTOKEN" use="required" />
|
||||||
|
<xs:attribute name="role" use="optional" />
|
||||||
|
<xs:attribute name="scheme" use="optional" />
|
||||||
|
</xs:complexType>
|
||||||
|
</xs:element>
|
||||||
|
<xs:element name="schematron-output">
|
||||||
|
<xs:complexType>
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element ref="svrl:text" minOccurs="0" maxOccurs="unbounded" />
|
||||||
|
<xs:element ref="svrl:ns-prefix-in-attribute-values" minOccurs="0" maxOccurs="unbounded" />
|
||||||
|
<xs:sequence minOccurs="0" maxOccurs="unbounded">
|
||||||
|
<xs:element ref="svrl:active-pattern" minOccurs="0" />
|
||||||
|
<xs:sequence minOccurs="0" maxOccurs="unbounded">
|
||||||
|
<xs:element ref="svrl:fired-rule" minOccurs="0" />
|
||||||
|
<xs:choice minOccurs="0" maxOccurs="unbounded">
|
||||||
|
<xs:element ref="svrl:failed-assert" />
|
||||||
|
<xs:element ref="svrl:successful-report" />
|
||||||
|
</xs:choice>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:sequence>
|
||||||
|
<xs:attribute name="phase" type="xs:NMTOKEN" use="optional" />
|
||||||
|
<xs:attribute name="schemaVersion" use="optional" />
|
||||||
|
<xs:attribute name="title" use="optional" />
|
||||||
|
</xs:complexType>
|
||||||
|
</xs:element>
|
||||||
|
<xs:element name="span">
|
||||||
|
<xs:complexType mixed="true">
|
||||||
|
<xs:attribute name="class" use="required" />
|
||||||
|
</xs:complexType>
|
||||||
|
</xs:element>
|
||||||
|
<xs:element name="successful-report">
|
||||||
|
<xs:complexType>
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element ref="svrl:diagnostic-reference" minOccurs="0" maxOccurs="unbounded" />
|
||||||
|
<xs:element ref="svrl:property-reference" minOccurs="0" maxOccurs="unbounded" />
|
||||||
|
<xs:element ref="svrl:text" />
|
||||||
|
</xs:sequence>
|
||||||
|
<xs:attributeGroup ref="svrl:attlist.assert-and-report" />
|
||||||
|
</xs:complexType>
|
||||||
|
</xs:element>
|
||||||
|
<xs:element name="text">
|
||||||
|
<xs:complexType>
|
||||||
|
<xs:complexContent>
|
||||||
|
<xs:extension base="svrl:rich-text">
|
||||||
|
<xs:attribute ref="xml:space" />
|
||||||
|
<xs:attribute ref="xml:lang" />
|
||||||
|
<xs:attribute name="fpi" use="optional" />
|
||||||
|
<xs:attribute name="icon" use="optional" />
|
||||||
|
<xs:attribute name="see" use="optional" />
|
||||||
|
</xs:extension>
|
||||||
|
</xs:complexContent>
|
||||||
|
</xs:complexType>
|
||||||
|
</xs:element>
|
||||||
|
</xs:schema>
|
||||||
|
|
||||||
10
src/main/model/xsd/xml.xsd
Normal file
10
src/main/model/xsd/xml.xsd
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"
|
||||||
|
targetNamespace="http://www.w3.org/XML/1998/namespace">
|
||||||
|
<xs:import namespace="http://purl.oclc.org/dsdl/svrl" schemaLocation="svrl-kosit.xsd" />
|
||||||
|
<xs:attribute name="space" />
|
||||||
|
<xs:attribute name="lang" />
|
||||||
|
<xs:attributeGroup name="local">
|
||||||
|
<xs:anyAttribute namespace="##other" processContents="skip" />
|
||||||
|
</xs:attributeGroup>
|
||||||
|
</xs:schema>
|
||||||
|
|
@ -41,7 +41,7 @@ public class DaemonIT {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void makeSureThatSuccessTest() throws IOException {
|
public void makeSureThatSuccessTest() throws IOException {
|
||||||
try ( InputStream io = DaemonIT.class.getClassLoader().getResourceAsStream(EXAMPLE_FILE) ) {
|
try ( final InputStream io = DaemonIT.class.getClassLoader().getResourceAsStream(EXAMPLE_FILE) ) {
|
||||||
given().contentType(ContentType.XML).body(toContent(io)).when().post("/").then().statusCode(200);
|
given().contentType(ContentType.XML).body(toContent(io)).when().post("/").then().statusCode(200);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -54,12 +54,12 @@ public class DaemonIT {
|
||||||
@Test
|
@Test
|
||||||
@Ignore // no default error report yet
|
@Ignore // no default error report yet
|
||||||
public void internalServerErrorTest() throws IOException {
|
public void internalServerErrorTest() throws IOException {
|
||||||
try ( InputStream io = DaemonIT.class.getClassLoader().getResourceAsStream(INVALID_XML) ) {
|
try ( final InputStream io = DaemonIT.class.getClassLoader().getResourceAsStream(INVALID_XML) ) {
|
||||||
given().contentType(APPLICATION_XML).body(toContent(io)).when().post("/").then().statusCode(200);
|
given().contentType(APPLICATION_XML).body(toContent(io)).when().post("/").then().statusCode(200);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private byte[] toContent(final InputStream io) throws IOException {
|
private static byte[] toContent(final InputStream io) throws IOException {
|
||||||
return IOUtils.toByteArray(io);
|
return IOUtils.toByteArray(io);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -75,7 +75,7 @@ public class DaemonIT {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void xmlResultTest() throws IOException {
|
public void xmlResultTest() throws IOException {
|
||||||
try ( InputStream io = DaemonIT.class.getClassLoader().getResourceAsStream(EXAMPLE_FILE) ) {
|
try ( final InputStream io = DaemonIT.class.getClassLoader().getResourceAsStream(EXAMPLE_FILE) ) {
|
||||||
given().body(toContent(io)).when().post("/").then().contentType(APPLICATION_XML).and().statusCode(200);
|
given().body(toContent(io)).when().post("/").then().contentType(APPLICATION_XML).and().statusCode(200);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -22,6 +22,9 @@ package de.kosit.validationtool.impl;
|
||||||
import static org.assertj.core.api.Assertions.assertThat;
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
|
|
||||||
import java.net.MalformedURLException;
|
import java.net.MalformedURLException;
|
||||||
|
import java.net.URI;
|
||||||
|
import java.net.URISyntaxException;
|
||||||
|
import java.net.URL;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
@ -48,64 +51,85 @@ public class ContentRepositoryTest {
|
||||||
@Rule
|
@Rule
|
||||||
public ExpectedException exception = ExpectedException.none();
|
public ExpectedException exception = ExpectedException.none();
|
||||||
|
|
||||||
|
|
||||||
@Before
|
@Before
|
||||||
public void setup() {
|
public void setup() {
|
||||||
repository = new ContentRepository(ObjectFactory.createProcessor(), Helper.REPOSITORY);
|
this.repository = new ContentRepository(ObjectFactory.createProcessor(), Helper.REPOSITORY);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testCreateSchema() throws MalformedURLException {
|
public void testCreateSchema() throws MalformedURLException {
|
||||||
final Schema schema = repository.createSchema(Helper.ASSERTION_SCHEMA.toURL());
|
final Schema schema = ContentRepository.createSchema(Helper.ASSERTION_SCHEMA.toURL());
|
||||||
assertThat(schema).isNotNull();
|
assertThat(schema).isNotNull();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testSchemaCaching() throws MalformedURLException {
|
public void testSchemaCaching() {
|
||||||
final Schema schema = repository.getReportInputSchema();
|
final Schema schema = this.repository.getReportInputSchema();
|
||||||
assertThat(repository.getReportInputSchema()).isSameAs(schema);
|
assertThat(this.repository.getReportInputSchema()).isSameAs(schema);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testCreateSchemaNotExisting() throws Exception {
|
public void testCreateSchemaNotExisting() throws Exception {
|
||||||
exception.expect(IllegalStateException.class);
|
this.exception.expect(IllegalStateException.class);
|
||||||
repository.createSchema(Helper.ASSERTION_SCHEMA.resolve("noexisting").toURL());
|
ContentRepository.createSchema(Helper.ASSERTION_SCHEMA.resolve("noexisting").toURL());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testLoadXSLT() throws MalformedURLException {
|
public void testLoadXSLT() {
|
||||||
final XsltExecutable executable = repository.loadXsltScript(Helper.SAMPLE_XSLT);
|
final XsltExecutable executable = this.repository.loadXsltScript(Helper.SAMPLE_XSLT);
|
||||||
assertThat(executable).isNotNull();
|
assertThat(executable).isNotNull();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testLoadXSLTNotExisting() throws MalformedURLException {
|
public void testLoadXSLTNotExisting() {
|
||||||
exception.expect(IllegalStateException.class);
|
this.exception.expect(IllegalStateException.class);
|
||||||
repository.loadXsltScript(Helper.SAMPLE_XSLT.resolve("notexisting"));
|
this.repository.loadXsltScript(Helper.SAMPLE_XSLT.resolve("notexisting"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testXpathCreation() throws MalformedURLException {
|
public void testXpathCreation() {
|
||||||
XPathExecutable xPath = repository.createXPath("//html", null);
|
XPathExecutable xPath = this.repository.createXPath("//html", null);
|
||||||
assertThat(xPath).isNotNull();
|
assertThat(xPath).isNotNull();
|
||||||
xPath = repository.createXPath("//html", Collections.emptyMap());
|
xPath = this.repository.createXPath("//html", Collections.emptyMap());
|
||||||
assertThat(xPath).isNotNull();
|
assertThat(xPath).isNotNull();
|
||||||
Map<String,String> namespace = new HashMap<>();
|
final Map<String, String> namespace = new HashMap<>();
|
||||||
namespace.put("html", "http://www.w3.org/1999/xhtml");
|
namespace.put("html", "http://www.w3.org/1999/xhtml");
|
||||||
xPath = repository.createXPath("//html:html", namespace );
|
xPath = this.repository.createXPath("//html:html", namespace);
|
||||||
assertThat(xPath).isNotNull();
|
assertThat(xPath).isNotNull();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testXpathCreationWithoutNamespace() {
|
public void testXpathCreationWithoutNamespace() {
|
||||||
exception.expect(IllegalStateException.class);
|
this.exception.expect(IllegalStateException.class);
|
||||||
repository.createXPath("//html:html", null );
|
this.repository.createXPath("//html:html", null);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testIllegalXpath() {
|
public void testIllegalXpath() {
|
||||||
exception.expect(IllegalStateException.class);
|
this.exception.expect(IllegalStateException.class);
|
||||||
repository.createXPath("kein Xpath Ausdruck", null );
|
this.repository.createXPath("kein Xpath Ausdruck", null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void loadFromJar() throws URISyntaxException {
|
||||||
|
this.repository = new ContentRepository(ObjectFactory.createProcessor(), Helper.JAR_REPOSITORY.toURI());
|
||||||
|
final XsltExecutable xsltExecutable = this.repository.loadXsltScript(URI.create("resources/eRechnung/report.xsl"));
|
||||||
|
assertThat(xsltExecutable).isNotNull();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testLoadSchema() {
|
||||||
|
final URL main = RelativeUriResolverTest.class.getClassLoader().getResource("simple/main.xsd");
|
||||||
|
final Schema schema = ContentRepository.createSchema(main, new ClassPathResourceResolver("/simple"));
|
||||||
|
assertThat(schema).isNotNull();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testLoadSchemaPackaged() throws URISyntaxException {
|
||||||
|
final URL main = RelativeUriResolverTest.class.getClassLoader().getResource("packaged/main.xsd");
|
||||||
|
final Schema schema = ContentRepository.createSchema(main,
|
||||||
|
new ClassPathResourceResolver(RelativeUriResolverTest.class.getClassLoader().getResource("packaged/").toURI()));
|
||||||
|
assertThat(schema).isNotNull();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -57,65 +57,66 @@ public class ConversionServiceTest {
|
||||||
|
|
||||||
@Before
|
@Before
|
||||||
public void setup() {
|
public void setup() {
|
||||||
service = new ConversionService();
|
this.service = new ConversionService();
|
||||||
repository = new ContentRepository(ObjectFactory.createProcessor(), new File("src/test/resources/examples/repository").toURI());
|
this.repository = new ContentRepository(ObjectFactory.createProcessor(),
|
||||||
|
new File("src/test/resources/examples/repository").toURI());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testMarshalNull() {
|
public void testMarshalNull() {
|
||||||
exception.expect(ConversionService.ConversionExeption.class);
|
this.exception.expect(ConversionService.ConversionExeption.class);
|
||||||
service.writeXml(null);
|
this.service.writeXml(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testMarshalUnknown() {
|
public void testMarshalUnknown() {
|
||||||
exception.expect(ConversionService.ConversionExeption.class);
|
this.exception.expect(ConversionService.ConversionExeption.class);
|
||||||
service.writeXml(new Serializable() {
|
this.service.writeXml(new Serializable() {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testUnmarshal() throws URISyntaxException {
|
public void testUnmarshal() throws URISyntaxException {
|
||||||
final Scenarios s = service.readXml(VALID_XML.toURI(), Scenarios.class);
|
final Scenarios s = this.service.readXml(VALID_XML.toURI(), Scenarios.class);
|
||||||
assertThat(s).isNotNull();
|
assertThat(s).isNotNull();
|
||||||
assertThat(s.getName()).isEqualToIgnoringCase("XInneres");
|
assertThat(s.getName()).isEqualToIgnoringCase("XInneres");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testUnmarshalWithSchema() throws URISyntaxException {
|
public void testUnmarshalWithSchema() throws URISyntaxException {
|
||||||
final Scenarios s = service.readXml(VALID_XML.toURI(), Scenarios.class, repository.createSchema(SCHEMA));
|
final Scenarios s = this.service.readXml(VALID_XML.toURI(), Scenarios.class, ContentRepository.createSchema(SCHEMA));
|
||||||
assertThat(s).isNotNull();
|
assertThat(s).isNotNull();
|
||||||
assertThat(s.getName()).isEqualToIgnoringCase("XInneres");
|
assertThat(s.getName()).isEqualToIgnoringCase("XInneres");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testUnmarshalInvalidXml() throws URISyntaxException {
|
public void testUnmarshalInvalidXml() throws URISyntaxException {
|
||||||
exception.expect(ConversionService.ConversionExeption.class);
|
this.exception.expect(ConversionService.ConversionExeption.class);
|
||||||
service.readXml(INVALID_XML.toURI(), Scenarios.class, repository.createSchema(SCHEMA));
|
this.service.readXml(INVALID_XML.toURI(), Scenarios.class, ContentRepository.createSchema(SCHEMA));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testUnmarshalIllFormed() throws URISyntaxException {
|
public void testUnmarshalIllFormed() throws URISyntaxException {
|
||||||
exception.expect(ConversionService.ConversionExeption.class);
|
this.exception.expect(ConversionService.ConversionExeption.class);
|
||||||
service.readXml(ILLFORMED_XML.toURI(), Scenarios.class, repository.createSchema(SCHEMA));
|
this.service.readXml(ILLFORMED_XML.toURI(), Scenarios.class, ContentRepository.createSchema(SCHEMA));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testUnmarshalEmpty() {
|
public void testUnmarshalEmpty() {
|
||||||
exception.expect(ConversionService.ConversionExeption.class);
|
this.exception.expect(ConversionService.ConversionExeption.class);
|
||||||
service.readXml(null, Scenarios.class);
|
this.service.readXml(null, Scenarios.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testUnmarshalUnknownType() throws URISyntaxException {
|
public void testUnmarshalUnknownType() throws URISyntaxException {
|
||||||
exception.expect(ConversionService.ConversionExeption.class);
|
this.exception.expect(ConversionService.ConversionExeption.class);
|
||||||
service.readXml(VALID_XML.toURI(), ConversionService.class);
|
this.service.readXml(VALID_XML.toURI(), ConversionService.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testUnmarshalWithoutType() throws URISyntaxException {
|
public void testUnmarshalWithoutType() throws URISyntaxException {
|
||||||
exception.expect(ConversionService.ConversionExeption.class);
|
this.exception.expect(ConversionService.ConversionExeption.class);
|
||||||
service.readXml(VALID_XML.toURI(), null);
|
this.service.readXml(VALID_XML.toURI(), null);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -33,10 +33,10 @@ import org.junit.Before;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.w3c.dom.Document;
|
import org.w3c.dom.Document;
|
||||||
|
|
||||||
|
import de.kosit.validationtool.api.AcceptRecommendation;
|
||||||
import de.kosit.validationtool.api.CheckConfiguration;
|
import de.kosit.validationtool.api.CheckConfiguration;
|
||||||
import de.kosit.validationtool.api.Input;
|
import de.kosit.validationtool.api.Input;
|
||||||
|
import de.kosit.validationtool.api.Result;
|
||||||
import net.sf.saxon.s9api.XdmNode;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test das Check-Interface
|
* Test das Check-Interface
|
||||||
|
|
@ -56,37 +56,51 @@ public class DefaultCheckTest {
|
||||||
|
|
||||||
@Before
|
@Before
|
||||||
public void setup() throws URISyntaxException {
|
public void setup() throws URISyntaxException {
|
||||||
CheckConfiguration d = new CheckConfiguration(SCENARIO_DEFINITION.toURI());
|
final CheckConfiguration d = new CheckConfiguration(SCENARIO_DEFINITION.toURI());
|
||||||
d.setScenarioRepository(new File("src/test/resources/examples/repository").toURI());
|
d.setScenarioRepository(new File("src/test/resources/examples/repository").toURI());
|
||||||
implementation = new DefaultCheck(d);
|
this.implementation = new DefaultCheck(d);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testHappyCase() throws Exception {
|
public void testHappyCase() {
|
||||||
final XdmNode doc = implementation.checkInput(read(VALID_EXAMPLE));
|
final Result doc = this.implementation.checkInput(read(VALID_EXAMPLE));
|
||||||
|
assertThat(doc).isNotNull();
|
||||||
|
assertThat(doc.getReport()).isNotNull();
|
||||||
|
assertThat(doc.isAcceptable()).isFalse();
|
||||||
|
assertThat(doc.getAcceptRecommendation()).isEqualTo(AcceptRecommendation.UNDEFINED);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testHappyCaseDocument() {
|
||||||
|
final Document doc = this.implementation.check(read(VALID_EXAMPLE));
|
||||||
assertThat(doc).isNotNull();
|
assertThat(doc).isNotNull();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testHappyCaseDocument() throws Exception {
|
public void testMultipleCase() {
|
||||||
final Document doc = implementation.check(read(VALID_EXAMPLE));
|
|
||||||
assertThat(doc).isNotNull();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testMultipleCase() throws Exception {
|
|
||||||
final List<Input> input = IntStream.range(0, MULTI_COUNT).mapToObj(i -> read(VALID_EXAMPLE)).collect(Collectors.toList());
|
final List<Input> input = IntStream.range(0, MULTI_COUNT).mapToObj(i -> read(VALID_EXAMPLE)).collect(Collectors.toList());
|
||||||
final List<XdmNode> docs = implementation.checkInput(input);
|
final List<Result> docs = this.implementation.checkInput(input);
|
||||||
assertThat(docs).isNotNull();
|
assertThat(docs).isNotNull();
|
||||||
assertThat(docs).hasSize(MULTI_COUNT);
|
assertThat(docs).hasSize(MULTI_COUNT);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testMultipleCaseDocument() throws Exception {
|
public void testMultipleCaseDocument() {
|
||||||
final List<Input> input = IntStream.range(0, MULTI_COUNT).mapToObj(i -> read(VALID_EXAMPLE)).collect(Collectors.toList());
|
final List<Input> input = IntStream.range(0, MULTI_COUNT).mapToObj(i -> read(VALID_EXAMPLE)).collect(Collectors.toList());
|
||||||
final List<Document> docs = implementation.check(input);
|
final List<Document> docs = this.implementation.check(input);
|
||||||
assertThat(docs).isNotNull();
|
assertThat(docs).isNotNull();
|
||||||
assertThat(docs).hasSize(MULTI_COUNT);
|
assertThat(docs).hasSize(MULTI_COUNT);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testExtractHtml() {
|
||||||
|
final DefaultResult doc = (DefaultResult) this.implementation.checkInput(read(VALID_EXAMPLE));
|
||||||
|
assertThat(doc).isNotNull();
|
||||||
|
assertThat(doc.getReport()).isNotNull();
|
||||||
|
assertThat(doc.isAcceptable()).isFalse();
|
||||||
|
assertThat(doc.extractHtmlAsString()).isNotEmpty();
|
||||||
|
assertThat(doc.extractHtmlAsElement()).isNotEmpty();
|
||||||
|
assertThat(doc.extractHtml()).isNotEmpty();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,6 @@ package de.kosit.validationtool.impl;
|
||||||
import static de.kosit.validationtool.api.InputFactory.read;
|
import static de.kosit.validationtool.api.InputFactory.read;
|
||||||
import static org.assertj.core.api.Assertions.assertThat;
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
|
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
|
|
@ -37,6 +36,8 @@ import de.kosit.validationtool.model.reportInput.XMLSyntaxError;
|
||||||
import net.sf.saxon.s9api.XdmNode;
|
import net.sf.saxon.s9api.XdmNode;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Testet die Document Parsing-Funktionalitäten.
|
||||||
|
*
|
||||||
* @author Andreas Penski
|
* @author Andreas Penski
|
||||||
*/
|
*/
|
||||||
public class DocumentParserTest {
|
public class DocumentParserTest {
|
||||||
|
|
@ -47,8 +48,6 @@ public class DocumentParserTest {
|
||||||
|
|
||||||
private static final URL NOT_EXISTING = ConversionServiceTest.class.getResource("/does not exist.xml");
|
private static final URL NOT_EXISTING = ConversionServiceTest.class.getResource("/does not exist.xml");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Rule
|
@Rule
|
||||||
public ExpectedException exception = ExpectedException.none();
|
public ExpectedException exception = ExpectedException.none();
|
||||||
|
|
||||||
|
|
@ -56,22 +55,21 @@ public class DocumentParserTest {
|
||||||
|
|
||||||
@Before
|
@Before
|
||||||
public void setup() {
|
public void setup() {
|
||||||
parser = new DocumentParseAction();
|
this.parser = new DocumentParseAction();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testSimple() throws IOException {
|
public void testSimple() {
|
||||||
final Result<XdmNode, XMLSyntaxError> result = parser.parseDocument(read(CONTENT));
|
final Result<XdmNode, XMLSyntaxError> result = DocumentParseAction.parseDocument(read(CONTENT));
|
||||||
assertThat(result).isNotNull();
|
assertThat(result).isNotNull();
|
||||||
assertThat(result.getObject()).isNotNull();
|
assertThat(result.getObject()).isNotNull();
|
||||||
assertThat(result.getErrors()).isEmpty();
|
assertThat(result.getErrors()).isEmpty();
|
||||||
assertThat(result.isValid()).isTrue();
|
assertThat(result.isValid()).isTrue();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testIllformed() throws IOException {
|
public void testIllformed() {
|
||||||
final Result<XdmNode, XMLSyntaxError> result = parser.parseDocument(read(ILLFORMED));
|
final Result<XdmNode, XMLSyntaxError> result = DocumentParseAction.parseDocument(read(ILLFORMED));
|
||||||
assertThat(result).isNotNull();
|
assertThat(result).isNotNull();
|
||||||
assertThat(result.getErrors()).isNotEmpty();
|
assertThat(result.getErrors()).isNotEmpty();
|
||||||
assertThat(result.getObject()).isNull();
|
assertThat(result.getObject()).isNull();
|
||||||
|
|
@ -80,10 +78,9 @@ public class DocumentParserTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testNullInput() {
|
public void testNullInput() {
|
||||||
exception.expect(IllegalArgumentException.class);
|
this.exception.expect(IllegalArgumentException.class);
|
||||||
parser.parseDocument(null);
|
DocumentParseAction.parseDocument(null);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -39,6 +39,23 @@ import net.sf.saxon.s9api.XdmNode;
|
||||||
*/
|
*/
|
||||||
public class Helper {
|
public class Helper {
|
||||||
|
|
||||||
|
public static class Simple {
|
||||||
|
|
||||||
|
public static final URI ROOT = EXAMPLES_DIR.resolve("simple/");
|
||||||
|
|
||||||
|
public static final URI SIMPLE_VALID = Simple.ROOT.resolve("input/simple.xml");
|
||||||
|
|
||||||
|
public static final URI FOO = Simple.ROOT.resolve("input/foo.xml");
|
||||||
|
|
||||||
|
public static final URI SCENARIOS = ROOT.resolve("scenarios.xml");
|
||||||
|
|
||||||
|
public static final URI REPOSITORY = ROOT.resolve("repository/");
|
||||||
|
|
||||||
|
public static final URI INVALID = ROOT.resolve("input/simple-invalid.xml");
|
||||||
|
|
||||||
|
public static final URI UNKNOWN = ROOT.resolve("input/unknown.xml");
|
||||||
|
}
|
||||||
|
|
||||||
public static final URI SOURCE_ROOT = Paths.get("src/main/resources").toUri();
|
public static final URI SOURCE_ROOT = Paths.get("src/main/resources").toUri();
|
||||||
|
|
||||||
public static final URI MODEL_ROOT = Paths.get("src/main/model").toUri();
|
public static final URI MODEL_ROOT = Paths.get("src/main/model").toUri();
|
||||||
|
|
@ -57,6 +74,8 @@ public class Helper {
|
||||||
|
|
||||||
public static final URI REPOSITORY = EXAMPLES_DIR.resolve("repository/");
|
public static final URI REPOSITORY = EXAMPLES_DIR.resolve("repository/");
|
||||||
|
|
||||||
|
public static final URL JAR_REPOSITORY = Helper.class.getClassLoader().getResource("xrechnung/repository/");
|
||||||
|
|
||||||
public static final URI NOT_EXISTING = EXAMPLES_DIR.resolve("doesnotexist");
|
public static final URI NOT_EXISTING = EXAMPLES_DIR.resolve("doesnotexist");
|
||||||
|
|
||||||
public static final URI SAMPLE_DIR = EXAMPLES_DIR.resolve("UBLReady/");
|
public static final URI SAMPLE_DIR = EXAMPLES_DIR.resolve("UBLReady/");
|
||||||
|
|
@ -73,18 +92,18 @@ public class Helper {
|
||||||
* @param url die url die geladen werden soll
|
* @param url die url die geladen werden soll
|
||||||
* @return ein result objekt mit Dokument
|
* @return ein result objekt mit Dokument
|
||||||
*/
|
*/
|
||||||
public static XdmNode load(URL url) {
|
public static XdmNode load(final URL url) {
|
||||||
try ( InputStream input = url.openStream() ) {
|
try ( final InputStream input = url.openStream() ) {
|
||||||
return ObjectFactory.createProcessor().newDocumentBuilder().build(new StreamSource(input));
|
return ObjectFactory.createProcessor().newDocumentBuilder().build(new StreamSource(input));
|
||||||
} catch (SaxonApiException | IOException e) {
|
} catch (final SaxonApiException | IOException e) {
|
||||||
throw new IllegalStateException("Fehler beim Laden der XML-Datei", e);
|
throw new IllegalStateException("Fehler beim Laden der XML-Datei", e);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static <T> T load(URL url, Class<T> type) throws URISyntaxException {
|
public static <T> T load(final URL url, final Class<T> type) throws URISyntaxException {
|
||||||
ConversionService c = new ConversionService();
|
final ConversionService c = new ConversionService();
|
||||||
c.initialize(de.kosit.validationtool.model.reportInput.ObjectFactory.class.getPackage(),
|
c.initialize(de.kosit.validationtool.model.reportInput.ObjectFactory.class.getPackage(),
|
||||||
de.kosit.validationtool.cmd.assertions.ObjectFactory.class.getPackage(),
|
de.kosit.validationtool.cmd.assertions.ObjectFactory.class.getPackage(),
|
||||||
de.kosit.validationtool.model.scenarios.ObjectFactory.class.getPackage());
|
de.kosit.validationtool.model.scenarios.ObjectFactory.class.getPackage());
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,7 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||||
|
|
||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
import java.net.URISyntaxException;
|
import java.net.URISyntaxException;
|
||||||
|
import java.net.URL;
|
||||||
|
|
||||||
import javax.xml.transform.Source;
|
import javax.xml.transform.Source;
|
||||||
import javax.xml.transform.TransformerException;
|
import javax.xml.transform.TransformerException;
|
||||||
|
|
@ -44,7 +45,7 @@ public class RelativeUriResolverTest {
|
||||||
static {
|
static {
|
||||||
try {
|
try {
|
||||||
BASE = RelativeUriResolver.class.getResource("/examples/assertions/").toURI();
|
BASE = RelativeUriResolver.class.getResource("/examples/assertions/").toURI();
|
||||||
} catch (URISyntaxException e) {
|
} catch (final URISyntaxException e) {
|
||||||
throw new IllegalStateException(e);
|
throw new IllegalStateException(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -56,19 +57,35 @@ public class RelativeUriResolverTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testSucces() throws TransformerException {
|
public void testSucces() throws TransformerException {
|
||||||
final Source resource = resolver.resolve("ubl-0001.xml", BASE.toASCIIString());
|
final Source resource = this.resolver.resolve("ubl-0001.xml", BASE.toASCIIString());
|
||||||
assertThat(resource).isNotNull();
|
assertThat(resource).isNotNull();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testNotExisting() throws TransformerException {
|
public void testNotExisting() throws TransformerException {
|
||||||
exception.expect(IllegalStateException.class);
|
this.exception.expect(IllegalStateException.class);
|
||||||
resolver.resolve("ubl-0001", BASE.toASCIIString());
|
this.resolver.resolve("ubl-0001", BASE.toASCIIString());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testOutOfPath() throws TransformerException {
|
public void testOutOfPath() throws TransformerException {
|
||||||
exception.expect(IllegalStateException.class);
|
this.exception.expect(IllegalStateException.class);
|
||||||
resolver.resolve("../results/report.xml", BASE.toASCIIString());
|
this.resolver.resolve("../results/report.xml", BASE.toASCIIString());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testClasspathLocal() throws URISyntaxException, TransformerException {
|
||||||
|
this.resolver = new RelativeUriResolver(RelativeUriResolver.class.getClassLoader().getResource("simple").toURI());
|
||||||
|
final URL moz = RelativeUriResolverTest.class.getClassLoader().getResource("simple/main.xsd");
|
||||||
|
final Source resolved = this.resolver.resolve("./resources/reference.xsd", moz.toURI().toASCIIString());
|
||||||
|
assertThat(resolved).isNotNull();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testClasspathJAR() throws URISyntaxException, TransformerException {
|
||||||
|
this.resolver = new RelativeUriResolver(RelativeUriResolver.class.getClassLoader().getResource("packaged").toURI());
|
||||||
|
final URL moz = RelativeUriResolverTest.class.getClassLoader().getResource("packaged/main.xsd");
|
||||||
|
final Source resolved = this.resolver.resolve("./resources/reference.xsd", moz.toURI().toASCIIString());
|
||||||
|
assertThat(resolved).isNotNull();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,7 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.net.URISyntaxException;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
|
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
|
|
@ -31,6 +32,7 @@ import org.junit.Rule;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.rules.ExpectedException;
|
import org.junit.rules.ExpectedException;
|
||||||
|
|
||||||
|
import de.kosit.validationtool.api.CheckConfiguration;
|
||||||
import de.kosit.validationtool.impl.model.Result;
|
import de.kosit.validationtool.impl.model.Result;
|
||||||
import de.kosit.validationtool.impl.tasks.DocumentParseAction;
|
import de.kosit.validationtool.impl.tasks.DocumentParseAction;
|
||||||
import de.kosit.validationtool.model.scenarios.ScenarioType;
|
import de.kosit.validationtool.model.scenarios.ScenarioType;
|
||||||
|
|
@ -57,46 +59,66 @@ public class ScenarioRepositoryTest {
|
||||||
|
|
||||||
@Before
|
@Before
|
||||||
public void setup() {
|
public void setup() {
|
||||||
content = new ContentRepository(ObjectFactory.createProcessor(), new File("src/test/resources/examples/repository").toURI());
|
this.content = new ContentRepository(ObjectFactory.createProcessor(), new File("src/test/resources/examples/repository").toURI());
|
||||||
Scenarios def = new Scenarios();
|
final Scenarios def = new Scenarios();
|
||||||
ScenarioType t = new ScenarioType();
|
final ScenarioType t = new ScenarioType();
|
||||||
t.setMatch("//*:name");
|
t.setMatch("//*:name");
|
||||||
t.setName("Test");
|
t.setName("Test");
|
||||||
t.initialize(content, true);
|
t.initialize(this.content, true);
|
||||||
def.getScenario().add(t);
|
def.getScenario().add(t);
|
||||||
repository = new ScenarioRepository(ObjectFactory.createProcessor(), content);
|
this.repository = new ScenarioRepository(this.content);
|
||||||
repository.initialize(def);
|
this.repository.initialize(def);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testHappyCase() throws Exception {
|
public void testHappyCase() throws Exception {
|
||||||
final Result<ScenarioType, String> scenario = repository.selectScenario(load(SAMPLE));
|
final Result<ScenarioType, String> scenario = this.repository.selectScenario(load(SAMPLE));
|
||||||
assertThat(scenario).isNotNull();
|
assertThat(scenario).isNotNull();
|
||||||
assertThat(scenario.isValid()).isTrue();
|
assertThat(scenario.isValid()).isTrue();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testNonMatch() throws Exception {
|
public void testNonMatch() throws Exception {
|
||||||
repository.getScenarios().getScenario().clear();
|
this.repository.getScenarios().getScenario().clear();
|
||||||
final Result<ScenarioType, String> scenario = repository.selectScenario(load(SAMPLE));
|
final ScenarioType fallback = new ScenarioType();
|
||||||
|
fallback.setName("fallback");
|
||||||
|
this.repository.setFallbackScenario(fallback);
|
||||||
|
final Result<ScenarioType, String> scenario = this.repository.selectScenario(load(SAMPLE));
|
||||||
assertThat(scenario).isNotNull();
|
assertThat(scenario).isNotNull();
|
||||||
assertThat(scenario.isValid()).isFalse();
|
assertThat(scenario.isValid()).isFalse();
|
||||||
|
assertThat(scenario.getObject().getName()).isEqualTo("fallback");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testMultiMatch() throws Exception {
|
public void testMultiMatch() throws Exception {
|
||||||
ScenarioType t = new ScenarioType();
|
final ScenarioType t = new ScenarioType();
|
||||||
t.setMatch("//*:name");
|
t.setMatch("//*:name");
|
||||||
t.setName("Test");
|
t.setName("Test");
|
||||||
t.initialize(content, true);
|
t.initialize(this.content, true);
|
||||||
repository.getScenarios().getScenario().add(t);
|
this.repository.getScenarios().getScenario().add(t);
|
||||||
final Result<ScenarioType, String> scenario = repository.selectScenario(load(SAMPLE));
|
final ScenarioType fallback = new ScenarioType();
|
||||||
|
fallback.setName("fallback");
|
||||||
|
this.repository.setFallbackScenario(fallback);
|
||||||
|
final Result<ScenarioType, String> scenario = this.repository.selectScenario(load(SAMPLE));
|
||||||
assertThat(scenario).isNotNull();
|
assertThat(scenario).isNotNull();
|
||||||
assertThat(scenario.isValid()).isFalse();
|
assertThat(scenario.isValid()).isFalse();
|
||||||
|
assertThat(scenario.getObject().getName()).isEqualTo("fallback");
|
||||||
}
|
}
|
||||||
|
|
||||||
private XdmNode load(URL url) throws IOException {
|
private static XdmNode load(final URL url) throws IOException {
|
||||||
DocumentParseAction p = new DocumentParseAction();
|
final DocumentParseAction p = new DocumentParseAction();
|
||||||
return p.parseDocument(read(url)).getObject();
|
return DocumentParseAction.parseDocument(read(url)).getObject();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void loadFromJar() throws URISyntaxException {
|
||||||
|
this.content = new ContentRepository(ObjectFactory.createProcessor(), Helper.JAR_REPOSITORY.toURI());
|
||||||
|
this.repository = new ScenarioRepository(this.content);
|
||||||
|
final CheckConfiguration conf = new CheckConfiguration(
|
||||||
|
ScenarioRepository.class.getClassLoader().getResource("xrechnung/scenarios.xml").toURI());
|
||||||
|
this.repository.initialize(conf);
|
||||||
|
assertThat(this.repository.getScenarios()).isNotNull();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,62 @@
|
||||||
|
package de.kosit.validationtool.impl;
|
||||||
|
|
||||||
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
|
|
||||||
|
import java.net.MalformedURLException;
|
||||||
|
import java.net.URISyntaxException;
|
||||||
|
|
||||||
|
import org.junit.Before;
|
||||||
|
import org.junit.Test;
|
||||||
|
|
||||||
|
import de.kosit.validationtool.api.AcceptRecommendation;
|
||||||
|
import de.kosit.validationtool.api.CheckConfiguration;
|
||||||
|
import de.kosit.validationtool.api.InputFactory;
|
||||||
|
import de.kosit.validationtool.api.Result;
|
||||||
|
import de.kosit.validationtool.impl.Helper.Simple;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Prüft die Funktionen des Validator auf Basis eines reduzierten Szenarios.
|
||||||
|
*
|
||||||
|
* @author Andreas Penski
|
||||||
|
*/
|
||||||
|
public class SimpleScenarioCheck {
|
||||||
|
|
||||||
|
private DefaultCheck implementation;
|
||||||
|
|
||||||
|
@Before
|
||||||
|
public void setup() throws URISyntaxException {
|
||||||
|
final CheckConfiguration d = new CheckConfiguration(Simple.SCENARIOS);
|
||||||
|
d.setScenarioRepository(Simple.REPOSITORY);
|
||||||
|
this.implementation = new DefaultCheck(d);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testSimple() throws MalformedURLException {
|
||||||
|
final Result result = this.implementation.checkInput(InputFactory.read(Simple.SIMPLE_VALID.toURL()));
|
||||||
|
assertThat(result).isNotNull();
|
||||||
|
assertThat(result.getAcceptRecommendation()).isEqualTo(AcceptRecommendation.ACCEPTABLE);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testInvalid() throws MalformedURLException {
|
||||||
|
final Result result = this.implementation.checkInput(InputFactory.read(Simple.INVALID.toURL()));
|
||||||
|
assertThat(result).isNotNull();
|
||||||
|
assertThat(result.getAcceptRecommendation()).isEqualTo(AcceptRecommendation.REJECT);
|
||||||
|
assertThat(result.getSchemaViolations()).isNotEmpty();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testUnknown() throws MalformedURLException {
|
||||||
|
final Result result = this.implementation.checkInput(InputFactory.read(Simple.UNKNOWN.toURL()));
|
||||||
|
assertThat(result).isNotNull();
|
||||||
|
assertThat(result.getAcceptRecommendation()).isEqualTo(AcceptRecommendation.REJECT);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testWithoutAcceptMatch() throws MalformedURLException {
|
||||||
|
final Result result = this.implementation.checkInput(InputFactory.read(Simple.FOO.toURL()));
|
||||||
|
assertThat(result).isNotNull();
|
||||||
|
assertThat(result.getAcceptRecommendation()).isEqualTo(AcceptRecommendation.UNDEFINED);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -21,7 +21,6 @@ package de.kosit.validationtool.impl;
|
||||||
|
|
||||||
import static org.assertj.core.api.Assertions.assertThat;
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
import java.net.URISyntaxException;
|
import java.net.URISyntaxException;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
|
|
||||||
|
|
@ -52,35 +51,33 @@ public class VersioningTest {
|
||||||
|
|
||||||
private ConversionService service;
|
private ConversionService service;
|
||||||
|
|
||||||
private ContentRepository repository;
|
|
||||||
|
|
||||||
@Before
|
@Before
|
||||||
public void setup() {
|
public void setup() {
|
||||||
service = new ConversionService();
|
this.service = new ConversionService();
|
||||||
repository = new ContentRepository(ObjectFactory.createProcessor(), new File("src/test/resources/examples/repository").toURI());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testBase() throws URISyntaxException {
|
public void testBase() throws URISyntaxException {
|
||||||
final Scenarios result = service.readXml(BASE.toURI(), Scenarios.class, repository.getScenarioSchema());
|
final Scenarios result = this.service.readXml(BASE.toURI(), Scenarios.class, ContentRepository.getScenarioSchema());
|
||||||
assertThat(result).isNotNull();
|
assertThat(result).isNotNull();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testFrameworkIncrement() throws URISyntaxException {
|
public void testFrameworkIncrement() throws URISyntaxException {
|
||||||
final Scenarios result = service.readXml(INCREMENT.toURI(), Scenarios.class, repository.getScenarioSchema());
|
final Scenarios result = this.service.readXml(INCREMENT.toURI(), Scenarios.class, ContentRepository.getScenarioSchema());
|
||||||
assertThat(result).isNotNull();
|
assertThat(result).isNotNull();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testNewFeature() throws URISyntaxException {
|
public void testNewFeature() throws URISyntaxException {
|
||||||
exception.expect(ConversionService.ConversionExeption.class);
|
this.exception.expect(ConversionService.ConversionExeption.class);
|
||||||
service.readXml(NEW_FEATURE.toURI(), Scenarios.class, repository.getScenarioSchema());
|
this.service.readXml(NEW_FEATURE.toURI(), Scenarios.class, ContentRepository.getScenarioSchema());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testNewVersion() throws URISyntaxException {
|
public void testNewVersion() throws URISyntaxException {
|
||||||
exception.expect(ConversionService.ConversionExeption.class);
|
this.exception.expect(ConversionService.ConversionExeption.class);
|
||||||
service.readXml(NEW_VERSION.toURI(), Scenarios.class, repository.getScenarioSchema());
|
this.service.readXml(NEW_VERSION.toURI(), Scenarios.class, ContentRepository.getScenarioSchema());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Binary file not shown.
5
src/test/resources/examples/simple/input/foo.xml
Normal file
5
src/test/resources/examples/simple/input/foo.xml
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
|
<foo xmlns="http://validator.kosit.de/test-sample">
|
||||||
|
<inner>asldkfj</inner>
|
||||||
|
</foo>
|
||||||
|
|
@ -0,0 +1,6 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
|
<simple xmlns="http://validator.kosit.de/test-sample">
|
||||||
|
<inner>asldkfj</inner>
|
||||||
|
<notAllowed />
|
||||||
|
</simple>
|
||||||
5
src/test/resources/examples/simple/input/simple.xml
Normal file
5
src/test/resources/examples/simple/input/simple.xml
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
|
<simple xmlns="http://validator.kosit.de/test-sample">
|
||||||
|
<inner>asldkfj</inner>
|
||||||
|
</simple>
|
||||||
5
src/test/resources/examples/simple/input/unknown.xml
Normal file
5
src/test/resources/examples/simple/input/unknown.xml
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
|
<existiertNicht xmlns="http://validator.kosit.de/unbekannt">
|
||||||
|
<inner>asldkfj</inner>
|
||||||
|
</existiertNicht>
|
||||||
44
src/test/resources/examples/simple/repository/report.xsl
Normal file
44
src/test/resources/examples/simple/repository/report.xsl
Normal file
|
|
@ -0,0 +1,44 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!--
|
||||||
|
~ 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.
|
||||||
|
-->
|
||||||
|
|
||||||
|
<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>
|
||||||
|
</report>
|
||||||
|
</xsl:template>
|
||||||
|
|
||||||
|
|
||||||
|
</xsl:stylesheet>
|
||||||
14
src/test/resources/examples/simple/repository/simple.xsd
Normal file
14
src/test/resources/examples/simple/repository/simple.xsd
Normal file
|
|
@ -0,0 +1,14 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<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"
|
||||||
|
xmlns="http://www.w3.org/1999/xhtml" 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" />
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
</xs:schema>
|
||||||
|
|
@ -18,50 +18,66 @@
|
||||||
~ under the License.
|
~ under the License.
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<scenarios xmlns="http://www.xoev.de/de/validator/framework/1/scenarios" frameworkVersion="1.1.1">
|
<scenarios xmlns="http://www.xoev.de/de/validator/framework/1/scenarios" frameworkVersion="1.1.2">
|
||||||
<name>XInneres</name>
|
<name>HTML-TestSuite</name>
|
||||||
<date>2017-08-08</date>
|
<date>2017-08-08</date>
|
||||||
<description>
|
<description>
|
||||||
<p>Prüft XInneres Nachrichten anhand der von uns offiziell herausgegebenen XML Schemata und Beispielen für mögliche weitergehende
|
<p>Szenario für Tests</p>
|
||||||
Prüfungen mit Schematron.
|
|
||||||
</p>
|
|
||||||
<p>Prüft elektronische Rechnungen im Format UBL 2.1</p>
|
|
||||||
</description>
|
</description>
|
||||||
|
|
||||||
<scenario>
|
<scenario>
|
||||||
<name>UBL 2.1 Invoice</name>
|
<name>Simple</name>
|
||||||
<namespace prefix="invoice">urn:oasis:names:specification:ubl:schema:xsd:Invoice-2</namespace>
|
<description>
|
||||||
<match>/invoice:Invoice</match>
|
<p>Nur Schemaprüfung.</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>/test:simple</match>
|
||||||
|
|
||||||
<validateWithXmlSchema>
|
<validateWithXmlSchema>
|
||||||
<resource>
|
<resource>
|
||||||
<name>UBL 2.1 Invoice</name>
|
<name>Sample Schema</name>
|
||||||
<location>resources/eRechnung/UBL-2.1/xsdrt/maindoc/UBL-Invoice-2.1.xsd</location>
|
<location>simple.xsd</location>
|
||||||
</resource>
|
</resource>
|
||||||
</validateWithXmlSchema>
|
</validateWithXmlSchema>
|
||||||
<validateWithSchematron>
|
|
||||||
<resource>
|
|
||||||
<name>BII Rules for Invoice</name>
|
|
||||||
<location>resources/eRechnung/UBL-2.1/xsl/BIIRULES-UBL-T10.xsl</location>
|
|
||||||
</resource>
|
|
||||||
</validateWithSchematron>
|
|
||||||
<validateWithSchematron>
|
|
||||||
<resource>
|
|
||||||
<name>openPEPPOL Rules for Invoice</name>
|
|
||||||
<location>resources/eRechnung/UBL-2.1/xsl/OPENPEPPOL-UBL-T10.xsl</location>
|
|
||||||
</resource>
|
|
||||||
</validateWithSchematron>
|
|
||||||
<createReport>
|
<createReport>
|
||||||
<resource>
|
<resource>
|
||||||
<name>Report für eRechnung</name>
|
<name>Report für eRechnung</name>
|
||||||
<location>resources/eRechnung/report.xsl</location>
|
<location>report.xsl</location>
|
||||||
|
</resource>
|
||||||
|
</createReport>
|
||||||
|
<acceptMatch>count(//cri:xmlSyntaxError) = 0</acceptMatch>
|
||||||
|
</scenario>
|
||||||
|
|
||||||
|
<scenario>
|
||||||
|
<name>NoAcceptMatch</name>
|
||||||
|
<description>
|
||||||
|
<p>Nur Schemaprüfung. Keine AcceptMatch deklaration</p>
|
||||||
|
<p>Testen, ob auch alte Konfiguration funktionioeren</p>
|
||||||
|
</description>
|
||||||
|
<namespace prefix="test">http://validator.kosit.de/test-sample</namespace>
|
||||||
|
<match>/test:foo</match>
|
||||||
|
|
||||||
|
<validateWithXmlSchema>
|
||||||
|
<resource>
|
||||||
|
<name>Sample Schema</name>
|
||||||
|
<location>simple.xsd</location>
|
||||||
|
</resource>
|
||||||
|
</validateWithXmlSchema>
|
||||||
|
<createReport>
|
||||||
|
<resource>
|
||||||
|
<name>Report für eRechnung</name>
|
||||||
|
<location>report.xsl</location>
|
||||||
</resource>
|
</resource>
|
||||||
</createReport>
|
</createReport>
|
||||||
</scenario>
|
</scenario>
|
||||||
|
|
||||||
|
|
||||||
<noScenarioReport>
|
<noScenarioReport>
|
||||||
<resource>
|
<resource>
|
||||||
<name>default</name>
|
<name>default</name>
|
||||||
<location>resources/eRechnung/default-report.xsl</location>
|
<location>report.xsl</location>
|
||||||
</resource>
|
</resource>
|
||||||
</noScenarioReport>
|
</noScenarioReport>
|
||||||
|
|
||||||
12
src/test/resources/simple/main.xsd
Normal file
12
src/test/resources/simple/main.xsd
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<schema xmlns:ref="http://www.example.org/reference" xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.example.org/main"
|
||||||
|
elementFormDefault="qualified">
|
||||||
|
|
||||||
|
<import namespace="http://www.example.org/reference" schemaLocation="./resources/reference.xsd" />
|
||||||
|
|
||||||
|
<complexType name="MainType">
|
||||||
|
<sequence>
|
||||||
|
<element name="ref" type="ref:ReferenzTyp"></element>
|
||||||
|
</sequence>
|
||||||
|
</complexType>
|
||||||
|
</schema>
|
||||||
9
src/test/resources/simple/resources/reference.xsd
Normal file
9
src/test/resources/simple/resources/reference.xsd
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.example.org/reference" xmlns:tns="http://www.example.org/reference" elementFormDefault="qualified">
|
||||||
|
|
||||||
|
<complexType name="ReferenzTyp">
|
||||||
|
<sequence>
|
||||||
|
<element name="some" type="string"></element>
|
||||||
|
</sequence>
|
||||||
|
</complexType>
|
||||||
|
</schema>
|
||||||
Loading…
Add table
Add a link
Reference in a new issue