mirror of
https://github.com/itplr-kosit/validator.git
synced 2026-05-25 16:55:39 +00:00
commit
2382445b7a
98 changed files with 29308 additions and 0 deletions
34
.gitignore
vendored
Normal file
34
.gitignore
vendored
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
# Created by .ignore support plugin (hsz.mobi)
|
||||
### Java template
|
||||
# Compiled class file
|
||||
*.class
|
||||
|
||||
# Log file
|
||||
*.log
|
||||
.idea
|
||||
*.iml
|
||||
|
||||
# Mobile Tools for Java (J2ME)
|
||||
.mtj.tmp/
|
||||
|
||||
# Package Files #
|
||||
*.jar
|
||||
src/test/generated
|
||||
|
||||
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
|
||||
hs_err_pid*
|
||||
### Maven template
|
||||
target/
|
||||
pom.xml.tag
|
||||
pom.xml.releaseBackup
|
||||
pom.xml.versionsBackup
|
||||
pom.xml.next
|
||||
release.properties
|
||||
dependency-reduced-pom.xml
|
||||
buildNumber.properties
|
||||
.mvn/timing.properties
|
||||
src/generated
|
||||
|
||||
# Avoid ignoring Maven wrapper jar file (.jar files are usually ignored)
|
||||
!/.mvn/wrapper/maven-wrapper.jar
|
||||
|
||||
5
NOTICE
Normal file
5
NOTICE
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
KoSIT Prüf-Tool
|
||||
Copyright 2017 Koordinierungsstelle für IT-Standards
|
||||
|
||||
This product includes software developed by
|
||||
Koordinierungsstelle für IT-Standards (http://www.kosit.de/).
|
||||
104
README.md
Normal file
104
README.md
Normal file
|
|
@ -0,0 +1,104 @@
|
|||
## Inhaltsverzeichnis
|
||||
|
||||
- [Über das Prütool](#über-das-prüftool)
|
||||
- [Status](#status)
|
||||
- [Verwendung](#verwendung)
|
||||
- [Build-Anweisungen](#build-anweisungen)
|
||||
- [Konfiguration xRechnung](#konfiguration-xrechnung)
|
||||
|
||||
|
||||
## Über das Prüftool
|
||||
* macht die KoSIT
|
||||
## Status
|
||||
|
||||
## Verwendung
|
||||
Das Prüftool steht in zwei Varianten zur Verfügung:
|
||||
- als [**Standalone-Version**](#verwendung-als-anwendung), die von der Kommandozeile aus aufgerufen werden kann
|
||||
- als [**Bibliothek**](#verwendung-als-bibliothek), die in eigene Anwendungen integriert werden kann
|
||||
|
||||
### Verwendung als Standalone-Anwendung
|
||||
```java -jar validationtool-<version>-standalone.jar -s <scenario-config-file> [OPTIONS] [FILE]...```
|
||||
|
||||
Eine Liste der möglichen Optionen kann der Hilfe entnommen werden. Diese steht mit folgendem Projektaufruf zur Verfügung
|
||||
|
||||
```java -jar validationtool-<version>-standalone.jar --help```
|
||||
|
||||
### Verwendung als Bibliothek
|
||||
Daneben kann das Prüftool auch in eigene Anwendungen integriert werden.
|
||||
|
||||
Die Bibliothek steht im Maven-Central-Repository zur Verfügung und kann mit kompatiblen Build-Tools genutzt werden.
|
||||
|
||||
* Maven
|
||||
```
|
||||
<dependency>
|
||||
<groupId>de.kosit</groupId>
|
||||
<artifactId>validationtool</artifactId>
|
||||
<version>1.0.0</version>
|
||||
</dependency>
|
||||
```
|
||||
* Gradle
|
||||
```
|
||||
dependencies {
|
||||
compile group: 'de.kosit', name: 'validationtool', version: '1.0.0'
|
||||
}
|
||||
```
|
||||
|
||||
Voraussetzung für die Verwendung ist eine valide Prüfszenarien-Definition (xml-Datei) und das dazugehörige Repository
|
||||
mit den von den definierten Szenarien benötigten Artefakten. Der folgende Quellcode zeigt die Erzeugung einer neuen Prüf-Instanz:
|
||||
|
||||
```java
|
||||
//Vorbereitung der Konfiguration
|
||||
URI scenarios = URI.create("scenarios.xml");
|
||||
CheckConfiguration config = new CheckConfiguration();
|
||||
config.setScenarioDefinition(scenarios);
|
||||
|
||||
//Instantiierung der DefaultCheck-Implementierung
|
||||
Check check = new DefaultCheck(config);
|
||||
```
|
||||
|
||||
Weitere Konfigurationsoption ist der Pfad zum Repository. Standardmäßig wird das Repository relativ zur Szenarien-Defintion
|
||||
aufgelöst.
|
||||
|
||||
Die so erzeugte Prüfinstanz initialisiert sämtliche Szenarien und deren Prüfartefakte. Ein etwaiger Konfigurationsfehler
|
||||
wird frühzeitig mitgeteilt.
|
||||
|
||||
Die eigentlich Prüfung erfolgt mit den beiden Methoden des `Check`-Interfaces:
|
||||
|
||||
```java
|
||||
...
|
||||
Check pruefer = new DefaultCheck(config);
|
||||
|
||||
//einzelne Datei prüfen
|
||||
Input pruefKandidat = InputFactory.read(new File("rechnung.xml"));
|
||||
Document report = pruefer.check(pruefKandidat);
|
||||
|
||||
//Batch-Prüfung
|
||||
List<File> files = Files.list(Paths.get("rechnungen")).map(path -> path.toFile()).collect(Collectors.toList());
|
||||
List<Input> toCheck = files.stream().map(InputFactory::read).collect(Collectors.toList());
|
||||
List<Document> reports = pruefer.check(toCheck);
|
||||
|
||||
```
|
||||
|
||||
Eine einmal initialisierte Prüfinstanz ist **threadsafe** und kann beliebig oft wieder verwendet
|
||||
werden. XML-Artefakte wie Schema oder XSLT-Executables werden bei Instantiierung des `DefaultCheck` initialisiert und
|
||||
wiederverwendet. Da diese Objekte relativ aufwändig zu Erzeugen sind, empfielt sich die Wiederverwendung der `Check`-Instanz.
|
||||
|
||||
Die Batch-Verarbeitung erfolgt grundsätzlich seriell. Der `DefaultCheck` implementiert **keine Parallelverarbeitung**.
|
||||
|
||||
Einziges Eingabeobjekt ist `Input`, welches sich mit den verschiedenen Methoden der `InputFactory` aus div. Eingabe-Resourcen
|
||||
erzeugen lässt. Die InputFactory erzeugt für jedes Eingabe-Objekt eine Prüfsumme, die im Report mitgeführt wird. Der
|
||||
verwendete Algorithmus ist über die `read`-Methoden der `InputFactory` definierbar. Standardmäßig wird _SHA-256_ des JDK
|
||||
verwendet
|
||||
|
||||
### Build-Anweisungen
|
||||
Das Projekt wird mit Apache Maven gebaut.
|
||||
|
||||
Mittels `mvn install` wird standardmäßig die Bibliotheks-Variante gebaut. Diese enthält nur die Klassen und
|
||||
Komponenten für die Prüfung. Abhängigkeiten müssen durch die einbindende Anwendung aufgelöst werden (maven).
|
||||
|
||||
Ein `mvn install -Pstandalone` baut die Standalone-Variante. Diese Variante enthält zusätzlich Klassen zur Verarbeitung
|
||||
von Eingaben aus der Kommandozeile, sowie für Ausgabeoptionen für Ergebnisse. Darüberhinaus ist diese als sog.
|
||||
Uber-Jar gebaut, sodass sämtliche Abhängigkeiten im Jar gebundlet sind und das Jar-File somit 'lauffähig' ist.
|
||||
|
||||
### Konfiguration xRechnung
|
||||
|
||||
334
pom.xml
Normal file
334
pom.xml
Normal file
|
|
@ -0,0 +1,334 @@
|
|||
<?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.
|
||||
-->
|
||||
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<prerequisites>
|
||||
<maven>3.0</maven>
|
||||
</prerequisites>
|
||||
<groupId>de.kosit</groupId>
|
||||
<artifactId>validationtool</artifactId>
|
||||
<version>1.0.0</version>
|
||||
<name>KoSIT XML Prüftool</name>
|
||||
<description>KoSIT XML Prüftool zur Prüfung von XML Dateien gegenüber definierten Szenarien.</description>
|
||||
<developers>
|
||||
<developer>
|
||||
<id>andreas.penski</id>
|
||||
<name>Andreas Penski</name>
|
||||
<organization>]init[ AG</organization>
|
||||
<organizationUrl>https://www.init.de</organizationUrl>
|
||||
</developer>
|
||||
<developer>
|
||||
<id>fabian.buettner</id>
|
||||
<name>Fabian Büttner</name>
|
||||
<organization>KoSIT</organization>
|
||||
<organizationUrl>http://www.kosit.de</organizationUrl>
|
||||
</developer>
|
||||
</developers>
|
||||
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<version.jacoco>0.7.9</version.jacoco>
|
||||
<version.lombok>1.16.16</version.lombok>
|
||||
<version.saxon-he>9.7.0-15</version.saxon-he>
|
||||
<version.slf4j>1.7.25</version.slf4j>
|
||||
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
<version>${version.lombok}</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.sf.saxon</groupId>
|
||||
<artifactId>Saxon-HE</artifactId>
|
||||
<version>${version.saxon-he}</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>slf4j-api</artifactId>
|
||||
<version>${version.slf4j}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-cli</groupId>
|
||||
<artifactId>commons-cli</artifactId>
|
||||
<version>1.4</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
<version>3.5</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.assertj</groupId>
|
||||
<artifactId>assertj-core</artifactId>
|
||||
<version>3.8.0</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>4.12</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>slf4j-simple</artifactId>
|
||||
<version>1.7.25</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-io</artifactId>
|
||||
<version>1.3.2</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<profiles>
|
||||
<profile>
|
||||
<id>full-distribution</id>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<version>2.3.1</version>
|
||||
<configuration>
|
||||
<classifier>full</classifier>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
<profile>
|
||||
<id>standalone</id>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>slf4j-simple</artifactId>
|
||||
<version>1.7.22</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-assembly-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>single</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<archive>
|
||||
<manifest>
|
||||
<mainClass>
|
||||
de.kosit.validationtool.cmd.CommandLineApplication
|
||||
</mainClass>
|
||||
</manifest>
|
||||
</archive>
|
||||
<descriptors>
|
||||
<descriptor>src/main/assembly/standalone-assembly.xml</descriptor>
|
||||
</descriptors>
|
||||
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<version>2.3.1</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>default-jar</id>
|
||||
<phase>none</phase>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
</profiles>
|
||||
|
||||
<build>
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>src/main/model</directory>
|
||||
</resource>
|
||||
</resources>
|
||||
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.6.1</version>
|
||||
<configuration>
|
||||
<source>1.8</source>
|
||||
<target>1.8</target>
|
||||
<encoding>UTF-8</encoding>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<version>2.20</version>
|
||||
<configuration>
|
||||
|
||||
<forkMode>always</forkMode>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<version>2.3.1</version>
|
||||
<configuration>
|
||||
<excludes>
|
||||
<exclude>simplelogger.properties</exclude>
|
||||
<exclude>de/kosit/validationtool/cmd/**</exclude>
|
||||
</excludes>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<!-- Integrate the /src/main/generated folder -->
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>build-helper-maven-plugin</artifactId>
|
||||
<version>1.1</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>add-source</id>
|
||||
<phase>generate-sources</phase>
|
||||
<goals>
|
||||
<goal>add-source</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<sources>
|
||||
<source>src/generated/java</source>
|
||||
</sources>
|
||||
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<!-- Generate model classes -->
|
||||
<plugin>
|
||||
<groupId>org.jvnet.jaxb2.maven2</groupId>
|
||||
<artifactId>maven-jaxb2-plugin</artifactId>
|
||||
<version>0.13.2</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>generate</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
<configuration>
|
||||
<extension>true</extension>
|
||||
<schemaDirectory>src/main/model/xsd</schemaDirectory>
|
||||
<bindingDirectory>src/main/model/binding</bindingDirectory>
|
||||
<generateDirectory>src/generated/java</generateDirectory>
|
||||
<packageLevelAnnotations>false</packageLevelAnnotations>
|
||||
<args>
|
||||
<arg>-Xinheritance</arg>
|
||||
</args>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.jvnet.jaxb2_commons</groupId>
|
||||
<artifactId>jaxb2-basics</artifactId>
|
||||
<version>0.11.1</version>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
<!-- Integrate code coverage -->
|
||||
<plugin>
|
||||
<groupId>org.jacoco</groupId>
|
||||
<artifactId>jacoco-maven-plugin</artifactId>
|
||||
<version>${version.jacoco}</version>
|
||||
<configuration>
|
||||
<excludes>
|
||||
<exclude>**/validationtool/model/**</exclude>
|
||||
<exclude>**/validationtool/cmd/assertions/**</exclude>
|
||||
</excludes>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>prepareJacocoJUnitArgLine</id>
|
||||
<goals>
|
||||
<goal>prepare-agent</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<propertyName>jacocoArgumentsJUnit</propertyName>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>generateJacocoReport</id>
|
||||
<goals>
|
||||
<goal>report</goal>
|
||||
</goals>
|
||||
<phase>verify</phase>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<version>2.10</version>
|
||||
<configuration>
|
||||
<!--suppress MavenModelInspection -->
|
||||
<argLine>-Dfile.encoding=UTF-8 ${jacocoArgumentsJUnit}</argLine>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-source-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>attach-sources</id>
|
||||
<goals>
|
||||
<goal>jar</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-release-plugin</artifactId>
|
||||
<version>2.5.3</version>
|
||||
<configuration>
|
||||
<tagNameFormat>v@{project.version}</tagNameFormat>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
||||
37
src/main/assembly/standalone-assembly.xml
Normal file
37
src/main/assembly/standalone-assembly.xml
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
<!--
|
||||
~ 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.
|
||||
-->
|
||||
|
||||
<assembly>
|
||||
<id>standalone</id>
|
||||
<formats>
|
||||
<format>jar</format>
|
||||
</formats>
|
||||
<includeBaseDirectory>false</includeBaseDirectory>
|
||||
<dependencySets>
|
||||
<dependencySet>
|
||||
<unpack>true</unpack>
|
||||
<scope>runtime</scope>
|
||||
</dependencySet>
|
||||
</dependencySets>
|
||||
<fileSets>
|
||||
<fileSet>
|
||||
<directory>${project.build.outputDirectory}</directory>
|
||||
</fileSet>
|
||||
</fileSets>
|
||||
</assembly>
|
||||
53
src/main/java/de/kosit/validationtool/api/Check.java
Normal file
53
src/main/java/de/kosit/validationtool/api/Check.java
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
package de.kosit.validationtool.api;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.w3c.dom.Document;
|
||||
|
||||
/**
|
||||
* Zentrale Schnittstellendefinition für das Prüf-Tool.
|
||||
*
|
||||
* @author Andreas Penski
|
||||
*/
|
||||
public interface Check {
|
||||
|
||||
/**
|
||||
* Führt die konfigurierte Prüfung für die übergebene Resource aus.
|
||||
*
|
||||
* @param input die Resource / XML-Datei, die geprüft werden soll.
|
||||
* @return ein Ergebnis-{@link Document}
|
||||
*/
|
||||
Document check(Input input);
|
||||
|
||||
|
||||
/**
|
||||
* Führt eine Prüfung im Batch-Mode durch. Die Default-Implementierung führt die Prüfung sequentiell aus.
|
||||
*
|
||||
* @param input die Eingabe
|
||||
* @return Liste mit Ergebnis-Dokumenten
|
||||
*/
|
||||
default List<Document> check(List<Input> input) {
|
||||
return input.stream().map(i -> check(i)).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,68 @@
|
|||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
package de.kosit.validationtool.api;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.Setter;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.net.URI;
|
||||
|
||||
/**
|
||||
* Zentrale Konfigration einer Prüf-Instanz.
|
||||
*
|
||||
* @author Andreas Penski
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@Slf4j
|
||||
@RequiredArgsConstructor
|
||||
public class CheckConfiguration {
|
||||
|
||||
/**
|
||||
* URL, die auf die scenerio.xml Datei zeigt.
|
||||
*/
|
||||
private final URI scenarioDefinition;
|
||||
|
||||
/**
|
||||
* Root-Ordner mit den von den einzelnen Szenarien benötigten Dateien
|
||||
*/
|
||||
private URI scenarioRepository;
|
||||
|
||||
|
||||
/**
|
||||
* Liefert das Repository mit den Artefakten der einzelnen Szenarien.
|
||||
*
|
||||
* @return uri die durch entsprechende resolver aufgelöst werden kann
|
||||
*/
|
||||
public URI getScenarioRepository() {
|
||||
if (scenarioRepository == null) {
|
||||
scenarioRepository = createDefaultRepository();
|
||||
}
|
||||
return scenarioRepository;
|
||||
}
|
||||
|
||||
private URI createDefaultRepository() {
|
||||
log.info("Creating default scenario repository (alongside scenario definition)");
|
||||
return scenarioDefinition.resolve(".");
|
||||
}
|
||||
|
||||
}
|
||||
45
src/main/java/de/kosit/validationtool/api/Input.java
Normal file
45
src/main/java/de/kosit/validationtool/api/Input.java
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
package de.kosit.validationtool.api;
|
||||
|
||||
import lombok.AccessLevel;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
/**
|
||||
* Eine Datei in eingelesener Form.
|
||||
*
|
||||
* @author apenski
|
||||
*/
|
||||
@Getter
|
||||
@RequiredArgsConstructor (access = AccessLevel.PACKAGE)
|
||||
@AllArgsConstructor (access = AccessLevel.PACKAGE)
|
||||
public class Input {
|
||||
|
||||
private final byte[] content;
|
||||
|
||||
private final String name;
|
||||
|
||||
private byte[] hashCode;
|
||||
|
||||
private String digestAlgorithm;
|
||||
|
||||
}
|
||||
244
src/main/java/de/kosit/validationtool/api/InputFactory.java
Normal file
244
src/main/java/de/kosit/validationtool/api/InputFactory.java
Normal file
|
|
@ -0,0 +1,244 @@
|
|||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
package de.kosit.validationtool.api;
|
||||
|
||||
import static org.apache.commons.lang3.StringUtils.isNotEmpty;
|
||||
|
||||
import java.io.*;
|
||||
import java.net.URL;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.security.DigestInputStream;
|
||||
import java.security.MessageDigest;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
|
||||
import javax.xml.bind.DatatypeConverter;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* Service zum Einlesen des Test-Objekts in den Speicher. Beim Einlesen wird gleichzeitig eine Prüfsumme ermittelt und
|
||||
* mit dem Ergebnis mitgeführt.
|
||||
*
|
||||
* @author Andreas Penski
|
||||
*/
|
||||
@Slf4j
|
||||
public class InputFactory {
|
||||
|
||||
static final String DEFAULT_ALGORITH = "SHA-256";
|
||||
|
||||
private static final int EOF = -1;
|
||||
|
||||
private static final int DEFAULT_BUFFER_SIZE = 4096;
|
||||
|
||||
public static final String MESSAGE_OPEN_STREAM_ERROR = "Can not open stream from";
|
||||
|
||||
@Getter
|
||||
private final String algorithm;
|
||||
|
||||
InputFactory() {
|
||||
this(null);
|
||||
}
|
||||
|
||||
InputFactory(String specifiedAlgorithm) {
|
||||
this.algorithm = isNotEmpty(specifiedAlgorithm) ? specifiedAlgorithm : DEFAULT_ALGORITH;
|
||||
createDigest();
|
||||
}
|
||||
|
||||
/**
|
||||
* Liest einen Prüfling von dem übergebenen Pfad. Es wird der Default-Prüfsummenalgorithmus zur Ermittlung der Prüfsumme
|
||||
* genutzt.
|
||||
*
|
||||
* @param path der Prüflings
|
||||
* @return ein Prüf-Eingabe-Objekt
|
||||
*/
|
||||
public static Input read(Path path) {
|
||||
return read(path, DEFAULT_ALGORITH);
|
||||
}
|
||||
|
||||
/**
|
||||
* Liest einen Prüfling von der übergebenen URL. Es wird ein definierter Algorithmis zur Ermittlung der Prüfsumme
|
||||
* genutzt.
|
||||
*
|
||||
* @param path der Prüflings
|
||||
* @param digestAlgorithm der Prüfsummenalgorithmus
|
||||
* @return ein Prüf-Eingabe-Objekt
|
||||
*/
|
||||
public static Input read(Path path, String digestAlgorithm) {
|
||||
checkNull(path);
|
||||
try ( InputStream stream = Files.newInputStream(path) ) {
|
||||
return read(stream, path.toString(), digestAlgorithm);
|
||||
} catch (IOException e) {
|
||||
throw new IllegalArgumentException(MESSAGE_OPEN_STREAM_ERROR + path, e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Liest einen Prüfling von der übergebenen Datei. Es wird der Default-Prüfsummenalgorithmus zur Ermittlung der
|
||||
* Prüfsumme genutzt.
|
||||
*
|
||||
* @param file der Prüflings
|
||||
* @return ein Prüf-Eingabe-Objekt
|
||||
*/
|
||||
public static Input read(File file) {
|
||||
return read(file, DEFAULT_ALGORITH);
|
||||
}
|
||||
|
||||
/**
|
||||
* Liest einen Prüfling von der übergebenen URL. Es wird der Default-Prüfsummenalgorithmus zur Ermittlung der Prüfsumme
|
||||
* genutzt.
|
||||
*
|
||||
* @param url URL des Prüflings
|
||||
* @return ein Prüf-Eingabe-Objekt
|
||||
*/
|
||||
public static Input read(URL url) {
|
||||
return read(url, DEFAULT_ALGORITH);
|
||||
}
|
||||
|
||||
/**
|
||||
* Liest einen Prüfling von der übergebenen URL. Es wird ein definierter Algorithmis zur Ermittlung der Prüfsumme
|
||||
* genutzt.
|
||||
*
|
||||
* @param url URL des Prüflings
|
||||
* @param digestAlgorithm der Prüfsummenalgorithmus
|
||||
* @return ein Prüf-Eingabe-Objekt
|
||||
*/
|
||||
public static Input read(URL url, String digestAlgorithm) {
|
||||
checkNull(url);
|
||||
try {
|
||||
return read(url.openStream(), url.getFile(), digestAlgorithm);
|
||||
} catch (IOException e) {
|
||||
throw new IllegalArgumentException(MESSAGE_OPEN_STREAM_ERROR + url, e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Liest einen Prüfling von der übergebenen URL. Es wird ein definierter Algorithmis zur Ermittlung der Prüfsumme
|
||||
* genutzt.
|
||||
*
|
||||
* @param file der Prüflings
|
||||
* @param digestAlgorithm der Prüfsummenalgorithmus
|
||||
* @return ein Prüf-Eingabe-Objekt
|
||||
*/
|
||||
public static Input read(File file, String digestAlgorithm) {
|
||||
checkNull(file);
|
||||
try {
|
||||
return read(file.toURI().toURL(), digestAlgorithm);
|
||||
} catch (IOException e) {
|
||||
throw new IllegalArgumentException(MESSAGE_OPEN_STREAM_ERROR + file, e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Liest einen Prüfling von der übergebenen byte-Sequenz. Es wird ein definierter Algorithmis zur Ermittlung der
|
||||
* Prüfsumme genutzt.
|
||||
*
|
||||
* @param input URL des Prüflings
|
||||
* @return ein Prüf-Eingabe-Objekt
|
||||
*/
|
||||
public static Input read(byte[] input, String name) {
|
||||
checkNull(input);
|
||||
return read(input, name, DEFAULT_ALGORITH);
|
||||
}
|
||||
|
||||
/**
|
||||
* Liest einen Prüfling von der übergebenen byte-Sequenz. Es wird ein definierter Algorithmis zur Ermittlung der
|
||||
* Prüfsumme genutzt.
|
||||
*
|
||||
* @param input URL des Prüflings
|
||||
* @param digestAlgorithm der Prüfsummenalgorithmus
|
||||
* @return ein Prüf-Eingabe-Objekt
|
||||
*/
|
||||
public static Input read(byte[] input, String name, String digestAlgorithm) {
|
||||
checkNull(input);
|
||||
return read(new ByteArrayInputStream(input), name, digestAlgorithm);
|
||||
}
|
||||
|
||||
private static void checkNull(Object input) {
|
||||
if (input == null) {
|
||||
throw new IllegalArgumentException("Input can not be null");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Liest einen Prüfling vom übergebenen {@link InputStream}.
|
||||
*
|
||||
* @param inputStream der {@link InputStream}
|
||||
* @param name der Name/Bezeichner des Prüflings
|
||||
* @return einen Prüfling in eingelesener Form
|
||||
*/
|
||||
public static Input read(InputStream inputStream, String name) {
|
||||
return read(inputStream, name, DEFAULT_ALGORITH);
|
||||
}
|
||||
|
||||
/**
|
||||
* Liest einen Prüfling vom übergebenen {@link InputStream}.
|
||||
*
|
||||
* @param inputStream der {@link InputStream}
|
||||
* @param name der Name/Bezeichner des Prüflings
|
||||
* @param digestAlgorithm der Prüfsummenalgorithmus
|
||||
* @return einen Prüfling in eingelesener Form
|
||||
*/
|
||||
public static Input read(InputStream inputStream, String name, String digestAlgorithm) {
|
||||
return new InputFactory(digestAlgorithm).readStream(inputStream, name);
|
||||
}
|
||||
|
||||
private Input readStream(InputStream inputStream, String name) {
|
||||
if (StringUtils.isNotBlank(name)) {
|
||||
log.debug("Generating hashcode for {} using {} algorithm", name, getAlgorithm());
|
||||
MessageDigest digest = createDigest();
|
||||
byte[] buffer = new byte[DEFAULT_BUFFER_SIZE];
|
||||
try ( BufferedInputStream bis = new BufferedInputStream(inputStream);
|
||||
DigestInputStream dis = new DigestInputStream(bis, digest);
|
||||
ByteArrayOutputStream out = new ByteArrayOutputStream() ) {
|
||||
|
||||
// read the file and update the hash calculation
|
||||
int n;
|
||||
while (EOF != (n = dis.read(buffer))) {
|
||||
out.write(buffer, 0, n);
|
||||
}
|
||||
// get the hash value as byte array
|
||||
byte[] hash = digest.digest();
|
||||
log.debug("Generated hashcode for {} is {}", name, DatatypeConverter.printHexBinary(hash));
|
||||
out.flush();
|
||||
return new Input(out.toByteArray(), name, hash, digest.getAlgorithm());
|
||||
} catch (IOException e) {
|
||||
throw new IllegalArgumentException(MESSAGE_OPEN_STREAM_ERROR + name, e);
|
||||
}
|
||||
} else {
|
||||
throw new IllegalArgumentException("Must supply a valid name/identifier for the input");
|
||||
}
|
||||
}
|
||||
|
||||
private MessageDigest createDigest() {
|
||||
try {
|
||||
MessageDigest digest;
|
||||
digest = MessageDigest.getInstance(getAlgorithm());
|
||||
return digest;
|
||||
} catch (NoSuchAlgorithmException e) {
|
||||
// should not happen
|
||||
throw new IllegalStateException(String.format("Specified method %s is not available", getAlgorithm()), e);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,132 @@
|
|||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
package de.kosit.validationtool.cmd;
|
||||
|
||||
import de.kosit.validationtool.cmd.assertions.AssertionType;
|
||||
import de.kosit.validationtool.cmd.assertions.Assertions;
|
||||
import de.kosit.validationtool.impl.model.Result;
|
||||
import de.kosit.validationtool.impl.tasks.CheckAction;
|
||||
import lombok.AccessLevel;
|
||||
import lombok.Getter;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import net.sf.saxon.s9api.*;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.w3c.dom.Document;
|
||||
|
||||
import javax.xml.transform.dom.DOMSource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Überprüft den Report mittels bereitgestellter Assertions. Diese {@link CheckAction} dient der Überprüfung der von der
|
||||
* KoSIT bereitgestellten Prüfszenarien und den darin enthaltenen Artefakten.
|
||||
*
|
||||
* @author Andreas Penski
|
||||
*/
|
||||
@Slf4j
|
||||
@RequiredArgsConstructor
|
||||
public class CheckAssertionAction implements CheckAction {
|
||||
|
||||
private final Assertions assertions;
|
||||
|
||||
@Getter(AccessLevel.PRIVATE)
|
||||
private final Processor processor;
|
||||
|
||||
private Map<String, List<AssertionType>> mappedAssertions;
|
||||
|
||||
private static boolean matches(String key, String name) {
|
||||
return key.startsWith(name) || (name + ".xml").endsWith(key);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void check(Bag results) {
|
||||
log.info("Checking assertions for {}", results.getInput().getName());
|
||||
final List<AssertionType> toCheck = findAssertions(results.getName());
|
||||
final List<String> errors = new ArrayList<>();
|
||||
if (toCheck != null && !toCheck.isEmpty()) {
|
||||
final XdmNode node = loadDocument(results.getReport());
|
||||
toCheck.forEach(a -> {
|
||||
if (!check(node, a)) {
|
||||
log.error("Assertion mismatch: {}", a.getValue());
|
||||
errors.add(a.getValue());
|
||||
}
|
||||
});
|
||||
if (errors.isEmpty()) {
|
||||
log.info("{} assertions successfully verified for {}", toCheck.size(), results.getName());
|
||||
} else {
|
||||
log.warn("{} assertion of {} failed while checking {}", errors.size(), toCheck.size(), results.getName());
|
||||
}
|
||||
results.setAssertionResult(new Result<>(toCheck.size(), errors));
|
||||
} else {
|
||||
log.warn("Can not find assertions for {}", results.getName());
|
||||
}
|
||||
}
|
||||
|
||||
private List<AssertionType> findAssertions(String name) {
|
||||
return getMapped().entrySet().stream().filter(e -> matches(e.getKey(), name)).map(Map.Entry::getValue).findFirst().orElse(null);
|
||||
}
|
||||
|
||||
private XdmNode loadDocument(Document d) {
|
||||
DocumentBuilder documentBuilder = getProcessor().newDocumentBuilder();
|
||||
try {
|
||||
return documentBuilder.build(new DOMSource(d));
|
||||
} catch (SaxonApiException e) {
|
||||
log.error("Can not load result document. Therefore can not run defined assertions", e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private boolean check(XdmNode document, AssertionType assertion) {
|
||||
try {
|
||||
final XPathSelector selector = createSelector(assertion);
|
||||
selector.setContextItem(document);
|
||||
return selector.effectiveBooleanValue();
|
||||
} catch (SaxonApiException e) {
|
||||
log.error("Error evaluating assertion {} for {}", assertion.getTest(), assertion.getReportDoc(), e);
|
||||
}
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
private XPathSelector createSelector(AssertionType assertion) throws SaxonApiException {
|
||||
try {
|
||||
final XPathCompiler compiler = getProcessor().newXPathCompiler();
|
||||
assertions.getNamespace().forEach(ns -> compiler.declareNamespace(ns.getPrefix(), ns.getValue()));
|
||||
return compiler.compile(assertion.getTest()).load();
|
||||
} catch (SaxonApiException e) {
|
||||
throw new IllegalStateException(String.format("Can not compile xpath match expression '%s'",
|
||||
StringUtils.isNotBlank(assertion.getTest()) ? assertion.getTest() : "EMPTY EXPRESSION"), e);
|
||||
}
|
||||
}
|
||||
|
||||
private Map<String, List<AssertionType>> getMapped() {
|
||||
if (mappedAssertions == null) {
|
||||
mappedAssertions = new HashMap<>();
|
||||
for (AssertionType assertionType : assertions.getAssertion()) {
|
||||
List<AssertionType> list = mappedAssertions.computeIfAbsent(assertionType.getReportDoc(), k -> new ArrayList<>());
|
||||
list.add(assertionType);
|
||||
}
|
||||
}
|
||||
return mappedAssertions;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,290 @@
|
|||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
package de.kosit.validationtool.cmd;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URI;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.apache.commons.cli.*;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import de.kosit.validationtool.api.CheckConfiguration;
|
||||
import de.kosit.validationtool.api.Input;
|
||||
import de.kosit.validationtool.api.InputFactory;
|
||||
import de.kosit.validationtool.cmd.assertions.Assertions;
|
||||
import de.kosit.validationtool.impl.ConversionService;
|
||||
import de.kosit.validationtool.impl.ObjectFactory;
|
||||
|
||||
/**
|
||||
* Commandline Version des Prüftools. Parsed die Kommandozeile und führt die konfigurierten Aktionen aus.
|
||||
*
|
||||
* @author Andreas Penski
|
||||
*/
|
||||
@Slf4j
|
||||
public class CommandLineApplication {
|
||||
|
||||
private static final Option HELP = Option.builder("?").longOpt("help").argName("Help").desc("Displays this help").build();
|
||||
|
||||
private static final Option SCENARIOS = Option.builder("s").required().longOpt("scenarios").hasArg()
|
||||
.desc("Location of scenarios.xml e.g.").build();
|
||||
|
||||
private static final Option REPOSITORY = Option.builder("r").longOpt("repository").hasArg()
|
||||
.desc("Directory containing scenario content").build();
|
||||
|
||||
private static final Option PRINT = Option.builder("p").longOpt("print").desc("Prints the check result to stdout").build();
|
||||
|
||||
private static final Option OUTPUT = Option.builder("o").longOpt("output-directory")
|
||||
.desc("Defines the out directory for results. Defaults to cwd").hasArg().build();
|
||||
|
||||
private static final Option EXTRACT_HTML = Option.builder("h").longOpt("html")
|
||||
.desc("Extract and save any html content within result as a separate file ").build();
|
||||
|
||||
private static final Option DEBUG = Option.builder("d").longOpt("debug").desc("Prints some more debug information").build();
|
||||
|
||||
private static final Option CHECK_ASSERTIONS = Option.builder("c").longOpt("check-assertions").hasArg()
|
||||
.desc("Check the result using defined assertions").argName("assertions-file").build();
|
||||
|
||||
private CommandLineApplication() {
|
||||
// main class -> hide constructor
|
||||
}
|
||||
|
||||
/**
|
||||
* Main-Funktion für die Kommandozeilen-Applikation.
|
||||
*
|
||||
* @param args die Eingabe-Argumente
|
||||
*/
|
||||
public static void main(String[] args) {
|
||||
final int resultStatus = mainProgram(args);
|
||||
System.exit(resultStatus);
|
||||
}
|
||||
|
||||
/**
|
||||
* Hauptprogramm für die Kommandozeilen-Applikation.
|
||||
*
|
||||
* @param args die Eingabe-Argumente
|
||||
*/
|
||||
static int mainProgram(String[] args) {
|
||||
Options options = createOptions();
|
||||
if (isHelpRequested(args)) {
|
||||
printHelp(options);
|
||||
} else {
|
||||
try {
|
||||
CommandLineParser parser = new DefaultParser();
|
||||
final CommandLine cmd = parser.parse(options, args);
|
||||
if (cmd.getArgList().isEmpty()) {
|
||||
printHelp(createOptions());
|
||||
} else {
|
||||
return processActions(cmd);
|
||||
}
|
||||
} catch (ParseException e) {
|
||||
log.error("Error processing command line arguments: " + e.getMessage());
|
||||
printHelp(options);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
private static boolean isHelpRequested(String[] args) {
|
||||
Options helpOptions = createHelpOptions();
|
||||
try {
|
||||
CommandLineParser parser = new DefaultParser();
|
||||
CommandLine cmd = parser.parse(helpOptions, args, true);
|
||||
if (cmd.hasOption(HELP.getOpt()) || args.length == 0) {
|
||||
return true;
|
||||
}
|
||||
} catch (ParseException e) {
|
||||
// we can ignore that, we just look for the help parameters
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private static int processActions(CommandLine cmd) {
|
||||
try {
|
||||
|
||||
long start = System.currentTimeMillis();
|
||||
CheckConfiguration d = new CheckConfiguration(determineDefinition(cmd));
|
||||
d.setScenarioRepository(determineRepository(cmd));
|
||||
InternalCheck check = new InternalCheck(d);
|
||||
Path outputDirectory = determineOutputDirectory(cmd);
|
||||
|
||||
if (cmd.hasOption(EXTRACT_HTML.getOpt())) {
|
||||
check.getCheckSteps().add(new ExtractHtmlContentAction(check.getContentRepository(), outputDirectory));
|
||||
}
|
||||
check.getCheckSteps().add(new SerializeReportAction(outputDirectory));
|
||||
if (cmd.hasOption(PRINT.getOpt())) {
|
||||
check.getCheckSteps().add(new PrintReportAction());
|
||||
}
|
||||
if (cmd.hasOption(CHECK_ASSERTIONS.getOpt())) {
|
||||
Assertions assertions = loadAssertions(cmd.getOptionValue(CHECK_ASSERTIONS.getOpt()));
|
||||
check.getCheckSteps().add(new CheckAssertionAction(assertions, ObjectFactory.createProcessor()));
|
||||
}
|
||||
|
||||
log.info("Setup completed in {}ms\n", System.currentTimeMillis() - start);
|
||||
|
||||
final Collection<Path> targets = determineTestTargets(cmd);
|
||||
start = System.currentTimeMillis();
|
||||
final List<Input> input = targets.stream().map(InputFactory::read).collect(Collectors.toList());
|
||||
boolean result = check.checkInput(input);
|
||||
log.info("Processing {} object(s) completed in {}ms", input.size(), System.currentTimeMillis() - start);
|
||||
return result ? 0 : 1;
|
||||
|
||||
} catch (Exception e) {
|
||||
if (cmd.hasOption(DEBUG.getOpt())) {
|
||||
log.error(e.getMessage(), e);
|
||||
} else {
|
||||
log.error(e.getMessage());
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
private static Assertions loadAssertions(String optionValue) {
|
||||
Path p = Paths.get(optionValue);
|
||||
Assertions a = null;
|
||||
if (Files.exists(p)) {
|
||||
ConversionService c = new ConversionService();
|
||||
c.initialize(de.kosit.validationtool.cmd.assertions.ObjectFactory.class.getPackage());
|
||||
a = c.readXml(p.toUri(), Assertions.class);
|
||||
}
|
||||
return a;
|
||||
}
|
||||
|
||||
private static Path determineOutputDirectory(CommandLine cmd) {
|
||||
final String value = cmd.getOptionValue(OUTPUT.getOpt());
|
||||
Path fir;
|
||||
if (StringUtils.isNotBlank(value)) {
|
||||
fir = Paths.get(value);
|
||||
if ((!Files.exists(fir) && !fir.toFile().mkdirs()) || !Files.isDirectory(fir)) {
|
||||
throw new IllegalStateException(String.format("Invalid target directory %s specified", value));
|
||||
}
|
||||
} else {
|
||||
fir = Paths.get(""/* cwd */);
|
||||
}
|
||||
return fir;
|
||||
}
|
||||
|
||||
private static Collection<Path> determineTestTargets(CommandLine cmd) {
|
||||
Collection<Path> targets = new ArrayList<>();
|
||||
if (!cmd.getArgList().isEmpty()) {
|
||||
cmd.getArgList().forEach(e -> targets.addAll(determineTestTarget(e)));
|
||||
}
|
||||
if (targets.isEmpty()) {
|
||||
throw new IllegalStateException("No test targets found. Nothing to check. Will quit now!");
|
||||
}
|
||||
return targets;
|
||||
}
|
||||
|
||||
private static Collection<Path> determineTestTarget(String s) {
|
||||
Path d = Paths.get(s);
|
||||
if (Files.isDirectory(d)) {
|
||||
return listDirectoryTargets(d);
|
||||
} else if (Files.exists(d)) {
|
||||
return Collections.singleton(d);
|
||||
}
|
||||
log.warn("The specified test target {} does not exist. Will be ignored", s);
|
||||
return Collections.emptyList();
|
||||
|
||||
}
|
||||
|
||||
private static Collection<Path> listDirectoryTargets(Path d) {
|
||||
try {
|
||||
return Files.list(d).filter(path -> path.toString().endsWith(".xml")).collect(Collectors.toList());
|
||||
} catch (IOException e) {
|
||||
throw new IllegalStateException("IOException while liste directory content. Can not determine test targets.", e);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private static URI determineRepository(CommandLine cmd) throws MalformedURLException {
|
||||
if (checkOptionWithValue(REPOSITORY, cmd)) {
|
||||
Path d = Paths.get(cmd.getOptionValue(REPOSITORY.getOpt()));
|
||||
if (Files.isDirectory(d)) {
|
||||
return d.toUri();
|
||||
} else {
|
||||
throw new IllegalArgumentException(
|
||||
String.format("Not a valid path for scenario definition specified: '%s'", d.toAbsolutePath()));
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private static URI determineDefinition(CommandLine cmd) throws MalformedURLException {
|
||||
checkOptionWithValue(SCENARIOS, cmd);
|
||||
Path f = Paths.get(cmd.getOptionValue(SCENARIOS.getOpt()));
|
||||
if (Files.isRegularFile(f)) {
|
||||
return f.toAbsolutePath().toUri();
|
||||
} else {
|
||||
throw new IllegalArgumentException(
|
||||
String.format("Not a valid path for scenario definition specified: '%s'", f.toAbsolutePath()));
|
||||
}
|
||||
}
|
||||
|
||||
private static boolean checkOptionWithValue(Option option, CommandLine cmd) {
|
||||
String opt = option.getOpt();
|
||||
if (cmd.hasOption(opt)) {
|
||||
String value = cmd.getOptionValue(opt);
|
||||
if (StringUtils.isNoneBlank(value)) {
|
||||
return true;
|
||||
} else {
|
||||
throw new IllegalArgumentException(String.format("Option value required for Option '%s'", option.getLongOpt()));
|
||||
}
|
||||
} else if (option.isRequired()) {
|
||||
|
||||
throw new IllegalArgumentException(String.format("Option '%s' required ", option.getLongOpt()));
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private static void printHelp(Options options) {
|
||||
// automatically generate the help statement
|
||||
HelpFormatter formatter = new HelpFormatter();
|
||||
formatter.printHelp("check-tool -s <scenario-config-file> [OPTIONS] [FILE]... ", options, false);
|
||||
}
|
||||
|
||||
private static Options createHelpOptions() {
|
||||
Options options = new Options();
|
||||
options.addOption(HELP);
|
||||
return options;
|
||||
}
|
||||
|
||||
private static Options createOptions() {
|
||||
Options options = new Options();
|
||||
options.addOption(HELP);
|
||||
options.addOption(SCENARIOS);
|
||||
options.addOption(REPOSITORY);
|
||||
options.addOption(PRINT);
|
||||
options.addOption(OUTPUT);
|
||||
options.addOption(EXTRACT_HTML);
|
||||
options.addOption(DEBUG);
|
||||
options.addOption(CHECK_ASSERTIONS);
|
||||
return options;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,98 @@
|
|||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
package de.kosit.validationtool.cmd;
|
||||
|
||||
import java.nio.file.Path;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.xml.transform.dom.DOMSource;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import de.kosit.validationtool.impl.ContentRepository;
|
||||
import de.kosit.validationtool.impl.tasks.CheckAction;
|
||||
|
||||
import net.sf.saxon.s9api.*;
|
||||
|
||||
/**
|
||||
* Extrahiert HTML-Dokumente aus dem Report und persistiert diese im konfigurierten Ausgabe-Verzeichnis.
|
||||
*
|
||||
* @author Andreas Penski
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Slf4j
|
||||
public class ExtractHtmlContentAction implements CheckAction {
|
||||
|
||||
private static final QName NAME_ATTRIBUTE = new QName("data-report-type");
|
||||
|
||||
private final ContentRepository repository;
|
||||
|
||||
private final Path outputDirectory;
|
||||
|
||||
private XPathExecutable executable;
|
||||
|
||||
@Override
|
||||
public void check(Bag results) {
|
||||
try {
|
||||
final XPathSelector selector = getSelector();
|
||||
DocumentBuilder documentBuilder = repository.getProcessor().newDocumentBuilder();
|
||||
|
||||
final XdmNode xdmSource = documentBuilder.build(new DOMSource(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) {
|
||||
XdmNode node = (XdmNode) xdmItem;
|
||||
final String name = origName + "-" + node.getAttributeValue(NAME_ATTRIBUTE);
|
||||
final Path file = outputDirectory.resolve(name + ".html");
|
||||
final Serializer serializer = repository.getProcessor().newSerializer(file.toFile());
|
||||
try {
|
||||
log.info("Writing report html '{}' to {}", name, file.toAbsolutePath());
|
||||
serializer.serializeNode(node);
|
||||
} catch (SaxonApiException 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
|
||||
public boolean isSkipped(Bag results) {
|
||||
if (results.getReport() == null) {
|
||||
log.warn("Can not extract html content. No report document found");
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
83
src/main/java/de/kosit/validationtool/cmd/InternalCheck.java
Normal file
83
src/main/java/de/kosit/validationtool/cmd/InternalCheck.java
Normal file
|
|
@ -0,0 +1,83 @@
|
|||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
package de.kosit.validationtool.cmd;
|
||||
|
||||
import de.kosit.validationtool.api.CheckConfiguration;
|
||||
import de.kosit.validationtool.api.Input;
|
||||
import de.kosit.validationtool.impl.DefaultCheck;
|
||||
import de.kosit.validationtool.impl.model.Result;
|
||||
import de.kosit.validationtool.impl.tasks.CheckAction;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 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!
|
||||
*
|
||||
* @author Andreas Penski
|
||||
*/
|
||||
@Slf4j
|
||||
class InternalCheck extends DefaultCheck {
|
||||
|
||||
/**
|
||||
* Erzeugt eine neue Instanz mit der angegebenen Konfiguration.
|
||||
*
|
||||
* @param configuration die Konfiguration
|
||||
*/
|
||||
public InternalCheck(CheckConfiguration configuration) {
|
||||
super(configuration);
|
||||
}
|
||||
|
||||
/**
|
||||
* Prüft die Prüflinge und gibt Informationen über etwaige Assertions aus.
|
||||
*
|
||||
* @param input die Prüflinge
|
||||
* @return false wenn es Assertion-Fehler gibt, sonst true
|
||||
*/
|
||||
public boolean checkInput(List<Input> input) {
|
||||
List<CheckAction.Bag> results = new ArrayList<>();
|
||||
input.forEach(i -> {
|
||||
CheckAction.Bag bag = new CheckAction.Bag(i, createReport());
|
||||
runCheckInternal(bag);
|
||||
results.add(bag);
|
||||
});
|
||||
|
||||
return printAndEvaluate(results);
|
||||
|
||||
}
|
||||
|
||||
private boolean printAndEvaluate(List<CheckAction.Bag> results) {
|
||||
final List<Result<Integer, String>> asserts = results.stream().filter(r -> r.getAssertionResult() != null)
|
||||
.map(CheckAction.Bag::getAssertionResult).collect(Collectors.toList());
|
||||
int checkAssertions = asserts.stream().mapToInt(e -> e.getObject()).sum();
|
||||
int failedAssertions = asserts.stream().mapToInt(e -> e.getErrors().size()).sum();
|
||||
|
||||
if (failedAssertions > 0) {
|
||||
log.error("Assertion check failed.\n\nAssertions run: {}, Assertions failed: {}\n", checkAssertions, failedAssertions);
|
||||
} else if (checkAssertions > 0) {
|
||||
log.info("Assertion check successful.\n\nAssertions run: {}, Assertions failed: {}\n", checkAssertions, failedAssertions);
|
||||
}
|
||||
return failedAssertions == 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,57 @@
|
|||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
package de.kosit.validationtool.cmd;
|
||||
|
||||
import java.io.StringWriter;
|
||||
|
||||
import javax.xml.transform.Result;
|
||||
import javax.xml.transform.Source;
|
||||
import javax.xml.transform.Transformer;
|
||||
import javax.xml.transform.TransformerException;
|
||||
import javax.xml.transform.dom.DOMSource;
|
||||
import javax.xml.transform.stream.StreamResult;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import de.kosit.validationtool.impl.ObjectFactory;
|
||||
import de.kosit.validationtool.impl.tasks.CheckAction;
|
||||
|
||||
/**
|
||||
* Gibt das Ergebnis-Document auf std-out aus.
|
||||
*
|
||||
* @author Andreas Penski
|
||||
*/
|
||||
@Slf4j
|
||||
public class PrintReportAction implements CheckAction {
|
||||
|
||||
@Override
|
||||
public void check(Bag results) {
|
||||
try {
|
||||
Transformer transformer = ObjectFactory.createTransformer(true);
|
||||
final StringWriter writer = new StringWriter();
|
||||
Result output = new StreamResult(writer);
|
||||
Source input = new DOMSource(results.getReport());
|
||||
transformer.transform(input, output);
|
||||
System.out.print(writer.toString());
|
||||
} catch (TransformerException e) {
|
||||
log.error("Error while printing result to stdout", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,68 @@
|
|||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
package de.kosit.validationtool.cmd;
|
||||
|
||||
import de.kosit.validationtool.impl.ObjectFactory;
|
||||
import de.kosit.validationtool.impl.tasks.CheckAction;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import javax.xml.transform.Result;
|
||||
import javax.xml.transform.Source;
|
||||
import javax.xml.transform.Transformer;
|
||||
import javax.xml.transform.TransformerException;
|
||||
import javax.xml.transform.dom.DOMSource;
|
||||
import javax.xml.transform.stream.StreamResult;
|
||||
import java.nio.file.Path;
|
||||
|
||||
/**
|
||||
* Schreibt das Prüfergebnis als XML-Dokument an eine definierte Stelle.
|
||||
*
|
||||
* @author Andreas Penski
|
||||
*/
|
||||
@Slf4j
|
||||
@RequiredArgsConstructor
|
||||
public class SerializeReportAction implements CheckAction {
|
||||
|
||||
private final Path outputDirectory;
|
||||
|
||||
@Override
|
||||
public void check(Bag results) {
|
||||
final Path file = outputDirectory.resolve(results.getName() + "-report.xml");
|
||||
try {
|
||||
log.info("Serializing result to {}", file.toAbsolutePath());
|
||||
Transformer transformer = ObjectFactory.createTransformer(true);
|
||||
Result output = new StreamResult(file.toFile());
|
||||
Source input = new DOMSource(results.getReport());
|
||||
transformer.transform(input, output);
|
||||
} catch (TransformerException e) {
|
||||
log.error("Can not serialize result report to {}", file.toAbsolutePath(), e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSkipped(Bag results) {
|
||||
if (results.getReport() == null) {
|
||||
log.warn("Can not serialize result report. No document found");
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,118 @@
|
|||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
package de.kosit.validationtool.impl;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.Reader;
|
||||
import java.net.URI;
|
||||
import java.net.URL;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.w3c.dom.ls.LSInput;
|
||||
import org.w3c.dom.ls.LSResourceResolver;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.Setter;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* {@link LSResourceResolver} der objekte relativ zu einem Basis-Pfad aus dem Classpath der Anwendung laden kann.
|
||||
*
|
||||
* @author Andreas Penski
|
||||
*/
|
||||
@Slf4j
|
||||
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
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@RequiredArgsConstructor
|
||||
private static class LSInputImpl implements LSInput {
|
||||
|
||||
private Reader characterStream;
|
||||
|
||||
private InputStream byteStream;
|
||||
|
||||
private String systemId;
|
||||
|
||||
private String publicId;
|
||||
|
||||
private String baseURI;
|
||||
|
||||
private String encoding;
|
||||
|
||||
private boolean certifiedText;
|
||||
|
||||
private String stringData;
|
||||
|
||||
/**
|
||||
* Instantiierung einer neue Instanz.
|
||||
* @param publicId die publicId
|
||||
* @param systemId die systemId
|
||||
* @param baseURI die baseURI
|
||||
*/
|
||||
public LSInputImpl(String publicId, String systemId, String baseURI) {
|
||||
this.publicId = publicId;
|
||||
this.systemId = systemId;
|
||||
this.baseURI = baseURI;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getCertifiedText() {
|
||||
return certifiedText;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,168 @@
|
|||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
package de.kosit.validationtool.impl;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.StringJoiner;
|
||||
|
||||
import javax.xml.bind.ValidationEvent;
|
||||
import javax.xml.bind.ValidationEventHandler;
|
||||
import javax.xml.transform.ErrorListener;
|
||||
import javax.xml.transform.SourceLocator;
|
||||
import javax.xml.transform.TransformerException;
|
||||
|
||||
import org.xml.sax.ErrorHandler;
|
||||
import org.xml.sax.SAXException;
|
||||
import org.xml.sax.SAXParseException;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
import de.kosit.validationtool.model.reportInput.XMLSyntaxError;
|
||||
import de.kosit.validationtool.model.reportInput.XMLSyntaxErrorSeverity;
|
||||
|
||||
import net.sf.saxon.s9api.MessageListener;
|
||||
import net.sf.saxon.s9api.XdmNode;
|
||||
|
||||
/**
|
||||
* Sammelt Fehler-Ereignisinformation beim Schema-Validieren und weiteren XML-basierten Aktionen
|
||||
*
|
||||
* @author Andreas Penski
|
||||
*/
|
||||
@Getter
|
||||
public class CollectingErrorEventHandler implements ValidationEventHandler, ErrorHandler, MessageListener, ErrorListener {
|
||||
|
||||
private static final int DEFAULT_ABORT_COUNT = 50;
|
||||
|
||||
private Collection<XMLSyntaxError> errors = new ArrayList<>();
|
||||
|
||||
private int stopProcessCount = DEFAULT_ABORT_COUNT;
|
||||
|
||||
private static XMLSyntaxError createError(XMLSyntaxErrorSeverity severity, String message) {
|
||||
XMLSyntaxError e = new XMLSyntaxError();
|
||||
e.setSeverity(severity);
|
||||
e.setMessage(message);
|
||||
return e;
|
||||
}
|
||||
|
||||
private static XMLSyntaxError createError(XMLSyntaxErrorSeverity severity, SAXParseException exception) {
|
||||
XMLSyntaxError e = createError(severity, exception.getMessage());
|
||||
e.setRowNumber(exception.getLineNumber());
|
||||
e.setColumnNumber(exception.getColumnNumber());
|
||||
return e;
|
||||
}
|
||||
|
||||
private static XMLSyntaxError createError(XMLSyntaxErrorSeverity severity, TransformerException exception) {
|
||||
XMLSyntaxError e = createError(severity, exception.getMessage());
|
||||
if (exception.getLocator() != null) {
|
||||
e.setRowNumber(exception.getLocator().getLineNumber());
|
||||
e.setColumnNumber(exception.getLocator().getColumnNumber());
|
||||
}
|
||||
return e;
|
||||
}
|
||||
|
||||
private static XMLSyntaxErrorSeverity translateSeverity(int severity) {
|
||||
switch (severity) {
|
||||
case ValidationEvent.WARNING:
|
||||
return XMLSyntaxErrorSeverity.SEVERITY_WARNING;
|
||||
case ValidationEvent.ERROR:
|
||||
return XMLSyntaxErrorSeverity.SEVERITY_ERROR;
|
||||
case ValidationEvent.FATAL_ERROR:
|
||||
return XMLSyntaxErrorSeverity.SEVERITY_FATAL_ERROR;
|
||||
default:
|
||||
throw new IllegalArgumentException("Unknown severity level " + severity);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean handleEvent(ValidationEvent event) {
|
||||
XMLSyntaxError e = createError(translateSeverity(event.getSeverity()), event.getMessage());
|
||||
e.setColumnNumber(event.getLocator().getColumnNumber());
|
||||
e.setRowNumber(event.getLocator().getLineNumber());
|
||||
errors.add(e);
|
||||
return stopProcessCount != errors.size();
|
||||
}
|
||||
|
||||
/**
|
||||
* Zeigt an, ob Validierungsfehler vorhanden sind.
|
||||
*
|
||||
* @return true wenn mindestens ein Fehler vorhanden ist.
|
||||
*/
|
||||
public boolean hasErrors() {
|
||||
return hasEvents() && errors.stream().anyMatch(e -> e.getSeverity() != XMLSyntaxErrorSeverity.SEVERITY_WARNING);
|
||||
}
|
||||
|
||||
/**
|
||||
* Zeigt an, ob es Validierungs-Ereignisse gab.
|
||||
*
|
||||
* @return true wenn mindestens ein Validierungsereignis aufgetreten ist
|
||||
*/
|
||||
public boolean hasEvents() {
|
||||
return !errors.isEmpty();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void warning(SAXParseException exception) throws SAXException {
|
||||
errors.add(createError(XMLSyntaxErrorSeverity.SEVERITY_WARNING, exception));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void error(SAXParseException exception) throws SAXException {
|
||||
errors.add(createError(XMLSyntaxErrorSeverity.SEVERITY_ERROR, exception));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fatalError(SAXParseException exception) throws SAXException {
|
||||
errors.add(createError(XMLSyntaxErrorSeverity.SEVERITY_FATAL_ERROR, exception));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void message(XdmNode content, boolean terminate, SourceLocator locator) {
|
||||
XMLSyntaxError e = new XMLSyntaxError();
|
||||
if (locator != null) {
|
||||
e.setColumnNumber(locator.getColumnNumber());
|
||||
e.setRowNumber(locator.getLineNumber());
|
||||
}
|
||||
e.setMessage("Error procesing" + content.getStringValue());
|
||||
e.setSeverity(terminate ? XMLSyntaxErrorSeverity.SEVERITY_FATAL_ERROR : XMLSyntaxErrorSeverity.SEVERITY_WARNING);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void warning(TransformerException exception) throws TransformerException {
|
||||
errors.add(createError(XMLSyntaxErrorSeverity.SEVERITY_WARNING, exception));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void error(TransformerException exception) throws TransformerException {
|
||||
errors.add(createError(XMLSyntaxErrorSeverity.SEVERITY_ERROR, exception));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fatalError(TransformerException exception) throws TransformerException {
|
||||
errors.add(createError(XMLSyntaxErrorSeverity.SEVERITY_FATAL_ERROR, exception));
|
||||
}
|
||||
|
||||
public String getErrorDescription() {
|
||||
final StringJoiner joiner = new StringJoiner("\n");
|
||||
errors.forEach(e -> joiner
|
||||
.add(e.getSeverity().value() + " " + e.getMessage() + " At row " + e.getRowNumber() + " at pos " + e.getColumnNumber()));
|
||||
return joiner.toString();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,175 @@
|
|||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
package de.kosit.validationtool.impl;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.URI;
|
||||
import java.net.URISyntaxException;
|
||||
import java.net.URL;
|
||||
import java.util.Collection;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.xml.transform.Source;
|
||||
import javax.xml.transform.stream.StreamSource;
|
||||
import javax.xml.validation.Schema;
|
||||
import javax.xml.validation.SchemaFactory;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.w3c.dom.ls.LSResourceResolver;
|
||||
import org.xml.sax.SAXException;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import net.sf.saxon.s9api.*;
|
||||
|
||||
/**
|
||||
* Repository für verschiedene XML Artefakte zur Vearbeitung der Prüfszenarien.
|
||||
*
|
||||
* @author Andreas Penski
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Slf4j
|
||||
public class ContentRepository {
|
||||
|
||||
@Getter
|
||||
private final Processor processor;
|
||||
|
||||
private final URI repository;
|
||||
|
||||
private Schema reportInputSchema;
|
||||
|
||||
private static Source resolve(URL resource) {
|
||||
try {
|
||||
return new StreamSource(resource.openStream(), resource.toURI().getRawPath());
|
||||
} catch (IOException | URISyntaxException e) {
|
||||
throw new IllegalStateException("Can not load schema for resource " + resource.getPath(), e);
|
||||
}
|
||||
}
|
||||
|
||||
private static Schema createSchema(Source[] schemaSources, LSResourceResolver resourceResolver) {
|
||||
try {
|
||||
SchemaFactory sf = ObjectFactory.createSchemaFactory();
|
||||
sf.setResourceResolver(resourceResolver);
|
||||
return sf.newSchema(schemaSources);
|
||||
} catch (SAXException e) {
|
||||
throw new IllegalArgumentException("Can not load schema from sources " + schemaSources[0].getSystemId(), e);
|
||||
}
|
||||
}
|
||||
|
||||
private static Schema createSchema(Source[] schemaSources) {
|
||||
return createSchema(schemaSources, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Lädt ein XSL von der angegebenen URI
|
||||
*
|
||||
* @param uri die URI der XSL Definition
|
||||
* @return ein XSLT Executable
|
||||
*/
|
||||
public XsltExecutable loadXsltScript(URI uri) {
|
||||
log.info("Loading XSLT script from {}", uri);
|
||||
final XsltCompiler xsltCompiler = getProcessor().newXsltCompiler();
|
||||
final CollectingErrorEventHandler listener = new CollectingErrorEventHandler();
|
||||
try {
|
||||
xsltCompiler.setErrorListener(listener);
|
||||
xsltCompiler.setURIResolver(new RelativeUriResolver(repository));
|
||||
|
||||
return xsltCompiler.compile(resolve(uri));
|
||||
} catch (SaxonApiException e) {
|
||||
listener.getErrors().forEach(event -> event.log(log));
|
||||
throw new IllegalStateException("Can not compile xslt executable for uri " + uri, e);
|
||||
} finally {
|
||||
if (!listener.hasErrors() && listener.hasEvents()) {
|
||||
log.warn("Received warnings while loading a xslt script {}", uri);
|
||||
listener.getErrors().forEach(e -> e.log(log));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Erzeugt ein Schema-Objekt auf Basis der übergebenen URL.
|
||||
*
|
||||
* @param url die url
|
||||
* @return das erzeugte Schema
|
||||
*/
|
||||
public Schema createSchema(URL url) {
|
||||
log.info("Load schema from source {}", url.getPath());
|
||||
return createSchema(new Source[] { resolve(url) });
|
||||
}
|
||||
|
||||
/**
|
||||
* Liefert das definiert Schema für die Szenario-Konfiguration
|
||||
*
|
||||
* @return Scenario-Schema
|
||||
*/
|
||||
public Schema getScenarioSchema() {
|
||||
return createSchema(ContentRepository.class.getResource("/xsd/scenarios.xsd"));
|
||||
}
|
||||
|
||||
/**
|
||||
* Liefert das definierte Schema für die Validierung des [@link CreateReportInput}
|
||||
*
|
||||
* @return ReportInput-Schema
|
||||
*/
|
||||
public Schema getReportInputSchema() {
|
||||
if (reportInputSchema == null) {
|
||||
final Source source = resolve(ContentRepository.class.getResource("/xsd/createReportInput.xsd"));
|
||||
reportInputSchema = createSchema(new Source[] { source }, new ClassPathResourceResolver("/xsd"));
|
||||
}
|
||||
return reportInputSchema;
|
||||
}
|
||||
|
||||
/**
|
||||
* Erzeugt ein Schema auf Basis der übegebenen URIs
|
||||
*
|
||||
* @param uris die uris in String-Repräsentation
|
||||
* @return das Schema
|
||||
*/
|
||||
public Schema createSchema(Collection<String> uris) {
|
||||
return createSchema(uris.stream().map(s -> resolve(URI.create(s))).toArray(Source[]::new));
|
||||
}
|
||||
|
||||
private Source resolve(URI source) {
|
||||
return new StreamSource(repository.resolve(source).toASCIIString());
|
||||
}
|
||||
|
||||
/**
|
||||
* Erzeugt einen [@link XPathExecutable} auf Basis der angegebenen Informationen.
|
||||
*
|
||||
* @param expression der XPATH-Ausdruck
|
||||
* @param namespaces optionale Namespace-Mappings
|
||||
* @return ein kompiliertes Executable
|
||||
*/
|
||||
public XPathExecutable createXPath(String expression, Map<String, String> namespaces) {
|
||||
try {
|
||||
final XPathCompiler compiler = getProcessor().newXPathCompiler();
|
||||
if (namespaces != null) {
|
||||
namespaces.entrySet().forEach(n -> compiler.declareNamespace(n.getKey(), n.getValue()));
|
||||
}
|
||||
return compiler.compile(expression);
|
||||
} catch (SaxonApiException e) {
|
||||
throw new IllegalStateException(String.format("Can not compile xpath match expression '%s'",
|
||||
StringUtils.isNotBlank(expression) ? expression : "EMPTY EXPRESSION"), e);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,241 @@
|
|||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
package de.kosit.validationtool.impl;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.StringWriter;
|
||||
import java.net.URI;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.StringJoiner;
|
||||
|
||||
import javax.xml.bind.*;
|
||||
import javax.xml.bind.annotation.XmlRegistry;
|
||||
import javax.xml.namespace.QName;
|
||||
import javax.xml.parsers.DocumentBuilder;
|
||||
import javax.xml.stream.*;
|
||||
import javax.xml.transform.stream.StreamSource;
|
||||
import javax.xml.validation.Schema;
|
||||
|
||||
import org.w3c.dom.Document;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* JAXB Conversion Utility.
|
||||
*/
|
||||
@Slf4j
|
||||
public class ConversionService {
|
||||
|
||||
// context setup
|
||||
private JAXBContext jaxbContext;
|
||||
|
||||
private static <T> QName createQName(final T model) {
|
||||
return new QName(model.getClass().getSimpleName().toLowerCase());
|
||||
}
|
||||
|
||||
private void checkInputEmpty(final URI xml) {
|
||||
if (xml == null) {
|
||||
throw new ConversionExeption("Can not unmarshal from empty input");
|
||||
}
|
||||
}
|
||||
|
||||
private <T> void checkTypeEmpty(final Class<T> type) {
|
||||
if (type == null) {
|
||||
throw new ConversionExeption("Can not unmarshal without type information. Need to specify a target type");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialisiert den default context; Alle Packages mit {@link XmlRegistry XmlRegistries}.
|
||||
*/
|
||||
public void initialize() {
|
||||
Collection<Package> p = new ArrayList<>();
|
||||
p.add(de.kosit.validationtool.model.reportInput.ObjectFactory.class.getPackage());
|
||||
p.add(de.kosit.validationtool.model.scenarios.ObjectFactory.class.getPackage());
|
||||
initialize(p);
|
||||
}
|
||||
|
||||
public void initialize(final Package... context) {
|
||||
initialize(Arrays.asList(context));
|
||||
}
|
||||
/**
|
||||
* Initialisiert den conversion service mit den angegegebenen Packages.
|
||||
*
|
||||
* @param context packages für den JAXB Kontext
|
||||
*/
|
||||
public void initialize(final Collection<Package> context) {
|
||||
final String[] packages = context != null ? context.stream().map(Package::getName).toArray(String[]::new) : new String[0];
|
||||
StringJoiner joiner = new StringJoiner(":");
|
||||
Arrays.stream(packages).forEach(p -> joiner.add(p));
|
||||
initialize(joiner.toString());
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialsiert den conversion service mit dem angegebenen Kontextpfad
|
||||
*
|
||||
* @param contextPath der Kontextpfad
|
||||
*/
|
||||
private void initialize(final String contextPath) {
|
||||
try {
|
||||
this.jaxbContext = JAXBContext.newInstance(contextPath);
|
||||
} catch (final JAXBException e) {
|
||||
throw new IllegalStateException(String.format("Can not create JAXB context for given context: %s", contextPath), e);
|
||||
}
|
||||
}
|
||||
|
||||
private JAXBContext getJaxbContext() {
|
||||
if (this.jaxbContext == null) {
|
||||
initialize();
|
||||
}
|
||||
return this.jaxbContext;
|
||||
}
|
||||
|
||||
/**
|
||||
* Unmarshalls a specifc xml model into a defined java object.
|
||||
*
|
||||
* @param xml the xml
|
||||
* @param type the expected type created
|
||||
* @param <T> type information
|
||||
* @return the created object
|
||||
*/
|
||||
public <T> T readXml(final URI xml, final Class<T> type) {
|
||||
return readXml(xml, type, null, null);
|
||||
}
|
||||
|
||||
public <T> T readXml(final URI xml, final Class<T> type, Schema schema) {
|
||||
return readXml(xml, type, schema, null);
|
||||
}
|
||||
|
||||
public <T> T readXml(final URI xml, final Class<T> type, Schema schema, ValidationEventHandler handler) {
|
||||
checkInputEmpty(xml);
|
||||
checkTypeEmpty(type);
|
||||
CollectingErrorEventHandler defaultHandler = null;
|
||||
ValidationEventHandler handler2Use = handler;
|
||||
if (schema != null && handler == null) {
|
||||
defaultHandler = new CollectingErrorEventHandler();
|
||||
handler2Use = defaultHandler;
|
||||
}
|
||||
try {
|
||||
final XMLInputFactory inputFactory = XMLInputFactory.newFactory();
|
||||
inputFactory.setProperty(XMLInputFactory.IS_SUPPORTING_EXTERNAL_ENTITIES, false);
|
||||
inputFactory.setProperty(XMLInputFactory.IS_REPLACING_ENTITY_REFERENCES, false);
|
||||
inputFactory.setProperty(XMLInputFactory.SUPPORT_DTD, false);
|
||||
final XMLStreamReader xsr = inputFactory.createXMLStreamReader(new StreamSource(xml.toASCIIString()));
|
||||
final Unmarshaller u = getJaxbContext().createUnmarshaller();
|
||||
u.setSchema(schema);
|
||||
|
||||
u.setEventHandler(handler2Use);
|
||||
final T value = u.unmarshal(xsr, type).getValue();
|
||||
if (defaultHandler != null && defaultHandler.hasErrors()) {
|
||||
throw new ConversionExeption(
|
||||
String.format("Schema errors while reading content from %s: %s", xml, defaultHandler.getErrorDescription()));
|
||||
}
|
||||
|
||||
return value;
|
||||
} catch (final JAXBException | XMLStreamException e) {
|
||||
throw new ConversionExeption(String.format("Can not unmarshal to type %s from %s", type.getSimpleName(), xml.toString()), e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Serializing an object to xml.
|
||||
*
|
||||
* @param model the object
|
||||
* @param <T> type of the object
|
||||
* @return the serialized form.
|
||||
*/
|
||||
public <T> String writeXml(final T model) {
|
||||
return writeXml(model, null, null);
|
||||
}
|
||||
|
||||
public <T> String writeXml(final T model, Schema schema, ValidationEventHandler handler) {
|
||||
if (model == null) {
|
||||
throw new ConversionExeption("Can not serialize null");
|
||||
}
|
||||
try ( StringWriter w = new StringWriter() ) {
|
||||
final JAXBIntrospector introspector = getJaxbContext().createJAXBIntrospector();
|
||||
final Marshaller marshaller = getJaxbContext().createMarshaller();
|
||||
marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
|
||||
marshaller.setProperty(Marshaller.JAXB_FRAGMENT, Boolean.TRUE);
|
||||
marshaller.setProperty(Marshaller.JAXB_ENCODING, "UTF-8");
|
||||
marshaller.setSchema(schema);
|
||||
marshaller.setEventHandler(handler);
|
||||
final XMLOutputFactory xof = XMLOutputFactory.newFactory();
|
||||
final XMLStreamWriter xmlStreamWriter = xof.createXMLStreamWriter(w);
|
||||
if (null == introspector.getElementName(model)) {
|
||||
final JAXBElement jaxbElement = new JAXBElement(createQName(model), model.getClass(), model);
|
||||
marshaller.marshal(jaxbElement, xmlStreamWriter);
|
||||
} else {
|
||||
marshaller.marshal(model, xmlStreamWriter);
|
||||
}
|
||||
xmlStreamWriter.flush();
|
||||
return w.toString();
|
||||
} catch (JAXBException | IOException | XMLStreamException e) {
|
||||
throw new ConversionExeption(String.format("Error serializing Object %s", model.getClass().getName()), e);
|
||||
}
|
||||
}
|
||||
|
||||
public <T> Document writeDocument(T input) {
|
||||
if (input == null) {
|
||||
throw new ConversionExeption("Can not serialize null");
|
||||
}
|
||||
DocumentBuilder builder = ObjectFactory.createDocumentBuilder(false);
|
||||
Document document = builder.newDocument();
|
||||
|
||||
// Marshal the Object to a Document
|
||||
Marshaller marshaller = null;
|
||||
try {
|
||||
marshaller = getJaxbContext().createMarshaller();
|
||||
marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
|
||||
marshaller.marshal(input, document);
|
||||
return document;
|
||||
} catch (JAXBException e) {
|
||||
throw new ConversionExeption(String.format("Error serializing Object %s to document", input.getClass().getName()), e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 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);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
137
src/main/java/de/kosit/validationtool/impl/DefaultCheck.java
Normal file
137
src/main/java/de/kosit/validationtool/impl/DefaultCheck.java
Normal file
|
|
@ -0,0 +1,137 @@
|
|||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
package de.kosit.validationtool.impl;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.w3c.dom.Document;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import de.kosit.validationtool.api.Check;
|
||||
import de.kosit.validationtool.api.CheckConfiguration;
|
||||
import de.kosit.validationtool.api.Input;
|
||||
import de.kosit.validationtool.impl.tasks.*;
|
||||
import de.kosit.validationtool.model.reportInput.CreateReportInput;
|
||||
import de.kosit.validationtool.model.reportInput.DocumentIdentificationType;
|
||||
import de.kosit.validationtool.model.reportInput.EngineType;
|
||||
import de.kosit.validationtool.model.reportInput.ProcessingError;
|
||||
|
||||
import net.sf.saxon.s9api.Processor;
|
||||
|
||||
/**
|
||||
* Die Referenz-Implementierung für den Prüfprozess. Nach initialer Konfiguration ist diese Klasse threadsafe und kann
|
||||
* in Server-Umgebungen eingesetzt werden
|
||||
*
|
||||
* @author Andreas Penski
|
||||
*/
|
||||
@Slf4j
|
||||
public class DefaultCheck implements Check {
|
||||
|
||||
private static final String ENGINE_NAME = "KoSIT Prüftool";
|
||||
|
||||
private static final String ENGINE_VERSION = "1.0.0";
|
||||
|
||||
private ScenarioRepository repository;
|
||||
|
||||
@Getter
|
||||
private ContentRepository contentRepository;
|
||||
|
||||
private ConversionService conversionService;
|
||||
|
||||
@Getter
|
||||
private List<CheckAction> checkSteps;
|
||||
|
||||
/**
|
||||
* Erzeugt eine neue Instanz mit der angegebenen Konfiguration.
|
||||
*
|
||||
* @param configuration die Konfiguration
|
||||
*/
|
||||
public DefaultCheck(CheckConfiguration configuration) {
|
||||
Processor processor = ObjectFactory.createProcessor();
|
||||
conversionService = new ConversionService();
|
||||
contentRepository = new ContentRepository(processor, configuration.getScenarioRepository());
|
||||
repository = new ScenarioRepository(processor, contentRepository);
|
||||
repository.initialize(configuration);
|
||||
checkSteps = new ArrayList<>();
|
||||
checkSteps.add(this::createDocumentIdentification);
|
||||
checkSteps.add(new DocumentParseAction());
|
||||
checkSteps.add(new ScenarioSelectionAction(repository));
|
||||
checkSteps.add(new SchemaValidationAction());
|
||||
checkSteps.add(new SchematronValidationAction(processor, configuration.getScenarioRepository()));
|
||||
checkSteps.add(new ValidateReportInputAction(conversionService, contentRepository.getReportInputSchema()));
|
||||
checkSteps.add(new CreateReportAction(processor, conversionService, repository, configuration.getScenarioRepository()));
|
||||
}
|
||||
|
||||
protected static CreateReportInput createReport() {
|
||||
CreateReportInput type = new CreateReportInput();
|
||||
EngineType e = new EngineType();
|
||||
e.setName(ENGINE_NAME);
|
||||
type.setEngine(e);
|
||||
type.setTimestamp(ObjectFactory.createTimestamp());
|
||||
type.setFrameworkVersion(ENGINE_VERSION);
|
||||
return type;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Document check(Input input) {
|
||||
CheckAction.Bag t = new CheckAction.Bag(input, createReport());
|
||||
return runCheckInternal(t);
|
||||
}
|
||||
|
||||
protected Document runCheckInternal(CheckAction.Bag t) {
|
||||
long started = System.currentTimeMillis();
|
||||
log.info("Checking content of {}", t.getInput().getName());
|
||||
Iterator<CheckAction> it = checkSteps.iterator();
|
||||
|
||||
|
||||
while (it.hasNext()) {
|
||||
final CheckAction action = it.next();
|
||||
if (!action.isSkipped(t)) {
|
||||
action.check(t);
|
||||
}
|
||||
if (t.isStopped()) {
|
||||
final ProcessingError processingError = t.getReportInput().getProcessingError();
|
||||
log.error("Error processing input {}: {}", t.getInput().getName(),
|
||||
processingError != null ? processingError.getError().stream().collect(Collectors.joining("\n")) : "");
|
||||
break;
|
||||
}
|
||||
}
|
||||
t.setFinished(true);
|
||||
log.info("Finished check of {} in {}ms\n", t.getInput().getName(), System.currentTimeMillis() - started);
|
||||
return t.getReport();
|
||||
}
|
||||
|
||||
private boolean createDocumentIdentification(CheckAction.Bag transporter) {
|
||||
DocumentIdentificationType i = new DocumentIdentificationType();
|
||||
DocumentIdentificationType.DocumentHash h = new DocumentIdentificationType.DocumentHash();
|
||||
h.setHashAlgorithm(transporter.getInput().getDigestAlgorithm());
|
||||
h.setHashValue(transporter.getInput().getHashCode());
|
||||
i.setDocumentHash(h);
|
||||
i.setDocumentReference(transporter.getInput().getName());
|
||||
transporter.getReportInput().setDocumentIdentification(i);
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
256
src/main/java/de/kosit/validationtool/impl/ObjectFactory.java
Normal file
256
src/main/java/de/kosit/validationtool/impl/ObjectFactory.java
Normal file
|
|
@ -0,0 +1,256 @@
|
|||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
package de.kosit.validationtool.impl;
|
||||
|
||||
import java.io.Reader;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URI;
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.Date;
|
||||
import java.util.GregorianCalendar;
|
||||
|
||||
import javax.xml.XMLConstants;
|
||||
import javax.xml.datatype.DatatypeConfigurationException;
|
||||
import javax.xml.datatype.DatatypeFactory;
|
||||
import javax.xml.datatype.XMLGregorianCalendar;
|
||||
import javax.xml.parsers.DocumentBuilder;
|
||||
import javax.xml.parsers.DocumentBuilderFactory;
|
||||
import javax.xml.parsers.ParserConfigurationException;
|
||||
import javax.xml.transform.*;
|
||||
import javax.xml.validation.Schema;
|
||||
import javax.xml.validation.SchemaFactory;
|
||||
import javax.xml.validation.Validator;
|
||||
|
||||
import org.xml.sax.SAXException;
|
||||
import org.xml.sax.SAXNotRecognizedException;
|
||||
import org.xml.sax.SAXNotSupportedException;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import net.sf.saxon.Configuration;
|
||||
import net.sf.saxon.expr.XPathContext;
|
||||
import net.sf.saxon.lib.*;
|
||||
import net.sf.saxon.s9api.Processor;
|
||||
import net.sf.saxon.trans.XPathException;
|
||||
|
||||
/**
|
||||
* Eine Factory für häufig verwendete Objekte mit XML. Zentralisiert die XML Security Konfiguration. Die Konfiguration
|
||||
* basiert auf den <a href="https://www.owasp.org/index.php/XML_Security_Cheat_Sheet">OWASP-Empfehlungen</a>.
|
||||
*
|
||||
* Diese Klasse ist stark abhängig von der Verwendung eines Oracle JDK. Alternative JDKs haben u.U. eine andere SAX- /
|
||||
* StAX- / XML-Implementierug und profitieren entsprechend NICHT von den hier getroffenen Einstellungen.
|
||||
*
|
||||
* @author Andreas Penski
|
||||
*/
|
||||
@Slf4j
|
||||
public class ObjectFactory {
|
||||
|
||||
private static final String ORACLE_XERCES_CLASS = "com.sun.org.apache.xerces.internal.impl.Constants";
|
||||
|
||||
private static final String DISSALLOW_DOCTYPE_DECL_FEATURE = "http://apache.org/xml/features/disallow-doctype-decl";
|
||||
|
||||
private static final String LOAD_EXTERNAL_DTD_FEATURE = "http://apache.org/xml/features/nonvalidating/load-external-dtd";
|
||||
|
||||
private static final String FEATURE_SECURE_PROCESSING = "http://javax.xml.XMLConstants/feature/secure-processing";
|
||||
|
||||
private static Processor processor;
|
||||
|
||||
static {
|
||||
try {
|
||||
Class.forName(ORACLE_XERCES_CLASS);
|
||||
} catch (ClassNotFoundException e) {
|
||||
log.warn("No oracle JDK version of XERCES found. Configured security features may not have any effect.");
|
||||
log.warn("Please take care of XML security while checking your xml contents");
|
||||
}
|
||||
}
|
||||
|
||||
private ObjectFactory() {
|
||||
// hide, it's a factory
|
||||
}
|
||||
|
||||
private static DocumentBuilderFactory createDocumentBuilderFactory(boolean validating) {
|
||||
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
|
||||
try {
|
||||
dbf.setValidating(validating);
|
||||
dbf.setNamespaceAware(true);
|
||||
|
||||
// explicitly enable secure processing
|
||||
dbf.setFeature(FEATURE_SECURE_PROCESSING, true);
|
||||
|
||||
// This is the PRIMARY defense. If DTDs (doctypes) are disallowed, almost all XML entity attacks are prevented
|
||||
dbf.setFeature(DISSALLOW_DOCTYPE_DECL_FEATURE, true);
|
||||
|
||||
// Disable external DTDs as well
|
||||
dbf.setFeature(LOAD_EXTERNAL_DTD_FEATURE, false);
|
||||
|
||||
// and these as well, per Timothy Morgan's 2014 paper: "XML Schema, DTD, and Entity Attacks"
|
||||
dbf.setXIncludeAware(false);
|
||||
dbf.setExpandEntityReferences(false);
|
||||
return dbf;
|
||||
} catch (ParserConfigurationException e) {
|
||||
throw new IllegalStateException("Can not create DocumentBuilderFactory due to underlying configuration error", e);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Transformer für die Ausgabe. Nutzt nicht Saxon!
|
||||
*
|
||||
* @param prettyPrint pretty-printing der Ausgabe
|
||||
* @return einen vorkonfigurierten Transformer
|
||||
*/
|
||||
public static Transformer createTransformer(boolean prettyPrint) {
|
||||
Transformer transformer = null;
|
||||
try {
|
||||
transformer = TransformerFactory.newInstance().newTransformer();
|
||||
if (prettyPrint) {
|
||||
transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "no");
|
||||
transformer.setOutputProperty(OutputKeys.METHOD, "xml");
|
||||
transformer.setOutputProperty(OutputKeys.INDENT, "yes");
|
||||
transformer.setOutputProperty(OutputKeys.ENCODING, "UTF-8");
|
||||
transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "4");
|
||||
}
|
||||
return transformer;
|
||||
} catch (TransformerConfigurationException e) {
|
||||
throw new IllegalStateException("Can not create Transformer due to underlying configuration error", e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Erzeugt einen Zeitstempel zur Verwendung in XML-Objekten
|
||||
*
|
||||
* @return eine Instanz {@link XMLGregorianCalendar}
|
||||
*/
|
||||
public static XMLGregorianCalendar createTimestamp() {
|
||||
try {
|
||||
GregorianCalendar cal = new GregorianCalendar();
|
||||
cal.setTime(new Date());
|
||||
return DatatypeFactory.newInstance().newXMLGregorianCalendar(cal);
|
||||
|
||||
} catch (DatatypeConfigurationException e) {
|
||||
throw new IllegalStateException("Can not create timestamp", e);
|
||||
}
|
||||
}
|
||||
|
||||
public static DocumentBuilder createDocumentBuilder(boolean validating) {
|
||||
try {
|
||||
return createDocumentBuilderFactory(validating).newDocumentBuilder();
|
||||
} catch (ParserConfigurationException e) {
|
||||
throw new IllegalStateException("Can not create DocumentFactory due to underlying configuration error", e);
|
||||
}
|
||||
}
|
||||
|
||||
private static String encode(String input) {
|
||||
try {
|
||||
return URLEncoder.encode(input, StandardCharsets.UTF_8.name());
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
throw new IllegalStateException("Error encoding property while initializing saxon", e);
|
||||
}
|
||||
}
|
||||
|
||||
public static Processor createProcessor() {
|
||||
if (processor == null) {
|
||||
processor = new Processor(false);
|
||||
//verhindere global im Prinzip alle resolving strategien
|
||||
SecureUriResolver resolver = new SecureUriResolver();
|
||||
processor.getUnderlyingConfiguration().setCollectionFinder(resolver);
|
||||
processor.getUnderlyingConfiguration().setOutputURIResolver(resolver);
|
||||
//hier fehlt eigentlich noch der UriResolver für unparsed text, wird erst ab Saxon 9.8 unterstützt
|
||||
|
||||
//grundsätzlich Feature-konfiguration:
|
||||
processor.setConfigurationProperty(FeatureKeys.DTD_VALIDATION, false);
|
||||
processor.setConfigurationProperty(FeatureKeys.ENTITY_RESOLVER_CLASS, "");
|
||||
processor.setConfigurationProperty(FeatureKeys.XINCLUDE, false);
|
||||
processor.setConfigurationProperty(FeatureKeys.ALLOW_EXTERNAL_FUNCTIONS, false);
|
||||
|
||||
// Konfiguration des zu verwendenden Parsers, wenn Saxon selbst einen erzeugen muss, bspw. beim XSL parsen
|
||||
processor.setConfigurationProperty(FeatureKeys.XML_PARSER_FEATURE + encode(FEATURE_SECURE_PROCESSING), true);
|
||||
processor.setConfigurationProperty(FeatureKeys.XML_PARSER_FEATURE + encode(DISSALLOW_DOCTYPE_DECL_FEATURE), false);
|
||||
processor.setConfigurationProperty(FeatureKeys.XML_PARSER_FEATURE + encode(LOAD_EXTERNAL_DTD_FEATURE), false);
|
||||
}
|
||||
return processor;
|
||||
}
|
||||
|
||||
/**
|
||||
* Erzeugt einen Validier für das angegebenen Schema.
|
||||
*
|
||||
* @param schema das Schema mit dem validiert werden soll
|
||||
* @return einen vorkonfigurierten Validator
|
||||
*/
|
||||
public static Validator createValidator(Schema schema) {
|
||||
final Validator validator = schema.newValidator();
|
||||
try {
|
||||
validator.setProperty(XMLConstants.ACCESS_EXTERNAL_DTD, "");
|
||||
} catch (SAXNotRecognizedException | SAXNotSupportedException e) {
|
||||
log.warn("Can not disable external DTD access. Maybe an unsupported JAXP implementation is used.");
|
||||
log.debug(e.getMessage(), e);
|
||||
}
|
||||
try {
|
||||
validator.setProperty(XMLConstants.ACCESS_EXTERNAL_SCHEMA, "");
|
||||
} catch (SAXNotRecognizedException | SAXNotSupportedException e) {
|
||||
log.warn("Can not disable external DTD access. Maybe an unsupported JAXP implementation is used.");
|
||||
log.debug(e.getMessage(), e);
|
||||
|
||||
}
|
||||
return validator;
|
||||
}
|
||||
|
||||
public static SchemaFactory createSchemaFactory() {
|
||||
SchemaFactory sf = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
|
||||
try {
|
||||
sf.setProperty(XMLConstants.ACCESS_EXTERNAL_DTD, "");
|
||||
sf.setProperty(XMLConstants.ACCESS_EXTERNAL_SCHEMA, "file");
|
||||
} catch (SAXException e) {
|
||||
log.warn("Can not disable external DTD access, maybe an unsupported JAXP implementation is used", e);
|
||||
}
|
||||
return sf;
|
||||
}
|
||||
|
||||
private static class SecureUriResolver implements CollectionFinder, OutputURIResolver, UnparsedTextURIResolver {
|
||||
|
||||
public static final String MESSAGE = "Configuration error. Resolving ist not allowed";
|
||||
|
||||
@Override
|
||||
public OutputURIResolver newInstance() {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result resolve(String href, String base) throws TransformerException {
|
||||
throw new IllegalStateException(MESSAGE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close(Result result) throws TransformerException {
|
||||
throw new IllegalStateException(MESSAGE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Reader resolve(URI absoluteURI, String encoding, Configuration config) throws XPathException {
|
||||
throw new IllegalStateException(MESSAGE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResourceCollection findCollection(XPathContext context, String collectionURI) throws XPathException {
|
||||
throw new IllegalStateException(MESSAGE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,85 @@
|
|||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
package de.kosit.validationtool.impl;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.Reader;
|
||||
import java.net.URI;
|
||||
|
||||
import javax.xml.transform.Source;
|
||||
import javax.xml.transform.TransformerException;
|
||||
import javax.xml.transform.URIResolver;
|
||||
import javax.xml.transform.stream.StreamSource;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
import net.sf.saxon.Configuration;
|
||||
import net.sf.saxon.lib.UnparsedTextURIResolver;
|
||||
import net.sf.saxon.trans.XPathException;
|
||||
|
||||
/**
|
||||
* {@link URIResolver} that resolves artifacts relative to a given base uri. The resolved URI must be resolving as child
|
||||
* e.g. the baseUri must be a parent of the resolved artifact.
|
||||
*
|
||||
* @author Andreas Penski
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
public class RelativeUriResolver implements URIResolver, UnparsedTextURIResolver {
|
||||
|
||||
/** the base uri */
|
||||
private final URI baseUri;
|
||||
|
||||
@Override
|
||||
public Source resolve(final String href, final String base) throws TransformerException {
|
||||
final URI resolved = URI.create(base).resolve(href);
|
||||
if (isUnderBaseUri(resolved)) {
|
||||
try {
|
||||
return new StreamSource(resolved.toURL().openStream());
|
||||
} catch (final IOException e) {
|
||||
|
||||
throw new IllegalStateException(String.format("Can not resolve required %s", href), e);
|
||||
}
|
||||
} else {
|
||||
throw new IllegalStateException(
|
||||
String.format("The resolved transformation artifact %s is not within the configured repository %s", resolved, baseUri));
|
||||
}
|
||||
}
|
||||
|
||||
private boolean isUnderBaseUri(URI resolved) {
|
||||
String base = baseUri.toASCIIString().replaceAll("file:/+", "");
|
||||
String r = resolved.toASCIIString().replaceAll("file:/+", "");
|
||||
return r.startsWith(base);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Reader resolve(URI absoluteURI, String encoding, Configuration config) throws XPathException {
|
||||
if (isUnderBaseUri(absoluteURI)) {
|
||||
try {
|
||||
return new InputStreamReader(absoluteURI.toURL().openStream(), encoding);
|
||||
} catch (IOException e) {
|
||||
throw new IllegalStateException(String.format("Can not resolve required %s", absoluteURI), e);
|
||||
}
|
||||
} else {
|
||||
throw new IllegalStateException(
|
||||
String.format("The resolved transformation artifact %s is not within the configured repository %s", absoluteURI, baseUri));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,173 @@
|
|||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
package de.kosit.validationtool.impl;
|
||||
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URI;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import javax.xml.transform.dom.DOMSource;
|
||||
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.Element;
|
||||
|
||||
import lombok.AccessLevel;
|
||||
import lombok.Getter;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import de.kosit.validationtool.api.CheckConfiguration;
|
||||
import de.kosit.validationtool.api.InputFactory;
|
||||
import de.kosit.validationtool.impl.model.Result;
|
||||
import de.kosit.validationtool.impl.tasks.DocumentParseAction;
|
||||
import de.kosit.validationtool.model.reportInput.XMLSyntaxError;
|
||||
import de.kosit.validationtool.model.scenarios.ScenarioType;
|
||||
import de.kosit.validationtool.model.scenarios.Scenarios;
|
||||
|
||||
import net.sf.saxon.s9api.*;
|
||||
|
||||
/**
|
||||
* Repository for die aktiven Szenario einer Prüfinstanz.
|
||||
*
|
||||
* @author Andreas Penski
|
||||
*/
|
||||
@Slf4j
|
||||
@RequiredArgsConstructor
|
||||
public class ScenarioRepository {
|
||||
|
||||
private static final String SUPPORTED_MAJOR_VERSION = "1";
|
||||
|
||||
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)
|
||||
private final ContentRepository repository;
|
||||
|
||||
private XsltExecutable noScenarioReport;
|
||||
|
||||
@Getter(value = AccessLevel.PACKAGE)
|
||||
private Scenarios scenarios;
|
||||
|
||||
private static boolean isSupportedDocument(Document doc) {
|
||||
final Element root = doc.getDocumentElement();
|
||||
return root.hasAttribute("frameworkVersion") && root.getAttribute("frameworkVersion").startsWith(SUPPORTED_MAJOR_VERSION)
|
||||
&& doc.getDocumentElement().getNamespaceURI().equals(SUPPORTED_MAJOR_VERSION_SCHEMA);
|
||||
}
|
||||
|
||||
private static void checkVersion(URI scenarioDefinition) {
|
||||
DocumentParseAction p = new DocumentParseAction();
|
||||
try {
|
||||
final Result<Document, XMLSyntaxError> result = p.parseDocument(InputFactory.read(scenarioDefinition.toURL()));
|
||||
if (result.isValid() && !isSupportedDocument(result.getObject())) {
|
||||
throw new IllegalStateException(String.format(
|
||||
"Specified scenario configuration %s is not supported.%nThis version only supports definitions of '%s'",
|
||||
scenarioDefinition, SUPPORTED_MAJOR_VERSION_SCHEMA));
|
||||
|
||||
}
|
||||
} catch (MalformedURLException e) {
|
||||
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.
|
||||
*
|
||||
* @param config die Konfiguration
|
||||
*/
|
||||
public void initialize(CheckConfiguration config) {
|
||||
ConversionService conversionService = new ConversionService();
|
||||
checkVersion(config.getScenarioDefinition());
|
||||
log.info("Loading scenarios from {}", config.getScenarioDefinition());
|
||||
CollectingErrorEventHandler handler = new CollectingErrorEventHandler();
|
||||
this.scenarios = conversionService.readXml(config.getScenarioDefinition(), Scenarios.class, repository.getScenarioSchema(),
|
||||
handler);
|
||||
if (!handler.hasErrors()) {
|
||||
log.info("Loaded scenarios for {} by {} from {}. The following scenarios are available:\n\n{}", scenarios.getName(),
|
||||
scenarios.getAuthor(), scenarios.getDate(), summarizeScenarios());
|
||||
log.info("Loading scenario content from {}", config.getScenarioRepository());
|
||||
getScenarios().getScenario().forEach(s -> s.initialize(repository, false));
|
||||
} else {
|
||||
throw new IllegalStateException(String.format("Can not load scenarios from %s due to %s", config.getScenarioDefinition(),
|
||||
handler.getErrorDescription()));
|
||||
}
|
||||
// initialize fallback report eager
|
||||
getNoScenarioReport();
|
||||
|
||||
}
|
||||
|
||||
private String summarizeScenarios() {
|
||||
StringBuilder b = new StringBuilder();
|
||||
scenarios.getScenario().forEach(s -> {
|
||||
b.append(s.getName());
|
||||
b.append("\n");
|
||||
});
|
||||
return b.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Ermittelt für das angegebene Dokument das passende Szenario.
|
||||
*
|
||||
* @param document das Eingabedokument
|
||||
* @return ein Ergebnis-Objekt zur weiteren Verarbeitung
|
||||
*/
|
||||
public Result<ScenarioType, String> selectScenario(Document document) {
|
||||
Result<ScenarioType, String> result = new Result<>();
|
||||
final List<ScenarioType> collect = scenarios.getScenario().stream().filter(s -> match(document, s)).collect(Collectors.toList());
|
||||
if (collect.size() == 1) {
|
||||
result = new Result<>(collect.get(0));
|
||||
} else if (collect.isEmpty()) {
|
||||
result.getErrors().add("None of the loaded scenarios matches the specified document");
|
||||
} else {
|
||||
result.getErrors().add("More than on scenario matches the specified document");
|
||||
}
|
||||
return result;
|
||||
|
||||
}
|
||||
|
||||
private boolean match(Document document, ScenarioType scenario) {
|
||||
try {
|
||||
final XPathSelector selector = scenario.getSelector();
|
||||
DocumentBuilder documentBuilder = getProcessor().newDocumentBuilder();
|
||||
|
||||
final XdmNode xdmSource = documentBuilder.build(new DOMSource(document));
|
||||
selector.setContextItem(xdmSource);
|
||||
return selector.effectiveBooleanValue();
|
||||
} catch (SaxonApiException e) {
|
||||
log.error("Error evaluating xpath expression", e);
|
||||
}
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
void initialize(Scenarios def) {
|
||||
this.scenarios = def;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,187 @@
|
|||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
package de.kosit.validationtool.impl.model;
|
||||
|
||||
import java.net.URI;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import javax.xml.validation.Schema;
|
||||
|
||||
import org.apache.commons.lang3.NotImplementedException;
|
||||
import org.w3c.dom.Document;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import de.kosit.validationtool.impl.ContentRepository;
|
||||
import de.kosit.validationtool.impl.ScenarioRepository;
|
||||
import de.kosit.validationtool.model.scenarios.*;
|
||||
|
||||
import net.sf.saxon.s9api.XPathExecutable;
|
||||
import net.sf.saxon.s9api.XPathSelector;
|
||||
import net.sf.saxon.s9api.XsltExecutable;
|
||||
|
||||
/**
|
||||
* Eine Basis-Klasse für Szenarien. Wiederverwendbare Objekte mit Bezug zum Szenario werden hier gecached. Die Klasse
|
||||
* stellt im eigentlichen Sinne eine Erweiterung der durch JAXB generierten Strukturen dar.
|
||||
*
|
||||
* @author Andreas Penski
|
||||
*/
|
||||
public abstract class BaseScenario {
|
||||
|
||||
private XPathExecutable xPathExecutable;
|
||||
|
||||
private Schema schema;
|
||||
|
||||
private List<Transformation> schematronValidations;
|
||||
|
||||
private ContentRepository repository;
|
||||
|
||||
private Transformation reportTransformation;
|
||||
|
||||
/**
|
||||
* Gibt eine Transformation zurück.
|
||||
* @return initialisierte Transformation
|
||||
*/
|
||||
public Transformation getReportTransformation() {
|
||||
if (reportTransformation == null) {
|
||||
final ResourceType resource = getCreateReport().getResource();
|
||||
final XsltExecutable executable = repository.loadXsltScript(URI.create(resource.getLocation()));
|
||||
reportTransformation = new Transformation(executable, resource);
|
||||
}
|
||||
return reportTransformation;
|
||||
}
|
||||
|
||||
/**
|
||||
* Lieferrt das Schema zu diesem Szenario.
|
||||
* @return das passende Schema
|
||||
*/
|
||||
public Schema getSchema() {
|
||||
if (schema == null) {
|
||||
final List<String> schemaResources = getValidateWithXmlSchema().getResource().stream().map(r -> r.getLocation())
|
||||
.collect(Collectors.toList());
|
||||
schema = repository.createSchema(schemaResources);
|
||||
}
|
||||
return schema;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Initialisiert das Szenario auf Basis eines [@link ContentRepository}
|
||||
* @param repository das Repository mit den Szenario-Artefakten
|
||||
* @param lazy optionales lazy loading der XML-Artefakte
|
||||
* @return true wenn erfolgreich
|
||||
*/
|
||||
public boolean initialize(ContentRepository repository, boolean lazy) {
|
||||
this.repository = repository;
|
||||
if (!lazy) {
|
||||
getSchema();
|
||||
getSelector();
|
||||
getSchematronValidations();
|
||||
getReportTransformation();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Liefer eine Liste mit Schematron Validierungs-Transformationen
|
||||
* @return liste mit initialisierten Transformationsinformationen
|
||||
*/
|
||||
public List<Transformation> getSchematronValidations() {
|
||||
if (schematronValidations == null) {
|
||||
schematronValidations = new ArrayList<>();
|
||||
getValidateWithSchematron().forEach(v -> {
|
||||
if (v.isPsvi()) {
|
||||
throw new NotImplementedException("This implemenation does not support PSVI usage");
|
||||
}
|
||||
final XsltExecutable xsltExecutable = repository.loadXsltScript(URI.create(v.getResource().getLocation()));
|
||||
schematronValidations.add(new Transformation(xsltExecutable, v.getResource()));
|
||||
});
|
||||
}
|
||||
return schematronValidations;
|
||||
}
|
||||
|
||||
/**
|
||||
* Der XPath-Selector zur Identifikation des Scenarios.
|
||||
*
|
||||
* @return vorbereiteten selector
|
||||
* @see {@link ScenarioRepository#selectScenario(Document)}.
|
||||
*/
|
||||
public XPathSelector getSelector() {
|
||||
if (xPathExecutable == null) {
|
||||
final Map<String, String> namespaces = getNamespace().stream().collect(Collectors.toMap(NamespaceType::getPrefix, NamespaceType::getValue));
|
||||
xPathExecutable = repository.createXPath(getMatch(), namespaces);
|
||||
}
|
||||
return xPathExecutable.load();
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter aus dem schema.
|
||||
*
|
||||
* @return xpath match
|
||||
*/
|
||||
public abstract String getMatch();
|
||||
|
||||
/**
|
||||
* Getter aus dem schema.
|
||||
*
|
||||
* @return {@link List} of {@link NamespaceType}
|
||||
*/
|
||||
public abstract List<NamespaceType> getNamespace();
|
||||
|
||||
/**
|
||||
* Getter aus dem schema.
|
||||
*
|
||||
* @return Validierungsanweisungen
|
||||
*/
|
||||
public abstract ValidateWithXmlSchema getValidateWithXmlSchema();
|
||||
|
||||
/**
|
||||
* Getter aus dem schema.
|
||||
*
|
||||
* @return Validierungsanweisungne
|
||||
*/
|
||||
public abstract List<ValidateWithSchematron> getValidateWithSchematron();
|
||||
|
||||
/**
|
||||
* Getter aus dem schema.
|
||||
*
|
||||
* @return report informationen
|
||||
*/
|
||||
public abstract CreateReportType getCreateReport();
|
||||
|
||||
/**
|
||||
* Laufzeitinformationen über eine Transformation.
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@AllArgsConstructor
|
||||
public class Transformation {
|
||||
|
||||
private XsltExecutable executable;
|
||||
|
||||
private ResourceType resourceType;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,82 @@
|
|||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
package de.kosit.validationtool.impl.model;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
|
||||
import de.kosit.validationtool.model.reportInput.XMLSyntaxErrorSeverity;
|
||||
|
||||
/**
|
||||
* Basis-Klasse für Syntax-Error. Wird über die JAXB-generierte Klasse
|
||||
* {@link de.kosit.validationtool.model.reportInput.XMLSyntaxError} erweitert.
|
||||
*
|
||||
* @author Andreas Penski
|
||||
*/
|
||||
public abstract class BaseXMLSyntaxError {
|
||||
|
||||
/**
|
||||
* Logged den Syntax-Fehler über einen definierten Logger.
|
||||
*
|
||||
* @param logger der Logger
|
||||
*/
|
||||
public void log(Logger logger) {
|
||||
String msgTemplate = "{} At row {} at pos {}";
|
||||
Object[] params = { getMessage(), getRowNumber(), getColumnNumber() };
|
||||
if (getSeverity() == XMLSyntaxErrorSeverity.SEVERITY_WARNING) {
|
||||
logger.warn(msgTemplate, params);
|
||||
} else {
|
||||
logger.error(msgTemplate, params);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.format("%s At row %s at pos %s", getMessage(), getRowNumber(), getColumnNumber());
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter aus dem schema
|
||||
*
|
||||
* @return Spalte des Fehlers
|
||||
*/
|
||||
public abstract Integer getColumnNumber();
|
||||
|
||||
/**
|
||||
* Getter aus dem schema
|
||||
*
|
||||
* @return Zeile des Fehlers
|
||||
*/
|
||||
public abstract Integer getRowNumber();
|
||||
|
||||
/**
|
||||
* Getter aus dem schema
|
||||
*
|
||||
* @return Fehlermeldung
|
||||
*/
|
||||
public abstract String getMessage();
|
||||
|
||||
/**
|
||||
* Getter aus dem schema
|
||||
*
|
||||
* @return severity
|
||||
*/
|
||||
public abstract XMLSyntaxErrorSeverity getSeverity();
|
||||
}
|
||||
80
src/main/java/de/kosit/validationtool/impl/model/Result.java
Normal file
80
src/main/java/de/kosit/validationtool/impl/model/Result.java
Normal file
|
|
@ -0,0 +1,80 @@
|
|||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
package de.kosit.validationtool.impl.model;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* Ein Ergebnisobjekte, dass das eigentliche Ergebnis hält und optional auch verschiedene Fehlerobjekte.
|
||||
*
|
||||
* @param <T> der Typ des Ergebnis-Objekts
|
||||
* @param <E> der Typ des Fehler-Objekts
|
||||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class Result<T, E> {
|
||||
|
||||
private T object;
|
||||
|
||||
private Collection<E> errors = new ArrayList<>();
|
||||
|
||||
/**
|
||||
* Erzeugt ein neues Ergebnis mit Fehler
|
||||
*
|
||||
* @param errors die Fehler
|
||||
*/
|
||||
public Result(Collection<E> errors) {
|
||||
this(null, errors);
|
||||
}
|
||||
|
||||
/**
|
||||
* Erzeugt ein neues Ergebnis mit einem Ergebnisobjekt
|
||||
*
|
||||
* @param o
|
||||
*/
|
||||
public Result(T o) {
|
||||
this(o, Collections.emptyList());
|
||||
}
|
||||
|
||||
/**
|
||||
* Zeigt an, ob das Ergebnis valide, also ohne Fehler ist.
|
||||
*
|
||||
* @return true wenn erfolgreich
|
||||
*/
|
||||
public boolean isValid() {
|
||||
return object != null && errors.isEmpty();
|
||||
}
|
||||
|
||||
/**
|
||||
* Zeigt an, ob das Ergebnis nicht valide ist, als entsprechend Fehler gesammelt wurden.
|
||||
*
|
||||
* @return true wenn erfolgreich wenn Fehler vorhanden sind.
|
||||
*/
|
||||
public boolean isInvalid() {
|
||||
return !isValid();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,120 @@
|
|||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
package de.kosit.validationtool.impl.tasks;
|
||||
|
||||
import de.kosit.validationtool.api.Input;
|
||||
import de.kosit.validationtool.impl.model.Result;
|
||||
import de.kosit.validationtool.model.reportInput.CreateReportInput;
|
||||
import de.kosit.validationtool.model.reportInput.XMLSyntaxError;
|
||||
import de.kosit.validationtool.model.scenarios.ScenarioType;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.w3c.dom.Document;
|
||||
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
/**
|
||||
* Interface, welches von allen Prüfschritten implementiert wird. Der Parameter vom Typ {@link Bag} dient dabei sowohl
|
||||
* als Quellce für Eingabe Parameter als auch für die Aufnahme von Ergebnisse, die an weitere Schritte weitergeleitet
|
||||
* werden sollen.
|
||||
*
|
||||
* @author Andreas Penski
|
||||
*/
|
||||
@FunctionalInterface
|
||||
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.
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
class Bag {
|
||||
|
||||
private Result<ScenarioType, String> scenarioSelectionResult;
|
||||
|
||||
private CreateReportInput reportInput;
|
||||
|
||||
/** Das finale Ergebnis */
|
||||
private Document report;
|
||||
|
||||
private boolean finished;
|
||||
|
||||
private boolean stopped;
|
||||
|
||||
/** Das zu prüfende Dokument */
|
||||
private Input input;
|
||||
|
||||
private Result<Document, XMLSyntaxError> parserResult;
|
||||
|
||||
private Result<Integer, String> assertionResult;
|
||||
|
||||
private Result<Boolean, XMLSyntaxError> schemaValidationResult;
|
||||
|
||||
public Bag(Input input) {
|
||||
this(input, new CreateReportInput());
|
||||
}
|
||||
|
||||
public Bag(Input input, CreateReportInput reportInput) {
|
||||
this.input = input;
|
||||
this.reportInput = reportInput;
|
||||
}
|
||||
|
||||
/**
|
||||
* Signalisiert einen vorzeitigen Stop der Vearbeitung.
|
||||
*/
|
||||
public void stopProcessing() {
|
||||
this.stopped = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gibt den Namen des Prüflings zurück, dabei werden etwaige Pfadinformationen abgeschnitten.
|
||||
*
|
||||
* @return der Name des Prüflings
|
||||
*/
|
||||
public String getName() {
|
||||
final String fileName = getInput().getName().replaceAll(".*/|.*\\\\", "");
|
||||
final Matcher matcher = Pattern.compile("(.*)\\..+").matcher(fileName);
|
||||
if (matcher.matches()) {
|
||||
return matcher.group(1);
|
||||
}
|
||||
return fileName;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,94 @@
|
|||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
package de.kosit.validationtool.impl.tasks;
|
||||
|
||||
import java.net.URI;
|
||||
|
||||
import javax.xml.transform.dom.DOMSource;
|
||||
|
||||
import org.w3c.dom.Document;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
import de.kosit.validationtool.impl.*;
|
||||
import de.kosit.validationtool.impl.model.Result;
|
||||
import de.kosit.validationtool.model.scenarios.ScenarioType;
|
||||
|
||||
import net.sf.saxon.s9api.*;
|
||||
|
||||
/**
|
||||
* Erzeugt den Report auf Basis der gesammelten Informationen über den Prüfling. Sollte kein Szenario identifiziert
|
||||
* worden sein, so wird ein {@link ScenarioRepository#getNoScenarioReport() default report} erzeugt.
|
||||
*
|
||||
* @author Andreas Penski
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
public class CreateReportAction implements CheckAction {
|
||||
|
||||
private final Processor processor;
|
||||
|
||||
private final ConversionService conversionService;
|
||||
|
||||
private final ScenarioRepository repository;
|
||||
|
||||
private final URI contentRepository;
|
||||
|
||||
private static XsltExecutable loadFromScenario(ScenarioType object) {
|
||||
return object.getReportTransformation().getExecutable();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void check(Bag results) {
|
||||
final DocumentBuilder documentBuilder = processor.newDocumentBuilder();
|
||||
try {
|
||||
|
||||
final Document inputDoc = results.getParserResult().isValid() ? results.getParserResult().getObject()
|
||||
: ObjectFactory.createDocumentBuilder(true).newDocument();
|
||||
|
||||
final XdmNode parsedDocument = documentBuilder.build(new DOMSource(inputDoc));
|
||||
final Document reportInput = conversionService.writeDocument(results.getReportInput());
|
||||
final XdmNode root = documentBuilder.build(new DOMSource(reportInput));
|
||||
final XsltTransformer transformer = getTransformation(results).load();
|
||||
transformer.setInitialContextNode(root);
|
||||
CollectingErrorEventHandler e = new CollectingErrorEventHandler();
|
||||
RelativeUriResolver resolver = new RelativeUriResolver(contentRepository);
|
||||
transformer.setMessageListener(e);
|
||||
transformer.setURIResolver(resolver);
|
||||
transformer.getUnderlyingController().setUnparsedTextURIResolver(resolver);
|
||||
transformer.setParameter(new QName("input-document"), parsedDocument);
|
||||
Document result = ObjectFactory.createDocumentBuilder(false).newDocument();
|
||||
transformer.setDestination(new DOMDestination(result));
|
||||
transformer.transform();
|
||||
results.setReport(result);
|
||||
|
||||
} catch (SaxonApiException e) {
|
||||
throw new IllegalStateException("Can not create final report", e);
|
||||
}
|
||||
}
|
||||
|
||||
private XsltExecutable getTransformation(Bag results) {
|
||||
final Result<ScenarioType, String> scenario = results.getScenarioSelectionResult();
|
||||
return scenario != null && scenario.isValid() ? loadFromScenario(scenario.getObject()) : loadFallback();
|
||||
}
|
||||
|
||||
private XsltExecutable loadFallback() {
|
||||
return repository.getNoScenarioReport();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,90 @@
|
|||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
package de.kosit.validationtool.impl.tasks;
|
||||
|
||||
import de.kosit.validationtool.api.Input;
|
||||
import de.kosit.validationtool.impl.CollectingErrorEventHandler;
|
||||
import de.kosit.validationtool.impl.ObjectFactory;
|
||||
import de.kosit.validationtool.impl.model.Result;
|
||||
import de.kosit.validationtool.model.reportInput.ValidationResultsWellformedness;
|
||||
import de.kosit.validationtool.model.reportInput.XMLSyntaxError;
|
||||
import de.kosit.validationtool.model.reportInput.XMLSyntaxErrorSeverity;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.w3c.dom.Document;
|
||||
import org.xml.sax.SAXException;
|
||||
|
||||
import javax.xml.parsers.DocumentBuilder;
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.util.Collections;
|
||||
|
||||
/**
|
||||
* Setzt Parsing-Funktionalitäten um. Prüft auf well-formedness
|
||||
*
|
||||
* @author Andreas Penski
|
||||
*/
|
||||
@Slf4j
|
||||
@RequiredArgsConstructor
|
||||
public class DocumentParseAction implements CheckAction {
|
||||
|
||||
/**
|
||||
* Parsed und überprüft ein übergebenes Dokument darauf ob es well-formed ist. Dies stellt den ersten
|
||||
* Verarbeitungsschritt des Prüf-Tools dar. Diese Funktion verzichtet explizit auf das Validierung gegenüber ein Schema.
|
||||
*
|
||||
* @param content ein Dokument
|
||||
* @return Ergebnis des Parsings inklusive etwaiger Fehler
|
||||
*/
|
||||
public Result<Document, XMLSyntaxError> parseDocument(Input content) {
|
||||
if (content == null) {
|
||||
throw new IllegalArgumentException("Url may not be null");
|
||||
}
|
||||
Result<Document, XMLSyntaxError> result;
|
||||
CollectingErrorEventHandler errorHandler = new CollectingErrorEventHandler();
|
||||
try ( InputStream input = new ByteArrayInputStream(content.getContent()) ) {
|
||||
DocumentBuilder db = ObjectFactory.createDocumentBuilder(false);
|
||||
db.setErrorHandler(errorHandler);
|
||||
Document doc = db.parse(input);
|
||||
result = new Result<>(doc, errorHandler.getErrors());
|
||||
} catch (SAXException e) {
|
||||
log.debug("SAXException while parsing {}", content.getName(), e);
|
||||
result = new Result<>(errorHandler.getErrors());
|
||||
} catch (IOException e) {
|
||||
log.debug("IOException while parsing {}", content, e);
|
||||
XMLSyntaxError error = new XMLSyntaxError();
|
||||
error.setSeverity(XMLSyntaxErrorSeverity.SEVERITY_FATAL_ERROR);
|
||||
error.setMessage(String.format("IOException while reading resource %s", content.getName()));
|
||||
result = new Result<>(Collections.singleton(error));
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void check(Bag results) {
|
||||
Result<Document, XMLSyntaxError> parserResult = parseDocument(results.getInput());
|
||||
ValidationResultsWellformedness v = new ValidationResultsWellformedness();
|
||||
results.setParserResult(parserResult);
|
||||
v.getXmlSyntaxError().addAll(parserResult.getErrors());
|
||||
results.getReportInput().setValidationResultsWellformedness(v);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,60 @@
|
|||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
package de.kosit.validationtool.impl.tasks;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
import de.kosit.validationtool.impl.ScenarioRepository;
|
||||
import de.kosit.validationtool.impl.model.Result;
|
||||
import de.kosit.validationtool.model.reportInput.CreateReportInput;
|
||||
import de.kosit.validationtool.model.reportInput.ProcessingError;
|
||||
import de.kosit.validationtool.model.scenarios.ScenarioType;
|
||||
|
||||
/**
|
||||
* Identifiziert das der Eingabe entsprechende Szenario, sofern eines konfiguriert ist.
|
||||
*
|
||||
* @author Andreas Penski
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
public class ScenarioSelectionAction implements CheckAction {
|
||||
|
||||
private final ScenarioRepository repository;
|
||||
|
||||
@Override
|
||||
public void check(Bag results) {
|
||||
final CreateReportInput report = results.getReportInput();
|
||||
final Result<ScenarioType, String> scenarioTypeResult = repository.selectScenario(results.getParserResult().getObject());
|
||||
results.setScenarioSelectionResult(scenarioTypeResult);
|
||||
if (scenarioTypeResult.isValid()) {
|
||||
final ScenarioType scenario = scenarioTypeResult.getObject();
|
||||
report.setScenario(scenario);
|
||||
} else {
|
||||
if (report.getProcessingError() == null) {
|
||||
report.setProcessingError(new ProcessingError());
|
||||
}
|
||||
report.getProcessingError().getError().addAll(scenarioTypeResult.getErrors());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSkipped(Bag results) {
|
||||
return results.getParserResult().isInvalid();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,86 @@
|
|||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
package de.kosit.validationtool.impl.tasks;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
|
||||
import javax.xml.transform.stream.StreamSource;
|
||||
import javax.xml.validation.Validator;
|
||||
|
||||
import org.xml.sax.SAXException;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import de.kosit.validationtool.impl.CollectingErrorEventHandler;
|
||||
import de.kosit.validationtool.impl.ObjectFactory;
|
||||
import de.kosit.validationtool.impl.model.Result;
|
||||
import de.kosit.validationtool.model.reportInput.CreateReportInput;
|
||||
import de.kosit.validationtool.model.reportInput.ValidationResultsXmlSchema;
|
||||
import de.kosit.validationtool.model.reportInput.XMLSyntaxError;
|
||||
import de.kosit.validationtool.model.scenarios.ScenarioType;
|
||||
|
||||
/**
|
||||
* Schema-Validierung der Eingabe-Datei mittels Schema-Definition aus dem identifizierten Szenario.
|
||||
*
|
||||
* @author Andreas Penski
|
||||
*/
|
||||
@Slf4j
|
||||
public class SchemaValidationAction implements CheckAction {
|
||||
|
||||
private Result<Boolean, XMLSyntaxError> validate(byte[] document, ScenarioType scenarioType) {
|
||||
log.debug("Validating document using scenario {}", scenarioType.getName());
|
||||
final CollectingErrorEventHandler errorHandler = new CollectingErrorEventHandler();
|
||||
try ( InputStream input = new ByteArrayInputStream(document) ) {
|
||||
final Validator validator = ObjectFactory.createValidator(scenarioType.getSchema());
|
||||
validator.setErrorHandler(errorHandler);
|
||||
validator.validate(new StreamSource(input));
|
||||
return new Result<>(!errorHandler.hasErrors(), errorHandler.getErrors());
|
||||
} catch (SAXException | IOException e) {
|
||||
throw new IllegalStateException("Error validating document", e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void check(Bag results) {
|
||||
final CreateReportInput report = results.getReportInput();
|
||||
final ScenarioType scenario = results.getScenarioSelectionResult().getObject();
|
||||
final Result<Boolean, XMLSyntaxError> validateResult = validate(results.getInput().getContent(), scenario);
|
||||
results.setSchemaValidationResult(validateResult);
|
||||
ValidationResultsXmlSchema result = new ValidationResultsXmlSchema();
|
||||
report.setValidationResultsXmlSchema(result);
|
||||
result.getResource().addAll(scenario.getValidateWithXmlSchema().getResource());
|
||||
if (!validateResult.isValid()) {
|
||||
result.getXmlSyntaxError().addAll(validateResult.getErrors());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public boolean isSkipped(Bag results) {
|
||||
return hasNoScenario(results);
|
||||
}
|
||||
|
||||
private static boolean hasNoScenario(Bag results) {
|
||||
return results.getScenarioSelectionResult() == null || results.getScenarioSelectionResult().isInvalid();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,97 @@
|
|||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
package de.kosit.validationtool.impl.tasks;
|
||||
|
||||
import java.net.URI;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import javax.xml.transform.dom.DOMSource;
|
||||
|
||||
import org.w3c.dom.Document;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
import de.kosit.validationtool.impl.CollectingErrorEventHandler;
|
||||
import de.kosit.validationtool.impl.ObjectFactory;
|
||||
import de.kosit.validationtool.impl.RelativeUriResolver;
|
||||
import de.kosit.validationtool.impl.model.BaseScenario;
|
||||
import de.kosit.validationtool.model.reportInput.CreateReportInput;
|
||||
import de.kosit.validationtool.model.reportInput.ValidationResultsSchematron;
|
||||
import de.kosit.validationtool.model.scenarios.ScenarioType;
|
||||
|
||||
import net.sf.saxon.s9api.*;
|
||||
|
||||
/**
|
||||
* Ausführung von konfigurierten Schematron Validierungen eines Szenarios.
|
||||
*
|
||||
* @author Andreas Penski
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
public class SchematronValidationAction implements CheckAction {
|
||||
|
||||
private final Processor processor;
|
||||
|
||||
private final URI repository;
|
||||
|
||||
private List<ValidationResultsSchematron> validate(Document document, ScenarioType scenario) {
|
||||
return scenario.getSchematronValidations().stream().map(v -> validate(document, v)).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
private ValidationResultsSchematron validate(Document document, BaseScenario.Transformation validation) {
|
||||
final DocumentBuilder documentBuilder = processor.newDocumentBuilder();
|
||||
try {
|
||||
final XdmNode root = documentBuilder.build(new DOMSource(document));
|
||||
final XsltTransformer transformer = validation.getExecutable().load();
|
||||
//resolving nur relative zum Repository
|
||||
final RelativeUriResolver resolver = new RelativeUriResolver(repository);
|
||||
transformer.setURIResolver(resolver);
|
||||
CollectingErrorEventHandler e = new CollectingErrorEventHandler();
|
||||
transformer.setMessageListener(e);
|
||||
|
||||
Document result = ObjectFactory.createDocumentBuilder(false).newDocument();
|
||||
transformer.setDestination(new DOMDestination(result));
|
||||
transformer.setInitialContextNode(root);
|
||||
transformer.transform();
|
||||
ValidationResultsSchematron s = new ValidationResultsSchematron();
|
||||
s.setResource(validation.getResourceType());
|
||||
ValidationResultsSchematron.Results r = new ValidationResultsSchematron.Results();
|
||||
r.setAny(result.getDocumentElement());
|
||||
s.setResults(r);
|
||||
return s;
|
||||
|
||||
} catch (SaxonApiException e) {
|
||||
throw new IllegalStateException("Can not run schematron validation", e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void check(Bag results) {
|
||||
final CreateReportInput report = results.getReportInput();
|
||||
final List<ValidationResultsSchematron> bla = validate(results.getParserResult().getObject(),
|
||||
results.getScenarioSelectionResult().getObject());
|
||||
report.getValidationResultsSchematron().addAll(bla);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSkipped(Bag results) {
|
||||
return results.getSchemaValidationResult() == null || results.getSchemaValidationResult().isInvalid();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,68 @@
|
|||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
package de.kosit.validationtool.impl.tasks;
|
||||
|
||||
import javax.xml.validation.Schema;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import de.kosit.validationtool.impl.CollectingErrorEventHandler;
|
||||
import de.kosit.validationtool.impl.ConversionService;
|
||||
import de.kosit.validationtool.impl.model.Result;
|
||||
import de.kosit.validationtool.model.reportInput.XMLSyntaxError;
|
||||
|
||||
/**
|
||||
* Validiert die gesammelten Informationen über den Prüfling. Zusätzlich Check.
|
||||
*
|
||||
* @author Andreas Penski
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Slf4j
|
||||
public class ValidateReportInputAction implements CheckAction {
|
||||
|
||||
private final ConversionService conversionService;
|
||||
|
||||
private final Schema schema;
|
||||
|
||||
@Override
|
||||
public void check(Bag bag) {
|
||||
final Result<Boolean, XMLSyntaxError> results = validate(bag.getReportInput());
|
||||
if (!results.isValid()) {
|
||||
log.error("Report input has errors {}", results.getErrors());
|
||||
bag.stopProcessing();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Validatiert das gegebene JAXB-Objekt gegen das konfigurierte Schema
|
||||
*
|
||||
* @param object das JAXB-Objekt
|
||||
* @param <T> der Typ des Objekts
|
||||
* @return ein Validierungsergebnis
|
||||
*/
|
||||
private <T> Result<Boolean, XMLSyntaxError> validate(T object) {
|
||||
CollectingErrorEventHandler h = new CollectingErrorEventHandler();
|
||||
final String result = conversionService.writeXml(object, schema, h);
|
||||
return new Result<>(StringUtils.isNotBlank(result), h.getErrors());
|
||||
}
|
||||
}
|
||||
55
src/main/model/binding/global.xjb
Normal file
55
src/main/model/binding/global.xjb
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<!--
|
||||
~ 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.
|
||||
-->
|
||||
|
||||
<jaxb:bindings
|
||||
xmlns:xs="http://www.w3.org/2001/XMLSchema"
|
||||
xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc"
|
||||
xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
|
||||
xmlns:inheritance="http://jaxb2-commons.dev.java.net/basic/inheritance"
|
||||
jaxb:extensionBindingPrefixes="inheritance"
|
||||
version="2.1">
|
||||
<jaxb:globalBindings>
|
||||
<xjc:serializable uid="-1"/>
|
||||
</jaxb:globalBindings>
|
||||
|
||||
|
||||
<jaxb:bindings schemaLocation="../xsd/createReportInput.xsd">
|
||||
<jaxb:schemaBindings>
|
||||
<jaxb:package name="de.kosit.validationtool.model.reportInput"/>
|
||||
</jaxb:schemaBindings>
|
||||
<jaxb:bindings node="//xs:complexType[@name='XMLSyntaxError']">
|
||||
<inheritance:extends>de.kosit.validationtool.impl.model.BaseXMLSyntaxError</inheritance:extends>
|
||||
</jaxb:bindings>
|
||||
</jaxb:bindings>
|
||||
<jaxb:bindings schemaLocation="../xsd/scenarios.xsd">
|
||||
<jaxb:schemaBindings>
|
||||
<jaxb:package name="de.kosit.validationtool.model.scenarios"/>
|
||||
</jaxb:schemaBindings>
|
||||
<jaxb:bindings node="//xs:complexType[@name='ScenarioType']">
|
||||
<inheritance:extends>de.kosit.validationtool.impl.model.BaseScenario</inheritance:extends>
|
||||
</jaxb:bindings>
|
||||
</jaxb:bindings>
|
||||
<jaxb:bindings schemaLocation="../xsd/assertions.xsd">
|
||||
<jaxb:schemaBindings>
|
||||
<jaxb:package name="de.kosit.validationtool.cmd.assertions"/>
|
||||
</jaxb:schemaBindings>
|
||||
</jaxb:bindings>
|
||||
|
||||
</jaxb:bindings>
|
||||
71
src/main/model/xsd/assertions.xsd
Normal file
71
src/main/model/xsd/assertions.xsd
Normal file
|
|
@ -0,0 +1,71 @@
|
|||
<?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.
|
||||
-->
|
||||
|
||||
<!-- $Id: assertions.xsd 7554 2017-09-13 14:27:21Z fbuettner $ -->
|
||||
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:a="http://www.xoev.de/de/validator/framework/1/assertions"
|
||||
targetNamespace="http://www.xoev.de/de/validator/framework/1/assertions" version="1.0.0"
|
||||
elementFormDefault="qualified"
|
||||
attributeFormDefault="unqualified">
|
||||
|
||||
<xs:element name="assertions">
|
||||
<xs:annotation>
|
||||
<xs:documentation>In diesem Dokument werden zum Test einer Prüftoolkonfiguration Zusicherungen zu einzelnen
|
||||
Prüfberichten beschrieben. Ein
|
||||
solches Dokument kann der Kommandozeilenversion des Prüftools über --check-assertions übergeben werden.
|
||||
</xs:documentation>
|
||||
</xs:annotation>
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="namespace" type="a:NamespaceType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="assertion" type="a:AssertionType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
|
||||
<xs:complexType name="NamespaceType">
|
||||
<xs:annotation>
|
||||
<xs:documentation>Definition eines Präfix für einen Namensraum, zur Verwendung in nachfolgenden
|
||||
assertion-Elementen.
|
||||
</xs:documentation>
|
||||
</xs:annotation>
|
||||
<xs:simpleContent>
|
||||
<xs:extension base="xs:anyURI">
|
||||
<xs:attribute name="prefix" use="required"/>
|
||||
</xs:extension>
|
||||
</xs:simpleContent>
|
||||
</xs:complexType>
|
||||
|
||||
<xs:complexType name="AssertionType">
|
||||
<xs:annotation>
|
||||
<xs:documentation>Zusicherung: für das in report-doc angegebene Dokument (relativ zum aktuellen
|
||||
Ausgabeverzeichnis) hat der angebene
|
||||
XPath-Test den "Effective Truth Value" true(). Im Textknoten kann eine textuelle Zusammenfassung des
|
||||
Tests stehen.
|
||||
</xs:documentation>
|
||||
</xs:annotation>
|
||||
<xs:simpleContent>
|
||||
<xs:extension base="xs:token">
|
||||
<xs:attribute name="report-doc" type="xs:anyURI" use="required"/>
|
||||
<xs:attribute name="test" type="xs:string" use="required"/>
|
||||
</xs:extension>
|
||||
</xs:simpleContent>
|
||||
</xs:complexType>
|
||||
|
||||
</xs:schema>
|
||||
153
src/main/model/xsd/createReportInput.xsd
Normal file
153
src/main/model/xsd/createReportInput.xsd
Normal file
|
|
@ -0,0 +1,153 @@
|
|||
<?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.
|
||||
-->
|
||||
|
||||
<!-- $Id$ -->
|
||||
<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"
|
||||
elementFormDefault="qualified" attributeFormDefault="unqualified">
|
||||
|
||||
<xs:import namespace="http://www.xoev.de/de/validator/framework/1/scenarios" schemaLocation="scenarios.xsd"/>
|
||||
|
||||
<xs:element name="createReportInput">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="engine" type="in:EngineType"/>
|
||||
<xs:element name="timestamp" type="xs:dateTime"/>
|
||||
<xs:element name="documentIdentification" type="in:DocumentIdentificationType"/>
|
||||
<xs:element ref="s:scenario" minOccurs="0"/>
|
||||
<xs:element name="validationResultsWellformedness" type="in:ValidationResultsWellformedness" minOccurs="0"/>
|
||||
<xs:element name="validationResultsXmlSchema" type="in:ValidationResultsXmlSchema" minOccurs="0"/>
|
||||
<xs:element name="validationResultsSchematron" type="in:ValidationResultsSchematron" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="processingError" type="in:ProcessingError" minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
<xs:attribute name="frameworkVersion" type="xs:string" use="required"/>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
|
||||
<xs:complexType name="Document">
|
||||
<xs:sequence>
|
||||
<xs:any processContents="skip" namespace="##any"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
|
||||
<xs:complexType name="ValidationResultsWellformedness">
|
||||
<xs:sequence>
|
||||
<xs:element name="xmlSyntaxError" type="in:XMLSyntaxError" minOccurs="0" maxOccurs="unbounded"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
|
||||
<xs:complexType name="ValidationResultsXmlSchema">
|
||||
<xs:sequence>
|
||||
<xs:element ref="s:resource" maxOccurs="unbounded"/>
|
||||
<xs:element name="xmlSyntaxError" type="in:XMLSyntaxError" minOccurs="0" maxOccurs="unbounded"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
|
||||
<xs:annotation>
|
||||
<xs:documentation>In alignment with
|
||||
http://docs.oracle.com/javase/8/docs/api/org/xml/sax/ErrorHandler.html and
|
||||
http://docs.oracle.com/javase/8/docs/api/org/xml/sax/SAXParseException.html</xs:documentation>
|
||||
</xs:annotation>
|
||||
<xs:complexType name="XMLSyntaxError">
|
||||
<xs:sequence>
|
||||
<xs:element name="message" type="xs:normalizedString"/>
|
||||
<xs:element name="severity" type="in:XMLSyntaxErrorSeverity"/>
|
||||
<xs:element name="rowNumber" type="xs:int" minOccurs="0"/>
|
||||
<xs:element name="columnNumber" type="xs:int" minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
|
||||
<xs:simpleType name="XMLSyntaxErrorSeverity">
|
||||
<xs:restriction base="xs:token">
|
||||
<xs:enumeration value="SEVERITY_WARNING"/>
|
||||
<xs:enumeration value="SEVERITY_ERROR"/>
|
||||
<xs:enumeration value="SEVERITY_FATAL_ERROR"/>
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
|
||||
<xs:complexType name="ValidationResultsSchematron">
|
||||
<xs:sequence>
|
||||
<xs:element ref="s:resource"/>
|
||||
<xs:element name="results">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:any namespace="##any" processContents="skip"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
|
||||
<xs:complexType name="DocumentIdentificationType">
|
||||
<xs:annotation>
|
||||
<xs:documentation>Dient der eindeutigen Identifikation des geprüften Dokuments anhand seines Hashwertes, der durch eine Dokumentenreferenz
|
||||
ergänzt werden kann.</xs:documentation>
|
||||
</xs:annotation>
|
||||
<xs:sequence>
|
||||
<xs:element name="documentHash">
|
||||
<xs:annotation>
|
||||
<xs:documentation>Angaben zum Hashwert des geprüften Dokuments.</xs:documentation>
|
||||
</xs:annotation>
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="hashAlgorithm" type="xs:normalizedString">
|
||||
<xs:annotation>
|
||||
<xs:documentation>Benennung eines Algorithmus zur Berechnung des Hashwerts.</xs:documentation>
|
||||
</xs:annotation>
|
||||
</xs:element>
|
||||
<xs:element name="hashValue" type="xs:base64Binary">
|
||||
<xs:annotation>
|
||||
<xs:documentation>Der Hashwert des geprüften Dokuments bei Anwendung des bezeichneten Algorithmus.</xs:documentation>
|
||||
</xs:annotation>
|
||||
</xs:element>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
<xs:element name="documentReference" type="xs:normalizedString">
|
||||
<xs:annotation>
|
||||
<xs:documentation>Eine von der prüfenden Organisationseinheit festgelegte, möglichst eindeutige Referenz des geprüften
|
||||
Dokuments.</xs:documentation>
|
||||
</xs:annotation>
|
||||
</xs:element>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
|
||||
<xs:complexType name="EngineType">
|
||||
<xs:sequence>
|
||||
<xs:element name="name" type="xs:normalizedString"/>
|
||||
<xs:element name="info" minOccurs="0" maxOccurs="unbounded">
|
||||
<xs:complexType>
|
||||
<xs:simpleContent>
|
||||
<xs:extension base="xs:normalizedString">
|
||||
<xs:attribute name="key" type="xs:NMTOKEN" use="required"/>
|
||||
</xs:extension>
|
||||
</xs:simpleContent>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
|
||||
<xs:complexType name="ProcessingError">
|
||||
<xs:sequence>
|
||||
<xs:element name="error" type="xs:string" minOccurs="1" maxOccurs="unbounded"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
|
||||
</xs:schema>
|
||||
137
src/main/model/xsd/scenarios.xsd
Normal file
137
src/main/model/xsd/scenarios.xsd
Normal file
|
|
@ -0,0 +1,137 @@
|
|||
<?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.
|
||||
-->
|
||||
|
||||
<!-- $Id$ -->
|
||||
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:s="http://www.xoev.de/de/validator/framework/1/scenarios"
|
||||
targetNamespace="http://www.xoev.de/de/validator/framework/1/scenarios" version="1.0.0" elementFormDefault="qualified" attributeFormDefault="unqualified">
|
||||
|
||||
<xs:element name="scenarios">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="name" type="xs:token"/>
|
||||
<xs:element minOccurs="0" name="author" type="xs:token"/>
|
||||
<xs:element name="date" type="xs:date"/>
|
||||
<xs:element name="description" type="s:DescriptionType"/>
|
||||
<xs:element ref="s:scenario" minOccurs="1" maxOccurs="unbounded"/>
|
||||
<xs:element name="noScenarioReport" type="s:NoScenarioReportType"/>
|
||||
</xs:sequence>
|
||||
<xs:attribute name="frameworkVersion" type="xs:string" use="required"/>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
|
||||
<xs:element name="scenario" type="s:ScenarioType"/>
|
||||
|
||||
<xs:complexType name="NoScenarioReportType">
|
||||
<xs:sequence>
|
||||
<xs:element ref="s:resource"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
|
||||
<xs:complexType name="DescriptionType">
|
||||
<xs:choice maxOccurs="unbounded">
|
||||
<xs:element name="p" type="xs:normalizedString"/>
|
||||
<xs:element name="ol">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element maxOccurs="unbounded" name="li" type="xs:normalizedString"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
<xs:element name="ul">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element maxOccurs="unbounded" name="li" type="xs:normalizedString"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
</xs:choice>
|
||||
</xs:complexType>
|
||||
|
||||
<!-- TODO: Prüfen, ob restriction passt -->
|
||||
<xs:simpleType name="ErrorLevelType">
|
||||
<xs:restriction base="xs:token">
|
||||
<xs:enumeration value="error"/>
|
||||
<xs:enumeration value="warning"/>
|
||||
<xs:enumeration value="information"/>
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
|
||||
<xs:simpleType name="Tokens">
|
||||
<xs:list itemType="xs:token"/>
|
||||
</xs:simpleType>
|
||||
|
||||
<xs:complexType name="ScenarioType">
|
||||
<xs:sequence>
|
||||
<xs:element name="name" type="xs:token"/>
|
||||
<xs:element minOccurs="0" name="description" type="s:DescriptionType"/>
|
||||
<xs:element minOccurs="0" maxOccurs="unbounded" name="namespace" type="s:NamespaceType"/>
|
||||
<xs:element name="match" type="xs:string"/>
|
||||
<xs:element name="validateWithXmlSchema" type="s:ValidateWithXmlSchema"/>
|
||||
<xs:element name="validateWithSchematron" maxOccurs="unbounded" minOccurs="0" type="s:ValidateWithSchematron"/>
|
||||
<xs:element name="createReport" type="s:CreateReportType"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
|
||||
<xs:element name="resource" type="s:ResourceType"/>
|
||||
|
||||
<xs:complexType name="NamespaceType">
|
||||
<xs:simpleContent>
|
||||
<xs:extension base="xs:anyURI">
|
||||
<xs:attribute name="prefix" use="required"/>
|
||||
</xs:extension>
|
||||
</xs:simpleContent>
|
||||
</xs:complexType>
|
||||
|
||||
<xs:complexType name="ResourceType">
|
||||
<xs:sequence>
|
||||
<xs:element name="name" type="xs:token"/>
|
||||
<xs:element name="location" type="xs:anyURI"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
|
||||
<xs:complexType name="ValidateWithXmlSchema">
|
||||
<xs:sequence>
|
||||
<xs:element ref="s:resource" maxOccurs="unbounded"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
|
||||
<xs:complexType name="ValidateWithSchematron">
|
||||
<xs:sequence>
|
||||
<xs:element ref="s:resource"/>
|
||||
</xs:sequence>
|
||||
<xs:attribute name="psvi" type="xs:boolean" default="false" use="optional"/>
|
||||
</xs:complexType>
|
||||
|
||||
|
||||
<xs:complexType name="CreateReportType">
|
||||
<xs:sequence>
|
||||
<xs:element ref="s:resource"/>
|
||||
<xs:element maxOccurs="3" minOccurs="0" name="customLevel" type="s:CustomErrorLevel"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
|
||||
<xs:complexType name="CustomErrorLevel">
|
||||
<xs:simpleContent>
|
||||
<xs:extension base="s:Tokens">
|
||||
<xs:attribute name="level" type="s:ErrorLevelType" use="required"/>
|
||||
</xs:extension>
|
||||
</xs:simpleContent>
|
||||
</xs:complexType>
|
||||
</xs:schema>
|
||||
51
src/main/resources/simplelogger.properties
Normal file
51
src/main/resources/simplelogger.properties
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
#
|
||||
# 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.
|
||||
#
|
||||
|
||||
# SLF4J's SimpleLogger configuration file for the command line client
|
||||
# Simple implementation of Logger that sends all enabled log messages, for all defined loggers, to System.err.
|
||||
|
||||
# Default logging detail level for all instances of SimpleLogger.
|
||||
# Must be one of ("trace", "debug", "info", "warn", or "error").
|
||||
# If not specified, defaults to "info".
|
||||
org.slf4j.simpleLogger.defaultLogLevel=info
|
||||
|
||||
|
||||
# Set to true if you want the current date and time to be included in output messages.
|
||||
# Default is false, and will output the number of milliseconds elapsed since startup.
|
||||
org.slf4j.simpleLogger.showDateTime=true
|
||||
|
||||
# The date and time format to be used in the output messages.
|
||||
# The pattern describing the date and time format is the same that is used in java.text.SimpleDateFormat.
|
||||
# If the format is not specified or is invalid, the default format is used.
|
||||
# The default format is yyyy-MM-dd HH:mm:ss:SSS Z.
|
||||
org.slf4j.simpleLogger.dateTimeFormat=yyyy-MM-dd HH:mm:ss
|
||||
|
||||
# Set to true if you want to output the current thread name.
|
||||
# Defaults to true.
|
||||
org.slf4j.simpleLogger.showThreadName=false
|
||||
|
||||
# Set to true if you want the Logger instance name to be included in output messages.
|
||||
# Defaults to true.
|
||||
org.slf4j.simpleLogger.showLogName=false
|
||||
|
||||
# Set to true if you want the last component of the name to be included in output messages.
|
||||
# Defaults to false.
|
||||
org.slf4j.simpleLogger.showShortLogName=false
|
||||
|
||||
org.slf4j.simpleLogger.levelInBrackets=true
|
||||
149
src/test/java/de/kosit/validationtool/api/InputFactoryTest.java
Normal file
149
src/test/java/de/kosit/validationtool/api/InputFactoryTest.java
Normal file
|
|
@ -0,0 +1,149 @@
|
|||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
package de.kosit.validationtool.api;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.File;
|
||||
import java.io.InputStream;
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URISyntaxException;
|
||||
import java.net.URL;
|
||||
import java.nio.file.Paths;
|
||||
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.ExpectedException;
|
||||
|
||||
import de.kosit.validationtool.impl.ConversionServiceTest;
|
||||
|
||||
/**
|
||||
* Testet den Hashcode-Service.
|
||||
*
|
||||
* @author Andreas Penski
|
||||
*/
|
||||
public class InputFactoryTest {
|
||||
|
||||
private static final URL CONTENT = ConversionServiceTest.class.getResource("/valid/scenarios.xml");
|
||||
|
||||
private static final URL OTHER_CONTENT = ConversionServiceTest.class.getResource("/valid/report.xml");
|
||||
|
||||
public static final String SOME_VALUE = "some value";
|
||||
|
||||
private static URL NOT_EXISTING;
|
||||
|
||||
static {
|
||||
try {
|
||||
NOT_EXISTING = new URL("file://localhost/somefile.text");
|
||||
} catch (MalformedURLException e) {
|
||||
// just ignore;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Rule
|
||||
public ExpectedException expectedException = ExpectedException.none();
|
||||
|
||||
@Test
|
||||
public void testDefaultDigestAlgorithm() {
|
||||
assertThat(new InputFactory().getAlgorithm()).isEqualTo(InputFactory.DEFAULT_ALGORITH);
|
||||
assertThat(new InputFactory("").getAlgorithm()).isEqualTo(InputFactory.DEFAULT_ALGORITH);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSimple() {
|
||||
final byte[] s1 = InputFactory.read(CONTENT).getHashCode();
|
||||
final byte[] s2 = InputFactory.read(CONTENT).getHashCode();
|
||||
final byte[] s3 = InputFactory.read(OTHER_CONTENT).getHashCode();
|
||||
assertThat(s1).isNotEmpty();
|
||||
assertThat(s1).isEqualTo(s2);
|
||||
assertThat(s3).isNotEmpty();
|
||||
assertThat(s1).isNotEqualTo(s3);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testWrongAlgorithm() {
|
||||
expectedException.expect(IllegalStateException.class);
|
||||
InputFactory service = new InputFactory("unknown");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testNullInputURL() {
|
||||
expectedException.expect(IllegalArgumentException.class);
|
||||
InputFactory.read((URL) null);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testInputByte() {
|
||||
final Input input = InputFactory.read(SOME_VALUE.getBytes(), SOME_VALUE);
|
||||
assertThat(input).isNotNull();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testInputStream() {
|
||||
final Input input = InputFactory.read(new ByteArrayInputStream(SOME_VALUE.getBytes()), SOME_VALUE);
|
||||
assertThat(input).isNotNull();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testNullStream() {
|
||||
expectedException.expect(IllegalArgumentException.class);
|
||||
final Input input = InputFactory.read((InputStream)null, SOME_VALUE);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testInputFile() throws URISyntaxException {
|
||||
final Input input = InputFactory.read(new File(CONTENT.toURI()));
|
||||
assertThat(input).isNotNull();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testInputPath() throws URISyntaxException {
|
||||
final Input input = InputFactory.read(Paths.get(CONTENT.toURI()));
|
||||
assertThat(input).isNotNull();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testNullInput() {
|
||||
expectedException.expect(IllegalArgumentException.class);
|
||||
InputFactory.read((byte[]) null, SOME_VALUE);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testNullInputName() {
|
||||
expectedException.expect(IllegalArgumentException.class);
|
||||
InputFactory.read(SOME_VALUE.getBytes(), null);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testEmptyInputName() {
|
||||
expectedException.expect(IllegalArgumentException.class);
|
||||
InputFactory.read(SOME_VALUE.getBytes(), "");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testUnexistingInput() {
|
||||
expectedException.expect(IllegalArgumentException.class);
|
||||
InputFactory.read(NOT_EXISTING);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,77 @@
|
|||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
package de.kosit.validationtool.cmd;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.URISyntaxException;
|
||||
import java.net.URL;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
import de.kosit.validationtool.api.InputFactory;
|
||||
import de.kosit.validationtool.cmd.assertions.Assertions;
|
||||
import de.kosit.validationtool.impl.Helper;
|
||||
import de.kosit.validationtool.impl.ObjectFactory;
|
||||
import de.kosit.validationtool.impl.tasks.CheckAction;
|
||||
import de.kosit.validationtool.model.reportInput.CreateReportInput;
|
||||
|
||||
/**
|
||||
* Testet das Assertion-Feature.
|
||||
*
|
||||
* @author Andreas Penski
|
||||
*/
|
||||
public class CheckAssertionActionTest {
|
||||
|
||||
private static final URL SAMPLE = CheckAssertionActionTest.class.getResource("/examples/assertions/ubl-0001.xml");
|
||||
|
||||
private static final URL SAMPLE_REPORT = CheckAssertionActionTest.class.getResource("/examples/assertions/ubl-0001-report.xml");
|
||||
|
||||
private static final URL SAMPLE_ASSERTIONS = CheckAssertionActionTest.class.getResource("/examples/assertions/tests-xrechnung.xml");
|
||||
|
||||
private CommandLine commandLine;
|
||||
|
||||
@Before
|
||||
public void setup() throws IOException {
|
||||
commandLine = new CommandLine();
|
||||
commandLine.activate();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testEmptyInput() {
|
||||
CheckAssertionAction a = new CheckAssertionAction(new Assertions(), ObjectFactory.createProcessor());
|
||||
a.check(new CheckAction.Bag(InputFactory.read(SAMPLE), new CreateReportInput()));
|
||||
assertThat(commandLine.getErrorOutput()).contains("Can not find assertions for");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSimple() throws URISyntaxException {
|
||||
final CheckAction.Bag bag = new CheckAction.Bag(InputFactory.read(SAMPLE), new CreateReportInput());
|
||||
bag.setReport(Helper.load(SAMPLE_REPORT).getObject());
|
||||
|
||||
final Assertions assertions = Helper.load(SAMPLE_ASSERTIONS, Assertions.class);
|
||||
CheckAssertionAction a = new CheckAssertionAction(assertions, ObjectFactory.createProcessor());
|
||||
a.check(bag);
|
||||
|
||||
assertThat(commandLine.getErrorOutput()).contains("Assertion mismatch");
|
||||
}
|
||||
}
|
||||
130
src/test/java/de/kosit/validationtool/cmd/CommandLine.java
Normal file
130
src/test/java/de/kosit/validationtool/cmd/CommandLine.java
Normal file
|
|
@ -0,0 +1,130 @@
|
|||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
package de.kosit.validationtool.cmd;
|
||||
|
||||
import java.io.*;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.commons.io.IOUtils;
|
||||
import org.apache.commons.io.output.TeeOutputStream;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
/**
|
||||
* Helferlein um Ausgaben auf der Kommandozeile zu testen.
|
||||
*
|
||||
* @author Andreas Penski
|
||||
*/
|
||||
public class CommandLine {
|
||||
|
||||
private static ReplaceableOutputStream<ByteArrayOutputStream> out = new ReplaceableOutputStream<>();
|
||||
|
||||
private static ReplaceableOutputStream<ByteArrayOutputStream> error = new ReplaceableOutputStream<>();
|
||||
|
||||
static {
|
||||
// Initialisierung muss vor SL4J's SimpleLogger erfolgen, sonst sind logs nicht erfasst.
|
||||
// deshalb darf diese Klasse kein Log haben
|
||||
System.setOut(new PrintStream(new TeeOutputStream(System.out, out)));
|
||||
System.setErr(new PrintStream(new TeeOutputStream(System.err, error)));
|
||||
}
|
||||
|
||||
public String getOutput() {
|
||||
return new String(out.getOut().toByteArray());
|
||||
}
|
||||
|
||||
|
||||
public String getErrorOutput() {
|
||||
return new String(error.getOut().toByteArray());
|
||||
}
|
||||
|
||||
public List<String> getOutputLines() {
|
||||
return readLines(out.getOut().toByteArray());
|
||||
}
|
||||
|
||||
public List<String> getErrorLines() {
|
||||
return readLines(error.getOut().toByteArray());
|
||||
}
|
||||
|
||||
private List<String> readLines(byte[] bytes) {
|
||||
try ( ByteArrayInputStream in = new ByteArrayInputStream(bytes);
|
||||
Reader r = new InputStreamReader(in) ) {
|
||||
|
||||
return IOUtils.readLines(r);
|
||||
} catch (IOException e) {
|
||||
throw new IllegalStateException("Can not read input");
|
||||
}
|
||||
}
|
||||
|
||||
public void activate() {
|
||||
out.setOut(new ByteArrayOutputStream());
|
||||
error.setOut(new ByteArrayOutputStream());
|
||||
|
||||
}
|
||||
|
||||
public void deactivate() {
|
||||
out.setOut(null);
|
||||
error.setOut(null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Simpler Proxy für {@link OutputStream}, dessen target ausgetauscht werden kann.
|
||||
*
|
||||
* @param <O> Typ des eigentlichen {@link OutputStream}
|
||||
*/
|
||||
private static class ReplaceableOutputStream<O extends OutputStream> extends OutputStream {
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
private O out;
|
||||
|
||||
public void write(int idx) throws IOException {
|
||||
if (out != null) {
|
||||
this.out.write(idx);
|
||||
}
|
||||
}
|
||||
|
||||
public void write(byte[] bts) throws IOException {
|
||||
if (out != null) {
|
||||
this.out.write(bts);
|
||||
}
|
||||
}
|
||||
|
||||
public void write(byte[] bts, int st, int end) throws IOException {
|
||||
if (out != null) {
|
||||
this.out.write(bts, st, end);
|
||||
}
|
||||
}
|
||||
|
||||
public void flush() throws IOException {
|
||||
|
||||
if (out != null) {
|
||||
this.out.flush();
|
||||
}
|
||||
}
|
||||
|
||||
public void close() throws IOException {
|
||||
if (out != null) {
|
||||
this.out.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,178 @@
|
|||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
package de.kosit.validationtool.cmd;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.List;
|
||||
|
||||
import static de.kosit.validationtool.impl.Helper.*;
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
/**
|
||||
* Testet die Parameter des Kommandozeilen-Tools.
|
||||
*
|
||||
* @author Andreas Penski
|
||||
*/
|
||||
public class CommandlineApplicationTest {
|
||||
|
||||
public static final String RESULT_OUTPUT = "Processing 1 object(s) completed";
|
||||
|
||||
private CommandLine commandLine;
|
||||
|
||||
|
||||
@Before
|
||||
public void setup() throws IOException {
|
||||
commandLine = new CommandLine();
|
||||
commandLine.activate();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testHelp() {
|
||||
String[] args = new String[] { "-?" };
|
||||
CommandLineApplication.mainProgram(args);
|
||||
assertThat(commandLine.getErrorOutput()).isEmpty();
|
||||
checkForHelp(commandLine.getOutputLines());
|
||||
}
|
||||
|
||||
private void checkForHelp(List<String> outputLines) {
|
||||
assertThat(outputLines.size()).isGreaterThan(0);
|
||||
outputLines.subList(1, outputLines.size() - 1).forEach(l -> assertThat(l.startsWith(" -") || l.startsWith(" ")));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testRequiredScenarioFile() {
|
||||
String[] args = new String[] { "-d", "arguments", "egal welche", "argument drin sind" };
|
||||
CommandLineApplication.mainProgram(args);
|
||||
assertThat(commandLine.getErrorOutput()).isNotEmpty();
|
||||
assertThat(commandLine.getErrorOutput()).contains("Missing required option: s");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testNotExistingScenarioFile() {
|
||||
String[] args = new String[] { "-s", Paths.get(NOT_EXISTING).toString(), Paths.get(NOT_EXISTING).toString() };
|
||||
CommandLineApplication.mainProgram(args);
|
||||
assertThat(commandLine.getErrorOutput()).isNotEmpty();
|
||||
assertThat(commandLine.getErrorOutput()).contains("Not a valid path for scenario definition specified");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testIncorrectRepository() {
|
||||
String[] args = new String[] { "-s", Paths.get(SCENARIO_FILE).toString(), Paths.get(NOT_EXISTING).toString() };
|
||||
CommandLineApplication.mainProgram(args);
|
||||
assertThat(commandLine.getErrorOutput()).isNotEmpty();
|
||||
assertThat(commandLine.getErrorOutput()).contains("Can not load schema from sources");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testNotExistingTestTarget() {
|
||||
String[] args = new String[] { "-s", Paths.get(SCENARIO_FILE).toString(), "-r", Paths.get(REPOSITORY).toString(),
|
||||
Paths.get(NOT_EXISTING).toString() };
|
||||
CommandLineApplication.mainProgram(args);
|
||||
assertThat(commandLine.getErrorOutput()).isNotEmpty();
|
||||
assertThat(commandLine.getErrorOutput()).contains("No test targets found");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testValidMinimalConfiguration() {
|
||||
String[] args = new String[] { "-s", Paths.get(SCENARIO_FILE).toString(), "-r", Paths.get(REPOSITORY).toString(),
|
||||
Paths.get(SAMPLE).toString() };
|
||||
CommandLineApplication.mainProgram(args);
|
||||
assertThat(commandLine.getErrorOutput()).contains(RESULT_OUTPUT);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testValidMultipleInput() {
|
||||
String[] args = new String[] { "-s", Paths.get(SCENARIO_FILE).toString(), "-r", Paths.get(REPOSITORY).toString(),
|
||||
Paths.get(SAMPLE).toString(), Paths.get(SAMPLE2).toString() };
|
||||
CommandLineApplication.mainProgram(args);
|
||||
assertThat(commandLine.getErrorOutput()).contains("Processing 2 object(s) completed");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testValidDirectoryInput() {
|
||||
String[] args = new String[] { "-s", Paths.get(SCENARIO_FILE).toString(), "-r", Paths.get(REPOSITORY).toString(),
|
||||
Paths.get(SAMPLE_DIR).toString() };
|
||||
CommandLineApplication.mainProgram(args);
|
||||
assertThat(commandLine.getErrorOutput()).contains("Processing 4 object(s) completed");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testValidOutputConfiguration() throws IOException {
|
||||
Path output = Paths.get("output");
|
||||
// assertThat(output).doesNotExist();
|
||||
String[] args = new String[] { "-s", Paths.get(SCENARIO_FILE).toString(), "-o", output.getFileName().toString(), "-r",
|
||||
Paths.get(REPOSITORY).toString(), Paths.get(SAMPLE).toString() };
|
||||
CommandLineApplication.mainProgram(args);
|
||||
assertThat(commandLine.getErrorOutput()).contains(RESULT_OUTPUT);
|
||||
assertThat(output).exists();
|
||||
assertThat(Files.list(output)).hasSize(1);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testNoInput() {
|
||||
// assertThat(output).doesNotExist();
|
||||
String[] args = new String[] { "-s", Paths.get(SCENARIO_FILE).toString(), "-r", Paths.get(REPOSITORY).toString(), };
|
||||
CommandLineApplication.mainProgram(args);
|
||||
checkForHelp(commandLine.getOutputLines());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testPrint() {
|
||||
|
||||
String[] args = new String[] { "-s", Paths.get(SCENARIO_FILE).toString(), "-p", "-r", Paths.get(REPOSITORY).toString(),
|
||||
Paths.get(SAMPLE).toString() };
|
||||
CommandLineApplication.mainProgram(args);
|
||||
assertThat(commandLine.getErrorOutput()).contains(RESULT_OUTPUT);
|
||||
assertThat(commandLine.getOutputLines()).contains("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testHtmlExtraktion() throws IOException {
|
||||
Path output = Files.createTempDirectory("pruef-tool-test");
|
||||
String[] args = new String[] { "-s", Paths.get(SCENARIO_FILE).toString(), "-h", "-o", output.toAbsolutePath().toString(), "-r",
|
||||
Paths.get(REPOSITORY).toString(), Paths.get(SAMPLE).toString() };
|
||||
CommandLineApplication.mainProgram(args);
|
||||
assertThat(commandLine.getErrorOutput()).contains(RESULT_OUTPUT);
|
||||
assertThat(Files.list(output).filter(f -> f.toString().endsWith(".html")).count()).isGreaterThan(0);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testAssertionsExtraktion() throws IOException {
|
||||
String[] args = new String[] { "-d", "-s", Paths.get(SCENARIO_FILE).toString(), "-r", Paths.get(REPOSITORY).toString(), "-c",
|
||||
Paths.get(ASSERTIONS).toString(), Paths.get(REPOSITORY).toString(), Paths.get(SAMPLE).toString() };
|
||||
CommandLineApplication.mainProgram(args);
|
||||
assertThat(commandLine.getErrorOutput()).contains(RESULT_OUTPUT);
|
||||
assertThat(commandLine.getErrorOutput()).contains("Can not find assertions for ");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testDebugFlag() throws IOException {
|
||||
String[] args = new String[] { "-s", Paths.get(SCENARIO_FILE).toString(), "-r", "unknown", "-d", Paths.get(ASSERTIONS).toString() };
|
||||
CommandLineApplication.mainProgram(args);
|
||||
assertThat(commandLine.getErrorOutput()).contains("at de.kosit.validationtool");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,74 @@
|
|||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
package de.kosit.validationtool.cmd;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.URL;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.apache.commons.io.FileUtils;
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
import de.kosit.validationtool.api.InputFactory;
|
||||
import de.kosit.validationtool.impl.Helper;
|
||||
import de.kosit.validationtool.impl.tasks.CheckAction;
|
||||
|
||||
/**
|
||||
* Testet die HTML-Extrkation des Kommondazeilenprogramms.
|
||||
*
|
||||
* @author Andreas Penski
|
||||
*/
|
||||
public class ExtractHtmlActionTest {
|
||||
|
||||
private static final URL REPORT = SerializeReportActionTest.class.getResource("/examples/results/report.xml");
|
||||
|
||||
private ExtractHtmlContentAction action;
|
||||
|
||||
private Path tmpDirectory;
|
||||
|
||||
@Before
|
||||
public void setup() throws IOException {
|
||||
tmpDirectory = Files.createTempDirectory("checktool");
|
||||
action = new ExtractHtmlContentAction(Helper.loadTestRepository(), tmpDirectory);
|
||||
}
|
||||
|
||||
@After
|
||||
public void tearDown() throws IOException {
|
||||
FileUtils.deleteDirectory(tmpDirectory.toFile());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSimple() throws IOException {
|
||||
CheckAction.Bag b = new CheckAction.Bag(InputFactory.read(REPORT));
|
||||
assertThat(action.isSkipped(b)).isTrue();
|
||||
b.setReport(Helper.load(REPORT).getObject());
|
||||
action.check(b);
|
||||
assertThat(action.isSkipped(b)).isFalse();
|
||||
action.check(b);
|
||||
assertThat(b.isStopped()).isFalse();
|
||||
assertThat(Files.list(tmpDirectory).collect(Collectors.toList())).hasSize(1);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,70 @@
|
|||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
package de.kosit.validationtool.cmd;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.URL;
|
||||
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
import de.kosit.validationtool.api.InputFactory;
|
||||
import de.kosit.validationtool.impl.Helper;
|
||||
import de.kosit.validationtool.impl.tasks.CheckAction;
|
||||
|
||||
/**
|
||||
* @author Andreas Penski
|
||||
*/
|
||||
public class PrintReportActionTest {
|
||||
|
||||
private static final URL REPORT = SerializeReportActionTest.class.getResource("/examples/results/report.xml");
|
||||
|
||||
private CommandLine commandLine;
|
||||
|
||||
private PrintReportAction action;
|
||||
|
||||
@Before
|
||||
public void setup() throws IOException {
|
||||
commandLine = new CommandLine();
|
||||
commandLine.activate();
|
||||
action = new PrintReportAction();
|
||||
}
|
||||
|
||||
@After
|
||||
public void tearDownd() throws IOException {
|
||||
commandLine.deactivate();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSimpleSerialize() {
|
||||
CheckAction.Bag b = new CheckAction.Bag(InputFactory.read(REPORT));
|
||||
b.setReport(Helper.load(REPORT).getObject());
|
||||
assertThat(action.isSkipped(b)).isFalse();
|
||||
action.check(b);
|
||||
assertThat(b.isStopped()).isFalse();
|
||||
assertThat(commandLine.getOutput()).isNotEmpty();
|
||||
assertThat(commandLine.getOutput()).startsWith("<?xml version=\"1.0\" ");
|
||||
assertThat(commandLine.getErrorOutput()).isEmpty();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,78 @@
|
|||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
package de.kosit.validationtool.cmd;
|
||||
|
||||
import de.kosit.validationtool.api.InputFactory;
|
||||
import de.kosit.validationtool.impl.Helper;
|
||||
import de.kosit.validationtool.impl.tasks.CheckAction;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.URL;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
/**
|
||||
* @author Andreas Penski
|
||||
*/
|
||||
public class SerializeReportActionTest {
|
||||
|
||||
private static final URL REPORT = SerializeReportActionTest.class.getResource("/examples/results/report.xml");
|
||||
|
||||
private Path tmpDirectory;
|
||||
|
||||
private SerializeReportAction action;
|
||||
|
||||
@Before
|
||||
public void setup() throws IOException {
|
||||
tmpDirectory = Files.createTempDirectory("checktool");
|
||||
action = new SerializeReportAction(tmpDirectory);
|
||||
}
|
||||
|
||||
@After
|
||||
public void tearDown() throws IOException {
|
||||
FileUtils.deleteDirectory(tmpDirectory.toFile());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSimpleSerialize() {
|
||||
CheckAction.Bag b = new CheckAction.Bag(InputFactory.read(REPORT));
|
||||
assertThat(action.isSkipped(b)).isTrue();
|
||||
b.setReport(Helper.load(REPORT).getObject());
|
||||
assertThat(action.isSkipped(b)).isFalse();
|
||||
action.check(b);
|
||||
assertThat(b.isStopped()).isFalse();
|
||||
assertThat(tmpDirectory.toFile().listFiles()).hasSize(1);
|
||||
}
|
||||
|
||||
//ERPT-83
|
||||
@Test
|
||||
public void testName(){
|
||||
final String name = "some.name.with.dots";
|
||||
CheckAction.Bag b = new CheckAction.Bag(InputFactory.read("ega".getBytes(), name + ".xml"));
|
||||
assertThat(b.getName()).isEqualTo(name);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,111 @@
|
|||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
package de.kosit.validationtool.impl;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
import java.net.MalformedURLException;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.xml.validation.Schema;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.ExpectedException;
|
||||
|
||||
import net.sf.saxon.s9api.XPathExecutable;
|
||||
import net.sf.saxon.s9api.XsltExecutable;
|
||||
|
||||
/**
|
||||
* Testet das ContentRepository.
|
||||
*
|
||||
* @author Andreas Penski
|
||||
*/
|
||||
public class ContentRepositoryTest {
|
||||
|
||||
private ContentRepository repository;
|
||||
|
||||
@Rule
|
||||
public ExpectedException exception = ExpectedException.none();
|
||||
|
||||
|
||||
@Before
|
||||
public void setup() {
|
||||
repository = new ContentRepository(ObjectFactory.createProcessor(), Helper.REPOSITORY);
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void testCreateSchema() throws MalformedURLException {
|
||||
final Schema schema = repository.createSchema(Helper.ASSERTION_SCHEMA.toURL());
|
||||
assertThat(schema).isNotNull();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSchemaCaching() throws MalformedURLException {
|
||||
final Schema schema = repository.getReportInputSchema();
|
||||
assertThat(repository.getReportInputSchema()).isSameAs(schema);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCreateSchemaNotExisting()throws Exception {
|
||||
exception.expect(IllegalStateException.class);
|
||||
repository.createSchema(Helper.ASSERTION_SCHEMA.resolve("noexisting").toURL());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testLoadXSLT() throws MalformedURLException {
|
||||
final XsltExecutable executable = repository.loadXsltScript(Helper.SAMPLE_XSLT);
|
||||
assertThat(executable).isNotNull();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testLoadXSLTNotExisting() throws MalformedURLException {
|
||||
exception.expect(IllegalStateException.class);
|
||||
repository.loadXsltScript(Helper.SAMPLE_XSLT.resolve("notexisting"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testXpathCreation() throws MalformedURLException {
|
||||
XPathExecutable xPath = repository.createXPath("//html", null);
|
||||
assertThat(xPath).isNotNull();
|
||||
xPath = repository.createXPath("//html", Collections.emptyMap());
|
||||
assertThat(xPath).isNotNull();
|
||||
Map<String,String> namespace = new HashMap<>();
|
||||
namespace.put("html", "http://www.w3.org/1999/xhtml");
|
||||
xPath = repository.createXPath("//html:html", namespace );
|
||||
assertThat(xPath).isNotNull();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testXpathCreationWithoutNamespace(){
|
||||
exception.expect(IllegalStateException.class);
|
||||
repository.createXPath("//html:html", null );
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testIllegalXpath(){
|
||||
exception.expect(IllegalStateException.class);
|
||||
repository.createXPath("kein Xpath Ausdruck", null );
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,121 @@
|
|||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
package de.kosit.validationtool.impl;
|
||||
|
||||
import static org.assertj.core.api.Java6Assertions.assertThat;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.Serializable;
|
||||
import java.net.URISyntaxException;
|
||||
import java.net.URL;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.ExpectedException;
|
||||
|
||||
import de.kosit.validationtool.model.scenarios.Scenarios;
|
||||
|
||||
/**
|
||||
* Simple test for testing the jaxb conversion service.
|
||||
*
|
||||
* @author apenski
|
||||
*/
|
||||
public class ConversionServiceTest {
|
||||
|
||||
private static final URL VALID_XML = ConversionServiceTest.class.getResource("/valid/scenarios.xml");
|
||||
|
||||
private static final URL INVALID_XML = ConversionServiceTest.class.getResource("/invalid/scenarios-invalid.xml");
|
||||
|
||||
private static final URL ILLFORMED_XML = ConversionServiceTest.class.getResource("/invalid/scenarios-illformed.xml");
|
||||
|
||||
private static final URL SCHEMA = ConversionServiceTest.class.getResource("/xsd/scenarios.xsd");
|
||||
|
||||
@Rule
|
||||
public ExpectedException exception = ExpectedException.none();
|
||||
|
||||
private ConversionService service;
|
||||
|
||||
private ContentRepository repository;
|
||||
|
||||
@Before
|
||||
public void setup() {
|
||||
service = new ConversionService();
|
||||
repository = new ContentRepository(ObjectFactory.createProcessor(), new File("src/test/resources/examples/repository").toURI());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testMarshalNull() {
|
||||
exception.expect(ConversionService.ConversionExeption.class);
|
||||
service.writeXml(null);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testMarshalUnknown() {
|
||||
exception.expect(ConversionService.ConversionExeption.class);
|
||||
service.writeXml(new Serializable() {
|
||||
});
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testUnmarshal() throws URISyntaxException {
|
||||
final Scenarios s = service.readXml(VALID_XML.toURI(), Scenarios.class);
|
||||
assertThat(s).isNotNull();
|
||||
assertThat(s.getName()).isEqualToIgnoringCase("XInneres");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testUnmarshalWithSchema() throws URISyntaxException {
|
||||
final Scenarios s = service.readXml(VALID_XML.toURI(), Scenarios.class, repository.createSchema(SCHEMA));
|
||||
assertThat(s).isNotNull();
|
||||
assertThat(s.getName()).isEqualToIgnoringCase("XInneres");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testUnmarshalInvalidXml() throws URISyntaxException {
|
||||
exception.expect(ConversionService.ConversionExeption.class);
|
||||
service.readXml(INVALID_XML.toURI(), Scenarios.class, repository.createSchema(SCHEMA));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testUnmarshalIllFormed() throws URISyntaxException {
|
||||
exception.expect(ConversionService.ConversionExeption.class);
|
||||
service.readXml(ILLFORMED_XML.toURI(), Scenarios.class, repository.createSchema(SCHEMA));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testUnmarshalEmpty() {
|
||||
exception.expect(ConversionService.ConversionExeption.class);
|
||||
service.readXml(null, Scenarios.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testUnmarshalUnknownType() throws URISyntaxException {
|
||||
exception.expect(ConversionService.ConversionExeption.class);
|
||||
service.readXml(VALID_XML.toURI(), ConversionService.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testUnmarshalWithoutType() throws URISyntaxException {
|
||||
exception.expect(ConversionService.ConversionExeption.class);
|
||||
service.readXml(VALID_XML.toURI(), null);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,75 @@
|
|||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
package de.kosit.validationtool.impl;
|
||||
|
||||
import de.kosit.validationtool.api.CheckConfiguration;
|
||||
import de.kosit.validationtool.api.Input;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.w3c.dom.Document;
|
||||
|
||||
import java.io.File;
|
||||
import java.net.URISyntaxException;
|
||||
import java.net.URL;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.IntStream;
|
||||
|
||||
import static de.kosit.validationtool.api.InputFactory.read;
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
/**
|
||||
* Test das Check-Interface
|
||||
*
|
||||
* @author Andreas Penski
|
||||
*/
|
||||
public class DefaultCheckTest {
|
||||
|
||||
private static final URL SCENARIO_DEFINITION = ScenarioRepositoryTest.class.getResource("/examples/UBLReady/scenarios-2.xml");
|
||||
|
||||
private static final URL VALID_EXAMPLE = ScenarioRepositoryTest.class
|
||||
.getResource("/examples/UBLReady/UBLReady_EU_UBL-NL_20170102_FULL.xml");
|
||||
|
||||
public static final int MULTI_COUNT = 5;
|
||||
|
||||
private DefaultCheck implementation;
|
||||
|
||||
@Before
|
||||
public void setup() throws URISyntaxException {
|
||||
CheckConfiguration d = new CheckConfiguration(SCENARIO_DEFINITION.toURI());
|
||||
d.setScenarioRepository(new File("src/test/resources/examples/repository").toURI());
|
||||
implementation = new DefaultCheck(d);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testHappyCase() throws Exception {
|
||||
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<Document> docs = implementation.check(input);
|
||||
assertThat(docs).isNotNull();
|
||||
assertThat(docs).hasSize(MULTI_COUNT);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,88 @@
|
|||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
package de.kosit.validationtool.impl;
|
||||
|
||||
import static de.kosit.validationtool.api.InputFactory.read;
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.URL;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.ExpectedException;
|
||||
import org.w3c.dom.Document;
|
||||
|
||||
import de.kosit.validationtool.impl.model.Result;
|
||||
import de.kosit.validationtool.impl.tasks.DocumentParseAction;
|
||||
import de.kosit.validationtool.model.reportInput.XMLSyntaxError;
|
||||
|
||||
/**
|
||||
* @author Andreas Penski
|
||||
*/
|
||||
public class DocumentParserTest {
|
||||
|
||||
private static final URL CONTENT = ConversionServiceTest.class.getResource("/valid/scenarios.xml");
|
||||
|
||||
private static final URL ILLFORMED = ConversionServiceTest.class.getResource("/invalid/scenarios-illformed.xml");
|
||||
|
||||
private static final URL NOT_EXISTING = ConversionServiceTest.class.getResource("/does not exist.xml");
|
||||
|
||||
|
||||
|
||||
@Rule
|
||||
public ExpectedException exception = ExpectedException.none();
|
||||
|
||||
private DocumentParseAction parser;
|
||||
|
||||
@Before
|
||||
public void setup() {
|
||||
parser = new DocumentParseAction();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSimple() throws IOException {
|
||||
final Result<Document, XMLSyntaxError> result = parser.parseDocument(read(CONTENT));
|
||||
assertThat(result).isNotNull();
|
||||
assertThat(result.getObject()).isNotNull();
|
||||
assertThat(result.getErrors()).isEmpty();
|
||||
assertThat(result.isValid()).isTrue();
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void testIllformed() throws IOException {
|
||||
final Result<Document, XMLSyntaxError> result = parser.parseDocument(read(ILLFORMED));
|
||||
assertThat(result).isNotNull();
|
||||
assertThat(result.getErrors()).isNotEmpty();
|
||||
assertThat(result.getObject()).isNull();
|
||||
assertThat(result.isValid()).isFalse();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testNullInput() {
|
||||
exception.expect(IllegalArgumentException.class);
|
||||
parser.parseDocument(null);
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
102
src/test/java/de/kosit/validationtool/impl/Helper.java
Normal file
102
src/test/java/de/kosit/validationtool/impl/Helper.java
Normal file
|
|
@ -0,0 +1,102 @@
|
|||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
package de.kosit.validationtool.impl;
|
||||
|
||||
import java.io.File;
|
||||
import java.net.URI;
|
||||
import java.net.URISyntaxException;
|
||||
import java.net.URL;
|
||||
import java.nio.file.Paths;
|
||||
|
||||
import org.w3c.dom.Document;
|
||||
|
||||
import de.kosit.validationtool.api.InputFactory;
|
||||
import de.kosit.validationtool.impl.model.Result;
|
||||
import de.kosit.validationtool.impl.tasks.CheckAction;
|
||||
import de.kosit.validationtool.impl.tasks.DocumentParseAction;
|
||||
import de.kosit.validationtool.model.reportInput.XMLSyntaxError;
|
||||
|
||||
/**
|
||||
* Helferlein für Test-Artefakte
|
||||
*
|
||||
* @author Andreas Penski
|
||||
*/
|
||||
public class Helper {
|
||||
|
||||
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 ASSERTION_SCHEMA = MODEL_ROOT.resolve("xsd/assertions.xsd");
|
||||
|
||||
public static final URI SCENARIO_SCHEMA = MODEL_ROOT.resolve("xsd/scenarios.xsd");
|
||||
|
||||
public static final URI TEST_ROOT = Paths.get("src/test/resources").toUri();
|
||||
|
||||
|
||||
|
||||
public static final URI EXAMPLES_DIR = TEST_ROOT.resolve("examples/");
|
||||
public static final URI ASSERTIONS = EXAMPLES_DIR.resolve("assertions/tests-xrechnung.xml");
|
||||
|
||||
public static final URI SCENARIO_FILE = EXAMPLES_DIR.resolve("UBLReady/scenarios-2.xml");
|
||||
|
||||
|
||||
public static final URI REPOSITORY = EXAMPLES_DIR.resolve("repository/");
|
||||
|
||||
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_XSLT = EXAMPLES_DIR.resolve("repository/resources/eRechnung/report.xsl");
|
||||
public static final URI SAMPLE = SAMPLE_DIR.resolve("UBLReady_EU_UBL-NL_20170102_FULL.xml");
|
||||
|
||||
public static final URI SAMPLE2 = SAMPLE_DIR.resolve("UBLReady_EU_UBL-NL_20170102_FULL-invalid.xml");
|
||||
|
||||
|
||||
/**
|
||||
* Lädt ein XML-Dokument von der gegebenen URL
|
||||
*
|
||||
* @param url die url die geladen werden soll
|
||||
* @return ein result objekt mit Dokument
|
||||
*/
|
||||
public static Result<Document, XMLSyntaxError> load(URL url) {
|
||||
DocumentParseAction a = new DocumentParseAction();
|
||||
CheckAction.Bag b = new CheckAction.Bag(InputFactory.read(url));
|
||||
a.check(b);
|
||||
return b.getParserResult();
|
||||
}
|
||||
|
||||
public static <T> T load(URL url, Class<T> type) throws URISyntaxException {
|
||||
ConversionService c = new ConversionService();
|
||||
c.initialize(de.kosit.validationtool.model.reportInput.ObjectFactory.class.getPackage(),
|
||||
de.kosit.validationtool.cmd.assertions.ObjectFactory.class.getPackage(),
|
||||
de.kosit.validationtool.model.scenarios.ObjectFactory.class.getPackage());
|
||||
return c.readXml(url.toURI(), type);
|
||||
}
|
||||
|
||||
/**
|
||||
* Lädt das default test repository mit Artefacten für Unit-Tests
|
||||
*
|
||||
* @return ein {@link ContentRepository}
|
||||
*/
|
||||
public static ContentRepository loadTestRepository() {
|
||||
return new ContentRepository(ObjectFactory.createProcessor(), new File("src/test/resources/examples/repository").toURI());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,74 @@
|
|||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
package de.kosit.validationtool.impl;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
import java.net.URI;
|
||||
import java.net.URISyntaxException;
|
||||
|
||||
import javax.xml.transform.Source;
|
||||
import javax.xml.transform.TransformerException;
|
||||
import javax.xml.transform.URIResolver;
|
||||
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.ExpectedException;
|
||||
|
||||
/**
|
||||
* Testet den Uri-Resolver der relative auflösen soll
|
||||
*
|
||||
* @author Andreas Penski
|
||||
*/
|
||||
public class RelativeUriResolverTest {
|
||||
|
||||
private static final URI BASE;
|
||||
|
||||
static {
|
||||
try {
|
||||
BASE = RelativeUriResolver.class.getResource("/examples/assertions/").toURI();
|
||||
} catch (URISyntaxException e) {
|
||||
throw new IllegalStateException(e);
|
||||
}
|
||||
}
|
||||
|
||||
@Rule
|
||||
public ExpectedException exception = ExpectedException.none();
|
||||
|
||||
private URIResolver resolver = new RelativeUriResolver(BASE);
|
||||
|
||||
@Test
|
||||
public void testSucces() throws TransformerException {
|
||||
final Source resource = resolver.resolve("ubl-0001.xml", BASE.toASCIIString());
|
||||
assertThat(resource).isNotNull();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testNotExisting() throws TransformerException {
|
||||
exception.expect(IllegalStateException.class);
|
||||
resolver.resolve("ubl-0001", BASE.toASCIIString());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testOutOfPath() throws TransformerException {
|
||||
exception.expect(IllegalStateException.class);
|
||||
resolver.resolve("../results/report.xml", BASE.toASCIIString());
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,76 @@
|
|||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
package de.kosit.validationtool.impl;
|
||||
|
||||
import static org.junit.Assert.fail;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.URL;
|
||||
|
||||
import javax.xml.transform.dom.DOMSource;
|
||||
import javax.xml.transform.stream.StreamSource;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.junit.Test;
|
||||
import org.w3c.dom.Document;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import net.sf.saxon.s9api.*;
|
||||
|
||||
/**
|
||||
* Testet verschiedene Saxon Security Einstellungen.
|
||||
*
|
||||
* @author Andreas Penski
|
||||
*/
|
||||
@Slf4j
|
||||
public class SaxonSecurityTest {
|
||||
|
||||
@Test
|
||||
public void testEvilStylesheets() throws IOException {
|
||||
Processor p = ObjectFactory.createProcessor();
|
||||
for (int i = 1; i <= 5; i++) {
|
||||
try {
|
||||
URL resource = SaxonSecurityTest.class.getResource(String.format("/evil/evil%s.xsl", i));
|
||||
final XsltCompiler compiler = p.newXsltCompiler();
|
||||
final RelativeUriResolver resolver = new RelativeUriResolver(Helper.REPOSITORY);
|
||||
compiler.setURIResolver(resolver);
|
||||
final XsltExecutable exetuable = compiler.compile(new StreamSource(resource.openStream()));
|
||||
final XsltTransformer transformer = exetuable.load();
|
||||
final Document document = ObjectFactory.createDocumentBuilder(false).newDocument();
|
||||
document.createElement("root");
|
||||
Document result = ObjectFactory.createDocumentBuilder(false).newDocument();
|
||||
transformer.getUnderlyingController().setUnparsedTextURIResolver(resolver);
|
||||
transformer.setURIResolver(resolver);
|
||||
transformer.setSource(new DOMSource(document));
|
||||
transformer.setDestination(new DOMDestination(result));
|
||||
transformer.transform();
|
||||
|
||||
// wenn der Punkt erreicht wird, sollte wenigstens, das Element evil nicht mit 'bösen' Inhalten gefüllt sein!
|
||||
if (StringUtils.isNotBlank(result.getDocumentElement().getTextContent())) {
|
||||
fail(String.format("Saxon configuration should prevent expansion within %s", resource));
|
||||
}
|
||||
|
||||
} catch (SaxonApiException | RuntimeException e) {
|
||||
log.info("Expected exception detected", e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,101 @@
|
|||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
package de.kosit.validationtool.impl;
|
||||
|
||||
import static de.kosit.validationtool.api.InputFactory.read;
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.net.URL;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.ExpectedException;
|
||||
import org.w3c.dom.Document;
|
||||
|
||||
import de.kosit.validationtool.impl.model.Result;
|
||||
import de.kosit.validationtool.impl.tasks.DocumentParseAction;
|
||||
import de.kosit.validationtool.model.scenarios.ScenarioType;
|
||||
import de.kosit.validationtool.model.scenarios.Scenarios;
|
||||
|
||||
/**
|
||||
* Testet das {@link ScenarioRepository}.
|
||||
*
|
||||
* @author Andreas Penski
|
||||
*/
|
||||
|
||||
public class ScenarioRepositoryTest {
|
||||
|
||||
private static final URL SAMPLE = ScenarioRepositoryTest.class.getResource("/valid/scenarios.xml");
|
||||
|
||||
@Rule
|
||||
public ExpectedException expectedException = ExpectedException.none();
|
||||
|
||||
ContentRepository content;
|
||||
|
||||
private ScenarioRepository repository;
|
||||
|
||||
@Before
|
||||
public void setup() {
|
||||
content = new ContentRepository(ObjectFactory.createProcessor(), new File("src/test/resources/examples/repository").toURI());
|
||||
Scenarios def = new Scenarios();
|
||||
ScenarioType t = new ScenarioType();
|
||||
t.setMatch("//*:name");
|
||||
t.setName("Test");
|
||||
t.initialize(content, true);
|
||||
def.getScenario().add(t);
|
||||
repository = new ScenarioRepository(ObjectFactory.createProcessor(), content);
|
||||
repository.initialize(def);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testHappyCase() throws Exception {
|
||||
final Result<ScenarioType, String> scenario = repository.selectScenario(load(SAMPLE));
|
||||
assertThat(scenario).isNotNull();
|
||||
assertThat(scenario.isValid()).isTrue();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testNonMatch() throws Exception {
|
||||
repository.getScenarios().getScenario().clear();
|
||||
final Result<ScenarioType, String> scenario = repository.selectScenario(load(SAMPLE));
|
||||
assertThat(scenario).isNotNull();
|
||||
assertThat(scenario.isValid()).isFalse();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testMultiMatch() throws Exception {
|
||||
ScenarioType t = new ScenarioType();
|
||||
t.setMatch("//*:name");
|
||||
t.setName("Test");
|
||||
t.initialize(content, true);
|
||||
repository.getScenarios().getScenario().add(t);
|
||||
final Result<ScenarioType, String> scenario = repository.selectScenario(load(SAMPLE));
|
||||
assertThat(scenario).isNotNull();
|
||||
assertThat(scenario.isValid()).isFalse();
|
||||
}
|
||||
|
||||
private Document load(URL url) throws IOException {
|
||||
DocumentParseAction p = new DocumentParseAction();
|
||||
return p.parseDocument(read(url)).getObject();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,115 @@
|
|||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
package de.kosit.validationtool.impl;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URI;
|
||||
import java.net.URL;
|
||||
import java.util.Collections;
|
||||
|
||||
import javax.xml.validation.Schema;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.ExpectedException;
|
||||
|
||||
import de.kosit.validationtool.api.InputFactory;
|
||||
import de.kosit.validationtool.impl.model.Result;
|
||||
import de.kosit.validationtool.impl.tasks.CheckAction;
|
||||
import de.kosit.validationtool.impl.tasks.SchemaValidationAction;
|
||||
import de.kosit.validationtool.model.reportInput.CreateReportInput;
|
||||
import de.kosit.validationtool.model.scenarios.ResourceType;
|
||||
import de.kosit.validationtool.model.scenarios.ScenarioType;
|
||||
import de.kosit.validationtool.model.scenarios.ValidateWithXmlSchema;
|
||||
|
||||
/**
|
||||
* Testet die {@linkSchemaValidatorAction}.
|
||||
*
|
||||
* @author Andreas Penski
|
||||
*/
|
||||
public class SchemaValidatorActionTest {
|
||||
|
||||
private static final URL VALID_EXAMPLE = SchemaValidatorActionTest.class
|
||||
.getResource("/examples/UBLReady/UBLReady_EU_UBL-NL_20170102_FULL.xml");
|
||||
|
||||
private static final URI INVALID_EXAMPLE = Helper.TEST_ROOT.resolve("invalid/scenarios-invalid.xml");
|
||||
|
||||
public ExpectedException expectedException = ExpectedException.none();
|
||||
|
||||
private SchemaValidationAction service;
|
||||
|
||||
private ContentRepository repository;
|
||||
|
||||
@Before
|
||||
public void setup() {
|
||||
service = new SchemaValidationAction();
|
||||
repository = new ContentRepository(ObjectFactory.createProcessor(), Helper.REPOSITORY);
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSimple() {
|
||||
CheckAction.Bag bag = new CheckAction.Bag(InputFactory.read(VALID_EXAMPLE), new CreateReportInput());
|
||||
bag.setParserResult(Helper.load(VALID_EXAMPLE));
|
||||
ScenarioType t = new ScenarioType();
|
||||
ValidateWithXmlSchema v = new ValidateWithXmlSchema();
|
||||
ResourceType r = new ResourceType();
|
||||
r.setLocation("resources/eRechnung/UBL-2.1/xsdrt/maindoc/UBL-Invoice-2.1.xsd");
|
||||
r.setName("invoice");
|
||||
v.getResource().add(r);
|
||||
t.setValidateWithXmlSchema(v);
|
||||
t.initialize(repository, true);
|
||||
bag.setScenarioSelectionResult(new Result<>(t, Collections.emptyList()));
|
||||
service.check(bag);
|
||||
assertThat(bag.getSchemaValidationResult().isValid()).isTrue();
|
||||
assertThat(bag.getSchemaValidationResult()).isNotNull();
|
||||
assertThat(bag.getSchemaValidationResult().isValid()).isTrue();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testValidationFailure() throws MalformedURLException {
|
||||
CheckAction.Bag bag = new CheckAction.Bag(InputFactory.read(INVALID_EXAMPLE.toURL()), new CreateReportInput());
|
||||
bag.setParserResult(Helper.load(INVALID_EXAMPLE.toURL()));
|
||||
ScenarioType t = new ScenarioType();
|
||||
ValidateWithXmlSchema v = new ValidateWithXmlSchema();
|
||||
ResourceType r = new ResourceType();
|
||||
r.setLocation(Helper.REPOSITORY.relativize(Helper.SCENARIO_SCHEMA).getRawPath());
|
||||
r.setName("invoice");
|
||||
v.getResource().add(r);
|
||||
t.setValidateWithXmlSchema(v);
|
||||
t.initialize(repository, true);
|
||||
bag.setScenarioSelectionResult(new Result<>(t, Collections.emptyList()));
|
||||
service.check(bag);
|
||||
assertThat(bag.getSchemaValidationResult().isValid()).isFalse();
|
||||
bag.getSchemaValidationResult().getErrors().forEach(e->{
|
||||
assertThat(e.getRowNumber()).isGreaterThan(0);
|
||||
assertThat(e.getColumnNumber()).isGreaterThan(0);
|
||||
});
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSchemaReferences() {
|
||||
final Schema reportInputSchema = repository.getReportInputSchema();
|
||||
assertThat(reportInputSchema).isNotNull();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,86 @@
|
|||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
package de.kosit.validationtool.impl;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
import java.io.File;
|
||||
import java.net.URISyntaxException;
|
||||
import java.net.URL;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.ExpectedException;
|
||||
|
||||
import de.kosit.validationtool.model.scenarios.Scenarios;
|
||||
|
||||
/**
|
||||
* Testet die Versionierung von Scenario-Dateien aka Konfigurationsdaten.
|
||||
*
|
||||
* @author Andreas Penski
|
||||
*/
|
||||
public class VersioningTest {
|
||||
|
||||
private static final URL BASE = VersioningTest.class.getResource("/examples/versioning/scenarios-base.xml");
|
||||
|
||||
private static final URL INCREMENT = VersioningTest.class.getResource("/examples/versioning/scenarios-increment.xml");
|
||||
|
||||
private static final URL NEW_FEATURE = VersioningTest.class.getResource("/examples/versioning/scenarios-newfeature.xml");
|
||||
|
||||
private static final URL NEW_VERSION = VersioningTest.class.getResource("/examples/versioning/scenarios-newVersion.xml");
|
||||
|
||||
@Rule
|
||||
public ExpectedException exception = ExpectedException.none();
|
||||
|
||||
private ConversionService service;
|
||||
|
||||
private ContentRepository repository;
|
||||
|
||||
@Before
|
||||
public void setup() {
|
||||
service = new ConversionService();
|
||||
repository = new ContentRepository(ObjectFactory.createProcessor(), new File("src/test/resources/examples/repository").toURI());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testBase() throws URISyntaxException {
|
||||
final Scenarios result = service.readXml(BASE.toURI(), Scenarios.class, repository.getScenarioSchema());
|
||||
assertThat(result).isNotNull();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFrameworkIncrement() throws URISyntaxException {
|
||||
final Scenarios result = service.readXml(INCREMENT.toURI(), Scenarios.class, repository.getScenarioSchema());
|
||||
assertThat(result).isNotNull();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testNewFeature() throws URISyntaxException {
|
||||
exception.expect(ConversionService.ConversionExeption.class);
|
||||
service.readXml(NEW_FEATURE.toURI(), Scenarios.class, repository.getScenarioSchema());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testNewVersion() throws URISyntaxException {
|
||||
exception.expect(ConversionService.ConversionExeption.class);
|
||||
service.readXml(NEW_VERSION.toURI(), Scenarios.class, repository.getScenarioSchema());
|
||||
}
|
||||
}
|
||||
32
src/test/resources/evil/evil1.xsl
Normal file
32
src/test/resources/evil/evil1.xsl
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
<?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"
|
||||
exclude-result-prefixes="xs"
|
||||
version="2.0">
|
||||
|
||||
<xsl:template match="/">
|
||||
<xsl:result-document href="ref.xml">
|
||||
<evil-content/>
|
||||
</xsl:result-document>
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
||||
30
src/test/resources/evil/evil2.xsl
Normal file
30
src/test/resources/evil/evil2.xsl
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
<?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"
|
||||
exclude-result-prefixes="xs"
|
||||
version="2.0">
|
||||
|
||||
<xsl:template match="/">
|
||||
<evil-content><xsl:value-of select="document('http://google.de')"/></evil-content>
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
||||
13
src/test/resources/evil/evil3.xsl
Normal file
13
src/test/resources/evil/evil3.xsl
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||
xmlns:xs="http://www.w3.org/2001/XMLSchema"
|
||||
exclude-result-prefixes="xs"
|
||||
version="2.0">
|
||||
|
||||
<xsl:include href="www.evil.de/xsl.xsl"/>
|
||||
|
||||
<xsl:template match="/">
|
||||
<evil-content/>
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
||||
14
src/test/resources/evil/evil4.xsl
Normal file
14
src/test/resources/evil/evil4.xsl
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||
xmlns:xs="http://www.w3.org/2001/XMLSchema"
|
||||
exclude-result-prefixes="xs"
|
||||
version="2.0">
|
||||
|
||||
<!-- Absoluter Pfad, sicherlich nicht unterhalb von -r -->
|
||||
<xsl:include href="file://c/temp/myfile.txt"/>
|
||||
|
||||
<xsl:template match="/">
|
||||
<evil-content/>
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
||||
33
src/test/resources/evil/evil5.xsl
Normal file
33
src/test/resources/evil/evil5.xsl
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
<?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"
|
||||
exclude-result-prefixes="xs"
|
||||
version="2.0">
|
||||
|
||||
|
||||
<xsl:template match="/">
|
||||
<evil-content>
|
||||
<xsl:value-of select="unparsed-text('src/test/resources/evil/ref.txt')"/>
|
||||
</evil-content>
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
||||
1
src/test/resources/evil/ref.txt
Normal file
1
src/test/resources/evil/ref.txt
Normal file
|
|
@ -0,0 +1 @@
|
|||
this content should not appear in
|
||||
|
|
@ -0,0 +1,301 @@
|
|||
<?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.
|
||||
-->
|
||||
|
||||
<!-- FROM http://www.softwarepakket.nl/upload/ublketentest/voorbeelden/referentiefactuur/UBLReady_EU_UBL-NL_20170102.xml
|
||||
VIA https://www.xml.com/news/2017-06-ublpdf-demo-invoices/
|
||||
-->
|
||||
<Invoice xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2"
|
||||
xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2"
|
||||
xsi:schemaLocation="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2
|
||||
http://docs.oasis-open.org/ubl/os-UBL-2.1/xsd/maindoc/UBL-Invoice-2.1.xsd">
|
||||
|
||||
<cbc:CustomizationID>urn:cen.eu:en16931:2017</cbc:CustomizationID>
|
||||
|
||||
<cbc:ProfileID>urn:www.cenbii.eu:profile:bii04:ver2.0</cbc:ProfileID>
|
||||
|
||||
<cbc:ID>20170102</cbc:ID>
|
||||
<cbc:IssueDate>2017-02-16</cbc:IssueDate>
|
||||
<cbc:DueDate>2017-03-18</cbc:DueDate>
|
||||
<cbc:InvoiceTypeCode listID="UNCL1001" listAgencyID="6">380</cbc:InvoiceTypeCode>
|
||||
<cbc:TaxPointDate>2017-02-16</cbc:TaxPointDate>
|
||||
<cbc:DocumentCurrencyCode listID="ISO 4217 Alpha" listAgencyID="6"
|
||||
>EUR
|
||||
</cbc:DocumentCurrencyCode>
|
||||
<cbc:AccountingCost>RK20172013</cbc:AccountingCost>
|
||||
<cac:InvoicePeriod>
|
||||
<cbc:StartDate>2017-02-14</cbc:StartDate>
|
||||
<cbc:EndDate>2017-02-14</cbc:EndDate>
|
||||
</cac:InvoicePeriod>
|
||||
|
||||
<cac:OrderReference>
|
||||
<cbc:ID>20170205</cbc:ID>
|
||||
</cac:OrderReference>
|
||||
|
||||
<cac:AccountingSupplierParty>
|
||||
<cac:Party>
|
||||
<cac:BigPartyName>
|
||||
<cbc:Name>UBL Platform</cbc:Name>
|
||||
</cac:BigPartyName>
|
||||
<cac:PostalAddress>
|
||||
<cbc:StreetName>Readystreet 9a</cbc:StreetName>
|
||||
<cbc:CityName>Amsterdam</cbc:CityName>
|
||||
<cbc:PostalZone>9876 YZ</cbc:PostalZone>
|
||||
<cac:SmallCountry>
|
||||
<cbc:IdentificationCode listID="ISO3166-1:Alpha2" listAgencyID="6"
|
||||
>NL
|
||||
</cbc:IdentificationCode>
|
||||
</cac:SmallCountry>
|
||||
</cac:PostalAddress>
|
||||
<cac:PartyTaxScheme>
|
||||
<cbc:CompanyID schemeID="NL:VAT" schemeAgencyID="ZZZ">NL123456789B01</cbc:CompanyID>
|
||||
<cac:TaxScheme>
|
||||
<cbc:ID schemeID="UN/ECE 5153" schemeAgencyID="6">VAT</cbc:ID>
|
||||
</cac:TaxScheme>
|
||||
</cac:PartyTaxScheme>
|
||||
<cac:PartyLegalEntity>
|
||||
<cbc:RegistrationName>UBL Ketentest BV</cbc:RegistrationName>
|
||||
<cbc:CompanyID>12345678</cbc:CompanyID>
|
||||
</cac:PartyLegalEntity>
|
||||
<cac:Contact>
|
||||
<cbc:Telephone>06 987654321</cbc:Telephone>
|
||||
<cbc:ElectronicMail>info@gbned.nl</cbc:ElectronicMail>
|
||||
</cac:Contact>
|
||||
</cac:Party>
|
||||
</cac:AccountingSupplierParty>
|
||||
|
||||
<cac:AccountingCustomerParty>
|
||||
<cac:Party>
|
||||
<cac:PartyName>
|
||||
<cbc:Name>UBL Ready</cbc:Name>
|
||||
</cac:PartyName>
|
||||
<cac:PostalAddress>
|
||||
<cbc:StreetName>Demostreet 1</cbc:StreetName>
|
||||
<cbc:CityName>Arnhem</cbc:CityName>
|
||||
<cbc:PostalZone>1234 AB</cbc:PostalZone>
|
||||
<cac:Country>
|
||||
<cbc:IdentificationCode listID="ISO3166-1:Alpha2" listAgencyID="6"
|
||||
>NL
|
||||
</cbc:IdentificationCode>
|
||||
</cac:Country>
|
||||
</cac:PostalAddress>
|
||||
|
||||
<cac:PartyLegalEntity>
|
||||
<cbc:RegistrationName>UBL Ready</cbc:RegistrationName>
|
||||
</cac:PartyLegalEntity>
|
||||
<cac:Contact>
|
||||
<cbc:Name>John Doe</cbc:Name>
|
||||
<cbc:Telephone>070-1111111</cbc:Telephone>
|
||||
<cbc:ElectronicMail>invoices@ublready.com</cbc:ElectronicMail>
|
||||
</cac:Contact>
|
||||
</cac:Party>
|
||||
</cac:AccountingCustomerParty>
|
||||
|
||||
<cac:Delivery>
|
||||
<cbc:ActualDeliveryDate>2017-02-16</cbc:ActualDeliveryDate>
|
||||
<cac:DeliveryLocation>
|
||||
<cac:Address>
|
||||
<cbc:StreetName>Stocklane 10</cbc:StreetName>
|
||||
<cbc:CityName>Arnhem</cbc:CityName>
|
||||
<cbc:PostalZone>4321 BA</cbc:PostalZone>
|
||||
<cac:Country>
|
||||
<cbc:IdentificationCode listID="ISO3166-1:Alpha2" listAgencyID="6"
|
||||
>NL
|
||||
</cbc:IdentificationCode>
|
||||
</cac:Country>
|
||||
</cac:Address>
|
||||
</cac:DeliveryLocation>
|
||||
</cac:Delivery>
|
||||
|
||||
<cac:PaymentMeans>
|
||||
<cbc:PaymentMeansCode listID="UNCL4461">31</cbc:PaymentMeansCode>
|
||||
<cac:PayeeFinancialAccount>
|
||||
<cbc:ID schemeID="IBAN">NL23ABNA0123456789</cbc:ID>
|
||||
<cac:FinancialInstitutionBranch>
|
||||
<cac:FinancialInstitution>
|
||||
<cbc:ID schemeID="BIC">ABNANL2A</cbc:ID>
|
||||
</cac:FinancialInstitution>
|
||||
</cac:FinancialInstitutionBranch>
|
||||
</cac:PayeeFinancialAccount>
|
||||
</cac:PaymentMeans>
|
||||
|
||||
<cac:PaymentTerms>
|
||||
<cbc:Note>Payments within 30 days.</cbc:Note>
|
||||
</cac:PaymentTerms>
|
||||
|
||||
<cac:AllowanceCharge>
|
||||
<cbc:ChargeIndicator>false</cbc:ChargeIndicator>
|
||||
<cbc:AllowanceChargeReasonCode listID="UNCL5189">64</cbc:AllowanceChargeReasonCode>
|
||||
<cbc:AllowanceChargeReason>Invoice allowance (VAT low 6%)</cbc:AllowanceChargeReason>
|
||||
<cbc:MultiplierFactorNumeric>1</cbc:MultiplierFactorNumeric>
|
||||
<cbc:Amount currencyID="EUR">22</cbc:Amount>
|
||||
<cbc:BaseAmount currencyID="EUR">220</cbc:BaseAmount>
|
||||
<cac:TaxCategory>
|
||||
<cbc:ID schemeID="UNCL5305">S</cbc:ID>
|
||||
<cbc:Percent>6</cbc:Percent>
|
||||
<cac:TaxScheme>
|
||||
<cbc:ID schemeID="UN/ECE 5153" schemeAgencyID="6">VAT</cbc:ID>
|
||||
</cac:TaxScheme>
|
||||
</cac:TaxCategory>
|
||||
</cac:AllowanceCharge>
|
||||
<cac:AllowanceCharge>
|
||||
<cbc:ChargeIndicator>false</cbc:ChargeIndicator>
|
||||
<cbc:AllowanceChargeReasonCode listID="UNCL5189">64</cbc:AllowanceChargeReasonCode>
|
||||
<cbc:AllowanceChargeReason>Invoice allowance (VAT high 21%)</cbc:AllowanceChargeReason>
|
||||
<cbc:MultiplierFactorNumeric>1</cbc:MultiplierFactorNumeric>
|
||||
<cbc:Amount currencyID="EUR">18</cbc:Amount>
|
||||
<cbc:BaseAmount currencyID="EUR">180</cbc:BaseAmount>
|
||||
<cac:TaxCategory>
|
||||
<cbc:ID schemeID="UNCL5305">S</cbc:ID>
|
||||
<cbc:Percent>21</cbc:Percent>
|
||||
<cac:TaxScheme>
|
||||
<cbc:ID schemeID="UN/ECE 5153" schemeAgencyID="6">VAT</cbc:ID>
|
||||
</cac:TaxScheme>
|
||||
</cac:TaxCategory>
|
||||
</cac:AllowanceCharge>
|
||||
<cac:AllowanceCharge>
|
||||
<cbc:ChargeIndicator>true</cbc:ChargeIndicator>
|
||||
<cbc:AllowanceChargeReasonCode listID="UNCL7161">ZZZ</cbc:AllowanceChargeReasonCode>
|
||||
<cbc:AllowanceChargeReason>Handling costs</cbc:AllowanceChargeReason>
|
||||
<cbc:Amount currencyID="EUR">10</cbc:Amount>
|
||||
<cac:TaxCategory>
|
||||
<cbc:ID schemeID="UNCL5305">S</cbc:ID>
|
||||
<cbc:Percent>21</cbc:Percent>
|
||||
<cac:TaxScheme>
|
||||
<cbc:ID schemeID="UN/ECE 5153" schemeAgencyID="6">VAT</cbc:ID>
|
||||
</cac:TaxScheme>
|
||||
</cac:TaxCategory>
|
||||
</cac:AllowanceCharge>
|
||||
<cac:TaxTotal>
|
||||
<cbc:TaxAmount currencyID="EUR">48.00</cbc:TaxAmount>
|
||||
<cac:TaxSubtotal>
|
||||
<cbc:TaxableAmount currencyID="EUR">198</cbc:TaxableAmount>
|
||||
<cbc:TaxAmount currencyID="EUR">11.88</cbc:TaxAmount>
|
||||
<cac:TaxCategory>
|
||||
<cbc:ID schemeID="UNCL5305">S</cbc:ID>
|
||||
<cbc:Percent>6.00</cbc:Percent>
|
||||
<cac:TaxScheme>
|
||||
<cbc:ID schemeID="UN/ECE 5153" schemeAgencyID="6">VAT</cbc:ID>
|
||||
</cac:TaxScheme>
|
||||
</cac:TaxCategory>
|
||||
</cac:TaxSubtotal>
|
||||
<cac:TaxSubtotal>
|
||||
<cbc:TaxableAmount currencyID="EUR">172</cbc:TaxableAmount>
|
||||
<cbc:TaxAmount currencyID="EUR">36.12</cbc:TaxAmount>
|
||||
<cac:TaxCategory>
|
||||
<cbc:ID schemeID="UNCL5305">S</cbc:ID>
|
||||
<cbc:Percent>21.00</cbc:Percent>
|
||||
<cac:TaxScheme>
|
||||
<cbc:ID schemeID="UN/ECE 5153" schemeAgencyID="6">VAT</cbc:ID>
|
||||
</cac:TaxScheme>
|
||||
</cac:TaxCategory>
|
||||
</cac:TaxSubtotal>
|
||||
</cac:TaxTotal>
|
||||
|
||||
<cac:LegalMonetaryTotal>
|
||||
<cbc:LineExtensionAmount currencyID="EUR">400.00</cbc:LineExtensionAmount>
|
||||
<cbc:TaxExclusiveAmount currencyID="EUR">370.00</cbc:TaxExclusiveAmount>
|
||||
<cbc:TaxInclusiveAmount currencyID="EUR">418.00</cbc:TaxInclusiveAmount>
|
||||
<cbc:AllowanceTotalAmount currencyID="EUR">40.00</cbc:AllowanceTotalAmount>
|
||||
<cbc:ChargeTotalAmount currencyID="EUR">10.00</cbc:ChargeTotalAmount>
|
||||
<cbc:PayableAmount currencyID="EUR">418.00</cbc:PayableAmount>
|
||||
</cac:LegalMonetaryTotal>
|
||||
|
||||
<cac:InvoiceLine>
|
||||
<cbc:ID>5</cbc:ID>
|
||||
<cbc:InvoicedQuantity unitCodeListID="UNECERec20" unitCode="ZZ">1.00</cbc:InvoicedQuantity>
|
||||
<cbc:LineExtensionAmount currencyID="EUR">50.00</cbc:LineExtensionAmount>
|
||||
<cac:Item>
|
||||
<cbc:Description>Book The digital highway in Holland</cbc:Description>
|
||||
<cbc:Name>The digital highway</cbc:Name>
|
||||
<cac:SellersItemIdentification>
|
||||
<cbc:ID>BK0232</cbc:ID>
|
||||
</cac:SellersItemIdentification>
|
||||
<cac:ClassifiedTaxCategory>
|
||||
<cbc:ID schemeID="UNCL5305">S</cbc:ID>
|
||||
<cbc:Percent>6.00</cbc:Percent>
|
||||
<cac:TaxScheme>
|
||||
<cbc:ID schemeID="UN/ECE 5153" schemeAgencyID="6">VAT</cbc:ID>
|
||||
</cac:TaxScheme>
|
||||
</cac:ClassifiedTaxCategory>
|
||||
</cac:Item>
|
||||
<cac:Price>
|
||||
<cbc:PriceAmount currencyID="EUR">50.00</cbc:PriceAmount>
|
||||
<cbc:BaseQuantity unitCodeListID="UNECERec20" unitCode="ZZ">1.00</cbc:BaseQuantity>
|
||||
</cac:Price>
|
||||
</cac:InvoiceLine>
|
||||
|
||||
<cac:InvoiceLine>
|
||||
<cbc:ID>10</cbc:ID>
|
||||
<cbc:InvoicedQuantity unitCodeListID="UNECERec20" unitCode="ZZ">2.00</cbc:InvoicedQuantity>
|
||||
<cbc:LineExtensionAmount currencyID="EUR">170.00</cbc:LineExtensionAmount>
|
||||
<cac:Item>
|
||||
<cbc:Description>Book Coding UBL for orders and invoices</cbc:Description>
|
||||
<cbc:Name>Coding UBL</cbc:Name>
|
||||
<cac:SellersItemIdentification>
|
||||
<cbc:ID>BK3025</cbc:ID>
|
||||
</cac:SellersItemIdentification>
|
||||
<cac:ClassifiedTaxCategory>
|
||||
<cbc:ID schemeID="UNCL5305">S</cbc:ID>
|
||||
<cbc:Percent>6.00</cbc:Percent>
|
||||
<cac:TaxScheme>
|
||||
<cbc:ID schemeID="UN/ECE 5153" schemeAgencyID="6">VAT</cbc:ID>
|
||||
</cac:TaxScheme>
|
||||
</cac:ClassifiedTaxCategory>
|
||||
</cac:Item>
|
||||
<cac:Price>
|
||||
<cbc:PriceAmount currencyID="EUR">85.00</cbc:PriceAmount>
|
||||
<cbc:BaseQuantity unitCodeListID="UNECERec20" unitCode="ZZ">2.00</cbc:BaseQuantity>
|
||||
</cac:Price>
|
||||
</cac:InvoiceLine>
|
||||
|
||||
<cac:InvoiceLine>
|
||||
<cbc:ID>15</cbc:ID>
|
||||
<cbc:InvoicedQuantity unitCodeListID="UNECERec20" unitCode="ZZ">1.00</cbc:InvoicedQuantity>
|
||||
<cbc:LineExtensionAmount currencyID="EUR">180.00</cbc:LineExtensionAmount>
|
||||
<cac:AllowanceCharge>
|
||||
<cbc:ChargeIndicator>false</cbc:ChargeIndicator>
|
||||
<cbc:AllowanceChargeReason>Price discount</cbc:AllowanceChargeReason>
|
||||
<cbc:MultiplierFactorNumeric>10</cbc:MultiplierFactorNumeric>
|
||||
<cbc:Amount currencyID="EUR">20.00</cbc:Amount>
|
||||
<cbc:BaseAmount currencyID="EUR">200</cbc:BaseAmount>
|
||||
</cac:AllowanceCharge>
|
||||
<cac:Item>
|
||||
<cbc:Description>Conversion softwarepackage to UBL</cbc:Description>
|
||||
<cbc:Name>Conversion UBL</cbc:Name>
|
||||
<cac:SellersItemIdentification>
|
||||
<cbc:ID>SW4026</cbc:ID>
|
||||
</cac:SellersItemIdentification>
|
||||
<cac:ClassifiedTaxCategory>
|
||||
<cbc:ID schemeID="UNCL5305">S</cbc:ID>
|
||||
<cbc:Percent>21.00</cbc:Percent>
|
||||
<cac:TaxScheme>
|
||||
<cbc:ID schemeID="UN/ECE 5153" schemeAgencyID="6">VAT</cbc:ID>
|
||||
</cac:TaxScheme>
|
||||
</cac:ClassifiedTaxCategory>
|
||||
</cac:Item>
|
||||
<cac:Price>
|
||||
<cbc:PriceAmount currencyID="EUR">200.00</cbc:PriceAmount>
|
||||
<cbc:BaseQuantity unitCodeListID="UNECERec20" unitCode="ZZ">1.00</cbc:BaseQuantity>
|
||||
</cac:Price>
|
||||
</cac:InvoiceLine>
|
||||
|
||||
</Invoice>
|
||||
|
|
@ -0,0 +1,302 @@
|
|||
<?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.
|
||||
-->
|
||||
|
||||
<!-- FROM http://www.softwarepakket.nl/upload/ublketentest/voorbeelden/referentiefactuur/UBLReady_EU_UBL-NL_20170102.xml
|
||||
VIA https://www.xml.com/news/2017-06-ublpdf-demo-invoices/
|
||||
-->
|
||||
<Invoice xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2"
|
||||
xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2"
|
||||
xsi:schemaLocation="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2
|
||||
http://docs.oasis-open.org/ubl/os-UBL-2.1/xsd/maindoc/UBL-Invoice-2.1.xsd">
|
||||
|
||||
<cbc:CustomizationID>urn:cen.eu:en16931:2017</cbc:CustomizationID>
|
||||
|
||||
<cbc:ProfileID>urn:www.cenbii.eu:profile:bii04:ver2.0</cbc:ProfileID>
|
||||
|
||||
<cbc:ID>20170102</cbc:ID>
|
||||
<cbc:IssueDate>2017-02-16</cbc:IssueDate>
|
||||
<cbc:DueDate>2017-03-18</cbc:DueDate>
|
||||
<cbc:InvoiceTypeCode listID="UNCL1001" listAgencyID="6">380</cbc:InvoiceTypeCode>
|
||||
<cbc:TaxPointDate>2017-02-16</cbc:TaxPointDate>
|
||||
<cbc:DocumentCurrencyCode listID="ISO 4217 Alpha" listAgencyID="6"
|
||||
>EUR
|
||||
</cbc:DocumentCurrencyCode>
|
||||
<cbc:AccountingCost>RK20172013</cbc:AccountingCost>
|
||||
<cac:InvoicePeriod>
|
||||
<cbc:StartDate>2017-02-14</cbc:StartDate>
|
||||
<cbc:EndDate>2017-02-14</cbc:EndDate>
|
||||
</cac:InvoicePeriod>
|
||||
|
||||
<cac:OrderReference>
|
||||
<cbc:ID>20170205</cbc:ID>
|
||||
</cac:OrderReference>
|
||||
|
||||
<cac:AccountingSupplierParty>
|
||||
<cac:Party>
|
||||
<cac:PartyName>
|
||||
<cbc:Name>UBL Platform</cbc:Name>
|
||||
</cac:PartyName>
|
||||
<cac:PostalAddress>
|
||||
<cbc:StreetName>Readystreet 9a</cbc:StreetName>
|
||||
<cbc:CityName>Amsterdam</cbc:CityName>
|
||||
<cbc:PostalZone>9876 YZ</cbc:PostalZone>
|
||||
<cac:Country>
|
||||
<cbc:IdentificationCode listID="ISO3166-1:Alpha2" listAgencyID="6"
|
||||
>NL
|
||||
</cbc:IdentificationCode>
|
||||
</cac:Country>
|
||||
</cac:PostalAddress>
|
||||
<cac:PartyTaxScheme>
|
||||
<cbc:CompanyID schemeID="NL:VAT" schemeAgencyID="ZZZ">NL123456789B01</cbc:CompanyID>
|
||||
<cac:TaxScheme>
|
||||
<cbc:ID schemeID="UN/ECE 5153" schemeAgencyID="6">VAT</cbc:ID>
|
||||
</cac:TaxScheme>
|
||||
</cac:PartyTaxScheme>
|
||||
<cac:PartyLegalEntity>
|
||||
<cbc:RegistrationName>UBL Ketentest BV</cbc:RegistrationName>
|
||||
<cbc:CompanyID>12345678</cbc:CompanyID>
|
||||
</cac:PartyLegalEntity>
|
||||
<cac:Contact>
|
||||
<cbc:Telephone>06 987654321</cbc:Telephone>
|
||||
<cbc:ElectronicMail>info@gbned.nl</cbc:ElectronicMail>
|
||||
</cac:Contact>
|
||||
</cac:Party>
|
||||
</cac:AccountingSupplierParty>
|
||||
|
||||
<cac:AccountingCustomerParty>
|
||||
<cac:Party>
|
||||
<cac:PartyName>
|
||||
<cbc:Name>UBL Ready</cbc:Name>
|
||||
</cac:PartyName>
|
||||
<cac:PostalAddress>
|
||||
<cbc:StreetName>Demostreet 1</cbc:StreetName>
|
||||
<cbc:CityName>Arnhem</cbc:CityName>
|
||||
<cbc:PostalZone>1234 AB</cbc:PostalZone>
|
||||
<cac:Country>
|
||||
<cbc:IdentificationCode listID="ISO3166-1:Alpha2" listAgencyID="6"
|
||||
>NL
|
||||
</cbc:IdentificationCode>
|
||||
</cac:Country>
|
||||
</cac:PostalAddress>
|
||||
|
||||
<cac:PartyLegalEntity>
|
||||
<cbc:RegistrationName>UBL Ready</cbc:RegistrationName>
|
||||
</cac:PartyLegalEntity>
|
||||
<cac:Contact>
|
||||
<cbc:Name>John Doe</cbc:Name>
|
||||
<cbc:Telephone>070-1111111</cbc:Telephone>
|
||||
<cbc:ElectronicMail>invoices@ublready.com</cbc:ElectronicMail>
|
||||
</cac:Contact>
|
||||
</cac:Party>
|
||||
</cac:AccountingCustomerParty>
|
||||
|
||||
<cac:Delivery>
|
||||
<cbc:ActualDeliveryDate>2017-02-16</cbc:ActualDeliveryDate>
|
||||
<cac:DeliveryLocation>
|
||||
<cac:Address>
|
||||
<cbc:StreetName>Stocklane 10</cbc:StreetName>
|
||||
<cbc:CityName>Arnhem</cbc:CityName>
|
||||
<cbc:PostalZone>4321 BA</cbc:PostalZone>
|
||||
<cac:Country>
|
||||
<cbc:IdentificationCode listID="ISO3166-1:Alpha2" listAgencyID="6"
|
||||
>NL
|
||||
</cbc:IdentificationCode>
|
||||
</cac:Country>
|
||||
</cac:Address>
|
||||
</cac:DeliveryLocation>
|
||||
</cac:Delivery>
|
||||
|
||||
<cac:PaymentMeans>
|
||||
<cbc:PaymentMeansCode listID="UNCL4461">31</cbc:PaymentMeansCode>
|
||||
<cac:PayeeFinancialAccount>
|
||||
<cbc:ID schemeID="IBAN">NL23ABNA0123456789</cbc:ID>
|
||||
<cac:FinancialInstitutionBranch>
|
||||
<cac:FinancialInstitution>
|
||||
<cbc:ID schemeID="BIC">ABNANL2A</cbc:ID>
|
||||
</cac:FinancialInstitution>
|
||||
</cac:FinancialInstitutionBranch>
|
||||
</cac:PayeeFinancialAccount>
|
||||
</cac:PaymentMeans>
|
||||
|
||||
<cac:PaymentTerms>
|
||||
<cbc:Note>Payments within 30 days.</cbc:Note>
|
||||
</cac:PaymentTerms>
|
||||
|
||||
<cac:AllowanceCharge>
|
||||
<cbc:ChargeIndicator>false</cbc:ChargeIndicator>
|
||||
<cbc:AllowanceChargeReasonCode listID="UNCL5189">64</cbc:AllowanceChargeReasonCode>
|
||||
<cbc:AllowanceChargeReason>Invoice allowance (VAT low 6%)</cbc:AllowanceChargeReason>
|
||||
<cbc:MultiplierFactorNumeric>1</cbc:MultiplierFactorNumeric>
|
||||
<cbc:Amount currencyID="EUR">22</cbc:Amount>
|
||||
<cbc:BaseAmount currencyID="EUR">220</cbc:BaseAmount>
|
||||
<cac:TaxCategory>
|
||||
<cbc:ID schemeID="UNCL5305">S</cbc:ID>
|
||||
<cbc:Percent>6</cbc:Percent>
|
||||
<cac:TaxScheme>
|
||||
<cbc:ID schemeID="UN/ECE 5153" schemeAgencyID="6">VAT</cbc:ID>
|
||||
</cac:TaxScheme>
|
||||
</cac:TaxCategory>
|
||||
</cac:AllowanceCharge>
|
||||
<cac:AllowanceCharge>
|
||||
<cbc:ChargeIndicator>false</cbc:ChargeIndicator>
|
||||
<cbc:AllowanceChargeReasonCode listID="UNCL5189">64</cbc:AllowanceChargeReasonCode>
|
||||
<cbc:AllowanceChargeReason>Invoice allowance (VAT high 21%)</cbc:AllowanceChargeReason>
|
||||
<cbc:MultiplierFactorNumeric>1</cbc:MultiplierFactorNumeric>
|
||||
<cbc:Amount currencyID="EUR">18</cbc:Amount>
|
||||
<cbc:BaseAmount currencyID="EUR">180</cbc:BaseAmount>
|
||||
<cac:TaxCategory>
|
||||
<cbc:ID schemeID="UNCL5305">S</cbc:ID>
|
||||
<cbc:Percent>21</cbc:Percent>
|
||||
<cac:TaxScheme>
|
||||
<cbc:ID schemeID="UN/ECE 5153" schemeAgencyID="6">VAT</cbc:ID>
|
||||
</cac:TaxScheme>
|
||||
</cac:TaxCategory>
|
||||
</cac:AllowanceCharge>
|
||||
<cac:AllowanceCharge>
|
||||
<cbc:ChargeIndicator>true</cbc:ChargeIndicator>
|
||||
<cbc:AllowanceChargeReasonCode listID="UNCL7161">ZZZ</cbc:AllowanceChargeReasonCode>
|
||||
<cbc:AllowanceChargeReason>Handling costs</cbc:AllowanceChargeReason>
|
||||
<cbc:Amount currencyID="EUR">10</cbc:Amount>
|
||||
<cac:TaxCategory>
|
||||
<cbc:ID schemeID="UNCL5305">S</cbc:ID>
|
||||
<cbc:Percent>21</cbc:Percent>
|
||||
<cac:TaxScheme>
|
||||
<cbc:ID schemeID="UN/ECE 5153" schemeAgencyID="6">VAT</cbc:ID>
|
||||
</cac:TaxScheme>
|
||||
</cac:TaxCategory>
|
||||
</cac:AllowanceCharge>
|
||||
<cac:TaxTotal>
|
||||
<cbc:TaxAmount currencyID="EUR">48.00</cbc:TaxAmount>
|
||||
<cac:TaxSubtotal>
|
||||
<cbc:TaxableAmount currencyID="EUR">198</cbc:TaxableAmount>
|
||||
<cbc:TaxAmount currencyID="EUR">11.88</cbc:TaxAmount>
|
||||
<cac:TaxCategory>
|
||||
<cbc:ID schemeID="UNCL5305">S</cbc:ID>
|
||||
<cbc:Percent>6.00</cbc:Percent>
|
||||
<cac:TaxScheme>
|
||||
<cbc:ID schemeID="UN/ECE 5153" schemeAgencyID="6">VAT</cbc:ID>
|
||||
</cac:TaxScheme>
|
||||
</cac:TaxCategory>
|
||||
</cac:TaxSubtotal>
|
||||
<cac:TaxSubtotal>
|
||||
<cbc:TaxableAmount currencyID="EUR">172</cbc:TaxableAmount>
|
||||
<cbc:TaxAmount currencyID="EUR">36.12</cbc:TaxAmount>
|
||||
<cac:TaxCategory>
|
||||
<cbc:ID schemeID="UNCL5305">S</cbc:ID>
|
||||
<cbc:Percent>21.00</cbc:Percent>
|
||||
<cac:TaxScheme>
|
||||
<cbc:ID schemeID="UN/ECE 5153" schemeAgencyID="6">VAT</cbc:ID>
|
||||
</cac:TaxScheme>
|
||||
</cac:TaxCategory>
|
||||
</cac:TaxSubtotal>
|
||||
</cac:TaxTotal>
|
||||
|
||||
<cac:LegalMonetaryTotal>
|
||||
<cbc:LineExtensionAmount currencyID="EUR">400.00</cbc:LineExtensionAmount>
|
||||
<cbc:TaxExclusiveAmount currencyID="EUR">370.00</cbc:TaxExclusiveAmount>
|
||||
<cbc:TaxInclusiveAmount currencyID="EUR">418.00</cbc:TaxInclusiveAmount>
|
||||
<cbc:AllowanceTotalAmount currencyID="EUR">40.00</cbc:AllowanceTotalAmount>
|
||||
<cbc:ChargeTotalAmount currencyID="EUR">10.00</cbc:ChargeTotalAmount>
|
||||
<cbc:PayableAmount currencyID="EUR">418.00</cbc:PayableAmount>
|
||||
</cac:LegalMonetaryTotal>
|
||||
|
||||
<cac:InvoiceLine>
|
||||
<cbc:ID>5</cbc:ID>
|
||||
<cbc:InvoicedQuantity unitCodeListID="UNECERec20" unitCode="ZZ">1.00</cbc:InvoicedQuantity>
|
||||
<cbc:LineExtensionAmount currencyID="EUR">50.00</cbc:LineExtensionAmount>
|
||||
<cac:Item>
|
||||
<cbc:Description>Book The digital highway in Holland</cbc:Description>
|
||||
<cbc:Name>The digital highway</cbc:Name>
|
||||
<cac:SellersItemIdentification>
|
||||
<cbc:ID>BK0232</cbc:ID>
|
||||
</cac:SellersItemIdentification>
|
||||
<cac:ClassifiedTaxCategory>
|
||||
<cbc:ID schemeID="UNCL5305">S</cbc:ID>
|
||||
<cbc:Percent>6.00</cbc:Percent>
|
||||
<cac:TaxScheme>
|
||||
<cbc:ID schemeID="UN/ECE 5153" schemeAgencyID="6">VAT</cbc:ID>
|
||||
</cac:TaxScheme>
|
||||
</cac:ClassifiedTaxCategory>
|
||||
</cac:Item>
|
||||
<cac:Price>
|
||||
<cbc:PriceAmount currencyID="EUR">50.00</cbc:PriceAmount>
|
||||
<cbc:BaseQuantity unitCodeListID="UNECERec20" unitCode="ZZ">1.00</cbc:BaseQuantity>
|
||||
</cac:Price>
|
||||
</cac:InvoiceLine>
|
||||
|
||||
<cac:InvoiceLine>
|
||||
<cbc:ID>10</cbc:ID>
|
||||
<cbc:InvoicedQuantity unitCodeListID="UNECERec20" unitCode="ZZ">2.00</cbc:InvoicedQuantity>
|
||||
<cbc:LineExtensionAmount currencyID="EUR">170.00</cbc:LineExtensionAmount>
|
||||
<cac:Item>
|
||||
<cbc:Description>Book Coding UBL for orders and invoices</cbc:Description>
|
||||
<cbc:Name>Coding UBL</cbc:Name>
|
||||
<cac:SellersItemIdentification>
|
||||
<cbc:ID>BK3025</cbc:ID>
|
||||
</cac:SellersItemIdentification>
|
||||
<cac:ClassifiedTaxCategory>
|
||||
<cbc:ID schemeID="UNCL5305">S</cbc:ID>
|
||||
<cbc:Percent>6.00</cbc:Percent>
|
||||
<cac:TaxScheme>
|
||||
<cbc:ID schemeID="UN/ECE 5153" schemeAgencyID="6">VAT</cbc:ID>
|
||||
</cac:TaxScheme>
|
||||
</cac:ClassifiedTaxCategory>
|
||||
</cac:Item>
|
||||
<cac:Price>
|
||||
<cbc:PriceAmount currencyID="EUR">85.00</cbc:PriceAmount>
|
||||
<cbc:BaseQuantity unitCodeListID="UNECERec20" unitCode="ZZ">2.00</cbc:BaseQuantity>
|
||||
</cac:Price>
|
||||
</cac:InvoiceLine>
|
||||
|
||||
<cac:InvoiceLine>
|
||||
<cbc:ID>15</cbc:ID>
|
||||
<cbc:InvoicedQuantity unitCodeListID="UNECERec20" unitCode="ZZ">1.00</cbc:InvoicedQuantity>
|
||||
<cbc:LineExtensionAmount currencyID="EUR">180.00</cbc:LineExtensionAmount>
|
||||
<cac:AllowanceCharge>
|
||||
<cbc:ChargeIndicator>false</cbc:ChargeIndicator>
|
||||
<cbc:AllowanceChargeReason>Price discount</cbc:AllowanceChargeReason>
|
||||
<cbc:MultiplierFactorNumeric>10</cbc:MultiplierFactorNumeric>
|
||||
<cbc:Amount currencyID="EUR">20.00</cbc:Amount>
|
||||
<cbc:BaseAmount currencyID="EUR">200</cbc:BaseAmount>
|
||||
</cac:AllowanceCharge>
|
||||
<cac:Item>
|
||||
<cbc:Description>Conversion softwarepackage to UBL</cbc:Description>
|
||||
<cbc:Name>Conversion UBL</cbc:Name>
|
||||
<cac:SellersItemIdentification>
|
||||
<cbc:ID>SW4026</cbc:ID>
|
||||
</cac:SellersItemIdentification>
|
||||
<cac:ClassifiedTaxCategory>
|
||||
<cbc:ID schemeID="UNCL5305">S</cbc:ID>
|
||||
<cbc:Percent>21.00</cbc:Percent>
|
||||
<cac:TaxScheme>
|
||||
<cbc:ID schemeID="UN/ECE 5153" schemeAgencyID="6">VAT</cbc:ID>
|
||||
</cac:TaxScheme>
|
||||
</cac:ClassifiedTaxCategory>
|
||||
</cac:Item>
|
||||
<cac:Price>
|
||||
<cbc:PriceAmount currencyID="EUR">200.00</cbc:PriceAmount>
|
||||
<cbc:BaseQuantity unitCodeListID="UNECERec20" unitCode="ZZ">1.00</cbc:BaseQuantity>
|
||||
</cac:Price>
|
||||
</cac:InvoiceLine>
|
||||
|
||||
</Invoice>
|
||||
|
||||
55
src/test/resources/examples/UBLReady/scenarios-1.xml
Normal file
55
src/test/resources/examples/UBLReady/scenarios-1.xml
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
<?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.
|
||||
-->
|
||||
|
||||
<scenarios xmlns="http://www.xoev.de/de/validator/framework/1/scenarios" frameworkVersion="1.0.0">
|
||||
<name>XInneres</name>
|
||||
<date>2017-08-08</date>
|
||||
<description>
|
||||
<p>Prüft XInneres Nachrichten anhand der von uns offiziell herausgegebenen XML Schemata und Beispielen für mögliche weitergehende Prüfungen mit Schematron. </p>
|
||||
<p>Prüft elektronische Rechnungen im Format UBL 2.1 </p>
|
||||
</description>
|
||||
|
||||
<scenario>
|
||||
<name>UBL 2.1 Invoice</name>
|
||||
<namespace prefix="invoice">urn:oasis:names:specification:ubl:schema:xsd:Invoice-2</namespace>
|
||||
<match>/invoice:Invoice</match>
|
||||
|
||||
<validateWithXmlSchema>
|
||||
<resource>
|
||||
<name>UBL 2.1 Invoice</name>
|
||||
<location>resources/eRechnung/UBL-2.1/xsdrt/maindoc/UBL-Invoice-2.1.xsd</location>
|
||||
</resource>
|
||||
</validateWithXmlSchema>
|
||||
<createReport>
|
||||
<resource>
|
||||
<name>Report für eRechnung</name>
|
||||
<!-- noch nicht vorhanden -->
|
||||
<location>does-not-exist.xsl</location>
|
||||
</resource>
|
||||
</createReport>
|
||||
</scenario>
|
||||
<noScenarioReport>
|
||||
<resource>
|
||||
<name>default</name>
|
||||
<location>resources/eRechnung/report.xsl</location>
|
||||
</resource>
|
||||
</noScenarioReport>
|
||||
|
||||
</scenarios>
|
||||
66
src/test/resources/examples/UBLReady/scenarios-2.xml
Normal file
66
src/test/resources/examples/UBLReady/scenarios-2.xml
Normal file
|
|
@ -0,0 +1,66 @@
|
|||
<?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.
|
||||
-->
|
||||
|
||||
<scenarios xmlns="http://www.xoev.de/de/validator/framework/1/scenarios" frameworkVersion="1.1.1">
|
||||
<name>XInneres</name>
|
||||
<date>2017-08-08</date>
|
||||
<description>
|
||||
<p>Prüft XInneres Nachrichten anhand der von uns offiziell herausgegebenen XML Schemata und Beispielen für mögliche weitergehende Prüfungen mit Schematron. </p>
|
||||
<p>Prüft elektronische Rechnungen im Format UBL 2.1 </p>
|
||||
</description>
|
||||
|
||||
<scenario>
|
||||
<name>UBL 2.1 Invoice</name>
|
||||
<namespace prefix="invoice">urn:oasis:names:specification:ubl:schema:xsd:Invoice-2</namespace>
|
||||
<match>/invoice:Invoice</match>
|
||||
|
||||
<validateWithXmlSchema>
|
||||
<resource>
|
||||
<name>UBL 2.1 Invoice</name>
|
||||
<location>resources/eRechnung/UBL-2.1/xsdrt/maindoc/UBL-Invoice-2.1.xsd</location>
|
||||
</resource>
|
||||
</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>
|
||||
<resource>
|
||||
<name>Report für eRechnung</name>
|
||||
<location>resources/eRechnung/report.xsl</location>
|
||||
</resource>
|
||||
</createReport>
|
||||
</scenario>
|
||||
<noScenarioReport>
|
||||
<resource>
|
||||
<name>default</name>
|
||||
<location>resources/eRechnung/default-report.xsl</location>
|
||||
</resource>
|
||||
</noScenarioReport>
|
||||
|
||||
</scenarios>
|
||||
45
src/test/resources/examples/assertions/tests-xrechnung.xml
Normal file
45
src/test/resources/examples/assertions/tests-xrechnung.xml
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
<?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.
|
||||
-->
|
||||
|
||||
<assertions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns="http://www.xoev.de/de/validator/framework/1/assertions"
|
||||
xsi:schemaLocation="http://www.xoev.de/de/validator/framework/1/assertions file:/C:/fb/svn/xoev/produkte/prueftool/trunk/xsd/assertions.xsd">
|
||||
|
||||
<namespace prefix="rep">http://www.xoev.de/de/validator/varl/1</namespace>
|
||||
|
||||
<assertion report-doc="ubl-0001.xml" test="/rep:report/rep:scenarioMatched/rep:validationStepResult/@id = 'xsd'">
|
||||
Schema wurde validiert
|
||||
</assertion>
|
||||
<assertion report-doc="ubl-0001.xml" test="/rep:report/rep:scenarioMatched/rep:validationStepResult/@id = 'sch.1'">
|
||||
Schematron wurde validiert
|
||||
</assertion>
|
||||
<assertion report-doc="ubl-0001.xml" test="/rep:report/rep:assessment/rep:accept">Empfehlung zur Annahme</assertion>
|
||||
|
||||
<assertion report-doc="ubl-0002.xml"
|
||||
test="/rep:report/rep:scenarioMatched/rep:validationStepResult/@id = 'val-xsd'">Schema wurde validiert
|
||||
</assertion>
|
||||
<assertion report-doc="ubl-0002.xml" test="/rep:report/rep:scenarioMatched/rep:validationStepResult/@id = 'sch.1'">
|
||||
Schematron wurde validiert
|
||||
</assertion>
|
||||
<assertion report-doc="ubl-0002.xml" test="/rep:report/rep:assessment/rep:accept">Empfehlung zur Ablehnung
|
||||
</assertion>
|
||||
|
||||
|
||||
</assertions>
|
||||
3426
src/test/resources/examples/assertions/ubl-0001-report.xml
Normal file
3426
src/test/resources/examples/assertions/ubl-0001-report.xml
Normal file
File diff suppressed because it is too large
Load diff
542
src/test/resources/examples/assertions/ubl-0001.xml
Normal file
542
src/test/resources/examples/assertions/ubl-0001.xml
Normal file
|
|
@ -0,0 +1,542 @@
|
|||
<?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.
|
||||
-->
|
||||
|
||||
<Invoice xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2"
|
||||
xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2"
|
||||
xmlns="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2">
|
||||
<cbc:CustomizationID>urn:cen.eu:en16931:2017</cbc:CustomizationID>
|
||||
<cbc:ID>12115118</cbc:ID>
|
||||
<cbc:IssueDate>2015-01-09</cbc:IssueDate>
|
||||
<cbc:DueDate>2015-01-09</cbc:DueDate>
|
||||
<cbc:InvoiceTypeCode>380</cbc:InvoiceTypeCode>
|
||||
<cbc:Note>Alle leveringen zijn franco. Alle prijzen zijn incl. BTW. Betalingstermijn: 14 dagen netto.
|
||||
Prijswijzigingen voorbehouden. Op al onze aanbiedingen, leveringen en overeenkomsten zijn van toepassing in de
|
||||
algemene verkoop en leveringsvoorwaarden. Gedeponeerd bij de K.v.K. te Amsterdam 25-04-'85##Delivery terms
|
||||
</cbc:Note>
|
||||
<cbc:DocumentCurrencyCode>EUR</cbc:DocumentCurrencyCode>
|
||||
<cac:AccountingSupplierParty>
|
||||
<cac:Party>
|
||||
<cac:PostalAddress>
|
||||
<cbc:StreetName>Postbus 7l</cbc:StreetName>
|
||||
<cbc:CityName>Velsen-Noord</cbc:CityName>
|
||||
<cbc:PostalZone>1950 AB</cbc:PostalZone>
|
||||
<cac:Country>
|
||||
<cbc:IdentificationCode>NL</cbc:IdentificationCode>
|
||||
</cac:Country>
|
||||
</cac:PostalAddress>
|
||||
<cac:PartyTaxScheme>
|
||||
<cbc:CompanyID>NL8200.98.395.B.01</cbc:CompanyID>
|
||||
<cac:TaxScheme>
|
||||
<cbc:ID>VAT</cbc:ID>
|
||||
</cac:TaxScheme>
|
||||
</cac:PartyTaxScheme>
|
||||
<cac:PartyLegalEntity>
|
||||
<cbc:RegistrationName>De Koksmaat</cbc:RegistrationName>
|
||||
<cbc:CompanyID>57151520</cbc:CompanyID>
|
||||
</cac:PartyLegalEntity>
|
||||
</cac:Party>
|
||||
</cac:AccountingSupplierParty>
|
||||
<cac:AccountingCustomerParty>
|
||||
<cac:Party>
|
||||
<cac:PartyIdentification>
|
||||
<cbc:ID>10202</cbc:ID>
|
||||
</cac:PartyIdentification>
|
||||
<cac:PostalAddress>
|
||||
<cbc:StreetName>POSTBUS 367</cbc:StreetName>
|
||||
<cbc:CityName>HEEMSKERK</cbc:CityName>
|
||||
<cbc:PostalZone>1960 AJ</cbc:PostalZone>
|
||||
<cac:Country>
|
||||
<cbc:IdentificationCode>NL</cbc:IdentificationCode>
|
||||
</cac:Country>
|
||||
</cac:PostalAddress>
|
||||
<cac:PartyLegalEntity>
|
||||
<cbc:RegistrationName>ODIN 59</cbc:RegistrationName>
|
||||
</cac:PartyLegalEntity>
|
||||
<cac:Contact>
|
||||
<cbc:Name>Dhr. J BLOKKER</cbc:Name>
|
||||
</cac:Contact>
|
||||
</cac:Party>
|
||||
</cac:AccountingCustomerParty>
|
||||
<cac:PaymentMeans>
|
||||
<cbc:PaymentMeansCode>30</cbc:PaymentMeansCode>
|
||||
<cbc:PaymentID>Deb. 10202 / Fact. 12115118</cbc:PaymentID>
|
||||
<cac:PayeeFinancialAccount>
|
||||
<cbc:ID>NL57 RABO 0107307510</cbc:ID>
|
||||
</cac:PayeeFinancialAccount>
|
||||
</cac:PaymentMeans>
|
||||
<cac:PaymentMeans>
|
||||
<cbc:PaymentMeansCode>30</cbc:PaymentMeansCode>
|
||||
<cbc:PaymentID>Deb. 10202 / Fact. 12115118</cbc:PaymentID>
|
||||
<cac:PayeeFinancialAccount>
|
||||
<cbc:ID>NL03 INGB 0004489902</cbc:ID>
|
||||
</cac:PayeeFinancialAccount>
|
||||
</cac:PaymentMeans>
|
||||
<cac:TaxTotal>
|
||||
<cbc:TaxAmount currencyID="EUR">20.73</cbc:TaxAmount>
|
||||
<cac:TaxSubtotal>
|
||||
<cbc:TaxableAmount currencyID="EUR">183.23</cbc:TaxableAmount>
|
||||
<cbc:TaxAmount currencyID="EUR">10.99</cbc:TaxAmount>
|
||||
<cac:TaxCategory>
|
||||
<cbc:ID>S</cbc:ID>
|
||||
<cbc:Percent>6</cbc:Percent>
|
||||
<cac:TaxScheme>
|
||||
<cbc:ID>VAT</cbc:ID>
|
||||
</cac:TaxScheme>
|
||||
</cac:TaxCategory>
|
||||
</cac:TaxSubtotal>
|
||||
<cac:TaxSubtotal>
|
||||
<cbc:TaxableAmount currencyID="EUR">46.37</cbc:TaxableAmount>
|
||||
<cbc:TaxAmount currencyID="EUR">9.74</cbc:TaxAmount>
|
||||
<cac:TaxCategory>
|
||||
<cbc:ID>S</cbc:ID>
|
||||
<cbc:Percent>21</cbc:Percent>
|
||||
<cac:TaxScheme>
|
||||
<cbc:ID>VAT</cbc:ID>
|
||||
</cac:TaxScheme>
|
||||
</cac:TaxCategory>
|
||||
</cac:TaxSubtotal>
|
||||
</cac:TaxTotal>
|
||||
<cac:LegalMonetaryTotal>
|
||||
<cbc:LineExtensionAmount currencyID="EUR">229.60</cbc:LineExtensionAmount>
|
||||
<cbc:TaxExclusiveAmount currencyID="EUR">229.60</cbc:TaxExclusiveAmount>
|
||||
<cbc:TaxInclusiveAmount currencyID="EUR">250.33</cbc:TaxInclusiveAmount>
|
||||
<cbc:PayableAmount currencyID="EUR">250.33</cbc:PayableAmount>
|
||||
</cac:LegalMonetaryTotal>
|
||||
<cac:InvoiceLine>
|
||||
<cbc:ID>1</cbc:ID>
|
||||
<cbc:InvoicedQuantity unitCode="EA">2</cbc:InvoicedQuantity>
|
||||
<cbc:LineExtensionAmount currencyID="EUR">19.90</cbc:LineExtensionAmount>
|
||||
<cac:Item>
|
||||
<cbc:Name>PATAT FRITES 10MM 10KG</cbc:Name>
|
||||
<cac:SellersItemIdentification>
|
||||
<cbc:ID>166022</cbc:ID>
|
||||
</cac:SellersItemIdentification>
|
||||
<cac:ClassifiedTaxCategory>
|
||||
<cbc:ID>S</cbc:ID>
|
||||
<cbc:Percent>6</cbc:Percent>
|
||||
<cac:TaxScheme>
|
||||
<cbc:ID>VAT</cbc:ID>
|
||||
</cac:TaxScheme>
|
||||
</cac:ClassifiedTaxCategory>
|
||||
</cac:Item>
|
||||
<cac:Price>
|
||||
<cbc:PriceAmount currencyID="EUR">9.95</cbc:PriceAmount>
|
||||
</cac:Price>
|
||||
</cac:InvoiceLine>
|
||||
<cac:InvoiceLine>
|
||||
<cbc:ID>2</cbc:ID>
|
||||
<cbc:InvoicedQuantity unitCode="EA">1</cbc:InvoicedQuantity>
|
||||
<cbc:LineExtensionAmount currencyID="EUR">9.85</cbc:LineExtensionAmount>
|
||||
<cac:Item>
|
||||
<cbc:Name>PKAAS 50PL. JONG BEL. 1KG</cbc:Name>
|
||||
<cac:SellersItemIdentification>
|
||||
<cbc:ID>661813</cbc:ID>
|
||||
</cac:SellersItemIdentification>
|
||||
<cac:ClassifiedTaxCategory>
|
||||
<cbc:ID>S</cbc:ID>
|
||||
<cbc:Percent>6</cbc:Percent>
|
||||
<cac:TaxScheme>
|
||||
<cbc:ID>VAT</cbc:ID>
|
||||
</cac:TaxScheme>
|
||||
</cac:ClassifiedTaxCategory>
|
||||
</cac:Item>
|
||||
<cac:Price>
|
||||
<cbc:PriceAmount currencyID="EUR">9.85</cbc:PriceAmount>
|
||||
</cac:Price>
|
||||
</cac:InvoiceLine>
|
||||
<cac:InvoiceLine>
|
||||
<cbc:ID>3</cbc:ID>
|
||||
<cbc:InvoicedQuantity unitCode="EA">1</cbc:InvoicedQuantity>
|
||||
<cbc:LineExtensionAmount currencyID="EUR">8.29</cbc:LineExtensionAmount>
|
||||
<cac:Item>
|
||||
<cbc:Name>POT KETCHUP 3 LT</cbc:Name>
|
||||
<cac:SellersItemIdentification>
|
||||
<cbc:ID>438146</cbc:ID>
|
||||
</cac:SellersItemIdentification>
|
||||
<cac:ClassifiedTaxCategory>
|
||||
<cbc:ID>S</cbc:ID>
|
||||
<cbc:Percent>6</cbc:Percent>
|
||||
<cac:TaxScheme>
|
||||
<cbc:ID>VAT</cbc:ID>
|
||||
</cac:TaxScheme>
|
||||
</cac:ClassifiedTaxCategory>
|
||||
</cac:Item>
|
||||
<cac:Price>
|
||||
<cbc:PriceAmount currencyID="EUR">8.29</cbc:PriceAmount>
|
||||
</cac:Price>
|
||||
</cac:InvoiceLine>
|
||||
<cac:InvoiceLine>
|
||||
<cbc:ID>4</cbc:ID>
|
||||
<cbc:InvoicedQuantity unitCode="EA">2</cbc:InvoicedQuantity>
|
||||
<cbc:LineExtensionAmount currencyID="EUR">14.46</cbc:LineExtensionAmount>
|
||||
<cac:Item>
|
||||
<cbc:Name>FRITESSAUS 3 LRR</cbc:Name>
|
||||
<cac:SellersItemIdentification>
|
||||
<cbc:ID>438103</cbc:ID>
|
||||
</cac:SellersItemIdentification>
|
||||
<cac:ClassifiedTaxCategory>
|
||||
<cbc:ID>S</cbc:ID>
|
||||
<cbc:Percent>6</cbc:Percent>
|
||||
<cac:TaxScheme>
|
||||
<cbc:ID>VAT</cbc:ID>
|
||||
</cac:TaxScheme>
|
||||
</cac:ClassifiedTaxCategory>
|
||||
</cac:Item>
|
||||
<cac:Price>
|
||||
<cbc:PriceAmount currencyID="EUR">7.23</cbc:PriceAmount>
|
||||
</cac:Price>
|
||||
</cac:InvoiceLine>
|
||||
<cac:InvoiceLine>
|
||||
<cbc:ID>5</cbc:ID>
|
||||
<cbc:InvoicedQuantity unitCode="EA">1</cbc:InvoicedQuantity>
|
||||
<cbc:LineExtensionAmount currencyID="EUR">35.00</cbc:LineExtensionAmount>
|
||||
<cac:Item>
|
||||
<cbc:Name>KOFFIE BLIK 3,5KG SNELF</cbc:Name>
|
||||
<cac:SellersItemIdentification>
|
||||
<cbc:ID>666955</cbc:ID>
|
||||
</cac:SellersItemIdentification>
|
||||
<cac:ClassifiedTaxCategory>
|
||||
<cbc:ID>S</cbc:ID>
|
||||
<cbc:Percent>6</cbc:Percent>
|
||||
<cac:TaxScheme>
|
||||
<cbc:ID>VAT</cbc:ID>
|
||||
</cac:TaxScheme>
|
||||
</cac:ClassifiedTaxCategory>
|
||||
</cac:Item>
|
||||
<cac:Price>
|
||||
<cbc:PriceAmount currencyID="EUR">35.00</cbc:PriceAmount>
|
||||
</cac:Price>
|
||||
</cac:InvoiceLine>
|
||||
<cac:InvoiceLine>
|
||||
<cbc:ID>6</cbc:ID>
|
||||
<cbc:InvoicedQuantity unitCode="EA">1</cbc:InvoicedQuantity>
|
||||
<cbc:LineExtensionAmount currencyID="EUR">35.00</cbc:LineExtensionAmount>
|
||||
<cac:Item>
|
||||
<cbc:Name>KOFFIE 3.5 KG BLIK STAND</cbc:Name>
|
||||
<cac:SellersItemIdentification>
|
||||
<cbc:ID>664871</cbc:ID>
|
||||
</cac:SellersItemIdentification>
|
||||
<cac:ClassifiedTaxCategory>
|
||||
<cbc:ID>S</cbc:ID>
|
||||
<cbc:Percent>6</cbc:Percent>
|
||||
<cac:TaxScheme>
|
||||
<cbc:ID>VAT</cbc:ID>
|
||||
</cac:TaxScheme>
|
||||
</cac:ClassifiedTaxCategory>
|
||||
</cac:Item>
|
||||
<cac:Price>
|
||||
<cbc:PriceAmount currencyID="EUR">35.00</cbc:PriceAmount>
|
||||
</cac:Price>
|
||||
</cac:InvoiceLine>
|
||||
<cac:InvoiceLine>
|
||||
<cbc:ID>7</cbc:ID>
|
||||
<cbc:InvoicedQuantity unitCode="EA">1</cbc:InvoicedQuantity>
|
||||
<cbc:LineExtensionAmount currencyID="EUR">10.65</cbc:LineExtensionAmount>
|
||||
<cac:Item>
|
||||
<cbc:Name>SUIKERKLONT</cbc:Name>
|
||||
<cac:SellersItemIdentification>
|
||||
<cbc:ID>350257</cbc:ID>
|
||||
</cac:SellersItemIdentification>
|
||||
<cac:ClassifiedTaxCategory>
|
||||
<cbc:ID>S</cbc:ID>
|
||||
<cbc:Percent>6</cbc:Percent>
|
||||
<cac:TaxScheme>
|
||||
<cbc:ID>VAT</cbc:ID>
|
||||
</cac:TaxScheme>
|
||||
</cac:ClassifiedTaxCategory>
|
||||
</cac:Item>
|
||||
<cac:Price>
|
||||
<cbc:PriceAmount currencyID="EUR">10.65</cbc:PriceAmount>
|
||||
</cac:Price>
|
||||
</cac:InvoiceLine>
|
||||
<cac:InvoiceLine>
|
||||
<cbc:ID>8</cbc:ID>
|
||||
<cbc:InvoicedQuantity unitCode="EA">1</cbc:InvoicedQuantity>
|
||||
<cbc:LineExtensionAmount currencyID="EUR">1.55</cbc:LineExtensionAmount>
|
||||
<cac:Item>
|
||||
<cbc:Name>1 KG UL BLOKJES</cbc:Name>
|
||||
<cac:SellersItemIdentification>
|
||||
<cbc:ID>350258</cbc:ID>
|
||||
</cac:SellersItemIdentification>
|
||||
<cac:ClassifiedTaxCategory>
|
||||
<cbc:ID>S</cbc:ID>
|
||||
<cbc:Percent>6</cbc:Percent>
|
||||
<cac:TaxScheme>
|
||||
<cbc:ID>VAT</cbc:ID>
|
||||
</cac:TaxScheme>
|
||||
</cac:ClassifiedTaxCategory>
|
||||
</cac:Item>
|
||||
<cac:Price>
|
||||
<cbc:PriceAmount currencyID="EUR">1.55</cbc:PriceAmount>
|
||||
</cac:Price>
|
||||
</cac:InvoiceLine>
|
||||
<cac:InvoiceLine>
|
||||
<cbc:ID>9</cbc:ID>
|
||||
<cbc:InvoicedQuantity unitCode="EA">3</cbc:InvoicedQuantity>
|
||||
<cbc:LineExtensionAmount currencyID="EUR">14.37</cbc:LineExtensionAmount>
|
||||
<cac:Item>
|
||||
<cbc:Name>BLOCKNOTE A5</cbc:Name>
|
||||
<cac:SellersItemIdentification>
|
||||
<cbc:ID>999998</cbc:ID>
|
||||
</cac:SellersItemIdentification>
|
||||
<cac:ClassifiedTaxCategory>
|
||||
<cbc:ID>S</cbc:ID>
|
||||
<cbc:Percent>6</cbc:Percent>
|
||||
<cac:TaxScheme>
|
||||
<cbc:ID>VAT</cbc:ID>
|
||||
</cac:TaxScheme>
|
||||
</cac:ClassifiedTaxCategory>
|
||||
</cac:Item>
|
||||
<cac:Price>
|
||||
<cbc:PriceAmount currencyID="EUR">4.79</cbc:PriceAmount>
|
||||
</cac:Price>
|
||||
</cac:InvoiceLine>
|
||||
<cac:InvoiceLine>
|
||||
<cbc:ID>10</cbc:ID>
|
||||
<cbc:InvoicedQuantity unitCode="EA">1</cbc:InvoicedQuantity>
|
||||
<cbc:LineExtensionAmount currencyID="EUR">8.29</cbc:LineExtensionAmount>
|
||||
<cac:Item>
|
||||
<cbc:Name>CHIPS NAT KLEIN ZAKJES</cbc:Name>
|
||||
<cac:SellersItemIdentification>
|
||||
<cbc:ID>740810</cbc:ID>
|
||||
</cac:SellersItemIdentification>
|
||||
<cac:ClassifiedTaxCategory>
|
||||
<cbc:ID>S</cbc:ID>
|
||||
<cbc:Percent>6</cbc:Percent>
|
||||
<cac:TaxScheme>
|
||||
<cbc:ID>VAT</cbc:ID>
|
||||
</cac:TaxScheme>
|
||||
</cac:ClassifiedTaxCategory>
|
||||
</cac:Item>
|
||||
<cac:Price>
|
||||
<cbc:PriceAmount currencyID="EUR">8.29</cbc:PriceAmount>
|
||||
</cac:Price>
|
||||
</cac:InvoiceLine>
|
||||
<cac:InvoiceLine>
|
||||
<cbc:ID>11</cbc:ID>
|
||||
<cbc:InvoicedQuantity unitCode="EA">2</cbc:InvoicedQuantity>
|
||||
<cbc:LineExtensionAmount currencyID="EUR">16.58</cbc:LineExtensionAmount>
|
||||
<cac:Item>
|
||||
<cbc:Name>CHIPS PAP KLEINE ZAKJES</cbc:Name>
|
||||
<cac:SellersItemIdentification>
|
||||
<cbc:ID>740829</cbc:ID>
|
||||
</cac:SellersItemIdentification>
|
||||
<cac:ClassifiedTaxCategory>
|
||||
<cbc:ID>S</cbc:ID>
|
||||
<cbc:Percent>6</cbc:Percent>
|
||||
<cac:TaxScheme>
|
||||
<cbc:ID>VAT</cbc:ID>
|
||||
</cac:TaxScheme>
|
||||
</cac:ClassifiedTaxCategory>
|
||||
</cac:Item>
|
||||
<cac:Price>
|
||||
<cbc:PriceAmount currencyID="EUR">8.29</cbc:PriceAmount>
|
||||
</cac:Price>
|
||||
</cac:InvoiceLine>
|
||||
<cac:InvoiceLine>
|
||||
<cbc:ID>12</cbc:ID>
|
||||
<cbc:InvoicedQuantity unitCode="EA">1</cbc:InvoicedQuantity>
|
||||
<cbc:LineExtensionAmount currencyID="EUR">9.95</cbc:LineExtensionAmount>
|
||||
<cac:Item>
|
||||
<cbc:Name>TR KL PAKJES APPELSAP</cbc:Name>
|
||||
<cac:SellersItemIdentification>
|
||||
<cbc:ID>740828</cbc:ID>
|
||||
</cac:SellersItemIdentification>
|
||||
<cac:ClassifiedTaxCategory>
|
||||
<cbc:ID>S</cbc:ID>
|
||||
<cbc:Percent>6</cbc:Percent>
|
||||
<cac:TaxScheme>
|
||||
<cbc:ID>VAT</cbc:ID>
|
||||
</cac:TaxScheme>
|
||||
</cac:ClassifiedTaxCategory>
|
||||
</cac:Item>
|
||||
<cac:Price>
|
||||
<cbc:PriceAmount currencyID="EUR">9.95</cbc:PriceAmount>
|
||||
</cac:Price>
|
||||
</cac:InvoiceLine>
|
||||
<cac:InvoiceLine>
|
||||
<cbc:ID>13</cbc:ID>
|
||||
<cbc:InvoicedQuantity unitCode="EA">2</cbc:InvoicedQuantity>
|
||||
<cbc:LineExtensionAmount currencyID="EUR">3.30</cbc:LineExtensionAmount>
|
||||
<cac:Item>
|
||||
<cbc:Name>PK CHOCOLADEMEL</cbc:Name>
|
||||
<cac:SellersItemIdentification>
|
||||
<cbc:ID>740827</cbc:ID>
|
||||
</cac:SellersItemIdentification>
|
||||
<cac:ClassifiedTaxCategory>
|
||||
<cbc:ID>S</cbc:ID>
|
||||
<cbc:Percent>6</cbc:Percent>
|
||||
<cac:TaxScheme>
|
||||
<cbc:ID>VAT</cbc:ID>
|
||||
</cac:TaxScheme>
|
||||
</cac:ClassifiedTaxCategory>
|
||||
</cac:Item>
|
||||
<cac:Price>
|
||||
<cbc:PriceAmount currencyID="EUR">1.65</cbc:PriceAmount>
|
||||
</cac:Price>
|
||||
</cac:InvoiceLine>
|
||||
<cac:InvoiceLine>
|
||||
<cbc:ID>14</cbc:ID>
|
||||
<cbc:InvoicedQuantity unitCode="EA">1</cbc:InvoicedQuantity>
|
||||
<cbc:LineExtensionAmount currencyID="EUR">10.80</cbc:LineExtensionAmount>
|
||||
<cac:Item>
|
||||
<cbc:Name>KRAT BIER</cbc:Name>
|
||||
<cac:SellersItemIdentification>
|
||||
<cbc:ID>999996</cbc:ID>
|
||||
</cac:SellersItemIdentification>
|
||||
<cac:ClassifiedTaxCategory>
|
||||
<cbc:ID>S</cbc:ID>
|
||||
<cbc:Percent>21</cbc:Percent>
|
||||
<cac:TaxScheme>
|
||||
<cbc:ID>VAT</cbc:ID>
|
||||
</cac:TaxScheme>
|
||||
</cac:ClassifiedTaxCategory>
|
||||
</cac:Item>
|
||||
<cac:Price>
|
||||
<cbc:PriceAmount currencyID="EUR">10.80</cbc:PriceAmount>
|
||||
</cac:Price>
|
||||
</cac:InvoiceLine>
|
||||
<cac:InvoiceLine>
|
||||
<cbc:ID>15</cbc:ID>
|
||||
<cbc:InvoicedQuantity unitCode="EA">1</cbc:InvoicedQuantity>
|
||||
<cbc:LineExtensionAmount currencyID="EUR">3.90</cbc:LineExtensionAmount>
|
||||
<cac:Item>
|
||||
<cbc:Name>STATIEGELD</cbc:Name>
|
||||
<cac:SellersItemIdentification>
|
||||
<cbc:ID>999995</cbc:ID>
|
||||
</cac:SellersItemIdentification>
|
||||
<cac:ClassifiedTaxCategory>
|
||||
<cbc:ID>S</cbc:ID>
|
||||
<cbc:Percent>6</cbc:Percent>
|
||||
<cac:TaxScheme>
|
||||
<cbc:ID>VAT</cbc:ID>
|
||||
</cac:TaxScheme>
|
||||
</cac:ClassifiedTaxCategory>
|
||||
</cac:Item>
|
||||
<cac:Price>
|
||||
<cbc:PriceAmount currencyID="EUR">3.90</cbc:PriceAmount>
|
||||
</cac:Price>
|
||||
</cac:InvoiceLine>
|
||||
<cac:InvoiceLine>
|
||||
<cbc:ID>16</cbc:ID>
|
||||
<cbc:InvoicedQuantity unitCode="EA">2</cbc:InvoicedQuantity>
|
||||
<cbc:LineExtensionAmount currencyID="EUR">7.60</cbc:LineExtensionAmount>
|
||||
<cac:Item>
|
||||
<cbc:Name>BLEEK 3 X 750 ML</cbc:Name>
|
||||
<cac:SellersItemIdentification>
|
||||
<cbc:ID>102172</cbc:ID>
|
||||
</cac:SellersItemIdentification>
|
||||
<cac:ClassifiedTaxCategory>
|
||||
<cbc:ID>S</cbc:ID>
|
||||
<cbc:Percent>21</cbc:Percent>
|
||||
<cac:TaxScheme>
|
||||
<cbc:ID>VAT</cbc:ID>
|
||||
</cac:TaxScheme>
|
||||
</cac:ClassifiedTaxCategory>
|
||||
</cac:Item>
|
||||
<cac:Price>
|
||||
<cbc:PriceAmount currencyID="EUR">3.80</cbc:PriceAmount>
|
||||
</cac:Price>
|
||||
</cac:InvoiceLine>
|
||||
<cac:InvoiceLine>
|
||||
<cbc:ID>17</cbc:ID>
|
||||
<cbc:InvoicedQuantity unitCode="EA">2</cbc:InvoicedQuantity>
|
||||
<cbc:LineExtensionAmount currencyID="EUR">9.34</cbc:LineExtensionAmount>
|
||||
<cac:Item>
|
||||
<cbc:Name>WC PAPIER</cbc:Name>
|
||||
<cac:SellersItemIdentification>
|
||||
<cbc:ID>999994</cbc:ID>
|
||||
</cac:SellersItemIdentification>
|
||||
<cac:ClassifiedTaxCategory>
|
||||
<cbc:ID>S</cbc:ID>
|
||||
<cbc:Percent>21</cbc:Percent>
|
||||
<cac:TaxScheme>
|
||||
<cbc:ID>VAT</cbc:ID>
|
||||
</cac:TaxScheme>
|
||||
</cac:ClassifiedTaxCategory>
|
||||
</cac:Item>
|
||||
<cac:Price>
|
||||
<cbc:PriceAmount currencyID="EUR">4.67</cbc:PriceAmount>
|
||||
</cac:Price>
|
||||
</cac:InvoiceLine>
|
||||
<cac:InvoiceLine>
|
||||
<cbc:ID>18</cbc:ID>
|
||||
<cbc:InvoicedQuantity unitCode="EA">1</cbc:InvoicedQuantity>
|
||||
<cbc:LineExtensionAmount currencyID="EUR">18.63</cbc:LineExtensionAmount>
|
||||
<cac:Item>
|
||||
<cbc:Name>BALPENNEN 50 ST BLAUW</cbc:Name>
|
||||
<cac:SellersItemIdentification>
|
||||
<cbc:ID>999993</cbc:ID>
|
||||
</cac:SellersItemIdentification>
|
||||
<cac:ClassifiedTaxCategory>
|
||||
<cbc:ID>S</cbc:ID>
|
||||
<cbc:Percent>21</cbc:Percent>
|
||||
<cac:TaxScheme>
|
||||
<cbc:ID>VAT</cbc:ID>
|
||||
</cac:TaxScheme>
|
||||
</cac:ClassifiedTaxCategory>
|
||||
</cac:Item>
|
||||
<cac:Price>
|
||||
<cbc:PriceAmount currencyID="EUR">18.63</cbc:PriceAmount>
|
||||
</cac:Price>
|
||||
</cac:InvoiceLine>
|
||||
<cac:InvoiceLine>
|
||||
<cbc:ID>19</cbc:ID>
|
||||
<cbc:InvoicedQuantity unitCode="EA">6</cbc:InvoicedQuantity>
|
||||
<cbc:LineExtensionAmount currencyID="EUR">102.12</cbc:LineExtensionAmount>
|
||||
<cac:Item>
|
||||
<cbc:Name>EM FRITUURVET</cbc:Name>
|
||||
<cac:SellersItemIdentification>
|
||||
<cbc:ID>999992</cbc:ID>
|
||||
</cac:SellersItemIdentification>
|
||||
<cac:ClassifiedTaxCategory>
|
||||
<cbc:ID>S</cbc:ID>
|
||||
<cbc:Percent>6</cbc:Percent>
|
||||
<cac:TaxScheme>
|
||||
<cbc:ID>VAT</cbc:ID>
|
||||
</cac:TaxScheme>
|
||||
</cac:ClassifiedTaxCategory>
|
||||
</cac:Item>
|
||||
<cac:Price>
|
||||
<cbc:PriceAmount currencyID="EUR">17.02</cbc:PriceAmount>
|
||||
</cac:Price>
|
||||
</cac:InvoiceLine>
|
||||
<cac:InvoiceLine>
|
||||
<cbc:ID>20</cbc:ID>
|
||||
<cbc:InvoicedQuantity unitCode="EA">6</cbc:InvoicedQuantity>
|
||||
<cbc:LineExtensionAmount currencyID="EUR">-109.98</cbc:LineExtensionAmount>
|
||||
<cac:Item>
|
||||
<cbc:Name>FRITUUR VET 10 KG RETOUR</cbc:Name>
|
||||
<cac:SellersItemIdentification>
|
||||
<cbc:ID>175137</cbc:ID>
|
||||
</cac:SellersItemIdentification>
|
||||
<cac:ClassifiedTaxCategory>
|
||||
<cbc:ID>S</cbc:ID>
|
||||
<cbc:Percent>6</cbc:Percent>
|
||||
<cac:TaxScheme>
|
||||
<cbc:ID>VAT</cbc:ID>
|
||||
</cac:TaxScheme>
|
||||
</cac:ClassifiedTaxCategory>
|
||||
</cac:Item>
|
||||
<cac:Price>
|
||||
<cbc:PriceAmount currencyID="EUR">18.33</cbc:PriceAmount>
|
||||
</cac:Price>
|
||||
</cac:InvoiceLine>
|
||||
</Invoice>
|
||||
542
src/test/resources/examples/assertions/ubl-0002.xml
Normal file
542
src/test/resources/examples/assertions/ubl-0002.xml
Normal file
|
|
@ -0,0 +1,542 @@
|
|||
<?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.
|
||||
-->
|
||||
|
||||
<Invoice xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2"
|
||||
xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2"
|
||||
xmlns="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2">
|
||||
<cbc:CustomizationID>urn:cen.eu:en16931:2017</cbc:CustomizationID>
|
||||
<cbc:ID>12115118</cbc:ID>
|
||||
<cbc:IssueDate>2015-01-09</cbc:IssueDate>
|
||||
<cbc:DueDate>2015-01-09</cbc:DueDate>
|
||||
<cbc:InvoiceTypeCode>380</cbc:InvoiceTypeCode>
|
||||
<cbc:Note>Alle leveringen zijn franco. Alle prijzen zijn incl. BTW. Betalingstermijn: 14 dagen netto.
|
||||
Prijswijzigingen voorbehouden. Op al onze aanbiedingen, leveringen en overeenkomsten zijn van toepassing in de
|
||||
algemene verkoop en leveringsvoorwaarden. Gedeponeerd bij de K.v.K. te Amsterdam 25-04-'85##Delivery terms
|
||||
</cbc:Note>
|
||||
<cbc:DocumentCurrencyCode>EUR</cbc:DocumentCurrencyCode>
|
||||
<cac:AccountingSupplierParty>
|
||||
<cac:Party>
|
||||
<cac:PostalAddress>
|
||||
<cbc:StreetName>Postbus 7l</cbc:StreetName>
|
||||
<cbc:CityName>Velsen-Noord</cbc:CityName>
|
||||
<cbc:PostalZone>1950 AB</cbc:PostalZone>
|
||||
<cac:Country>
|
||||
<cbc:IdentificationCode>NL</cbc:IdentificationCode>
|
||||
</cac:Country>
|
||||
</cac:PostalAddress>
|
||||
<cac:PartyTaxScheme>
|
||||
<cbc:CompanyID>NL8200.98.395.B.01</cbc:CompanyID>
|
||||
<cac:TaxScheme>
|
||||
<cbc:ID>VAT</cbc:ID>
|
||||
</cac:TaxScheme>
|
||||
</cac:PartyTaxScheme>
|
||||
<cac:PartyLegalEntity>
|
||||
<cbc:RegistrationName>De Koksmaat</cbc:RegistrationName>
|
||||
<cbc:CompanyID>57151520</cbc:CompanyID>
|
||||
</cac:PartyLegalEntity>
|
||||
</cac:Party>
|
||||
</cac:AccountingSupplierParty>
|
||||
<cac:AccountingCustomerParty>
|
||||
<cac:Party>
|
||||
<cac:PartyIdentification>
|
||||
<cbc:ID>10202</cbc:ID>
|
||||
</cac:PartyIdentification>
|
||||
<cac:PostalAddress>
|
||||
<cbc:StreetName>POSTBUS 367</cbc:StreetName>
|
||||
<cbc:CityName>HEEMSKERK</cbc:CityName>
|
||||
<cbc:PostalZone>1960 AJ</cbc:PostalZone>
|
||||
<cac:Country>
|
||||
<cbc:IdentificationCode>NL</cbc:IdentificationCode>
|
||||
</cac:Country>
|
||||
</cac:PostalAddress>
|
||||
<cac:PartyLegalEntity>
|
||||
<cbc:RegistrationName>ODIN 59</cbc:RegistrationName>
|
||||
</cac:PartyLegalEntity>
|
||||
<cac:Contact>
|
||||
<cbc:Name>Dhr. J BLOKKER</cbc:Name>
|
||||
</cac:Contact>
|
||||
</cac:Party>
|
||||
</cac:AccountingCustomerParty>
|
||||
<cac:PaymentMeans>
|
||||
<cbc:PaymentMeansCode>30</cbc:PaymentMeansCode>
|
||||
<cbc:PaymentID>Deb. 10202 / Fact. 12115118</cbc:PaymentID>
|
||||
<cac:PayeeFinancialAccount>
|
||||
<cbc:ID>NL57 RABO 0107307510</cbc:ID>
|
||||
</cac:PayeeFinancialAccount>
|
||||
</cac:PaymentMeans>
|
||||
<cac:PaymentMeans>
|
||||
<cbc:PaymentMeansCode>30</cbc:PaymentMeansCode>
|
||||
<cbc:PaymentID>Deb. 10202 / Fact. 12115118</cbc:PaymentID>
|
||||
<cac:PayeeFinancialAccount>
|
||||
<cbc:ID>NL03 INGB 0004489902</cbc:ID>
|
||||
</cac:PayeeFinancialAccount>
|
||||
</cac:PaymentMeans>
|
||||
<cac:TaxTotal>
|
||||
<cbc:TaxAmount currencyID="EUR">20.73</cbc:TaxAmount>
|
||||
<cac:TaxSubtotal>
|
||||
<cbc:TaxableAmount currencyID="EUR">183.23</cbc:TaxableAmount>
|
||||
<cbc:TaxAmount currencyID="EUR">10.99</cbc:TaxAmount>
|
||||
<cac:TaxCategory>
|
||||
<cbc:ID>S</cbc:ID>
|
||||
<cbc:Percent>6</cbc:Percent>
|
||||
<cac:TaxScheme>
|
||||
<cbc:ID>VAT</cbc:ID>
|
||||
</cac:TaxScheme>
|
||||
</cac:TaxCategory>
|
||||
</cac:TaxSubtotal>
|
||||
<cac:TaxSubtotal>
|
||||
<cbc:TaxableAmount currencyID="EUR">46.37</cbc:TaxableAmount>
|
||||
<cbc:TaxAmount currencyID="EUR">9.74</cbc:TaxAmount>
|
||||
<cac:TaxCategory>
|
||||
<cbc:ID>S</cbc:ID>
|
||||
<cbc:Percent>21</cbc:Percent>
|
||||
<cac:TaxScheme>
|
||||
<cbc:ID>VAT</cbc:ID>
|
||||
</cac:TaxScheme>
|
||||
</cac:TaxCategory>
|
||||
</cac:TaxSubtotal>
|
||||
</cac:TaxTotal>
|
||||
<cac:LegalMonetaryTotal>
|
||||
<cbc:LineExtensionAmount currencyID="EUR">229.60</cbc:LineExtensionAmount>
|
||||
<cbc:TaxExclusiveAmount currencyID="EUR">229.60</cbc:TaxExclusiveAmount>
|
||||
<cbc:TaxInclusiveAmount currencyID="EUR">250.33</cbc:TaxInclusiveAmount>
|
||||
<cbc:PayableAmount currencyID="EUR">250.33</cbc:PayableAmount>
|
||||
</cac:LegalMonetaryTotal>
|
||||
<cac:InvoiceLine>
|
||||
<cbc:ID>1</cbc:ID>
|
||||
<cbc:InvoicedQuantity unitCode="EA">2</cbc:InvoicedQuantity>
|
||||
<cbc:LineExtensionAmount currencyID="EUR">19.90</cbc:LineExtensionAmount>
|
||||
<cac:Item>
|
||||
<cbc:Name>PATAT FRITES 10MM 10KG</cbc:Name>
|
||||
<cac:SellersItemIdentification>
|
||||
<cbc:ID>166022</cbc:ID>
|
||||
</cac:SellersItemIdentification>
|
||||
<cac:ClassifiedTaxCategory>
|
||||
<cbc:ID>S</cbc:ID>
|
||||
<cbc:Percent>6</cbc:Percent>
|
||||
<cac:TaxScheme>
|
||||
<cbc:ID>VAT</cbc:ID>
|
||||
</cac:TaxScheme>
|
||||
</cac:ClassifiedTaxCategory>
|
||||
</cac:Item>
|
||||
<cac:Price>
|
||||
<cbc:PriceAmount currencyID="EUR">9.95</cbc:PriceAmount>
|
||||
</cac:Price>
|
||||
</cac:InvoiceLine>
|
||||
<cac:InvoiceLine>
|
||||
<cbc:ID>2</cbc:ID>
|
||||
<cbc:InvoicedQuantity unitCode="EA">1</cbc:InvoicedQuantity>
|
||||
<cbc:LineExtensionAmount currencyID="EUR">9.85</cbc:LineExtensionAmount>
|
||||
<cac:Item>
|
||||
<cbc:Name>PKAAS 50PL. JONG BEL. 1KG</cbc:Name>
|
||||
<cac:SellersItemIdentification>
|
||||
<cbc:ID>661813</cbc:ID>
|
||||
</cac:SellersItemIdentification>
|
||||
<cac:ClassifiedTaxCategory>
|
||||
<cbc:ID>S</cbc:ID>
|
||||
<cbc:Percent>6</cbc:Percent>
|
||||
<cac:TaxScheme>
|
||||
<cbc:ID>VAT</cbc:ID>
|
||||
</cac:TaxScheme>
|
||||
</cac:ClassifiedTaxCategory>
|
||||
</cac:Item>
|
||||
<cac:Price>
|
||||
<cbc:PriceAmount currencyID="EUR">9.85</cbc:PriceAmount>
|
||||
</cac:Price>
|
||||
</cac:InvoiceLine>
|
||||
<cac:InvoiceLine>
|
||||
<cbc:ID>3</cbc:ID>
|
||||
<cbc:InvoicedQuantity unitCode="EA">1</cbc:InvoicedQuantity>
|
||||
<cbc:LineExtensionAmount currencyID="EUR">8.29</cbc:LineExtensionAmount>
|
||||
<cac:Item>
|
||||
<cbc:Name>POT KETCHUP 3 LT</cbc:Name>
|
||||
<cac:SellersItemIdentification>
|
||||
<cbc:ID>438146</cbc:ID>
|
||||
</cac:SellersItemIdentification>
|
||||
<cac:ClassifiedTaxCategory>
|
||||
<cbc:ID>S</cbc:ID>
|
||||
<cbc:Percent>6</cbc:Percent>
|
||||
<cac:TaxScheme>
|
||||
<cbc:ID>VAT</cbc:ID>
|
||||
</cac:TaxScheme>
|
||||
</cac:ClassifiedTaxCategory>
|
||||
</cac:Item>
|
||||
<cac:Price>
|
||||
<cbc:PriceAmount currencyID="EUR">8.29</cbc:PriceAmount>
|
||||
</cac:Price>
|
||||
</cac:InvoiceLine>
|
||||
<cac:InvoiceLine>
|
||||
<cbc:ID>4</cbc:ID>
|
||||
<cbc:InvoicedQuantity unitCode="EA">2</cbc:InvoicedQuantity>
|
||||
<cbc:LineExtensionAmount currencyID="EUR">14.46</cbc:LineExtensionAmount>
|
||||
<cac:Item>
|
||||
<cbc:Name>FRITESSAUS 3 LRR</cbc:Name>
|
||||
<cac:SellersItemIdentification>
|
||||
<cbc:ID>438103</cbc:ID>
|
||||
</cac:SellersItemIdentification>
|
||||
<cac:ClassifiedTaxCategory>
|
||||
<cbc:ID>S</cbc:ID>
|
||||
<cbc:Percent>6</cbc:Percent>
|
||||
<cac:TaxScheme>
|
||||
<cbc:ID>VAT</cbc:ID>
|
||||
</cac:TaxScheme>
|
||||
</cac:ClassifiedTaxCategory>
|
||||
</cac:Item>
|
||||
<cac:Price>
|
||||
<cbc:PriceAmount currencyID="EUR">7.23</cbc:PriceAmount>
|
||||
</cac:Price>
|
||||
</cac:InvoiceLine>
|
||||
<cac:InvoiceLine>
|
||||
<cbc:ID>5</cbc:ID>
|
||||
<cbc:InvoicedQuantity unitCode="EA">1</cbc:InvoicedQuantity>
|
||||
<cbc:LineExtensionAmount currencyID="EUR">35.00</cbc:LineExtensionAmount>
|
||||
<cac:Item>
|
||||
<cbc:Name>KOFFIE BLIK 3,5KG SNELF</cbc:Name>
|
||||
<cac:SellersItemIdentification>
|
||||
<cbc:ID>666955</cbc:ID>
|
||||
</cac:SellersItemIdentification>
|
||||
<cac:ClassifiedTaxCategory>
|
||||
<cbc:ID>S</cbc:ID>
|
||||
<cbc:Percent>6</cbc:Percent>
|
||||
<cac:TaxScheme>
|
||||
<cbc:ID>VAT</cbc:ID>
|
||||
</cac:TaxScheme>
|
||||
</cac:ClassifiedTaxCategory>
|
||||
</cac:Item>
|
||||
<cac:Price>
|
||||
<cbc:PriceAmount currencyID="EUR">35.00</cbc:PriceAmount>
|
||||
</cac:Price>
|
||||
</cac:InvoiceLine>
|
||||
<cac:InvoiceLine>
|
||||
<cbc:ID>6</cbc:ID>
|
||||
<cbc:InvoicedQuantity unitCode="EA">1</cbc:InvoicedQuantity>
|
||||
<cbc:LineExtensionAmount currencyID="EUR">35.00</cbc:LineExtensionAmount>
|
||||
<cac:Item>
|
||||
<cbc:Name>KOFFIE 3.5 KG BLIK STAND</cbc:Name>
|
||||
<cac:SellersItemIdentification>
|
||||
<cbc:ID>664871</cbc:ID>
|
||||
</cac:SellersItemIdentification>
|
||||
<cac:ClassifiedTaxCategory>
|
||||
<cbc:ID>S</cbc:ID>
|
||||
<cbc:Percent>6</cbc:Percent>
|
||||
<cac:TaxScheme>
|
||||
<cbc:ID>VAT</cbc:ID>
|
||||
</cac:TaxScheme>
|
||||
</cac:ClassifiedTaxCategory>
|
||||
</cac:Item>
|
||||
<cac:Price>
|
||||
<cbc:PriceAmount currencyID="EUR">35.00</cbc:PriceAmount>
|
||||
</cac:Price>
|
||||
</cac:InvoiceLine>
|
||||
<cac:InvoiceLine>
|
||||
<cbc:ID>7</cbc:ID>
|
||||
<cbc:InvoicedQuantity unitCode="EA">1</cbc:InvoicedQuantity>
|
||||
<cbc:LineExtensionAmount currencyID="EUR">10.65</cbc:LineExtensionAmount>
|
||||
<cac:Item>
|
||||
<cbc:Name>SUIKERKLONT</cbc:Name>
|
||||
<cac:SellersItemIdentification>
|
||||
<cbc:ID>350257</cbc:ID>
|
||||
</cac:SellersItemIdentification>
|
||||
<cac:ClassifiedTaxCategory>
|
||||
<cbc:ID>S</cbc:ID>
|
||||
<cbc:Percent>6</cbc:Percent>
|
||||
<cac:TaxScheme>
|
||||
<cbc:ID>VAT</cbc:ID>
|
||||
</cac:TaxScheme>
|
||||
</cac:ClassifiedTaxCategory>
|
||||
</cac:Item>
|
||||
<cac:Price>
|
||||
<cbc:PriceAmount currencyID="EUR">10.65</cbc:PriceAmount>
|
||||
</cac:Price>
|
||||
</cac:InvoiceLine>
|
||||
<cac:InvoiceLine>
|
||||
<cbc:ID>8</cbc:ID>
|
||||
<cbc:InvoicedQuantity unitCode="EA">1</cbc:InvoicedQuantity>
|
||||
<cbc:LineExtensionAmount currencyID="EUR">1.55</cbc:LineExtensionAmount>
|
||||
<cac:Item>
|
||||
<cbc:Name>1 KG UL BLOKJES</cbc:Name>
|
||||
<cac:SellersItemIdentification>
|
||||
<cbc:ID>350258</cbc:ID>
|
||||
</cac:SellersItemIdentification>
|
||||
<cac:ClassifiedTaxCategory>
|
||||
<cbc:ID>S</cbc:ID>
|
||||
<cbc:Percent>6</cbc:Percent>
|
||||
<cac:TaxScheme>
|
||||
<cbc:ID>VAT</cbc:ID>
|
||||
</cac:TaxScheme>
|
||||
</cac:ClassifiedTaxCategory>
|
||||
</cac:Item>
|
||||
<cac:Price>
|
||||
<cbc:PriceAmount currencyID="EUR">1.55</cbc:PriceAmount>
|
||||
</cac:Price>
|
||||
</cac:InvoiceLine>
|
||||
<cac:InvoiceLine>
|
||||
<cbc:ID>9</cbc:ID>
|
||||
<cbc:InvoicedQuantity unitCode="EA">3</cbc:InvoicedQuantity>
|
||||
<cbc:LineExtensionAmount currencyID="EUR">14.37</cbc:LineExtensionAmount>
|
||||
<cac:Item>
|
||||
<cbc:Name>BLOCKNOTE A5</cbc:Name>
|
||||
<cac:SellersItemIdentification>
|
||||
<cbc:ID>999998</cbc:ID>
|
||||
</cac:SellersItemIdentification>
|
||||
<cac:ClassifiedTaxCategory>
|
||||
<cbc:ID>S</cbc:ID>
|
||||
<cbc:Percent>6</cbc:Percent>
|
||||
<cac:TaxScheme>
|
||||
<cbc:ID>VAT</cbc:ID>
|
||||
</cac:TaxScheme>
|
||||
</cac:ClassifiedTaxCategory>
|
||||
</cac:Item>
|
||||
<cac:Price>
|
||||
<cbc:PriceAmount currencyID="EUR">4.79</cbc:PriceAmount>
|
||||
</cac:Price>
|
||||
</cac:InvoiceLine>
|
||||
<cac:InvoiceLine>
|
||||
<cbc:ID>10</cbc:ID>
|
||||
<cbc:InvoicedQuantity unitCode="EA">1</cbc:InvoicedQuantity>
|
||||
<cbc:LineExtensionAmount currencyID="EUR">8.29</cbc:LineExtensionAmount>
|
||||
<cac:Item>
|
||||
<cbc:Name>CHIPS NAT KLEIN ZAKJES</cbc:Name>
|
||||
<cac:SellersItemIdentification>
|
||||
<cbc:ID>740810</cbc:ID>
|
||||
</cac:SellersItemIdentification>
|
||||
<cac:ClassifiedTaxCategory>
|
||||
<cbc:ID>S</cbc:ID>
|
||||
<cbc:Percent>6</cbc:Percent>
|
||||
<cac:TaxScheme>
|
||||
<cbc:ID>VAT</cbc:ID>
|
||||
</cac:TaxScheme>
|
||||
</cac:ClassifiedTaxCategory>
|
||||
</cac:Item>
|
||||
<cac:Price>
|
||||
<cbc:PriceAmount currencyID="EUR">8.29</cbc:PriceAmount>
|
||||
</cac:Price>
|
||||
</cac:InvoiceLine>
|
||||
<cac:InvoiceLine>
|
||||
<cbc:ID>11</cbc:ID>
|
||||
<cbc:InvoicedQuantity unitCode="EA">2</cbc:InvoicedQuantity>
|
||||
<cbc:LineExtensionAmount currencyID="EUR">16.58</cbc:LineExtensionAmount>
|
||||
<cac:Item>
|
||||
<cbc:Name>CHIPS PAP KLEINE ZAKJES</cbc:Name>
|
||||
<cac:SellersItemIdentification>
|
||||
<cbc:ID>740829</cbc:ID>
|
||||
</cac:SellersItemIdentification>
|
||||
<cac:ClassifiedTaxCategory>
|
||||
<cbc:ID>S</cbc:ID>
|
||||
<cbc:Percent>6</cbc:Percent>
|
||||
<cac:TaxScheme>
|
||||
<cbc:ID>VAT</cbc:ID>
|
||||
</cac:TaxScheme>
|
||||
</cac:ClassifiedTaxCategory>
|
||||
</cac:Item>
|
||||
<cac:Price>
|
||||
<cbc:PriceAmount currencyID="EUR">8.29</cbc:PriceAmount>
|
||||
</cac:Price>
|
||||
</cac:InvoiceLine>
|
||||
<cac:InvoiceLine>
|
||||
<cbc:ID>12</cbc:ID>
|
||||
<cbc:InvoicedQuantity unitCode="EA">1</cbc:InvoicedQuantity>
|
||||
<cbc:LineExtensionAmount currencyID="EUR">9.95</cbc:LineExtensionAmount>
|
||||
<cac:Item>
|
||||
<cbc:Name>TR KL PAKJES APPELSAP</cbc:Name>
|
||||
<cac:SellersItemIdentification>
|
||||
<cbc:ID>740828</cbc:ID>
|
||||
</cac:SellersItemIdentification>
|
||||
<cac:ClassifiedTaxCategory>
|
||||
<cbc:ID>S</cbc:ID>
|
||||
<cbc:Percent>6</cbc:Percent>
|
||||
<cac:TaxScheme>
|
||||
<cbc:ID>VAT</cbc:ID>
|
||||
</cac:TaxScheme>
|
||||
</cac:ClassifiedTaxCategory>
|
||||
</cac:Item>
|
||||
<cac:Price>
|
||||
<cbc:PriceAmount currencyID="EUR">9.95</cbc:PriceAmount>
|
||||
</cac:Price>
|
||||
</cac:InvoiceLine>
|
||||
<cac:InvoiceLine>
|
||||
<cbc:ID>13</cbc:ID>
|
||||
<cbc:InvoicedQuantity unitCode="EA">2</cbc:InvoicedQuantity>
|
||||
<cbc:LineExtensionAmount currencyID="EUR">3.30</cbc:LineExtensionAmount>
|
||||
<cac:Item>
|
||||
<cbc:Name>PK CHOCOLADEMEL</cbc:Name>
|
||||
<cac:SellersItemIdentification>
|
||||
<cbc:ID>740827</cbc:ID>
|
||||
</cac:SellersItemIdentification>
|
||||
<cac:ClassifiedTaxCategory>
|
||||
<cbc:ID>S</cbc:ID>
|
||||
<cbc:Percent>6</cbc:Percent>
|
||||
<cac:TaxScheme>
|
||||
<cbc:ID>VAT</cbc:ID>
|
||||
</cac:TaxScheme>
|
||||
</cac:ClassifiedTaxCategory>
|
||||
</cac:Item>
|
||||
<cac:Price>
|
||||
<cbc:PriceAmount currencyID="EUR">1.65</cbc:PriceAmount>
|
||||
</cac:Price>
|
||||
</cac:InvoiceLine>
|
||||
<cac:InvoiceLine>
|
||||
<cbc:ID>14</cbc:ID>
|
||||
<cbc:InvoicedQuantity unitCode="EA">1</cbc:InvoicedQuantity>
|
||||
<cbc:LineExtensionAmount currencyID="EUR">10.80</cbc:LineExtensionAmount>
|
||||
<cac:Item>
|
||||
<cbc:Name>KRAT BIER</cbc:Name>
|
||||
<cac:SellersItemIdentification>
|
||||
<cbc:ID>999996</cbc:ID>
|
||||
</cac:SellersItemIdentification>
|
||||
<cac:ClassifiedTaxCategory>
|
||||
<cbc:ID>S</cbc:ID>
|
||||
<cbc:Percent>21</cbc:Percent>
|
||||
<cac:TaxScheme>
|
||||
<cbc:ID>VAT</cbc:ID>
|
||||
</cac:TaxScheme>
|
||||
</cac:ClassifiedTaxCategory>
|
||||
</cac:Item>
|
||||
<cac:Price>
|
||||
<cbc:PriceAmount currencyID="EUR">10.80</cbc:PriceAmount>
|
||||
</cac:Price>
|
||||
</cac:InvoiceLine>
|
||||
<cac:InvoiceLine>
|
||||
<cbc:ID>15</cbc:ID>
|
||||
<cbc:InvoicedQuantity unitCode="EA">1</cbc:InvoicedQuantity>
|
||||
<cbc:LineExtensionAmount currencyID="EUR">3.90</cbc:LineExtensionAmount>
|
||||
<cac:Item>
|
||||
<cbc:Name>STATIEGELD</cbc:Name>
|
||||
<cac:SellersItemIdentification>
|
||||
<cbc:ID>999995</cbc:ID>
|
||||
</cac:SellersItemIdentification>
|
||||
<cac:ClassifiedTaxCategory>
|
||||
<cbc:ID>S</cbc:ID>
|
||||
<cbc:Percent>6</cbc:Percent>
|
||||
<cac:TaxScheme>
|
||||
<cbc:ID>VAT</cbc:ID>
|
||||
</cac:TaxScheme>
|
||||
</cac:ClassifiedTaxCategory>
|
||||
</cac:Item>
|
||||
<cac:Price>
|
||||
<cbc:PriceAmount currencyID="EUR">3.90</cbc:PriceAmount>
|
||||
</cac:Price>
|
||||
</cac:InvoiceLine>
|
||||
<cac:InvoiceLine>
|
||||
<cbc:ID>16</cbc:ID>
|
||||
<cbc:InvoicedQuantity unitCode="EA">2</cbc:InvoicedQuantity>
|
||||
<cbc:LineExtensionAmount currencyID="EUR">7.60</cbc:LineExtensionAmount>
|
||||
<cac:Item>
|
||||
<cbc:Name>BLEEK 3 X 750 ML</cbc:Name>
|
||||
<cac:SellersItemIdentification>
|
||||
<cbc:ID>102172</cbc:ID>
|
||||
</cac:SellersItemIdentification>
|
||||
<cac:ClassifiedTaxCategory>
|
||||
<cbc:ID>S</cbc:ID>
|
||||
<cbc:Percent>21</cbc:Percent>
|
||||
<cac:TaxScheme>
|
||||
<cbc:ID>VAT</cbc:ID>
|
||||
</cac:TaxScheme>
|
||||
</cac:ClassifiedTaxCategory>
|
||||
</cac:Item>
|
||||
<cac:Price>
|
||||
<cbc:PriceAmount currencyID="EUR">3.80</cbc:PriceAmount>
|
||||
</cac:Price>
|
||||
</cac:InvoiceLine>
|
||||
<cac:InvoiceLine>
|
||||
<cbc:ID>17</cbc:ID>
|
||||
<cbc:InvoicedQuantity unitCode="EA">2</cbc:InvoicedQuantity>
|
||||
<cbc:LineExtensionAmount currencyID="EUR">9.34</cbc:LineExtensionAmount>
|
||||
<cac:Item>
|
||||
<cbc:Name>WC PAPIER</cbc:Name>
|
||||
<cac:SellersItemIdentification>
|
||||
<cbc:ID>999994</cbc:ID>
|
||||
</cac:SellersItemIdentification>
|
||||
<cac:ClassifiedTaxCategory>
|
||||
<cbc:ID>S</cbc:ID>
|
||||
<cbc:Percent>21</cbc:Percent>
|
||||
<cac:TaxScheme>
|
||||
<cbc:ID>VAT</cbc:ID>
|
||||
</cac:TaxScheme>
|
||||
</cac:ClassifiedTaxCategory>
|
||||
</cac:Item>
|
||||
<cac:Price>
|
||||
<cbc:PriceAmount currencyID="EUR">4.67</cbc:PriceAmount>
|
||||
</cac:Price>
|
||||
</cac:InvoiceLine>
|
||||
<cac:InvoiceLine>
|
||||
<cbc:ID>18</cbc:ID>
|
||||
<cbc:InvoicedQuantity unitCode="EA">1</cbc:InvoicedQuantity>
|
||||
<cbc:LineExtensionAmount currencyID="EUR">18.63</cbc:LineExtensionAmount>
|
||||
<cac:Item>
|
||||
<cbc:Name>BALPENNEN 50 ST BLAUW</cbc:Name>
|
||||
<cac:SellersItemIdentification>
|
||||
<cbc:ID>999993</cbc:ID>
|
||||
</cac:SellersItemIdentification>
|
||||
<cac:ClassifiedTaxCategory>
|
||||
<cbc:ID>S</cbc:ID>
|
||||
<cbc:Percent>21</cbc:Percent>
|
||||
<cac:TaxScheme>
|
||||
<cbc:ID>VAT</cbc:ID>
|
||||
</cac:TaxScheme>
|
||||
</cac:ClassifiedTaxCategory>
|
||||
</cac:Item>
|
||||
<cac:Price>
|
||||
<cbc:PriceAmount currencyID="EUR">18.63</cbc:PriceAmount>
|
||||
</cac:Price>
|
||||
</cac:InvoiceLine>
|
||||
<cac:InvoiceLine>
|
||||
<cbc:ID>19</cbc:ID>
|
||||
<cbc:InvoicedQuantity unitCode="EA">6</cbc:InvoicedQuantity>
|
||||
<cbc:LineExtensionAmount currencyID="EUR">102.12</cbc:LineExtensionAmount>
|
||||
<cac:Item>
|
||||
<cbc:Name>EM FRITUURVET</cbc:Name>
|
||||
<cac:SellersItemIdentification>
|
||||
<cbc:ID>999992</cbc:ID>
|
||||
</cac:SellersItemIdentification>
|
||||
<cac:ClassifiedTaxCategory>
|
||||
<cbc:ID>S</cbc:ID>
|
||||
<cbc:Percent>6</cbc:Percent>
|
||||
<cac:TaxScheme>
|
||||
<cbc:ID>VAT</cbc:ID>
|
||||
</cac:TaxScheme>
|
||||
</cac:ClassifiedTaxCategory>
|
||||
</cac:Item>
|
||||
<cac:Price>
|
||||
<cbc:PriceAmount currencyID="EUR">17.02</cbc:PriceAmount>
|
||||
</cac:Price>
|
||||
</cac:InvoiceLine>
|
||||
<cac:InvoiceLine>
|
||||
<cbc:ID>20</cbc:ID>
|
||||
<cbc:InvoicedQuantity unitCode="EA">6</cbc:InvoicedQuantity>
|
||||
<cbc:LineExtensionAmount currencyID="EUR">-109.98</cbc:LineExtensionAmount>
|
||||
<cac:Item>
|
||||
<cbc:Name>FRITUUR VET 10 KG RETOUR</cbc:Name>
|
||||
<cac:SellersItemIdentification>
|
||||
<cbc:ID>175137</cbc:ID>
|
||||
</cac:SellersItemIdentification>
|
||||
<cac:ClassifiedTaxCategory>
|
||||
<cbc:ID>S</cbc:ID>
|
||||
<cbc:Percent>6</cbc:Percent>
|
||||
<cac:TaxScheme>
|
||||
<cbc:ID>VAT</cbc:ID>
|
||||
</cac:TaxScheme>
|
||||
</cac:ClassifiedTaxCategory>
|
||||
</cac:Item>
|
||||
<cac:Price>
|
||||
<cbc:PriceAmount currencyID="EUR">18.33</cbc:PriceAmount>
|
||||
</cac:Price>
|
||||
</cac:InvoiceLine>
|
||||
</Invoice>
|
||||
|
|
@ -0,0 +1,769 @@
|
|||
<?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
|
|
@ -0,0 +1,235 @@
|
|||
<?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.
|
||||
-->
|
||||
|
|
@ -0,0 +1,81 @@
|
|||
<?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.
|
||||
-->
|
||||
|
|
@ -0,0 +1,73 @@
|
|||
<?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.
|
||||
-->
|
||||
|
|
@ -0,0 +1,99 @@
|
|||
<?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.
|
||||
-->
|
||||
|
|
@ -0,0 +1,78 @@
|
|||
<?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.
|
||||
-->
|
||||
|
|
@ -0,0 +1,102 @@
|
|||
<?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.
|
||||
-->
|
||||
|
|
@ -0,0 +1,83 @@
|
|||
<?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.
|
||||
-->
|
||||
|
|
@ -0,0 +1,554 @@
|
|||
<?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.
|
||||
-->
|
||||
|
|
@ -0,0 +1,499 @@
|
|||
<?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>
|
||||
|
|
@ -0,0 +1,46 @@
|
|||
<?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>
|
||||
|
|
@ -0,0 +1,332 @@
|
|||
<?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>
|
||||
|
|
@ -0,0 +1,153 @@
|
|||
<?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.
|
||||
-->
|
||||
|
|
@ -0,0 +1,156 @@
|
|||
<?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
|
|
@ -0,0 +1,756 @@
|
|||
<?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 check) 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>
|
||||
|
|
@ -0,0 +1,607 @@
|
|||
<?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 check) 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>
|
||||
330
src/test/resources/examples/results/report.xml
Normal file
330
src/test/resources/examples/results/report.xml
Normal file
|
|
@ -0,0 +1,330 @@
|
|||
<?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.
|
||||
-->
|
||||
|
||||
<rep:report xmlns:rep="http://www.xoev.de/de/validator/varl/1 " valid="false" varlVersion="1.0.0">
|
||||
<rep:engine>
|
||||
<rep:name>KoSIT POC</rep:name>
|
||||
</rep:engine>
|
||||
<rep:timestamp>2017-09-01T13:13:59.055+02:00</rep:timestamp>
|
||||
<rep:documentIdentification>
|
||||
<rep:documentHash>
|
||||
<rep:hashAlgorithm>SHA-256</rep:hashAlgorithm>
|
||||
<rep:hashValue>4exhW9EJxAbhlZLHZ3mYZ3/hWGG5e6mIpiTAlGTpQ7s=</rep:hashValue>
|
||||
</rep:documentHash>
|
||||
<rep:documentReference>
|
||||
/C:/Developer/source/init/eRechnung-Check/src/test/resources/examples/UBLReady/UBLReady_EU_UBL-NL_20170102_FULL.xml
|
||||
</rep:documentReference>
|
||||
</rep:documentIdentification>
|
||||
<ns2:scenario xmlns:ns2="http://www.xoev.de/de/validator/framework/1/scenarios"
|
||||
xmlns="http://www.xoev.de/de/validator/framework/1/createreportinput">
|
||||
<ns2:name>UBL 2.1 Invoice</ns2:name>
|
||||
<ns2:namespace prefix="invoice">urn:oasis:names:specification:ubl:schema:xsd:Invoice-2</ns2:namespace>
|
||||
<ns2:match>/invoice:Invoice</ns2:match>
|
||||
<ns2:validateWithXmlSchema>
|
||||
<ns2:resource>
|
||||
<ns2:name>UBL 2.1 Invoice</ns2:name>
|
||||
<ns2:location>resources/eRechnung/UBL-2.1/xsdrt/maindoc/UBL-Invoice-2.1.xsd</ns2:location>
|
||||
</ns2:resource>
|
||||
</ns2:validateWithXmlSchema>
|
||||
<ns2:validateWithSchematron>
|
||||
<ns2:resource>
|
||||
<ns2:name>BII Rules for Invoice</ns2:name>
|
||||
<ns2:location>resources/eRechnung/UBL-2.1/xsl/BIIRULES-UBL-T10.xsl</ns2:location>
|
||||
</ns2:resource>
|
||||
</ns2:validateWithSchematron>
|
||||
<ns2:validateWithSchematron>
|
||||
<ns2:resource>
|
||||
<ns2:name>openPEPPOL Rules for Invoice</ns2:name>
|
||||
<ns2:location>resources/eRechnung/UBL-2.1/xsl/OPENPEPPOL-UBL-T10.xsl</ns2:location>
|
||||
</ns2:resource>
|
||||
</ns2:validateWithSchematron>
|
||||
<ns2:createReport>
|
||||
<ns2:resource>
|
||||
<ns2:name>Report für eRechnung</ns2:name>
|
||||
<ns2:location>resources/eRechnung/report.xsl</ns2:location>
|
||||
</ns2:resource>
|
||||
</ns2:createReport>
|
||||
</ns2:scenario>
|
||||
<rep:validationResult>
|
||||
<rep:validationStepResult id="step_1" valid="true">
|
||||
<ns2:resource xmlns:ns2="http://www.xoev.de/de/validator/framework/1/scenarios"
|
||||
xmlns="http://www.xoev.de/de/validator/framework/1/createreportinput">
|
||||
<ns2:name>UBL 2.1 Invoice</ns2:name>
|
||||
<ns2:location>resources/eRechnung/UBL-2.1/xsdrt/maindoc/UBL-Invoice-2.1.xsd</ns2:location>
|
||||
</ns2:resource>
|
||||
</rep:validationStepResult>
|
||||
<rep:validationStepResult id="step_2" valid="false">
|
||||
<ns2:resource xmlns:ns2="http://www.xoev.de/de/validator/framework/1/scenarios"
|
||||
xmlns="http://www.xoev.de/de/validator/framework/1/createreportinput">
|
||||
<ns2:name>BII Rules for Invoice</ns2:name>
|
||||
<ns2:location>resources/eRechnung/UBL-2.1/xsl/BIIRULES-UBL-T10.xsl</ns2:location>
|
||||
</ns2:resource>
|
||||
<rep:message code="CL-T10-R010" id="message_2.1" level="warning"
|
||||
xpathLocation="/*:Invoice[namespace-uri()='urn:oasis:names:specification:ubl:schema:xsd:Invoice-2'][1]/*:AllowanceCharge[namespace-uri()='urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2'][3]/*:AllowanceChargeReasonCode[namespace-uri()='urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2'][1]">
|
||||
[CL-T10-R010]-Coded allowance and charge reasons SHOULD belong to the UNCL 4465 code list BII2 subset
|
||||
</rep:message>
|
||||
</rep:validationStepResult>
|
||||
<rep:validationStepResult id="step_3" valid="false">
|
||||
<ns2:resource xmlns:ns2="http://www.xoev.de/de/validator/framework/1/scenarios"
|
||||
xmlns="http://www.xoev.de/de/validator/framework/1/createreportinput">
|
||||
<ns2:name>openPEPPOL Rules for Invoice</ns2:name>
|
||||
<ns2:location>resources/eRechnung/UBL-2.1/xsl/OPENPEPPOL-UBL-T10.xsl</ns2:location>
|
||||
</ns2:resource>
|
||||
<rep:message code="EUGEN-T10-R026" id="message_3.1" level="error"
|
||||
xpathLocation="/*:Invoice[namespace-uri()='urn:oasis:names:specification:ubl:schema:xsd:Invoice-2'][1]/*:DocumentCurrencyCode[namespace-uri()='urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2'][1]">
|
||||
[EUGEN-T10-R026]-A currency code element MUST have a list identifier attribute 'ISO4217'.
|
||||
</rep:message>
|
||||
<rep:message code="EUGEN-T10-R041" id="message_3.2" level="warning"
|
||||
xpathLocation="/*:Invoice[namespace-uri()='urn:oasis:names:specification:ubl:schema:xsd:Invoice-2'][1]/*:AccountingSupplierParty[namespace-uri()='urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2'][1]">
|
||||
[EUGEN-T10-R041]-The VAT identifier for the supplier SHOULD be prefixed with country code for companies
|
||||
with VAT registration in EU countries
|
||||
</rep:message>
|
||||
<rep:message code="EUGEN-T10-R054" id="message_3.3" level="warning"
|
||||
xpathLocation="/*:Invoice[namespace-uri()='urn:oasis:names:specification:ubl:schema:xsd:Invoice-2'][1]/*:AccountingSupplierParty[namespace-uri()='urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2'][1]/*:Party[namespace-uri()='urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2'][1]/*:PartyLegalEntity[namespace-uri()='urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2'][1]/*:CompanyID[namespace-uri()='urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2'][1]">
|
||||
[EUGEN-T10-R054]-A party legal entity company identifier SHOULD have a scheme identifier attribute.
|
||||
</rep:message>
|
||||
<rep:message code="EUGEN-T10-R029" id="message_3.4" level="error"
|
||||
xpathLocation="/*:Invoice[namespace-uri()='urn:oasis:names:specification:ubl:schema:xsd:Invoice-2'][1]/*:AllowanceCharge[namespace-uri()='urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2'][1]/*:AllowanceChargeReasonCode[namespace-uri()='urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2'][1]">
|
||||
[EUGEN-T10-R029]-An allowance charge reason code MUST have a list identifier attribute 'UNCL4465'.
|
||||
</rep:message>
|
||||
<rep:message code="EUGEN-T10-R029" id="message_3.5" level="error"
|
||||
xpathLocation="/*:Invoice[namespace-uri()='urn:oasis:names:specification:ubl:schema:xsd:Invoice-2'][1]/*:AllowanceCharge[namespace-uri()='urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2'][2]/*:AllowanceChargeReasonCode[namespace-uri()='urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2'][1]">
|
||||
[EUGEN-T10-R029]-An allowance charge reason code MUST have a list identifier attribute 'UNCL4465'.
|
||||
</rep:message>
|
||||
<rep:message code="EUGEN-T10-R029" id="message_3.6" level="error"
|
||||
xpathLocation="/*:Invoice[namespace-uri()='urn:oasis:names:specification:ubl:schema:xsd:Invoice-2'][1]/*:AllowanceCharge[namespace-uri()='urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2'][3]/*:AllowanceChargeReasonCode[namespace-uri()='urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2'][1]">
|
||||
[EUGEN-T10-R029]-An allowance charge reason code MUST have a list identifier attribute 'UNCL4465'.
|
||||
</rep:message>
|
||||
</rep:validationStepResult>
|
||||
</rep:validationResult>
|
||||
<rep:assessment>
|
||||
<rep:reject>
|
||||
<rep:explanation>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" data-report-type="devreport-reject">
|
||||
<head>
|
||||
<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>
|
||||
<body>
|
||||
<h1>Prüfbericht der KoSIT</h1>
|
||||
<h2>Angaben zum geprüften Dokument</h2>
|
||||
<table class="tbl-meta">
|
||||
<tr>
|
||||
<td colspan="2">Dokument:</td>
|
||||
<td colspan="3">
|
||||
/C:/Developer/source/init/eRechnung-Check/src/test/resources/examples/UBLReady/UBLReady_EU_UBL-NL_20170102_FULL.xml
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">Szenario:</td>
|
||||
<td colspan="3"/>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">Zeitpunkt:</td>
|
||||
<td colspan="3">1.9.2017 13:13:59</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">Validierungsschritte:</td>
|
||||
<td>Fehler</td>
|
||||
<td>Warnung</td>
|
||||
<td>Information</td>
|
||||
</tr>
|
||||
</table>
|
||||
<p class="important"><b>Konformitätsprüfung:</b>Das geprüfte Dokument enthält 4 Fehler / 3
|
||||
Warnungen. Es ist <b>nicht konform</b> zu den formalen Vorgaben.
|
||||
</p>
|
||||
<table class="tbl-errors">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Pos</th>
|
||||
<th>Code</th>
|
||||
<th>CustomLevel (Level)</th>
|
||||
<th>Step</th>
|
||||
<th>Text</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr class="warning">
|
||||
<td>1</td>
|
||||
<td>CL-T10-R010</td>
|
||||
<td>warning</td>
|
||||
<td/>
|
||||
<td>[CL-T10-R010]-Coded allowance and charge reasons SHOULD belong to the UNCL 4465
|
||||
code list BII2 subset
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="4"/>
|
||||
<td/>
|
||||
</tr>
|
||||
<tr class="error">
|
||||
<td>2</td>
|
||||
<td>EUGEN-T10-R026</td>
|
||||
<td>error</td>
|
||||
<td/>
|
||||
<td>[EUGEN-T10-R026]-A currency code element MUST have a list identifier attribute
|
||||
'ISO4217'.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="4"/>
|
||||
<td/>
|
||||
</tr>
|
||||
<tr class="warning">
|
||||
<td>3</td>
|
||||
<td>EUGEN-T10-R041</td>
|
||||
<td>warning</td>
|
||||
<td/>
|
||||
<td>[EUGEN-T10-R041]-The VAT identifier for the supplier SHOULD be prefixed with
|
||||
country code for companies with VAT registration in EU countries
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="4"/>
|
||||
<td/>
|
||||
</tr>
|
||||
<tr class="warning">
|
||||
<td>4</td>
|
||||
<td>EUGEN-T10-R054</td>
|
||||
<td>warning</td>
|
||||
<td/>
|
||||
<td>[EUGEN-T10-R054]-A party legal entity company identifier SHOULD have a scheme
|
||||
identifier attribute.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="4"/>
|
||||
<td/>
|
||||
</tr>
|
||||
<tr class="error">
|
||||
<td>5</td>
|
||||
<td>EUGEN-T10-R029</td>
|
||||
<td>error</td>
|
||||
<td/>
|
||||
<td>[EUGEN-T10-R029]-An allowance charge reason code MUST have a list identifier
|
||||
attribute 'UNCL4465'.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="4"/>
|
||||
<td/>
|
||||
</tr>
|
||||
<tr class="error">
|
||||
<td>6</td>
|
||||
<td>EUGEN-T10-R029</td>
|
||||
<td>error</td>
|
||||
<td/>
|
||||
<td>[EUGEN-T10-R029]-An allowance charge reason code MUST have a list identifier
|
||||
attribute 'UNCL4465'.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="4"/>
|
||||
<td/>
|
||||
</tr>
|
||||
<tr class="error">
|
||||
<td>7</td>
|
||||
<td>EUGEN-T10-R029</td>
|
||||
<td>error</td>
|
||||
<td/>
|
||||
<td>[EUGEN-T10-R029]-An allowance charge reason code MUST have a list identifier
|
||||
attribute 'UNCL4465'.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="4"/>
|
||||
<td/>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p class="important"><b>Bewertung:</b>Es wird empfohlen das Dokument zurückzuweisen.
|
||||
</p>
|
||||
<p class="info">Erstellt mit: KoSIT POC für das InstructionSet
|
||||
<em/>
|
||||
vom .
|
||||
</p>
|
||||
</body>
|
||||
</html>
|
||||
</rep:explanation>
|
||||
</rep:reject>
|
||||
</rep:assessment>
|
||||
</rep:report>
|
||||
66
src/test/resources/examples/versioning/scenarios-base.xml
Normal file
66
src/test/resources/examples/versioning/scenarios-base.xml
Normal file
|
|
@ -0,0 +1,66 @@
|
|||
<?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.
|
||||
-->
|
||||
|
||||
<scenarios xmlns="http://www.xoev.de/de/validator/framework/1/scenarios" frameworkVersion="1.0.0">
|
||||
<name>XInneres</name>
|
||||
<date>2017-08-08</date>
|
||||
<description>
|
||||
<p>Prüft XInneres Nachrichten anhand der von uns offiziell herausgegebenen XML Schemata und Beispielen für mögliche weitergehende Prüfungen mit Schematron. </p>
|
||||
<p>Prüft elektronische Rechnungen im Format UBL 2.1 </p>
|
||||
</description>
|
||||
|
||||
<scenario>
|
||||
<name>UBL 2.1 Invoice</name>
|
||||
<namespace prefix="invoice">urn:oasis:names:specification:ubl:schema:xsd:Invoice-2</namespace>
|
||||
<match>/invoice:Invoice</match>
|
||||
|
||||
<validateWithXmlSchema>
|
||||
<resource>
|
||||
<name>UBL 2.1 Invoice</name>
|
||||
<location>resources/eRechnung/UBL-2.1/xsdrt/maindoc/UBL-Invoice-2.1.xsd</location>
|
||||
</resource>
|
||||
</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>
|
||||
<resource>
|
||||
<name>Report für eRechnung</name>
|
||||
<location>resources/eRechnung/report.xsl</location>
|
||||
</resource>
|
||||
</createReport>
|
||||
</scenario>
|
||||
<noScenarioReport>
|
||||
<resource>
|
||||
<name>default</name>
|
||||
<location>resources/eRechnung/report.xsl</location>
|
||||
</resource>
|
||||
</noScenarioReport>
|
||||
|
||||
</scenarios>
|
||||
|
|
@ -0,0 +1,66 @@
|
|||
<?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.
|
||||
-->
|
||||
|
||||
<scenarios xmlns="http://www.xoev.de/de/validator/framework/1/scenarios" frameworkVersion="1.1.0">
|
||||
<name>XInneres</name>
|
||||
<date>2017-08-08</date>
|
||||
<description>
|
||||
<p>Prüft XInneres Nachrichten anhand der von uns offiziell herausgegebenen XML Schemata und Beispielen für mögliche weitergehende Prüfungen mit Schematron. </p>
|
||||
<p>Prüft elektronische Rechnungen im Format UBL 2.1 </p>
|
||||
</description>
|
||||
|
||||
<scenario>
|
||||
<name>UBL 2.1 Invoice</name>
|
||||
<namespace prefix="invoice">urn:oasis:names:specification:ubl:schema:xsd:Invoice-2</namespace>
|
||||
<match>/invoice:Invoice</match>
|
||||
|
||||
<validateWithXmlSchema>
|
||||
<resource>
|
||||
<name>UBL 2.1 Invoice</name>
|
||||
<location>resources/eRechnung/UBL-2.1/xsdrt/maindoc/UBL-Invoice-2.1.xsd</location>
|
||||
</resource>
|
||||
</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>
|
||||
<resource>
|
||||
<name>Report für eRechnung</name>
|
||||
<location>resources/eRechnung/report.xsl</location>
|
||||
</resource>
|
||||
</createReport>
|
||||
</scenario>
|
||||
<noScenarioReport>
|
||||
<resource>
|
||||
<name>default</name>
|
||||
<location>resources/eRechnung/report.xsl</location>
|
||||
</resource>
|
||||
</noScenarioReport>
|
||||
|
||||
</scenarios>
|
||||
|
|
@ -0,0 +1,60 @@
|
|||
<?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.
|
||||
-->
|
||||
|
||||
<scenarios xmlns="http://www.xoev.de/de/validator/framework/1/scenarios" frameworkVersion="1.1.0">
|
||||
<name>XInneres</name>
|
||||
<date>2017-08-08</date>
|
||||
<description>
|
||||
<p>Prüft XInneres Nachrichten anhand der von uns offiziell herausgegebenen XML Schemata und Beispielen für mögliche weitergehende Prüfungen mit Schematron. </p>
|
||||
<p>Prüft elektronische Rechnungen im Format UBL 2.1 </p>
|
||||
</description>
|
||||
|
||||
<scenario>
|
||||
<name>UBL 2.1 Invoice</name>
|
||||
<namespace prefix="invoice">urn:oasis:names:specification:ubl:schema:xsd:Invoice-2</namespace>
|
||||
<match>/invoice:Invoice</match>
|
||||
<newElementFeature>toTest</newElementFeature>
|
||||
<validateWithXmlSchema>
|
||||
<resource>
|
||||
<name>UBL 2.1 Invoice</name>
|
||||
<location>resources/eRechnung/UBL-2.1/xsdrt/maindoc/UBL-Invoice-2.1.xsd</location>
|
||||
</resource>
|
||||
</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>
|
||||
<resource>
|
||||
<name>Report für eRechnung</name>
|
||||
<location>resources/eRechnung/report.xsl</location>
|
||||
</resource>
|
||||
</createReport>
|
||||
</scenario>
|
||||
|
||||
</scenarios>
|
||||
|
|
@ -0,0 +1,60 @@
|
|||
<?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.
|
||||
-->
|
||||
|
||||
<scenarios xmlns="http://www.xoev.de/de/validator/framework/2/scenarios" frameworkVersion="2.1.0">
|
||||
<name>XInneres</name>
|
||||
<date>2017-08-08</date>
|
||||
<description>
|
||||
<p>Prüft XInneres Nachrichten anhand der von uns offiziell herausgegebenen XML Schemata und Beispielen für mögliche weitergehende Prüfungen mit Schematron. </p>
|
||||
<p>Prüft elektronische Rechnungen im Format UBL 2.1 </p>
|
||||
</description>
|
||||
|
||||
<scenario>
|
||||
<name>UBL 2.1 Invoice</name>
|
||||
<namespace prefix="invoice">urn:oasis:names:specification:ubl:schema:xsd:Invoice-2</namespace>
|
||||
<match>/invoice:Invoice</match>
|
||||
<newElementFeature>toTest</newElementFeature>
|
||||
<validateWithXmlSchema>
|
||||
<resource>
|
||||
<name>UBL 2.1 Invoice</name>
|
||||
<location>resources/eRechnung/UBL-2.1/xsdrt/maindoc/UBL-Invoice-2.1.xsd</location>
|
||||
</resource>
|
||||
</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>
|
||||
<resource>
|
||||
<name>Report für eRechnung</name>
|
||||
<location>resources/eRechnung/report.xsl</location>
|
||||
</resource>
|
||||
</createReport>
|
||||
</scenario>
|
||||
|
||||
</scenarios>
|
||||
90
src/test/resources/invalid/scenarios-illformed.xml
Normal file
90
src/test/resources/invalid/scenarios-illformed.xml
Normal file
|
|
@ -0,0 +1,90 @@
|
|||
<?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.
|
||||
-->
|
||||
|
||||
<scenarios xmlns="http://xoev.de/validation/scenarios/1">
|
||||
<name>XInneres</name>
|
||||
<date>2017-08-08</date>
|
||||
<description>
|
||||
<p>Prüft XInneres Nachrichten anhand der von uns offiziell herausgegebenen XML Schemata und Beispielen für mögliche weitergehende Prüfungen mit Schematron. </p>
|
||||
<p>Prüft elektronische Rechnungen im Format UBL 2.1 </p>
|
||||
</description>
|
||||
|
||||
<scenario>
|
||||
<name>XMeld 2.1</name>
|
||||
<namespace prefix="xmeld">http://www.osci.de/xmeld21</namespace>
|
||||
<match>/xmeld:*</match>
|
||||
<validateWithXmlSchema>
|
||||
<resource>
|
||||
<name>XML Schema von XMeld 2.1 (aggregiert)</name>
|
||||
<location>resources/xmeld21/xmeld-nachrichten.xsd</location>
|
||||
</resource>
|
||||
</validateWithXmlSchema>
|
||||
<validateWithSchematron>
|
||||
<resource>
|
||||
<name>XInneres Prüfregeln</name>
|
||||
<location>resources/xmeld21/xinneres-pruefregeln.xsl</location>
|
||||
</resource>
|
||||
</validateWithSchematron>
|
||||
<createReport>
|
||||
<resource>
|
||||
<name>Default Report</name>
|
||||
<location>resources/default/report.xsl</location>
|
||||
</resource>
|
||||
</createReport>
|
||||
</scenariox>
|
||||
|
||||
<scenario>
|
||||
<name>UBL 2.1 Invoice</name>
|
||||
<namespace prefix="invoice">urn:oasis:names:specification:ubl:schema:xsd:Invoice-2</namespace>
|
||||
<match>/invoice:Invoice</match>
|
||||
|
||||
<validateWithXmlSchema>
|
||||
<resource>
|
||||
<name>UBL 2.1 Invoice</name>
|
||||
<location>resources/eRechnung/UBL-2.1/xsdrt/maindoc/UBL-Invoice-2.1.xsd</location>
|
||||
</resource>
|
||||
</validateWithXmlSchema>
|
||||
<validateWithSchematron>
|
||||
<resource>
|
||||
<name>BII Rules for Invoice</name>
|
||||
<location>resources/eRechnung/BIS2.0-VA-V3.4.0/XSLT/BIIRULES-UBL-T10.xsl</location>
|
||||
</resource>
|
||||
</validateWithSchematron>
|
||||
<validateWithSchematron>
|
||||
<resource>
|
||||
<name>openPEPPOL Rules for Invoice</name>
|
||||
<location>resources/eRechnung/BIS2.0-VA-V3.4.0/XSLT/OPENPEPPOL-UBL-T10.xsl</location>
|
||||
</resource>
|
||||
</validateWithSchematron>
|
||||
<createReport>
|
||||
<resource>
|
||||
<name>Report für eRechnung</name>
|
||||
<!-- report-erechnung.xsl bindet report.xsl ein -->
|
||||
<location>resources/eRechnung/report-erechnung.xsl</location>
|
||||
</resource>
|
||||
<customLevel level="warning">EUGEN-T110-R019</customLevel>
|
||||
</createReport>
|
||||
<!--<createReport>
|
||||
<name>Report für eRechnung (Dataport-Fassung)</name>
|
||||
<location>resources/eRechnung/report-erechnung-dataport.xsl</location>
|
||||
</createReport>-->
|
||||
</scenario>
|
||||
|
||||
</scenarios>
|
||||
87
src/test/resources/invalid/scenarios-invalid.xml
Normal file
87
src/test/resources/invalid/scenarios-invalid.xml
Normal file
|
|
@ -0,0 +1,87 @@
|
|||
<?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.
|
||||
-->
|
||||
|
||||
<scenarios xmlns="http://www.xoev.de/de/validator/framework/1/scenarios">
|
||||
<name>XInneres</name>
|
||||
<date>2017-08-08</date>
|
||||
<description>
|
||||
<p>Prüft XInneres Nachrichten anhand der von uns offiziell herausgegebenen XML Schemata und Beispielen für
|
||||
mögliche weitergehende Prüfungen mit Schematron.
|
||||
</p>
|
||||
<p>Prüft elektronische Rechnungen im Format UBL 2.1</p>
|
||||
</description>
|
||||
|
||||
<scenario>
|
||||
<name>XMeld 2.1</name>
|
||||
<namespace prefix="xmeld">http://www.osci.de/xmeld21</namespace>
|
||||
<match>/xmeld:*</match>
|
||||
|
||||
<validateWithSchematron>
|
||||
<resource>
|
||||
<name>XInneres Prüfregeln</name>
|
||||
<location>resources/xmeld21/xinneres-pruefregeln.xsl</location>
|
||||
</resource>
|
||||
</validateWithSchematron>
|
||||
<createReport>
|
||||
<resource>
|
||||
<name>Default Report</name>
|
||||
<location>resources/default/report.xsl</location>
|
||||
</resource>
|
||||
</createReport>
|
||||
</scenario>
|
||||
|
||||
<scenario>
|
||||
<name>UBL 2.1 Invoice</name>
|
||||
<namespace prefix="invoice">urn:oasis:names:specification:ubl:schema:xsd:Invoice-2</namespace>
|
||||
<match>/invoice:Invoice</match>
|
||||
|
||||
<validateWithXmlSchema>
|
||||
<resource>
|
||||
<name>UBL 2.1 Invoice</name>
|
||||
<location>resources/eRechnung/UBL-2.1/xsdrt/maindoc/UBL-Invoice-2.1.xsd</location>
|
||||
</resource>
|
||||
</validateWithXmlSchema>
|
||||
<validateWithSchematron>
|
||||
<resource>
|
||||
<name>BII Rules for Invoice</name>
|
||||
<location>resources/eRechnung/BIS2.0-VA-V3.4.0/XSLT/BIIRULES-UBL-T10.xsl</location>
|
||||
</resource>
|
||||
</validateWithSchematron>
|
||||
<validateWithSchematron>
|
||||
<resource>
|
||||
<name>openPEPPOL Rules for Invoice</name>
|
||||
<location>resources/eRechnung/BIS2.0-VA-V3.4.0/XSLT/OPENPEPPOL-UBL-T10.xsl</location>
|
||||
</resource>
|
||||
</validateWithSchematron>
|
||||
<createReport>
|
||||
<resource>
|
||||
<name>Report für eRechnung</name>
|
||||
<!-- report-erechnung.xsl bindet report.xsl ein -->
|
||||
<location>resources/eRechnung/report-erechnung.xsl</location>
|
||||
</resource>
|
||||
<customLevel level="warning">EUGEN-T110-R019</customLevel>
|
||||
</createReport>
|
||||
<!--<createReport>
|
||||
<name>Report für eRechnung (Dataport-Fassung)</name>
|
||||
<location>resources/eRechnung/report-erechnung-dataport.xsl</location>
|
||||
</createReport>-->
|
||||
</scenario>
|
||||
|
||||
</scenarios>
|
||||
101
src/test/resources/valid/report.xml
Normal file
101
src/test/resources/valid/report.xml
Normal file
|
|
@ -0,0 +1,101 @@
|
|||
<?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.
|
||||
-->
|
||||
|
||||
<rep:report xmlns:rep="http://xoev.de/validation/report/1" xmlns:s="http://xoev.de/validation/scenarios/1" valid="true">
|
||||
|
||||
<rep:engine>
|
||||
<rep:name>Prüfmodul der KoSIT POC</rep:name>
|
||||
</rep:engine>
|
||||
|
||||
<rep:timestamp>2017-08-17T12:00:00</rep:timestamp>
|
||||
|
||||
<rep:documentIdentification>
|
||||
<rep:documentHash>
|
||||
<rep:hashAlgorithm>fake</rep:hashAlgorithm>
|
||||
<rep:hashValue>0x0c</rep:hashValue>
|
||||
</rep:documentHash>
|
||||
<rep:documentReference>ABHanAZR_AllesKorrekt.xml</rep:documentReference>
|
||||
</rep:documentIdentification>
|
||||
|
||||
<s:scenario>
|
||||
<s:name>UBL 2.1 Invoice</s:name>
|
||||
<s:namespace prefix="invoice">urn:oasis:names:specification:ubl:schema:xsd:Invoice-2</s:namespace>
|
||||
<s:match>/invoice:Invoice</s:match>
|
||||
<s:validateWithXmlSchema>
|
||||
<s:resource>
|
||||
<s:name>UBL 2.1 Invoice</s:name>
|
||||
<s:location>resources/eRechnung/UBL-2.1/xsdrt/maindoc/UBL-Invoice-2.1.xsd</s:location>
|
||||
</s:resource>
|
||||
</s:validateWithXmlSchema>
|
||||
<s:validateWithSchematron>
|
||||
<s:resource>
|
||||
<s:name>BII Rules for Invoice</s:name>
|
||||
<s:location>resources/eRechnung/BIS2.0-VA-V3.4.0/XSLT/BIIRULES-UBL-T10.xsl</s:location>
|
||||
</s:resource>
|
||||
</s:validateWithSchematron>
|
||||
<s:validateWithSchematron>
|
||||
<s:resource>
|
||||
<s:name>openPEPPOL Rules for Invoice</s:name>
|
||||
<s:location>resources/eRechnung/BIS2.0-VA-V3.4.0/XSLT/OPENPEPPOL-UBL-T10.xsl</s:location>
|
||||
</s:resource>
|
||||
</s:validateWithSchematron>
|
||||
<s:createReport>
|
||||
<s:resource>
|
||||
<s:name>Report für eRechnung</s:name>
|
||||
<s:location>resources/eRechnung/report-erechnung.xsl</s:location>
|
||||
</s:resource>
|
||||
</s:createReport>
|
||||
</s:scenario>
|
||||
|
||||
<rep:documentData>
|
||||
<rechnungsnummer>123</rechnungsnummer>
|
||||
<rechnungssteller>ABC GmbH</rechnungssteller>
|
||||
</rep:documentData>
|
||||
|
||||
<rep:validationResult>
|
||||
<rep:validationStepResult id="step_1" valid="true">
|
||||
<s:resource>
|
||||
<s:name>UBL 2.1 Invoice</s:name>
|
||||
<s:location>resources/eRechnung/UBL-2.1/xsdrt/maindoc/UBL-Invoice-2.1.xsd</s:location>
|
||||
</s:resource>
|
||||
<!--<rep:message id="message_1.1" level="error" lineNumber="1" columnNumber="120">Problem ...</rep:message>-->
|
||||
</rep:validationStepResult>
|
||||
|
||||
<rep:validationStepResult id="step_2" valid="false">
|
||||
<s:resource>
|
||||
<s:name>openPEPPOL Rules for Invoice</s:name>
|
||||
<s:location>../resources/eRechnung/BIS2.0-VA-V3.4.0/XSLT/OPENPEPPOL-UBL-T10.xsl</s:location>
|
||||
</s:resource>
|
||||
<rep:message id="message_2.1" level="warning" lineNumber="120" columnNumber="13" xpathLocation="..." code="EUGEN-T110-R013">[EUGEN-T110-R025]-UBLVersionID must be 2.1</rep:message>
|
||||
</rep:validationStepResult>
|
||||
|
||||
</rep:validationResult>
|
||||
|
||||
<rep:assessment>
|
||||
<rep:customLevel level="warning">EUGEN-T110-R024</rep:customLevel>
|
||||
<rep:reject>
|
||||
<rep:explanation id="enduser">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml"> ... </html>
|
||||
</rep:explanation>
|
||||
</rep:reject>
|
||||
</rep:assessment>
|
||||
|
||||
|
||||
</rep:report>
|
||||
96
src/test/resources/valid/scenarios.xml
Normal file
96
src/test/resources/valid/scenarios.xml
Normal file
|
|
@ -0,0 +1,96 @@
|
|||
<?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.
|
||||
-->
|
||||
|
||||
<scenarios xmlns="http://www.xoev.de/de/validator/framework/1/scenarios" frameworkVersion="1.0.0">
|
||||
<name>XInneres</name>
|
||||
<date>2017-08-08</date>
|
||||
<description>
|
||||
<p>Prüft XInneres Nachrichten anhand der von uns offiziell herausgegebenen XML Schemata und Beispielen für mögliche weitergehende Prüfungen mit Schematron. </p>
|
||||
<p>Prüft elektronische Rechnungen im Format UBL 2.1 </p>
|
||||
</description>
|
||||
|
||||
<scenario>
|
||||
<name>XMeld 2.1</name>
|
||||
<namespace prefix="xmeld">http://www.osci.de/xmeld21</namespace>
|
||||
<match>/xmeld:*</match>
|
||||
<validateWithXmlSchema>
|
||||
<resource>
|
||||
<name>XML Schema von XMeld 2.1 (aggregiert)</name>
|
||||
<location>resources/xmeld21/xmeld-nachrichten.xsd</location>
|
||||
</resource>
|
||||
</validateWithXmlSchema>
|
||||
<validateWithSchematron>
|
||||
<resource>
|
||||
<name>XInneres Prüfregeln</name>
|
||||
<location>resources/xmeld21/xinneres-pruefregeln.xsl</location>
|
||||
</resource>
|
||||
</validateWithSchematron>
|
||||
<createReport>
|
||||
<resource>
|
||||
<name>Default Report</name>
|
||||
<location>resources/default/report.xsl</location>
|
||||
</resource>
|
||||
</createReport>
|
||||
</scenario>
|
||||
|
||||
<scenario>
|
||||
<name>UBL 2.1 Invoice</name>
|
||||
<namespace prefix="invoice">urn:oasis:names:specification:ubl:schema:xsd:Invoice-2</namespace>
|
||||
<match>/invoice:Invoice</match>
|
||||
|
||||
<validateWithXmlSchema>
|
||||
<resource>
|
||||
<name>UBL 2.1 Invoice</name>
|
||||
<location>resources/eRechnung/UBL-2.1/xsdrt/maindoc/UBL-Invoice-2.1.xsd</location>
|
||||
</resource>
|
||||
</validateWithXmlSchema>
|
||||
<validateWithSchematron>
|
||||
<resource>
|
||||
<name>BII Rules for Invoice</name>
|
||||
<location>resources/eRechnung/BIS2.0-VA-V3.4.0/XSLT/BIIRULES-UBL-T10.xsl</location>
|
||||
</resource>
|
||||
</validateWithSchematron>
|
||||
<validateWithSchematron>
|
||||
<resource>
|
||||
<name>openPEPPOL Rules for Invoice</name>
|
||||
<location>resources/eRechnung/BIS2.0-VA-V3.4.0/XSLT/OPENPEPPOL-UBL-T10.xsl</location>
|
||||
</resource>
|
||||
</validateWithSchematron>
|
||||
<createReport>
|
||||
<resource>
|
||||
<name>Report für eRechnung</name>
|
||||
<!-- report-erechnung.xsl bindet report.xsl ein -->
|
||||
<location>resources/eRechnung/report-erechnung.xsl</location>
|
||||
</resource>
|
||||
<customLevel level="warning">EUGEN-T110-R019</customLevel>
|
||||
</createReport>
|
||||
<!--<createReport>
|
||||
<name>Report für eRechnung (Dataport-Fassung)</name>
|
||||
<location>resources/eRechnung/report-erechnung-dataport.xsl</location>
|
||||
</createReport>-->
|
||||
</scenario>
|
||||
<noScenarioReport>
|
||||
<resource>
|
||||
<name>default</name>
|
||||
<location>resources/eRechnung/report.xsl</location>
|
||||
</resource>
|
||||
</noScenarioReport>
|
||||
|
||||
</scenarios>
|
||||
Loading…
Add table
Add a link
Reference in a new issue