#39 The supplied Input unnecessarily is not written into memory

This commit is contained in:
Andreas Penski 2019-12-18 15:57:44 +01:00
parent d7ee019194
commit efd4fd5fff
63 changed files with 1111 additions and 18196 deletions

View file

@ -19,24 +19,46 @@
package de.kosit.validationtool.api;
import lombok.*;
import java.io.IOException;
import java.io.InputStream;
import javax.xml.transform.Source;
/**
* Eine Datei in eingelesener Form.
* An input for the validator.
*
* @author apenski
*/
@Getter
@RequiredArgsConstructor (access = AccessLevel.PACKAGE)
@AllArgsConstructor (access = AccessLevel.PACKAGE)
public class Input {
private final byte[] content;
public interface Input {
private final String name;
/**
* The name of the input for document identification
*
* @return the name
*/
String getName();
private byte[] hashCode;
/**
* The hashcode for document identification
*
* @return the computed hashcode
*/
byte[] getHashCode();
private String digestAlgorithm;
/**
* The digest algorithm used for computing the {@link #getHashCode()}
*
* @return the name of the digest algorith
*/
String getDigestAlgorithm();
/**
* Opens a new {@link InputStream } for this input which carries the actual data
*
* @return an open {@link InputStream}
* @throws IOException on I/O while opening the stream
*/
Source getSource() throws IOException;
}

View file

@ -22,7 +22,6 @@ package de.kosit.validationtool.api;
import static org.apache.commons.lang3.StringUtils.isNotEmpty;
import java.io.BufferedInputStream;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.IOException;
@ -30,6 +29,7 @@ import java.io.InputStream;
import java.net.MalformedURLException;
import java.net.URI;
import java.net.URL;
import java.net.URLConnection;
import java.nio.file.Files;
import java.nio.file.Path;
import java.security.DigestInputStream;
@ -37,12 +37,19 @@ import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import javax.xml.bind.DatatypeConverter;
import javax.xml.transform.Source;
import javax.xml.transform.stream.StreamSource;
import org.apache.commons.lang3.StringUtils;
import lombok.Getter;
import lombok.extern.slf4j.Slf4j;
import de.kosit.validationtool.impl.input.ByteArrayInput;
import de.kosit.validationtool.impl.input.ResourceInput;
import de.kosit.validationtool.impl.input.SourceInput;
import de.kosit.validationtool.impl.input.StreamHelper;
/**
* Service zum Einlesen des Test-Objekts in den Speicher. Beim Einlesen wird gleichzeitig eine Prüfsumme ermittelt und
* mit dem Ergebnis mitgeführt.
@ -69,7 +76,8 @@ public class InputFactory {
InputFactory(final String specifiedAlgorithm) {
this.algorithm = isNotEmpty(specifiedAlgorithm) ? specifiedAlgorithm : DEFAULT_ALGORITH;
createDigest();
// check validity
StreamHelper.createDigest(this.algorithm);
}
/**
@ -140,11 +148,48 @@ public class InputFactory {
*/
public static Input read(final URL url, final String digestAlgorithm) {
checkNull(url);
checkNotEmpty(url.getFile());
try {
return read(url.openStream(), url.getFile(), digestAlgorithm);
} catch (final IOException e) {
final URLConnection urlConnection = url.openConnection();
urlConnection.connect();
} catch (IOException e) {
throw new IllegalArgumentException(MESSAGE_OPEN_STREAM_ERROR + url, e);
}
return new ResourceInput(url, url.getFile(), digestAlgorithm);
}
/**
* Reads a test document from a {@link Source}.
*
* @param source source
* @return an {@link Input}
*/
public static Input read(final StreamSource source) {
return read(source, DEFAULT_ALGORITH);
}
/**
* Reads a test document from a {@link Source} using a specified digest algorithm.
*
* @param source source
* @param digestAlgorithm the digest algorithm
* @return an {@link Input}
*/
public static Input read(final StreamSource source, final String digestAlgorithm) {
return read(source, digestAlgorithm, null);
}
/**
* Reads a test document from a {@link Source} using a specified digest algorithm.
*
* @param source source
* @param digestAlgorithm the digest algorithm
* @return an {@link Input}
*/
public static Input read(final Source source, final String digestAlgorithm, final byte[] hashcode) {
checkNull(source);
return new SourceInput(source, source.getSystemId(), digestAlgorithm, hashcode);
}
/**
@ -162,6 +207,7 @@ public class InputFactory {
} catch (final IOException e) {
throw new IllegalArgumentException(MESSAGE_OPEN_STREAM_ERROR + file, e);
}
}
/**
@ -186,7 +232,14 @@ public class InputFactory {
*/
public static Input read(final byte[] input, final String name, final String digestAlgorithm) {
checkNull(input);
return read(new ByteArrayInputStream(input), name, digestAlgorithm);
checkNotEmpty(name);
return new ByteArrayInput(input, name, digestAlgorithm);
}
private static void checkNotEmpty(final String name) {
if (StringUtils.isBlank(name)) {
throw new IllegalArgumentException("Input name can not be null");
}
}
private static void checkNull(final Object input) {
@ -221,7 +274,7 @@ public class InputFactory {
private Input readStream(final InputStream inputStream, final String name) {
if (StringUtils.isNotBlank(name)) {
log.debug("Generating hashcode for {} using {} algorithm", name, getAlgorithm());
final MessageDigest digest = createDigest();
final MessageDigest digest = StreamHelper.createDigest(getAlgorithm());
final byte[] buffer = new byte[DEFAULT_BUFFER_SIZE];
try ( final BufferedInputStream bis = new BufferedInputStream(inputStream);
final DigestInputStream dis = new DigestInputStream(bis, digest);
@ -236,7 +289,9 @@ public class InputFactory {
final 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());
final ByteArrayInput input = new ByteArrayInput(out.toByteArray(), name, digest.getAlgorithm());
input.setHashCode(hash);
return input;
} catch (final IOException e) {
throw new IllegalArgumentException(MESSAGE_OPEN_STREAM_ERROR + name, e);
}
@ -245,15 +300,4 @@ public class InputFactory {
}
}
private MessageDigest createDigest() {
try {
final MessageDigest digest;
digest = MessageDigest.getInstance(getAlgorithm());
return digest;
} catch (final NoSuchAlgorithmException e) {
// should not happen
throw new IllegalStateException(String.format("Specified method %s is not available", getAlgorithm()), e);
}
}
}

View file

@ -240,6 +240,7 @@ public class CommandLineApplication {
return result ? 0 : 1;
} catch (final Exception e) {
e.printStackTrace();
if (cmd.hasOption(DEBUG.getOpt())) {
log.error(e.getMessage(), e);
} else {

View file

@ -27,10 +27,10 @@ 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.api.InputFactory;
import de.kosit.validationtool.impl.DefaultCheck;
import de.kosit.validationtool.impl.ObjectFactory;
import de.kosit.validationtool.impl.input.ByteArrayInput;
import de.kosit.validationtool.model.scenarios.Scenarios;
/**
@ -55,7 +55,7 @@ class Daemon {
private final Check implemenation;
HttpServerHandler(Check check) {
HttpServerHandler(final Check check) {
this.implemenation = check;
}
@ -66,24 +66,25 @@ class Daemon {
* soll.
*/
@Override
public void handle(HttpExchange httpExchange) throws IOException {
public void handle(final HttpExchange httpExchange) throws IOException {
try {
log.debug("Incoming request");
String requestMethod = httpExchange.getRequestMethod();
final String requestMethod = httpExchange.getRequestMethod();
if (requestMethod.equals("POST")) {
InputStream inputStream = httpExchange.getRequestBody();
Input serverInput = InputFactory.read(inputStream, "Prüfling" + counter.incrementAndGet());
final InputStream inputStream = httpExchange.getRequestBody();
final ByteArrayInput serverInput = (ByteArrayInput) InputFactory.read(inputStream,
"Prüfling" + counter.incrementAndGet());
int contentLength = serverInput.getContent().length;
if (contentLength != 0) {
writeOutputstreamArray(httpExchange, implemenation.check(serverInput));
if (serverInput.getLength() > 0) {
writeOutputstreamArray(httpExchange, this.implemenation.check(serverInput));
} else {
writeError(httpExchange, 400, "XML-Inhalt erforderlich!");
}
} else {
writeError(httpExchange, 405, "Es ist nur die POST-Methode erlaubt!");
}
} catch (Exception e) {
} catch (final Exception e) {
writeError(httpExchange, 500, "Interner Fehler bei der Verarbeitung des Requests: " + e.getMessage());
log.error("Es ist ein Fehler aufgetreten. Das Dokument kann nicht geprüft werden", e);
}
@ -100,17 +101,17 @@ class Daemon {
private final Scenarios scenarios;
HealthHandler(Scenarios scenarios) {
HealthHandler(final Scenarios scenarios) {
this.scenarios = scenarios;
}
@Override
public void handle(HttpExchange httpExchange) throws IOException {
Health health = new Health(scenarios);
Document doc = health.writeHealthXml();
public void handle(final HttpExchange httpExchange) throws IOException {
final Health health = new Health(this.scenarios);
final Document doc = health.writeHealthXml();
try {
writeOutputstreamArray(httpExchange, doc);
} catch (TransformerException e) {
} catch (final TransformerException e) {
writeError(httpExchange, 500, e.getMessage());
log.error("Fehler beim Erzeugen der Status-Information", e);
}
@ -134,9 +135,9 @@ class Daemon {
* @param rCode der Code-Status
* @param response die String antwort, die ich anzeigen möchte
*/
private static void writeError(HttpExchange httpExchange, int rCode, String response) throws IOException {
private static void writeError(final HttpExchange httpExchange, final int rCode, final String response) throws IOException {
httpExchange.sendResponseHeaders(rCode, response.length());
OutputStream os = httpExchange.getResponseBody();
final OutputStream os = httpExchange.getResponseBody();
os.write(response.getBytes());
os.close();
}
@ -147,9 +148,10 @@ class Daemon {
* @param httpExchange um den Antwort Body zu erhalten
* @param doc der Report
*/
private static void writeOutputstreamArray(HttpExchange httpExchange, Document doc) throws IOException, TransformerException {
private static void writeOutputstreamArray(final HttpExchange httpExchange, final Document doc)
throws IOException, TransformerException {
final byte[] bytes = serialize(doc);
OutputStream os = httpExchange.getResponseBody();
final OutputStream os = httpExchange.getResponseBody();
httpExchange.getResponseHeaders().add("Content-Type", "application/xml");
httpExchange.sendResponseHeaders(200, bytes.length);
os.write(bytes);
@ -162,15 +164,15 @@ class Daemon {
*
* @param report Vom Typ Dokument, aka Report .
*/
private static byte[] serialize(Document report) throws TransformerException {
private static byte[] serialize(final Document report) throws TransformerException {
try ( ByteArrayOutputStream bArrayOS = new ByteArrayOutputStream() ) {
DOMSource source = new DOMSource(report);
StreamResult streamResult = new StreamResult(bArrayOS);
Transformer transformer = ObjectFactory.createTransformer(true);
try ( final ByteArrayOutputStream bArrayOS = new ByteArrayOutputStream() ) {
final DOMSource source = new DOMSource(report);
final StreamResult streamResult = new StreamResult(bArrayOS);
final Transformer transformer = ObjectFactory.createTransformer(true);
transformer.transform(source, streamResult);
return bArrayOS.toByteArray();
} catch (IOException e) {
} catch (final IOException e) {
log.error("Report {}", e.getMessage(), e);
throw new IllegalStateException(e);
}
@ -180,19 +182,19 @@ class Daemon {
* Methode zum Starten des Servers
*/
void startServer() {
CheckConfiguration config = new CheckConfiguration(scenarioDefinition);
config.setScenarioRepository(repository);
final CheckConfiguration config = new CheckConfiguration(this.scenarioDefinition);
config.setScenarioRepository(this.repository);
HttpServer server = null;
try {
server = HttpServer.create(new InetSocketAddress(hostName, port), 0);
DefaultCheck check = new DefaultCheck(config);
server = HttpServer.create(new InetSocketAddress(this.hostName, this.port), 0);
final DefaultCheck check = new DefaultCheck(config);
server.createContext("/", new HttpServerHandler(check));
server.createContext("/health", new HealthHandler(check.getRepository().getScenarios()));
server.setExecutor(Executors.newFixedThreadPool(threadCount));
server.setExecutor(Executors.newFixedThreadPool(this.threadCount));
server.start();
log.info("Server unter Port {} ist erfolgreich gestartet", port);
} catch (IOException e) {
log.error("Fehler beim HttpServer erstellen!", e.getMessage(), e);
log.info("Server unter Port {} ist erfolgreich gestartet", this.port);
} catch (final IOException e) {
log.error("Fehler beim HttpServer erstellen: {}", e.getMessage(), e);
}
}
}

View file

@ -81,8 +81,8 @@ public class DefaultCheck implements Check {
this.repository = new ScenarioRepository(this.contentRepository);
this.repository.initialize(configuration);
this.checkSteps = new ArrayList<>();
this.checkSteps.add(new CreateDocumentIdentificationAction());
this.checkSteps.add(new DocumentParseAction());
this.checkSteps.add(new CreateDocumentIdentificationAction());
this.checkSteps.add(new ScenarioSelectionAction(this.repository));
this.checkSteps.add(new SchemaValidationAction());
this.checkSteps.add(new SchematronValidationAction(this.contentRepository, this.conversionService));

View file

@ -0,0 +1,57 @@
package de.kosit.validationtool.impl.input;
import java.io.InputStream;
import lombok.Getter;
import lombok.Setter;
import lombok.extern.slf4j.Slf4j;
import de.kosit.validationtool.api.Input;
/**
* Base class for all {@link Input Inputs}.
*
* @author Andreas Penski
*/
@Slf4j
public abstract class AbstractInput implements Input, LazyReadInput {
private byte[] hashCode;
@Getter
@Setter
private long length;
@Override
public byte[] getHashCode() {
if (this.hashCode == null) {
throw new IllegalStateException("Hashcode is not computed yet");
}
return this.hashCode;
}
protected InputStream wrap(final InputStream stream) {
InputStream result = stream;
if (!isHashcodeComputed()) {
result = StreamHelper.wrapDigesting(this, result, getDigestAlgorithm());
}
if (getLength() == 0) {
result = StreamHelper.wrapCount(this, result);
}
return result;
}
@Override
public boolean isHashcodeComputed() {
return this.hashCode != null;
}
@Override
public void setHashCode(final byte[] digest) {
this.hashCode = digest;
}
public boolean supportsMultipleReads() {
return true;
}
}

View file

@ -0,0 +1,39 @@
package de.kosit.validationtool.impl.input;
import java.io.ByteArrayInputStream;
import java.io.InputStream;
import javax.xml.transform.Source;
import javax.xml.transform.stream.StreamSource;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
* Classical in-memory {@link de.kosit.validationtool.api.Input}. It is not memory efficient to read the whole file into
* memory prio validating. Consider using the {@link ResourceInput}.
*
* @author Andreas Penski
*/
@Getter
@AllArgsConstructor
public class ByteArrayInput extends AbstractInput {
private final byte[] content;
private final String name;
private final String digestAlgorithm;
@Override
public long getLength() {
return this.content != null ? this.content.length : 0;
}
@Override
public Source getSource() {
final InputStream stream = wrap(new ByteArrayInputStream(this.content));
return new StreamSource(stream, getName());
}
}

View file

@ -0,0 +1,36 @@
package de.kosit.validationtool.impl.input;
import java.io.InputStream;
import de.kosit.validationtool.api.Input;
/**
* Internal interface used for lazy generation of the hashcode for document identification.
*
* @see StreamHelper#wrapDigesting(LazyReadInput, InputStream, String) for details
* @author Andreas Penski
*/
interface LazyReadInput {
/**
* Sets a hashcode
*
* @param digest the digest
*/
void setHashCode(byte[] digest);
/**
* Determines whether a hashcode has been computed yet
*
* @return true when computed
*/
boolean isHashcodeComputed();
/**
* Setting the length of the {@link Input}.
*
* @param length the length
*/
void setLength(long length);
}

View file

@ -0,0 +1,43 @@
package de.kosit.validationtool.impl.input;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import javax.xml.transform.Source;
import javax.xml.transform.stream.StreamSource;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import de.kosit.validationtool.api.Input;
/**
* An {@link Input} carries an {@link URL} which can be used for all 'locatable' inputs such as {@link File},
* {@link java.nio.file.Path} and any other {@link URL}.
*
* This stream is NOT read into memory. So this implementation has good in memory efficieny. The validation process MAY
* read the stream more than once. Make sure, that the {@link URL} points to fast I/O devices
*
* @author Andreas Penski
*/
@Getter
@RequiredArgsConstructor
public class ResourceInput extends AbstractInput {
private final URL url;
private final String name;
private final String digestAlgorithm;
@Override
public Source getSource() throws IOException {
InputStream stream = this.url.openStream();
if (!isHashcodeComputed()) {
stream = StreamHelper.wrapDigesting(this, stream, getDigestAlgorithm());
}
return new StreamSource(stream, this.name);
}
}

View file

@ -0,0 +1,108 @@
package de.kosit.validationtool.impl.input;
import java.io.IOException;
import java.nio.charset.Charset;
import javax.xml.transform.Source;
import javax.xml.transform.stream.StreamSource;
import org.apache.commons.io.input.ReaderInputStream;
import org.apache.commons.lang3.NotImplementedException;
import lombok.Getter;
import lombok.extern.slf4j.Slf4j;
/**
* A validator {@link de.kosit.validationtool.api.Input} based an on a {@link Source}.
*
* @author Andreas Penski
*/
@Getter
@Slf4j
public class SourceInput extends AbstractInput {
private final Source source;
private final String name;
private final String digestAlgorithm;
public SourceInput(final StreamSource source, final String name, final String digestAlgorithm) {
this(source, name, digestAlgorithm, null);
}
public SourceInput(final Source source, final String name, final String digestAlgorithm, final byte[] hashCode) {
this.source = source;
this.name = name;
this.digestAlgorithm = digestAlgorithm;
setHashCode(hashCode);
validate();
}
private void validate() {
if (!isSupported()) {
throw new IllegalStateException("Unsupported source. Only StreamSource supported yet");
}
if (((StreamSource) this.source).getInputStream() == null && !isHashcodeComputed()) {
log.warn("No hashcode supplied, will wrap the reader using system default charset");
}
}
@Override
public Source getSource() throws IOException {
if (!isSupported()) {
throw new IllegalStateException("Unsupported source. Only InputStream-based StreamSource supported yet");
}
if (isWrappingRequired()) {
return wrap();
}
if (isConsumed()) {
throw new IllegalStateException("A StreamSource can only read once");
}
return this.source;
}
private boolean isSupported() {
return isStreamSource();
}
private boolean isConsumed() throws IOException {
if (!isStreamSource()) {
throw new NotImplementedException("Supports only StreamSource yet");
}
final StreamSource ss = (StreamSource) this.source;
try {
return (ss.getInputStream() != null && ss.getInputStream().available() == 0)
|| (ss.getReader() != null && !ss.getReader().ready());
} catch (final IOException e) {
return true;
}
}
private boolean isStreamSource() {
return this.source instanceof StreamSource;
}
private Source wrap() {
Source result = this.source;
if (isStreamSource()) {
final StreamSource ss = (StreamSource) this.source;
if (ss.getInputStream() != null) {
result = new StreamSource(wrap(ss.getInputStream()), this.source.getSystemId());
} else if (ss.getReader() != null) {
result = new StreamSource(wrap(new ReaderInputStream(ss.getReader(), Charset.defaultCharset())), this.source.getSystemId());
}
}
return result;
}
private boolean isWrappingRequired() {
return !isHashcodeComputed();
}
@Override
public boolean supportsMultipleReads() {
return false;
}
}

View file

@ -0,0 +1,95 @@
package de.kosit.validationtool.impl.input;
import java.io.FilterInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.security.DigestInputStream;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import org.apache.commons.io.input.CountingInputStream;
/**
* Helper for stream handling.
*
* @author Andreas Penski
*/
public class StreamHelper {
/**
* Helper class, which generates the hashcode while reading the stream e.g. for parsing the document. This allows
* generating the hashcode without an aditional reading step.
*/
private static class DigestingInputStream extends FilterInputStream {
private final MessageDigest digest;
private final LazyReadInput reference;
DigestingInputStream(final LazyReadInput input, final InputStream in, final MessageDigest digest) {
super(new DigestInputStream(in, digest));
this.digest = digest;
this.reference = input;
}
@Override
public void close() throws IOException {
super.close();
this.reference.setHashCode(this.digest.digest());
}
}
private static class CountInputStream extends FilterInputStream {
private final LazyReadInput reference;
public CountInputStream(final LazyReadInput input, final InputStream stream) {
super(new org.apache.commons.io.input.CountingInputStream(stream));
this.reference = input;
}
@Override
public void close() throws IOException {
super.close();
this.reference.setLength(((CountingInputStream) this.in).getByteCount());
}
}
private StreamHelper() {
// hide
}
public static MessageDigest createDigest(final String algorithm) {
try {
final MessageDigest digest;
digest = MessageDigest.getInstance(algorithm);
return digest;
} catch (final NoSuchAlgorithmException e) {
// should not happen
throw new IllegalArgumentException(String.format("Specified method %s is not available", algorithm), e);
}
}
/**
* Wraps the {@link InputStream} with a counting length implementation.
*
* @param input the {@link LazyReadInput input}
* @param stream the stream
* @return a wrapped stream
*/
public static InputStream wrapCount(final LazyReadInput input, final InputStream stream) {
return new CountInputStream(input, stream);
}
/**
* Wraps the {@link InputStream} with an implementation the generates a hash sum over the stream data.
*
* @param input the {@link LazyReadInput input}
* @param stream the stream
* @return a wrapped stream
*/
public static InputStream wrapDigesting(final LazyReadInput input, final InputStream stream, final String digestAlgorithm) {
return new DigestingInputStream(input, stream, createDigest(digestAlgorithm));
}
}

View file

@ -19,14 +19,10 @@
package de.kosit.validationtool.impl.tasks;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.Collections;
import java.util.stream.Collectors;
import javax.xml.transform.stream.StreamSource;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
@ -63,10 +59,10 @@ public class DocumentParseAction implements CheckAction {
throw new IllegalArgumentException("Input may not be null");
}
Result<XdmNode, XMLSyntaxError> result;
try ( final InputStream input = new ByteArrayInputStream(content.getContent()) ) {
try {
final DocumentBuilder builder = ObjectFactory.createProcessor().newDocumentBuilder();
builder.setLineNumbering(true);
final XdmNode doc = builder.build(new StreamSource(input));
final XdmNode doc = builder.build(content.getSource());
result = new Result<>(doc, Collections.emptyList());
} catch (final SaxonApiException | IOException e) {
log.debug("Exception while parsing {}", content.getName(), e);

View file

@ -20,67 +20,201 @@
package de.kosit.validationtool.impl.tasks;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.nio.file.Files;
import java.nio.file.Path;
import javax.xml.transform.Source;
import javax.xml.transform.stream.StreamSource;
import javax.xml.validation.Validator;
import org.apache.commons.io.FileUtils;
import org.xml.sax.SAXException;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.Setter;
import lombok.extern.slf4j.Slf4j;
import de.kosit.validationtool.api.Input;
import de.kosit.validationtool.impl.CollectingErrorEventHandler;
import de.kosit.validationtool.impl.ObjectFactory;
import de.kosit.validationtool.impl.input.AbstractInput;
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;
import net.sf.saxon.s9api.SaxonApiException;
import net.sf.saxon.s9api.Serializer;
import net.sf.saxon.s9api.XdmNode;
/**
* Schema-Validierung der Eingabe-Datei mittels Schema-Definition aus dem identifizierten Szenario.
* Schema valiation of the {@link Input} with the schema of the supplied scenario. This implementation is based on JDK
* functionality and therefore needs a {@link Source} to do the actual validation. Since we base the validator on Saxon
* HE functionality, we have no support for schema in Saxon (e.g. the in memory version of the document is not
* schema-aware) and need to re-read the actual source.
*
* Since the actual {@link Input} implementation may not be read twice, we must serialize the previously read document.
* This implementation tries to do the validation in an efficient manner. If possible the source is read a second time
* to validate. If not, the source is serialized to the heap upon re-read/validaiton up to a configurable file size. The
* document is serialized to a temporary file otherwise.
*
* @author Andreas Penski
*/
@Slf4j
public class SchemaValidationAction implements CheckAction {
private Result<Boolean, XMLSyntaxError> validate(byte[] document, ScenarioType scenarioType) {
private static class ByteArraySerializedDocument implements SerializedDocument {
private byte[] bytes;
@Override
public void serialize(final XdmNode node) throws SaxonApiException, IOException {
try ( final ByteArrayOutputStream out = new ByteArrayOutputStream() ) {
final Serializer serializer = ObjectFactory.createProcessor().newSerializer();
serializer.setOutputStream(out);
serializer.serializeNode(node);
serializer.close();
this.bytes = out.toByteArray();
}
}
@Override
public void close() {
// nothing do do
}
@Override
public InputStream openStream() {
return new ByteArrayInputStream(this.bytes);
}
}
private static class FileSerializedDocument implements SerializedDocument {
private final Path file;
FileSerializedDocument() throws IOException {
this.file = Files.createTempFile("validator", ".xml");
}
@Override
public void serialize(final XdmNode node) throws SaxonApiException, IOException {
try ( final OutputStream out = Files.newOutputStream(this.file) ) {
final Serializer serializer = ObjectFactory.createProcessor().newSerializer();
serializer.setOutputStream(out);
serializer.serializeNode(node);
serializer.close();
}
}
@Override
public void close() throws IOException {
Files.deleteIfExists(this.file);
}
@Override
public InputStream openStream() throws IOException {
return Files.newInputStream(this.file);
}
}
private static final Long BA_LIMIT = 10L;
private static final String LIMIT_PARAMETER = "schema.validation.inmem.limit";
@Setter(AccessLevel.PACKAGE)
@Getter
private long inMemoryLimit = Long.parseLong(System.getProperty(LIMIT_PARAMETER, BA_LIMIT.toString())) * FileUtils.ONE_MB;
private Result<Boolean, XMLSyntaxError> validate(final Bag results, final ScenarioType scenarioType) {
log.debug("Validating document using scenario {}", scenarioType.getName());
final CollectingErrorEventHandler errorHandler = new CollectingErrorEventHandler();
try ( InputStream input = new ByteArrayInputStream(document) ) {
try ( final SourceProvider validateInput = resolveSource(results) ) {
final Validator validator = ObjectFactory.createValidator(scenarioType.getSchema());
validator.setErrorHandler(errorHandler);
validator.validate(new StreamSource(input));
validator.validate(validateInput.getSource());
return new Result<>(!errorHandler.hasErrors(), errorHandler.getErrors());
} catch (SAXException | IOException e) {
} catch (final SAXException | SaxonApiException | IOException e) {
throw new IllegalStateException("Error validating document", e);
}
}
@Override
public void check(Bag results) {
public void check(final Bag results) {
final CreateReportInput report = results.getReportInput();
final ScenarioType scenario = results.getScenarioSelectionResult().getObject();
final Result<Boolean, XMLSyntaxError> validateResult = validate(results.getInput().getContent(), scenario);
final Result<Boolean, XMLSyntaxError> validateResult = validate(results, scenario);
results.setSchemaValidationResult(validateResult);
ValidationResultsXmlSchema result = new ValidationResultsXmlSchema();
final ValidationResultsXmlSchema result = new ValidationResultsXmlSchema();
report.setValidationResultsXmlSchema(result);
result.getResource().addAll(scenario.getValidateWithXmlSchema().getResource());
if (!validateResult.isValid()) {
result.getXmlSyntaxError().addAll(validateResult.getErrors());
}
}
private SourceProvider resolveSource(final Bag results) throws IOException, SaxonApiException {
final SourceProvider source;
if (results.getInput() instanceof AbstractInput && (((AbstractInput) results.getInput()).supportsMultipleReads())) {
source = () -> results.getInput().getSource();
} else {
source = serialize(results.getInput(), results.getParserResult().getObject());
}
return source;
}
private SerializedDocument serialize(final Input input, final XdmNode object) throws IOException, SaxonApiException {
final SerializedDocument doc;
if (input instanceof AbstractInput && ((AbstractInput) input).getLength() < getInMemoryLimit()) {
doc = new ByteArraySerializedDocument();
} else {
doc = new FileSerializedDocument();
}
doc.serialize(object);
return doc;
}
@Override
public boolean isSkipped(Bag results) {
public boolean isSkipped(final Bag results) {
return hasNoScenario(results);
}
private static boolean hasNoScenario(Bag results) {
private static boolean hasNoScenario(final Bag results) {
return results.getScenarioSelectionResult() == null || results.getScenarioSelectionResult().isInvalid();
}
private interface SourceProvider extends AutoCloseable {
Source getSource() throws IOException;
@Override
default void close() throws IOException {
// nothing
}
}
private interface SerializedDocument extends AutoCloseable, SourceProvider {
void serialize(XdmNode node) throws SaxonApiException, IOException;
InputStream openStream() throws IOException;
@Override
default Source getSource() throws IOException {
return new StreamSource(openStream());
}
}
}

View file

@ -23,17 +23,22 @@ import static org.assertj.core.api.Assertions.assertThat;
import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.MalformedURLException;
import java.net.URISyntaxException;
import java.net.URL;
import java.nio.file.Paths;
import javax.xml.transform.stream.StreamSource;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import de.kosit.validationtool.impl.ConversionServiceTest;
import de.kosit.validationtool.impl.Helper.Simple;
import de.kosit.validationtool.impl.input.SourceInput;
/**
* Testet den Hashcode-Service.
@ -42,23 +47,22 @@ import de.kosit.validationtool.impl.ConversionServiceTest;
*/
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;
private static final int EOF = -1;
private static final int DEFAULT_BUFFER_SIZE = 4096;
static {
try {
NOT_EXISTING = new URL("file://localhost/somefile.text");
} catch (MalformedURLException e) {
} catch (final MalformedURLException e) {
// just ignore;
}
}
@Rule
public ExpectedException expectedException = ExpectedException.none();
@ -69,25 +73,40 @@ public class InputFactoryTest {
}
@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();
public void testHashCodeGeneration() throws IOException {
final byte[] s1 = drain(InputFactory.read(Simple.SIMPLE_VALID.toURL())).getHashCode();
final byte[] s2 = drain(InputFactory.read(Simple.SIMPLE_VALID.toURL())).getHashCode();
final byte[] s3 = drain(InputFactory.read(Simple.INVALID.toURL())).getHashCode();
assertThat(s1).isNotEmpty();
assertThat(s1).isEqualTo(s2);
assertThat(s3).isNotEmpty();
assertThat(s1).isNotEqualTo(s3);
}
private static Input drain(final Input input) throws IOException {
final byte[] buffer = new byte[DEFAULT_BUFFER_SIZE];
final StreamSource s = (StreamSource) input.getSource();
try ( final InputStream stream = s.getInputStream() ) {
int n;
while (EOF != (n = stream.read(buffer))) {
// nothing
}
}
return input;
}
@Test
public void testWrongAlgorithm() {
expectedException.expect(IllegalStateException.class);
InputFactory service = new InputFactory("unknown");
this.expectedException.expect(IllegalArgumentException.class);
new InputFactory("unknown");
}
@Test
public void testNullInputURL() {
expectedException.expect(IllegalArgumentException.class);
this.expectedException.expect(IllegalArgumentException.class);
InputFactory.read((URL) null);
}
@ -105,43 +124,71 @@ public class InputFactoryTest {
@Test
public void testNullStream() {
expectedException.expect(IllegalArgumentException.class);
this.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()));
final Input input = InputFactory.read(new File(Simple.SIMPLE_VALID));
assertThat(input).isNotNull();
}
@Test
public void testInputPath() throws URISyntaxException {
final Input input = InputFactory.read(Paths.get(CONTENT.toURI()));
final Input input = InputFactory.read(Paths.get(Simple.SIMPLE_VALID));
assertThat(input).isNotNull();
}
@Test
public void testNullInput() {
expectedException.expect(IllegalArgumentException.class);
this.expectedException.expect(IllegalArgumentException.class);
InputFactory.read((byte[]) null, SOME_VALUE);
}
@Test
public void testNullInputName() {
expectedException.expect(IllegalArgumentException.class);
this.expectedException.expect(IllegalArgumentException.class);
InputFactory.read(SOME_VALUE.getBytes(), null);
}
@Test
public void testEmptyInputName() {
expectedException.expect(IllegalArgumentException.class);
InputFactory.read(SOME_VALUE.getBytes(), "");
public void testEmptyInputName() throws IOException {
this.expectedException.expect(IllegalArgumentException.class);
final Input input = InputFactory.read(SOME_VALUE.getBytes(), "");
drain(input);
}
@Test
public void testSourceInput() throws IOException {
try ( final InputStream s = Simple.SIMPLE_VALID.toURL().openStream() ) {
final SourceInput input = (SourceInput) InputFactory.read(new StreamSource(s));
assertThat(input.getSource()).isNotNull();
drain(input);
assertThat(input.getHashCode()).isNotNull();
assertThat(input.getLength()).isGreaterThan(0L);
this.expectedException.expect(IllegalStateException.class);
input.getSource();
}
}
@Test
public void testSourceInputReader() throws IOException {
try ( final InputStream s = Simple.SIMPLE_VALID.toURL().openStream();
final InputStreamReader reader = new InputStreamReader(s) ) {
final SourceInput input = (SourceInput) InputFactory.read(new StreamSource(reader));
assertThat(input.getSource()).isNotNull();
drain(input);
assertThat(input.getHashCode()).isNotNull();
assertThat(input.getLength()).isGreaterThan(0L);
this.expectedException.expect(IllegalStateException.class);
input.getSource();
}
}
@Test
public void testUnexistingInput() {
expectedException.expect(IllegalArgumentException.class);
this.expectedException.expect(IllegalArgumentException.class);
InputFactory.read(NOT_EXISTING);
}

View file

@ -20,12 +20,6 @@
package de.kosit.validationtool.cmd;
import static de.kosit.validationtool.impl.Helper.ASSERTIONS;
import static de.kosit.validationtool.impl.Helper.NOT_EXISTING;
import static de.kosit.validationtool.impl.Helper.REPOSITORY;
import static de.kosit.validationtool.impl.Helper.SAMPLE;
import static de.kosit.validationtool.impl.Helper.SAMPLE2;
import static de.kosit.validationtool.impl.Helper.SAMPLE_DIR;
import static de.kosit.validationtool.impl.Helper.SCENARIO_FILE;
import static org.assertj.core.api.Assertions.assertThat;
import java.io.IOException;
@ -34,9 +28,12 @@ import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.List;
import org.apache.commons.io.FileUtils;
import org.junit.Before;
import org.junit.Test;
import de.kosit.validationtool.impl.Helper.Simple;
/**
* Testet die Parameter des Kommandozeilen-Tools.
*
@ -51,88 +48,88 @@ public class CommandlineApplicationTest {
@Before
public void setup() throws IOException {
commandLine = new CommandLine();
commandLine.activate();
this.commandLine = new CommandLine();
this.commandLine.activate();
}
@Test
public void testHelp() {
String[] args = new String[] { "-?" };
final String[] args = new String[] { "-?" };
CommandLineApplication.mainProgram(args);
assertThat(commandLine.getErrorOutput()).isEmpty();
checkForHelp(commandLine.getOutputLines());
assertThat(this.commandLine.getErrorOutput()).isEmpty();
checkForHelp(this.commandLine.getOutputLines());
}
private void checkForHelp(List<String> outputLines) {
private static void checkForHelp(final 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" };
final 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");
assertThat(this.commandLine.getErrorOutput()).isNotEmpty();
assertThat(this.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() };
final String[] args = new String[] { "-s", Paths.get(Simple.NOT_EXISTING).toString(), Paths.get(Simple.NOT_EXISTING).toString() };
CommandLineApplication.mainProgram(args);
assertThat(commandLine.getErrorOutput()).isNotEmpty();
assertThat(commandLine.getErrorOutput()).contains("Not a valid path for scenario definition specified");
assertThat(this.commandLine.getErrorOutput()).isNotEmpty();
assertThat(this.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() };
final String[] args = new String[] { "-s", Paths.get(Simple.SCENARIOS).toString(), Paths.get(Simple.NOT_EXISTING).toString() };
CommandLineApplication.mainProgram(args);
assertThat(commandLine.getErrorOutput()).isNotEmpty();
assertThat(commandLine.getErrorOutput()).contains("Can not load schema from sources");
assertThat(this.commandLine.getErrorOutput()).isNotEmpty();
assertThat(this.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() };
final String[] args = new String[] { "-s", Paths.get(Simple.SCENARIOS).toString(), "-r", Paths.get(Simple.REPOSITORY).toString(),
Paths.get(Simple.NOT_EXISTING).toString() };
CommandLineApplication.mainProgram(args);
assertThat(commandLine.getErrorOutput()).isNotEmpty();
assertThat(commandLine.getErrorOutput()).contains("No test targets found");
assertThat(this.commandLine.getErrorOutput()).isNotEmpty();
assertThat(this.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() };
final String[] args = new String[] { "-s", Paths.get(Simple.SCENARIOS).toString(), "-r", Paths.get(Simple.REPOSITORY).toString(),
Paths.get(Simple.SIMPLE_VALID).toString() };
CommandLineApplication.mainProgram(args);
assertThat(commandLine.getErrorOutput()).contains(RESULT_OUTPUT);
assertThat(this.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() };
final String[] args = new String[] { "-s", Paths.get(Simple.SCENARIOS).toString(), "-r", Paths.get(Simple.REPOSITORY).toString(),
Paths.get(Simple.SIMPLE_VALID).toString(), Paths.get(Simple.FOO).toString() };
CommandLineApplication.mainProgram(args);
assertThat(commandLine.getErrorOutput()).contains("Processing 2 object(s) completed");
assertThat(this.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() };
final String[] args = new String[] { "-s", Paths.get(Simple.SCENARIOS).toString(), "-r", Paths.get(Simple.REPOSITORY).toString(),
Paths.get(Simple.EXAMPLES).toString() };
CommandLineApplication.mainProgram(args);
assertThat(commandLine.getErrorOutput()).contains("Processing 4 object(s) completed");
assertThat(this.commandLine.getErrorOutput()).contains("Processing 5 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() };
final Path output = Paths.get("output");
FileUtils.deleteDirectory(output.toFile());
final String[] args = new String[] { "-s", Paths.get(Simple.SCENARIOS).toString(), "-o", output.getFileName().toString(), "-r",
Paths.get(Simple.REPOSITORY).toString(), Paths.get(Simple.SIMPLE_VALID).toString() };
CommandLineApplication.mainProgram(args);
assertThat(commandLine.getErrorOutput()).contains(RESULT_OUTPUT);
assertThat(this.commandLine.getErrorOutput()).contains(RESULT_OUTPUT);
assertThat(output).exists();
assertThat(Files.list(output)).hasSize(1);
}
@ -140,45 +137,47 @@ public class CommandlineApplicationTest {
@Test
public void testNoInput() {
// assertThat(output).doesNotExist();
String[] args = new String[] { "-s", Paths.get(SCENARIO_FILE).toString(), "-r", Paths.get(REPOSITORY).toString(), };
final String[] args = new String[] { "-s", Paths.get(Simple.SCENARIOS).toString(), "-r", Paths.get(Simple.REPOSITORY).toString(), };
CommandLineApplication.mainProgram(args);
checkForHelp(commandLine.getOutputLines());
checkForHelp(this.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() };
final String[] args = new String[] { "-s", Paths.get(Simple.SCENARIOS).toString(), "-p", "-r",
Paths.get(Simple.REPOSITORY).toString(), Paths.get(Simple.SIMPLE_VALID).toString() };
CommandLineApplication.mainProgram(args);
assertThat(commandLine.getErrorOutput()).contains(RESULT_OUTPUT);
assertThat(commandLine.getOutputLines().get(0)).contains("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
assertThat(this.commandLine.getErrorOutput()).contains(RESULT_OUTPUT);
assertThat(this.commandLine.getOutputLines().get(0)).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() };
final Path output = Files.createTempDirectory("pruef-tool-test");
final String[] args = new String[] { "-s", Paths.get(Simple.SCENARIOS).toString(), "-h", "-o", output.toAbsolutePath().toString(),
"-r", Paths.get(Simple.REPOSITORY).toString(), Paths.get(Simple.SIMPLE_VALID).toString() };
CommandLineApplication.mainProgram(args);
assertThat(commandLine.getErrorOutput()).contains(RESULT_OUTPUT);
assertThat(this.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() };
final String[] args = new String[] { "-d", "-s", Paths.get(Simple.SCENARIOS).toString(), "-r",
Paths.get(Simple.REPOSITORY).toString(), "-c", Paths.get(ASSERTIONS).toString(), Paths.get(Simple.REPOSITORY).toString(),
Paths.get(Simple.SIMPLE_VALID).toString() };
CommandLineApplication.mainProgram(args);
assertThat(commandLine.getErrorOutput()).contains(RESULT_OUTPUT);
assertThat(commandLine.getErrorOutput()).contains("Can not find assertions for ");
assertThat(this.commandLine.getErrorOutput()).contains(RESULT_OUTPUT);
assertThat(this.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() };
final String[] args = new String[] { "-s", Paths.get(Simple.SCENARIOS).toString(), "-r", "unknown", "-d",
Paths.get(ASSERTIONS).toString() };
CommandLineApplication.mainProgram(args);
assertThat(commandLine.getErrorOutput()).contains("at de.kosit.validationtool");
assertThat(this.commandLine.getErrorOutput()).contains("at de.kosit.validationtool");
}
}

View file

@ -10,6 +10,8 @@ import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
import de.kosit.validationtool.impl.Helper.Simple;
import io.restassured.RestAssured;
import io.restassured.http.ContentType;
@ -20,11 +22,9 @@ import io.restassured.http.ContentType;
*/
public class DaemonIT {
private static final String EXAMPLE_FILE = "examples/UBLReady/UBLReady_EU_UBL-NL_20170102_FULL.xml";
private static final String APPLICATION_XML = "application/xml";
private static final String INVALID_XML = "examples/UBLReady/UBLReady_EU_UBL-NL_20170102_FULL-invalid.xml";
@Before
public void setup() {
@ -41,7 +41,7 @@ public class DaemonIT {
@Test
public void makeSureThatSuccessTest() throws IOException {
try ( final InputStream io = DaemonIT.class.getClassLoader().getResourceAsStream(EXAMPLE_FILE) ) {
try ( final InputStream io = Simple.SIMPLE_VALID.toURL().openStream() ) {
given().contentType(ContentType.XML).body(toContent(io)).when().post("/").then().statusCode(200);
}
}
@ -54,7 +54,7 @@ public class DaemonIT {
@Test
@Ignore // no default error report yet
public void internalServerErrorTest() throws IOException {
try ( final InputStream io = DaemonIT.class.getClassLoader().getResourceAsStream(INVALID_XML) ) {
try ( final InputStream io = Simple.INVALID.toURL().openStream() ) {
given().contentType(APPLICATION_XML).body(toContent(io)).when().post("/").then().statusCode(200);
}
}
@ -75,7 +75,8 @@ public class DaemonIT {
@Test
public void xmlResultTest() throws IOException {
try ( final InputStream io = DaemonIT.class.getClassLoader().getResourceAsStream(EXAMPLE_FILE) ) {
try ( final InputStream io = Simple.SIMPLE_VALID.toURL().openStream() ) {
given().body(toContent(io)).when().post("/").then().contentType(APPLICATION_XML).and().statusCode(200);
}
}

View file

@ -36,6 +36,8 @@ import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import de.kosit.validationtool.impl.Helper.Simple;
import net.sf.saxon.s9api.XPathExecutable;
import net.sf.saxon.s9api.XsltExecutable;
@ -53,7 +55,7 @@ public class ContentRepositoryTest {
@Before
public void setup() {
this.repository = new ContentRepository(ObjectFactory.createProcessor(), Helper.REPOSITORY);
this.repository = new ContentRepository(ObjectFactory.createProcessor(), Simple.REPOSITORY);
}
@Test
@ -71,19 +73,19 @@ public class ContentRepositoryTest {
@Test
public void testCreateSchemaNotExisting() throws Exception {
this.exception.expect(IllegalStateException.class);
ContentRepository.createSchema(Helper.ASSERTION_SCHEMA.resolve("noexisting").toURL());
ContentRepository.createSchema(Simple.NOT_EXISTING.toURL());
}
@Test
public void testLoadXSLT() {
final XsltExecutable executable = this.repository.loadXsltScript(Helper.SAMPLE_XSLT);
final XsltExecutable executable = this.repository.loadXsltScript(Simple.REPORT_XSL);
assertThat(executable).isNotNull();
}
@Test
public void testLoadXSLTNotExisting() {
this.exception.expect(IllegalStateException.class);
this.repository.loadXsltScript(Helper.SAMPLE_XSLT.resolve("notexisting"));
this.repository.loadXsltScript(Simple.NOT_EXISTING);
}
@Test
@ -119,8 +121,8 @@ public class ContentRepositoryTest {
@Test
public void testLoadSchema() {
final URL main = RelativeUriResolverTest.class.getClassLoader().getResource("simple/main.xsd");
final Schema schema = ContentRepository.createSchema(main, new ClassPathResourceResolver("/simple"));
final URL main = RelativeUriResolverTest.class.getClassLoader().getResource("loading/main.xsd");
final Schema schema = ContentRepository.createSchema(main, new ClassPathResourceResolver("/loading"));
assertThat(schema).isNotNull();
}

View file

@ -31,6 +31,8 @@ import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import de.kosit.validationtool.impl.Helper.Invalid;
import de.kosit.validationtool.impl.Helper.Simple;
import de.kosit.validationtool.model.scenarios.Scenarios;
/**
@ -40,12 +42,6 @@ import de.kosit.validationtool.model.scenarios.Scenarios;
*/
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
@ -77,28 +73,28 @@ public class ConversionServiceTest {
@Test
public void testUnmarshal() throws URISyntaxException {
final Scenarios s = this.service.readXml(VALID_XML.toURI(), Scenarios.class);
final Scenarios s = this.service.readXml(Simple.SCENARIOS, Scenarios.class);
assertThat(s).isNotNull();
assertThat(s.getName()).isEqualToIgnoringCase("XInneres");
assertThat(s.getName()).isEqualToIgnoringCase("HTML-TestSuite");
}
@Test
public void testUnmarshalWithSchema() throws URISyntaxException {
final Scenarios s = this.service.readXml(VALID_XML.toURI(), Scenarios.class, ContentRepository.createSchema(SCHEMA));
public void testUnmarshalWithSchema() {
final Scenarios s = this.service.readXml(Simple.SCENARIOS, Scenarios.class, ContentRepository.createSchema(SCHEMA));
assertThat(s).isNotNull();
assertThat(s.getName()).isEqualToIgnoringCase("XInneres");
assertThat(s.getName()).isEqualToIgnoringCase("HTML-TestSuite");
}
@Test
public void testUnmarshalInvalidXml() throws URISyntaxException {
public void testUnmarshalInvalidXml() {
this.exception.expect(ConversionService.ConversionExeption.class);
this.service.readXml(INVALID_XML.toURI(), Scenarios.class, ContentRepository.createSchema(SCHEMA));
this.service.readXml(Invalid.SCENARIOS, Scenarios.class, ContentRepository.createSchema(SCHEMA));
}
@Test
public void testUnmarshalIllFormed() throws URISyntaxException {
public void testUnmarshalIllFormed() {
this.exception.expect(ConversionService.ConversionExeption.class);
this.service.readXml(ILLFORMED_XML.toURI(), Scenarios.class, ContentRepository.createSchema(SCHEMA));
this.service.readXml(Invalid.SCENARIOS_ILLFORMED, Scenarios.class, ContentRepository.createSchema(SCHEMA));
}
@Test
@ -110,13 +106,13 @@ public class ConversionServiceTest {
@Test
public void testUnmarshalUnknownType() throws URISyntaxException {
this.exception.expect(ConversionService.ConversionExeption.class);
this.service.readXml(VALID_XML.toURI(), ConversionService.class);
this.service.readXml(Simple.SCENARIOS, ConversionService.class);
}
@Test
public void testUnmarshalWithoutType() throws URISyntaxException {
this.exception.expect(ConversionService.ConversionExeption.class);
this.service.readXml(VALID_XML.toURI(), null);
this.service.readXml(Simple.SCENARIOS, null);
}
}

View file

@ -26,7 +26,6 @@ import static org.assertj.core.api.Assertions.assertThat;
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;
@ -39,6 +38,7 @@ import de.kosit.validationtool.api.AcceptRecommendation;
import de.kosit.validationtool.api.CheckConfiguration;
import de.kosit.validationtool.api.Input;
import de.kosit.validationtool.api.Result;
import de.kosit.validationtool.impl.Helper.Simple;
/**
* Test das Check-Interface
@ -47,10 +47,7 @@ import de.kosit.validationtool.api.Result;
*/
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;
@ -58,14 +55,23 @@ public class DefaultCheckTest {
@Before
public void setup() throws URISyntaxException {
final CheckConfiguration d = new CheckConfiguration(SCENARIO_DEFINITION.toURI());
d.setScenarioRepository(new File("src/test/resources/examples/repository").toURI());
final CheckConfiguration d = new CheckConfiguration(Simple.SCENARIOS);
d.setScenarioRepository(new File(Simple.REPOSITORY).toURI());
this.implementation = new DefaultCheck(d);
}
@Test
public void testHappyCase() {
final Result doc = this.implementation.checkInput(read(VALID_EXAMPLE));
final Result doc = this.implementation.checkInput(read(Simple.SIMPLE_VALID));
assertThat(doc).isNotNull();
assertThat(doc.getReport()).isNotNull();
assertThat(doc.isAcceptable()).isTrue();
assertThat(doc.getAcceptRecommendation()).isEqualTo(AcceptRecommendation.ACCEPTABLE);
}
@Test
public void testWithoutAcceptMatch() {
final Result doc = this.implementation.checkInput(read(Simple.FOO));
assertThat(doc).isNotNull();
assertThat(doc.getReport()).isNotNull();
assertThat(doc.isAcceptable()).isFalse();
@ -74,13 +80,13 @@ public class DefaultCheckTest {
@Test
public void testHappyCaseDocument() {
final Document doc = this.implementation.check(read(VALID_EXAMPLE));
final Document doc = this.implementation.check(read(Simple.SIMPLE_VALID));
assertThat(doc).isNotNull();
}
@Test
public void testMultipleCase() {
final List<Input> input = IntStream.range(0, MULTI_COUNT).mapToObj(i -> read(VALID_EXAMPLE)).collect(Collectors.toList());
final List<Input> input = IntStream.range(0, MULTI_COUNT).mapToObj(i -> read(Simple.SIMPLE_VALID)).collect(Collectors.toList());
final List<Result> docs = this.implementation.checkInput(input);
assertThat(docs).isNotNull();
assertThat(docs).hasSize(MULTI_COUNT);
@ -88,7 +94,7 @@ public class DefaultCheckTest {
@Test
public void testMultipleCaseDocument() {
final List<Input> input = IntStream.range(0, MULTI_COUNT).mapToObj(i -> read(VALID_EXAMPLE)).collect(Collectors.toList());
final List<Input> input = IntStream.range(0, MULTI_COUNT).mapToObj(i -> read(Simple.SIMPLE_VALID)).collect(Collectors.toList());
final List<Document> docs = this.implementation.check(input);
assertThat(docs).isNotNull();
assertThat(docs).hasSize(MULTI_COUNT);
@ -96,10 +102,10 @@ public class DefaultCheckTest {
@Test
public void testExtractHtml() {
final DefaultResult doc = (DefaultResult) this.implementation.checkInput(read(VALID_EXAMPLE));
final DefaultResult doc = (DefaultResult) this.implementation.checkInput(read(Simple.SIMPLE_VALID));
assertThat(doc).isNotNull();
assertThat(doc.getReport()).isNotNull();
assertThat(doc.isAcceptable()).isFalse();
assertThat(doc.isAcceptable()).isTrue();
assertThat(doc.extractHtmlAsString()).isNotEmpty();
assertThat(doc.extractHtmlAsElement()).isNotEmpty();
assertThat(doc.extractHtml()).isNotEmpty();

View file

@ -22,13 +22,11 @@ package de.kosit.validationtool.impl;
import static de.kosit.validationtool.api.InputFactory.read;
import static org.assertj.core.api.Assertions.assertThat;
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.impl.Helper.Simple;
import de.kosit.validationtool.impl.model.Result;
import de.kosit.validationtool.impl.tasks.DocumentParseAction;
import de.kosit.validationtool.model.reportInput.XMLSyntaxError;
@ -42,25 +40,12 @@ import net.sf.saxon.s9api.XdmNode;
*/
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() {
this.parser = new DocumentParseAction();
}
@Test
public void testSimple() {
final Result<XdmNode, XMLSyntaxError> result = DocumentParseAction.parseDocument(read(CONTENT));
final Result<XdmNode, XMLSyntaxError> result = DocumentParseAction.parseDocument(read(Simple.SIMPLE_VALID));
assertThat(result).isNotNull();
assertThat(result.getObject()).isNotNull();
assertThat(result.getErrors()).isEmpty();
@ -69,7 +54,7 @@ public class DocumentParserTest {
@Test
public void testIllformed() {
final Result<XdmNode, XMLSyntaxError> result = DocumentParseAction.parseDocument(read(ILLFORMED));
final Result<XdmNode, XMLSyntaxError> result = DocumentParseAction.parseDocument(read(Simple.NOT_WELLFORMED));
assertThat(result).isNotNull();
assertThat(result.getErrors()).isNotEmpty();
assertThat(result.getObject()).isNull();

View file

@ -37,12 +37,14 @@ import net.sf.saxon.s9api.XdmNode;
*
* @author Andreas Penski
*/
public class Helper {
public class Helper {
public static class Simple {
public static final URI ROOT = EXAMPLES_DIR.resolve("simple/");
public static final URI EXAMPLES = ROOT.resolve("input/");
public static final URI SIMPLE_VALID = Simple.ROOT.resolve("input/simple.xml");
public static final URI FOO = Simple.ROOT.resolve("input/foo.xml");
@ -58,15 +60,30 @@ public class Helper {
public static final URI UNKNOWN = ROOT.resolve("input/unknown.xml");
public static final URI GARBAGE = ROOT.resolve("input/no-xml.file");
public static final URI NOT_EXISTING = EXAMPLES_DIR.resolve("doesnotexist");
public static final URI REPORT_XSL = REPOSITORY.resolve("report.xsl");
public static URI getSchemaLocation() {
return ROOT.resolve("repository/simple.xsd");
}
}
public static class Invalid {
public static final URI ROOT = EXAMPLES_DIR.resolve("invaid/");
public static final URI SCENARIOS = ROOT.resolve("scenarios.xml");
public static final URI SCENARIOS_ILLFORMED = ROOT.resolve("scenarios-illformed.xml");
}
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();
@ -74,21 +91,14 @@ public class Helper {
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 URL JAR_REPOSITORY = Helper.class.getClassLoader().getResource("xrechnung/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

View file

@ -75,8 +75,8 @@ public class RelativeUriResolverTest {
@Test
public void testClasspathLocal() throws URISyntaxException, TransformerException {
this.resolver = new RelativeUriResolver(RelativeUriResolver.class.getClassLoader().getResource("simple").toURI());
final URL moz = RelativeUriResolverTest.class.getClassLoader().getResource("simple/main.xsd");
this.resolver = new RelativeUriResolver(RelativeUriResolver.class.getClassLoader().getResource("loading").toURI());
final URL moz = RelativeUriResolverTest.class.getClassLoader().getResource("loading/main.xsd");
final Source resolved = this.resolver.resolve("./resources/reference.xsd", moz.toURI().toASCIIString());
assertThat(resolved).isNotNull();
}

View file

@ -33,7 +33,14 @@ import org.w3c.dom.Document;
import lombok.extern.slf4j.Slf4j;
import net.sf.saxon.s9api.*;
import de.kosit.validationtool.impl.Helper.Simple;
import net.sf.saxon.s9api.DOMDestination;
import net.sf.saxon.s9api.Processor;
import net.sf.saxon.s9api.SaxonApiException;
import net.sf.saxon.s9api.XsltCompiler;
import net.sf.saxon.s9api.XsltExecutable;
import net.sf.saxon.s9api.XsltTransformer;
/**
* Testet verschiedene Saxon Security Einstellungen.
@ -45,18 +52,18 @@ public class SaxonSecurityTest {
@Test
public void testEvilStylesheets() throws IOException {
Processor p = ObjectFactory.createProcessor();
final 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 URL resource = SaxonSecurityTest.class.getResource(String.format("/evil/evil%s.xsl", i));
final XsltCompiler compiler = p.newXsltCompiler();
final RelativeUriResolver resolver = new RelativeUriResolver(Helper.REPOSITORY);
final RelativeUriResolver resolver = new RelativeUriResolver(Simple.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();
final Document result = ObjectFactory.createDocumentBuilder(false).newDocument();
transformer.getUnderlyingController().setUnparsedTextURIResolver(resolver);
transformer.setURIResolver(resolver);
transformer.setSource(new DOMSource(document));
@ -68,7 +75,7 @@ public class SaxonSecurityTest {
fail(String.format("Saxon configuration should prevent expansion within %s", resource));
}
} catch (SaxonApiException | RuntimeException e) {
} catch (final SaxonApiException | RuntimeException e) {
log.info("Expected exception detected", e.getMessage());
}
}

View file

@ -22,10 +22,9 @@ 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.URI;
import java.net.URISyntaxException;
import java.net.URL;
import org.junit.Before;
import org.junit.Rule;
@ -33,6 +32,7 @@ import org.junit.Test;
import org.junit.rules.ExpectedException;
import de.kosit.validationtool.api.CheckConfiguration;
import de.kosit.validationtool.impl.Helper.Simple;
import de.kosit.validationtool.impl.model.Result;
import de.kosit.validationtool.impl.tasks.DocumentParseAction;
import de.kosit.validationtool.model.scenarios.ScenarioType;
@ -48,8 +48,6 @@ import net.sf.saxon.s9api.XdmNode;
public class ScenarioRepositoryTest {
private static final URL SAMPLE = ScenarioRepositoryTest.class.getResource("/valid/scenarios.xml");
@Rule
public ExpectedException expectedException = ExpectedException.none();
@ -59,7 +57,7 @@ public class ScenarioRepositoryTest {
@Before
public void setup() {
this.content = new ContentRepository(ObjectFactory.createProcessor(), new File("src/test/resources/examples/repository").toURI());
this.content = new ContentRepository(ObjectFactory.createProcessor(), Simple.REPOSITORY);
final Scenarios def = new Scenarios();
final ScenarioType t = new ScenarioType();
t.setMatch("//*:name");
@ -72,7 +70,7 @@ public class ScenarioRepositoryTest {
@Test
public void testHappyCase() throws Exception {
final Result<ScenarioType, String> scenario = this.repository.selectScenario(load(SAMPLE));
final Result<ScenarioType, String> scenario = this.repository.selectScenario(load(Simple.SCENARIOS));
assertThat(scenario).isNotNull();
assertThat(scenario.isValid()).isTrue();
}
@ -83,7 +81,7 @@ public class ScenarioRepositoryTest {
final ScenarioType fallback = new ScenarioType();
fallback.setName("fallback");
this.repository.setFallbackScenario(fallback);
final Result<ScenarioType, String> scenario = this.repository.selectScenario(load(SAMPLE));
final Result<ScenarioType, String> scenario = this.repository.selectScenario(load(Simple.SCENARIOS));
assertThat(scenario).isNotNull();
assertThat(scenario.isValid()).isFalse();
assertThat(scenario.getObject().getName()).isEqualTo("fallback");
@ -100,15 +98,15 @@ public class ScenarioRepositoryTest {
final ScenarioType fallback = new ScenarioType();
fallback.setName("fallback");
this.repository.setFallbackScenario(fallback);
final Result<ScenarioType, String> scenario = this.repository.selectScenario(load(SAMPLE));
final Result<ScenarioType, String> scenario = this.repository.selectScenario(load(Simple.SCENARIOS));
assertThat(scenario).isNotNull();
assertThat(scenario.isValid()).isFalse();
assertThat(scenario.getObject().getName()).isEqualTo("fallback");
}
private static XdmNode load(final URL url) throws IOException {
private static XdmNode load(final URI uri) throws IOException {
final DocumentParseAction p = new DocumentParseAction();
return DocumentParseAction.parseDocument(read(url)).getObject();
return DocumentParseAction.parseDocument(read(uri.toURL())).getObject();
}
@Test

View file

@ -1,113 +0,0 @@
/*
* 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());
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());
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();
}
}

View file

@ -49,7 +49,7 @@ public class SimpleScenarioCheck {
public void testUnknown() throws MalformedURLException {
final Result result = this.implementation.checkInput(InputFactory.read(Simple.UNKNOWN.toURL()));
assertThat(result).isNotNull();
assertThat(result.getAcceptRecommendation()).isEqualTo(AcceptRecommendation.REJECT);
assertThat(result.isProcessingSuccessful()).isFalse();
}
@Test

View file

@ -0,0 +1,174 @@
/*
* 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 static org.assertj.core.api.Assertions.assertThat;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.Reader;
import java.net.MalformedURLException;
import java.net.URI;
import javax.xml.transform.stream.StreamSource;
import javax.xml.validation.Schema;
import org.junit.Before;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import de.kosit.validationtool.api.Input;
import de.kosit.validationtool.api.InputFactory;
import de.kosit.validationtool.impl.ContentRepository;
import de.kosit.validationtool.impl.Helper;
import de.kosit.validationtool.impl.Helper.Simple;
import de.kosit.validationtool.impl.ObjectFactory;
import de.kosit.validationtool.impl.input.SourceInput;
import de.kosit.validationtool.impl.model.Result;
import de.kosit.validationtool.impl.tasks.CheckAction.Bag;
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;
/**
* Tests die {@link SchemaValidationAction}.
*
* @author Andreas Penski
*/
public class SchemaValidatorActionTest {
public ExpectedException expectedException = ExpectedException.none();
private SchemaValidationAction service;
private ContentRepository repository;
@Before
public void setup() {
this.service = new SchemaValidationAction();
this.repository = new ContentRepository(ObjectFactory.createProcessor(), Simple.REPOSITORY);
}
@Test
public void testSimple() throws MalformedURLException {
final CheckAction.Bag bag = createBag(InputFactory.read(Simple.SIMPLE_VALID.toURL()));
this.service.check(bag);
assertThat(bag.getSchemaValidationResult().isValid()).isTrue();
assertThat(bag.getSchemaValidationResult()).isNotNull();
assertThat(bag.getSchemaValidationResult().isValid()).isTrue();
}
@Test
public void testValidationFailure() throws MalformedURLException {
final Input input = InputFactory.read(Simple.INVALID.toURL());
final CheckAction.Bag bag = createBag(input);
this.service.check(bag);
assertThat(bag.getSchemaValidationResult().isValid()).isFalse();
bag.getSchemaValidationResult().getErrors().forEach(e->{
assertThat(e.getRowNumber()).isGreaterThan(0);
assertThat(e.getColumnNumber()).isGreaterThan(0);
});
}
private Bag createBag(final Input input) {
final Bag bag = new Bag(input, new CreateReportInput());
bag.setScenarioSelectionResult(new Result<>(createScenario(Helper.Simple.getSchemaLocation())));
return bag;
}
private ScenarioType createScenario(final URI schemafile) {
final ScenarioType t = new ScenarioType();
final ValidateWithXmlSchema v = new ValidateWithXmlSchema();
final ResourceType r = new ResourceType();
r.setLocation(schemafile.getRawPath());
r.setName("invoice");
v.getResource().add(r);
t.setValidateWithXmlSchema(v);
t.initialize(this.repository, true);
return t;
}
@Test
public void testSchemaReferences() {
final Schema reportInputSchema = this.repository.getReportInputSchema();
assertThat(reportInputSchema).isNotNull();
}
@Test
public void testNoRepeatableRead() throws Exception {
try ( final InputStream inputStream = Simple.SIMPLE_VALID.toURL().openStream() ) {
final Bag bag = createBag(InputFactory.read(new StreamSource(inputStream)));
// don't read the real inputstream here!
bag.setParserResult(DocumentParseAction.parseDocument(InputFactory.read(Simple.SIMPLE_VALID.toURL())));
this.service.check(bag);
assertThat(bag.getSchemaValidationResult()).isNotNull();
assertThat(bag.getSchemaValidationResult().isValid()).isTrue();
}
}
@Test
public void testNoRepeatableReadBigFile() throws Exception {
try ( final InputStream inputStream = Simple.SIMPLE_VALID.toURL().openStream() ) {
final SourceInput input = (SourceInput) InputFactory.read(new StreamSource(inputStream));
final Bag bag = createBag(input);
// set limit and length for serialization to 5 bytes
this.service.setInMemoryLimit(5L);
input.setLength(6L);
bag.setParserResult(DocumentParseAction.parseDocument(InputFactory.read(Simple.SIMPLE_VALID.toURL())));
this.service.check(bag);
assertThat(bag.getSchemaValidationResult()).isNotNull();
assertThat(bag.getSchemaValidationResult().isValid()).isTrue();
}
}
@Test
public void testNoRepeatableReaderInput() throws Exception {
try ( final InputStream inputStream = Simple.SIMPLE_VALID.toURL().openStream();
final Reader reader = new InputStreamReader(inputStream) ) {
final SourceInput input = (SourceInput) InputFactory.read(new StreamSource(reader));
final Bag bag = createBag(input);
bag.setParserResult(DocumentParseAction.parseDocument(InputFactory.read(Simple.SIMPLE_VALID.toURL())));
this.service.check(bag);
this.service.check(bag);
assertThat(bag.getSchemaValidationResult()).isNotNull();
assertThat(bag.getSchemaValidationResult().isValid()).isTrue();
}
}
@Test
public void testNoRepeatableReaderInputBigFile() throws Exception {
try ( final InputStream inputStream = Simple.SIMPLE_VALID.toURL().openStream();
final Reader reader = new InputStreamReader(inputStream) ) {
final SourceInput input = (SourceInput) InputFactory.read(new StreamSource(reader));
final Bag bag = createBag(input);
// set limit and length for serialization to 5 bytes
this.service.setInMemoryLimit(5L);
bag.setParserResult(DocumentParseAction.parseDocument(InputFactory.read(Simple.SIMPLE_VALID.toURL())));
this.service.check(bag);
this.service.check(bag);
assertThat(bag.getSchemaValidationResult()).isNotNull();
assertThat(bag.getSchemaValidationResult().isValid()).isTrue();
}
}
}

View file

@ -1,301 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Licensed to the Koordinierungsstelle für IT-Standards (KoSIT) under
~ one or more contributor license agreements. See the NOTICE file
~ distributed with this work for additional information
~ regarding copyright ownership. KoSIT licenses this file
~ to you under the Apache License, Version 2.0 (the
~ "License"); you may not use this file except in compliance
~ with the License. You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing,
~ software distributed under the License is distributed on an
~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
~ KIND, either express or implied. See the License for the
~ specific language governing permissions and limitations
~ under the License.
-->
<!-- 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>

View file

@ -1,302 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Licensed to the Koordinierungsstelle für IT-Standards (KoSIT) under
~ one or more contributor license agreements. See the NOTICE file
~ distributed with this work for additional information
~ regarding copyright ownership. KoSIT licenses this file
~ to you under the Apache License, Version 2.0 (the
~ "License"); you may not use this file except in compliance
~ with the License. You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing,
~ software distributed under the License is distributed on an
~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
~ KIND, either express or implied. See the License for the
~ specific language governing permissions and limitations
~ under the License.
-->
<!-- 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>

View file

@ -18,48 +18,42 @@
~ under the License.
-->
<scenarios xmlns="http://www.xoev.de/de/validator/framework/1/scenarios" frameworkVersion="1.1.1">
<name>XInneres</name>
<scenarios xmlns="http://www.xoev.de/de/validator/framework/1/scenarios" frameworkVersion="1.1.2">
<name>HTML-TestSuite</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>
<p>Szenario für Tests</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>
<name>Simple</name>
<description>
<p>Nur Schemaprüfung.</p>
</description>
<namespace prefix="cri">http://www.xoev.de/de/validator/framework/1/createreportinput</namespace>
<namespace prefix="test">http://validator.kosit.de/test-sample</namespace>
<namespace prefix="rpt">http://validator.kosit.de/test-report</namespace>
<match>/test:simple</match>
<validateWithXmlSchema>
<resource>
<name>UBL 2.1 Invoice</name>
<location>resources/eRechnung/UBL-2.1/xsdrt/maindoc/UBL-Invoice-2.1.xsd</location>
<name>Sample Schema</name>
<location>simple.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>
<location>report.xsl</location>
</resource>
</createReport>
</scenario>
<acceptMatch>count(//cri:xmlSyntaxError) = 0</acceptMatch>
<noScenarioReport>
<resource>
<name>default</name>
<location>resources/eRechnung/default-report.xsl</location>
<location>report.xsl</location>
</resource>
</noScenarioReport>

View file

@ -18,37 +18,35 @@
~ under the License.
-->
<scenarios xmlns="http://www.xoev.de/de/validator/framework/1/scenarios" frameworkVersion="1.0.0">
<name>XInneres</name>
<scenarios xmlns="http://www.xoev.de/de/validator/framework/1/scenarios" frameworkVersion="1.1.2">
<name>HTML-TestSuite</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>
<p>Szenario für Tests</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>
<name>Simple</name>
<validateWithXmlSchema>
<resource>
<name>UBL 2.1 Invoice</name>
<location>resources/eRechnung/UBL-2.1/xsdrt/maindoc/UBL-Invoice-2.1.xsd</location>
<name>Sample Schema</name>
<location>simple.xsd</location>
</resource>
</validateWithXmlSchema>
<createReport>
<resource>
<name>Report für eRechnung</name>
<!-- noch nicht vorhanden -->
<location>does-not-exist.xsl</location>
<location>report.xsl</location>
</resource>
</createReport>
<acceptMatch>count(//cri:xmlSyntaxError) = 0</acceptMatch>
</scenario>
<noScenarioReport>
<resource>
<name>default</name>
<location>resources/eRechnung/report.xsl</location>
<location>report.xsl</location>
</resource>
</noScenarioReport>

View file

@ -1,769 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Licensed to the Koordinierungsstelle für IT-Standards (KoSIT) under
~ one or more contributor license agreements. See the NOTICE file
~ distributed with this work for additional information
~ regarding copyright ownership. KoSIT licenses this file
~ to you under the Apache License, Version 2.0 (the
~ "License"); you may not use this file except in compliance
~ with the License. You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing,
~ software distributed under the License is distributed on an
~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
~ KIND, either express or implied. See the License for the
~ specific language governing permissions and limitations
~ under the License.
-->
<!-- ====================================================================== -->
<!-- ===== CCTS Core Component Type Schema Module ===== -->
<!-- ====================================================================== -->
<xsd:schema xmlns:ccts="urn:un:unece:uncefact:documentation:2"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
targetNamespace="urn:un:unece:uncefact:data:specification:CoreComponentTypeSchemaModule:2"
elementFormDefault="qualified"
attributeFormDefault="unqualified">
<!-- ===== Type Definitions ===== -->
<!-- =================================================================== -->
<!-- ===== CCT: AmountType ===== -->
<!-- =================================================================== -->
<xsd:complexType name="AmountType">
<xsd:annotation>
<xsd:documentation xml:lang="en">
<ccts:UniqueID>UNDT000001</ccts:UniqueID>
<ccts:CategoryCode>CCT</ccts:CategoryCode>
<ccts:DictionaryEntryName>Amount. Type</ccts:DictionaryEntryName>
<ccts:VersionID>1.0</ccts:VersionID>
<ccts:Definition>A number of monetary units specified in a currency where the unit of the currency is
explicit or implied.
</ccts:Definition>
<ccts:RepresentationTermName>Amount</ccts:RepresentationTermName>
<ccts:PrimitiveType>decimal</ccts:PrimitiveType>
</xsd:documentation>
</xsd:annotation>
<xsd:simpleContent>
<xsd:extension base="xsd:decimal">
<xsd:attribute name="currencyID" type="xsd:normalizedString" use="optional">
<xsd:annotation>
<xsd:documentation xml:lang="en">
<ccts:UniqueID>UNDT000001-SC2</ccts:UniqueID>
<ccts:CategoryCode>SC</ccts:CategoryCode>
<ccts:DictionaryEntryName>Amount Currency. Identifier</ccts:DictionaryEntryName>
<ccts:Definition>The currency of the amount.</ccts:Definition>
<ccts:ObjectClass>Amount Currency</ccts:ObjectClass>
<ccts:PropertyTermName>Identification</ccts:PropertyTermName>
<ccts:RepresentationTermName>Identifier</ccts:RepresentationTermName>
<ccts:PrimitiveType>string</ccts:PrimitiveType>
<ccts:UsageRule>Reference UNECE Rec 9, using 3-letter alphabetic codes.</ccts:UsageRule>
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="currencyCodeListVersionID" type="xsd:normalizedString" use="optional">
<xsd:annotation>
<xsd:documentation xml:lang="en">
<ccts:UniqueID>UNDT000001-SC3</ccts:UniqueID>
<ccts:CategoryCode>SC</ccts:CategoryCode>
<ccts:DictionaryEntryName>Amount Currency. Code List Version. Identifier
</ccts:DictionaryEntryName>
<ccts:Definition>The VersionID of the UN/ECE Rec9 code list.</ccts:Definition>
<ccts:ObjectClass>Amount Currency</ccts:ObjectClass>
<ccts:PropertyTermName>Code List Version</ccts:PropertyTermName>
<ccts:RepresentationTermName>Identifier</ccts:RepresentationTermName>
<ccts:PrimitiveType>string</ccts:PrimitiveType>
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
</xsd:extension>
</xsd:simpleContent>
</xsd:complexType>
<!-- ===== CCT: BinaryObjectType ===== -->
<!-- =================================================================== -->
<xsd:complexType name="BinaryObjectType">
<xsd:annotation>
<xsd:documentation xml:lang="en">
<ccts:UniqueID>UNDT000002</ccts:UniqueID>
<ccts:CategoryCode>CCT</ccts:CategoryCode>
<ccts:DictionaryEntryName>Binary Object. Type</ccts:DictionaryEntryName>
<ccts:VersionID>1.0</ccts:VersionID>
<ccts:Definition>A set of finite-length sequences of binary octets.</ccts:Definition>
<ccts:RepresentationTermName>Binary Object</ccts:RepresentationTermName>
<ccts:PrimitiveType>binary</ccts:PrimitiveType>
</xsd:documentation>
</xsd:annotation>
<xsd:simpleContent>
<xsd:extension base="xsd:base64Binary">
<xsd:attribute name="format" type="xsd:string" use="optional">
<xsd:annotation>
<xsd:documentation xml:lang="en">
<ccts:UniqueID>UNDT000002-SC2</ccts:UniqueID>
<ccts:CategoryCode>SC</ccts:CategoryCode>
<ccts:DictionaryEntryName>Binary Object. Format. Text</ccts:DictionaryEntryName>
<ccts:Definition>The format of the binary content.</ccts:Definition>
<ccts:ObjectClass>Binary Object</ccts:ObjectClass>
<ccts:PropertyTermName>Format</ccts:PropertyTermName>
<ccts:RepresentationTermName>Text</ccts:RepresentationTermName>
<ccts:PrimitiveType>string</ccts:PrimitiveType>
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="mimeCode" type="xsd:normalizedString" use="optional">
<xsd:annotation>
<xsd:documentation xml:lang="en">
<ccts:UniqueID>UNDT000002-SC3</ccts:UniqueID>
<ccts:CategoryCode>SC</ccts:CategoryCode>
<ccts:DictionaryEntryName>Binary Object. Mime. Code</ccts:DictionaryEntryName>
<ccts:Definition>The mime type of the binary object.</ccts:Definition>
<ccts:ObjectClass>Binary Object</ccts:ObjectClass>
<ccts:PropertyTermName>Mime</ccts:PropertyTermName>
<ccts:RepresentationTermName>Code</ccts:RepresentationTermName>
<ccts:PrimitiveType>string</ccts:PrimitiveType>
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="encodingCode" type="xsd:normalizedString" use="optional">
<xsd:annotation>
<xsd:documentation xml:lang="en">
<ccts:UniqueID>UNDT000002-SC4</ccts:UniqueID>
<ccts:CategoryCode>SC</ccts:CategoryCode>
<ccts:DictionaryEntryName>Binary Object. Encoding. Code</ccts:DictionaryEntryName>
<ccts:Definition>Specifies the decoding algorithm of the binary object.</ccts:Definition>
<ccts:ObjectClass>Binary Object</ccts:ObjectClass>
<ccts:PropertyTermName>Encoding</ccts:PropertyTermName>
<ccts:RepresentationTermName>Code</ccts:RepresentationTermName>
<ccts:PrimitiveType>string</ccts:PrimitiveType>
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="characterSetCode" type="xsd:normalizedString" use="optional">
<xsd:annotation>
<xsd:documentation xml:lang="en">
<ccts:UniqueID>UNDT000002-SC5</ccts:UniqueID>
<ccts:CategoryCode>SC</ccts:CategoryCode>
<ccts:DictionaryEntryName>Binary Object. Character Set. Code</ccts:DictionaryEntryName>
<ccts:Definition>The character set of the binary object if the mime type is text.
</ccts:Definition>
<ccts:ObjectClass>Binary Object</ccts:ObjectClass>
<ccts:PropertyTermName>Character Set</ccts:PropertyTermName>
<ccts:RepresentationTermName>Code</ccts:RepresentationTermName>
<ccts:PrimitiveType>string</ccts:PrimitiveType>
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="uri" type="xsd:anyURI" use="optional">
<xsd:annotation>
<xsd:documentation xml:lang="en">
<ccts:UniqueID>UNDT000002-SC6</ccts:UniqueID>
<ccts:CategoryCode>SC</ccts:CategoryCode>
<ccts:DictionaryEntryName>Binary Object. Uniform Resource. Identifier
</ccts:DictionaryEntryName>
<ccts:Definition>The Uniform Resource Identifier that identifies where the binary object is
located.
</ccts:Definition>
<ccts:ObjectClass>Binary Object</ccts:ObjectClass>
<ccts:PropertyTermName>Uniform Resource Identifier</ccts:PropertyTermName>
<ccts:RepresentationTermName>Identifier</ccts:RepresentationTermName>
<ccts:PrimitiveType>string</ccts:PrimitiveType>
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="filename" type="xsd:string" use="optional">
<xsd:annotation>
<xsd:documentation xml:lang="en">
<ccts:UniqueID>UNDT000002-SC7</ccts:UniqueID>
<ccts:CategoryCode>SC</ccts:CategoryCode>
<ccts:DictionaryEntryName>Binary Object. Filename.Text</ccts:DictionaryEntryName>
<ccts:Definition>The filename of the binary object.</ccts:Definition>
<ccts:ObjectClass>Binary Object</ccts:ObjectClass>
<ccts:PropertyTermName>Filename</ccts:PropertyTermName>
<ccts:RepresentationTermName>Text</ccts:RepresentationTermName>
<ccts:PrimitiveType>string</ccts:PrimitiveType>
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
</xsd:extension>
</xsd:simpleContent>
</xsd:complexType>
<!-- ===== CCT: CodeType ===== -->
<!-- =================================================================== -->
<xsd:complexType name="CodeType">
<xsd:annotation>
<xsd:documentation xml:lang="en">
<ccts:UniqueID>UNDT000007</ccts:UniqueID>
<ccts:CategoryCode>CCT</ccts:CategoryCode>
<ccts:DictionaryEntryName>Code. Type</ccts:DictionaryEntryName>
<ccts:VersionID>1.0</ccts:VersionID>
<ccts:Definition>A character string (letters, figures, or symbols) that for brevity and/or languange
independence may be used to represent or replace a definitive value or text of an attribute together
with relevant supplementary information.
</ccts:Definition>
<ccts:RepresentationTermName>Code</ccts:RepresentationTermName>
<ccts:PrimitiveType>string</ccts:PrimitiveType>
<ccts:UsageRule>Should not be used if the character string identifies an instance of an object class or
an object in the real world, in which case the Identifier. Type should be used.
</ccts:UsageRule>
</xsd:documentation>
</xsd:annotation>
<xsd:simpleContent>
<xsd:extension base="xsd:normalizedString">
<xsd:attribute name="listID" type="xsd:normalizedString" use="optional">
<xsd:annotation>
<xsd:documentation xml:lang="en">
<ccts:UniqueID>UNDT000007-SC2</ccts:UniqueID>
<ccts:CategoryCode>SC</ccts:CategoryCode>
<ccts:DictionaryEntryName>Code List. Identifier</ccts:DictionaryEntryName>
<ccts:Definition>The identification of a list of codes.</ccts:Definition>
<ccts:ObjectClass>Code List</ccts:ObjectClass>
<ccts:PropertyTermName>Identification</ccts:PropertyTermName>
<ccts:RepresentationTermName>Identifier</ccts:RepresentationTermName>
<ccts:PrimitiveType>string</ccts:PrimitiveType>
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="listAgencyID" type="xsd:normalizedString" use="optional">
<xsd:annotation>
<xsd:documentation xml:lang="en">
<ccts:UniqueID>UNDT000007-SC3</ccts:UniqueID>
<ccts:CategoryCode>SC</ccts:CategoryCode>
<ccts:DictionaryEntryName>Code List. Agency. Identifier</ccts:DictionaryEntryName>
<ccts:Definition>An agency that maintains one or more lists of codes.</ccts:Definition>
<ccts:ObjectClass>Code List</ccts:ObjectClass>
<ccts:PropertyTermName>Agency</ccts:PropertyTermName>
<ccts:RepresentationTermName>Identifier</ccts:RepresentationTermName>
<ccts:PrimitiveType>string</ccts:PrimitiveType>
<ccts:UsageRule>Defaults to the UN/EDIFACT data element 3055 code list.</ccts:UsageRule>
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="listAgencyName" type="xsd:string" use="optional">
<xsd:annotation>
<xsd:documentation xml:lang="en">
<ccts:UniqueID>UNDT000007-SC4</ccts:UniqueID>
<ccts:CategoryCode>SC</ccts:CategoryCode>
<ccts:DictionaryEntryName>Code List. Agency Name. Text</ccts:DictionaryEntryName>
<ccts:Definition>The name of the agency that maintains the list of codes.</ccts:Definition>
<ccts:ObjectClass>Code List</ccts:ObjectClass>
<ccts:PropertyTermName>Agency Name</ccts:PropertyTermName>
<ccts:RepresentationTermName>Text</ccts:RepresentationTermName>
<ccts:PrimitiveType>string</ccts:PrimitiveType>
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="listName" type="xsd:string" use="optional">
<xsd:annotation>
<xsd:documentation xml:lang="en">
<ccts:UniqueID>UNDT000007-SC5</ccts:UniqueID>
<ccts:CategoryCode>SC</ccts:CategoryCode>
<ccts:DictionaryEntryName>Code List. Name. Text</ccts:DictionaryEntryName>
<ccts:Definition>The name of a list of codes.</ccts:Definition>
<ccts:ObjectClass>Code List</ccts:ObjectClass>
<ccts:PropertyTermName>Name</ccts:PropertyTermName>
<ccts:RepresentationTermName>Text</ccts:RepresentationTermName>
<ccts:PrimitiveType>string</ccts:PrimitiveType>
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="listVersionID" type="xsd:normalizedString" use="optional">
<xsd:annotation>
<xsd:documentation xml:lang="en">
<ccts:UniqueID>UNDT000007-SC6</ccts:UniqueID>
<ccts:CategoryCode>SC</ccts:CategoryCode>
<ccts:DictionaryEntryName>Code List. Version. Identifier</ccts:DictionaryEntryName>
<ccts:Definition>The version of the list of codes.</ccts:Definition>
<ccts:ObjectClass>Code List</ccts:ObjectClass>
<ccts:PropertyTermName>Version</ccts:PropertyTermName>
<ccts:RepresentationTermName>Identifier</ccts:RepresentationTermName>
<ccts:PrimitiveType>string</ccts:PrimitiveType>
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="name" type="xsd:string" use="optional">
<xsd:annotation>
<xsd:documentation xml:lang="en">
<ccts:UniqueID>UNDT000007-SC7</ccts:UniqueID>
<ccts:CategoryCode>SC</ccts:CategoryCode>
<ccts:DictionaryEntryName>Code. Name. Text</ccts:DictionaryEntryName>
<ccts:Definition>The textual equivalent of the code content component.</ccts:Definition>
<ccts:ObjectClass>Code</ccts:ObjectClass>
<ccts:PropertyTermName>Name</ccts:PropertyTermName>
<ccts:RepresentationTermName>Text</ccts:RepresentationTermName>
<ccts:PrimitiveType>string</ccts:PrimitiveType>
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="languageID" type="xsd:language" use="optional">
<xsd:annotation>
<xsd:documentation xml:lang="en">
<ccts:UniqueID>UNDT000007-SC8</ccts:UniqueID>
<ccts:CategoryCode>SC</ccts:CategoryCode>
<ccts:DictionaryEntryName>Language. Identifier</ccts:DictionaryEntryName>
<ccts:Definition>The identifier of the language used in the code name.</ccts:Definition>
<ccts:ObjectClass>Language</ccts:ObjectClass>
<ccts:PropertyTermName>Identification</ccts:PropertyTermName>
<ccts:RepresentationTermName>Identifier</ccts:RepresentationTermName>
<ccts:PrimitiveType>string</ccts:PrimitiveType>
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="listURI" type="xsd:anyURI" use="optional">
<xsd:annotation>
<xsd:documentation xml:lang="en">
<ccts:UniqueID>UNDT000007-SC9</ccts:UniqueID>
<ccts:CategoryCode>SC</ccts:CategoryCode>
<ccts:DictionaryEntryName>Code List. Uniform Resource. Identifier</ccts:DictionaryEntryName>
<ccts:Definition>The Uniform Resource Identifier that identifies where the code list is
located.
</ccts:Definition>
<ccts:ObjectClass>Code List</ccts:ObjectClass>
<ccts:PropertyTermName>Uniform Resource Identifier</ccts:PropertyTermName>
<ccts:RepresentationTermName>Identifier</ccts:RepresentationTermName>
<ccts:PrimitiveType>string</ccts:PrimitiveType>
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="listSchemeURI" type="xsd:anyURI" use="optional">
<xsd:annotation>
<xsd:documentation xml:lang="en">
<ccts:UniqueID>UNDT000007-SC10</ccts:UniqueID>
<ccts:CategoryCode>SC</ccts:CategoryCode>
<ccts:DictionaryEntryName>Code List Scheme. Uniform Resource. Identifier
</ccts:DictionaryEntryName>
<ccts:Definition>The Uniform Resource Identifier that identifies where the code list scheme
is located.
</ccts:Definition>
<ccts:ObjectClass>Code List Scheme</ccts:ObjectClass>
<ccts:PropertyTermName>Uniform Resource Identifier</ccts:PropertyTermName>
<ccts:RepresentationTermName>Identifier</ccts:RepresentationTermName>
<ccts:PrimitiveType>string</ccts:PrimitiveType>
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
</xsd:extension>
</xsd:simpleContent>
</xsd:complexType>
<!-- ===== CCT: DateTimeType ===== -->
<!-- =================================================================== -->
<xsd:complexType name="DateTimeType">
<xsd:annotation>
<xsd:documentation xml:lang="en">
<ccts:UniqueID>UNDT000008</ccts:UniqueID>
<ccts:CategoryCode>CCT</ccts:CategoryCode>
<ccts:DictionaryEntryName>Date Time. Type</ccts:DictionaryEntryName>
<ccts:VersionID>1.0</ccts:VersionID>
<ccts:Definition>A particular point in the progression of time together with the relevant supplementary
information.
</ccts:Definition>
<ccts:RepresentationTermName>Date Time</ccts:RepresentationTermName>
<ccts:PrimitiveType>string</ccts:PrimitiveType>
<ccts:UsageRule>Can be used for a date and/or time.</ccts:UsageRule>
</xsd:documentation>
</xsd:annotation>
<xsd:simpleContent>
<xsd:extension base="xsd:string">
<xsd:attribute name="format" type="xsd:string" use="optional">
<xsd:annotation>
<xsd:documentation xml:lang="en">
<ccts:UniqueID>UNDT000008-SC1</ccts:UniqueID>
<ccts:CategoryCode>SC</ccts:CategoryCode>
<ccts:DictionaryEntryName>Date Time. Format. Text</ccts:DictionaryEntryName>
<ccts:Definition>The format of the date time content</ccts:Definition>
<ccts:ObjectClass>Date Time</ccts:ObjectClass>
<ccts:PropertyTermName>Format</ccts:PropertyTermName>
<ccts:RepresentationTermName>Text</ccts:RepresentationTermName>
<ccts:PrimitiveType>string</ccts:PrimitiveType>
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
</xsd:extension>
</xsd:simpleContent>
</xsd:complexType>
<!-- ===== CCT: IdentifierType ===== -->
<!-- =================================================================== -->
<xsd:complexType name="IdentifierType">
<xsd:annotation>
<xsd:documentation xml:lang="en">
<ccts:UniqueID>UNDT000011</ccts:UniqueID>
<ccts:CategoryCode>CCT</ccts:CategoryCode>
<ccts:DictionaryEntryName>Identifier. Type</ccts:DictionaryEntryName>
<ccts:VersionID>1.0</ccts:VersionID>
<ccts:Definition>A character string to identify and distinguish uniquely, one instance of an object in
an identification scheme from all other objects in the same scheme together with relevant
supplementary information.
</ccts:Definition>
<ccts:RepresentationTermName>Identifier</ccts:RepresentationTermName>
<ccts:PrimitiveType>string</ccts:PrimitiveType>
</xsd:documentation>
</xsd:annotation>
<xsd:simpleContent>
<xsd:extension base="xsd:normalizedString">
<xsd:attribute name="schemeID" type="xsd:normalizedString" use="optional">
<xsd:annotation>
<xsd:documentation xml:lang="en">
<ccts:UniqueID>UNDT000011-SC2</ccts:UniqueID>
<ccts:CategoryCode>SC</ccts:CategoryCode>
<ccts:DictionaryEntryName>Identification Scheme. Identifier</ccts:DictionaryEntryName>
<ccts:Definition>The identification of the identification scheme.</ccts:Definition>
<ccts:ObjectClass>Identification Scheme</ccts:ObjectClass>
<ccts:PropertyTermName>Identification</ccts:PropertyTermName>
<ccts:RepresentationTermName>Identifier</ccts:RepresentationTermName>
<ccts:PrimitiveType>string</ccts:PrimitiveType>
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="schemeName" type="xsd:string" use="optional">
<xsd:annotation>
<xsd:documentation xml:lang="en">
<ccts:UniqueID>UNDT000011-SC3</ccts:UniqueID>
<ccts:CategoryCode>SC</ccts:CategoryCode>
<ccts:DictionaryEntryName>Identification Scheme. Name. Text</ccts:DictionaryEntryName>
<ccts:Definition>The name of the identification scheme.</ccts:Definition>
<ccts:ObjectClass>Identification Scheme</ccts:ObjectClass>
<ccts:PropertyTermName>Name</ccts:PropertyTermName>
<ccts:RepresentationTermName>Text</ccts:RepresentationTermName>
<ccts:PrimitiveType>string</ccts:PrimitiveType>
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="schemeAgencyID" type="xsd:normalizedString" use="optional">
<xsd:annotation>
<xsd:documentation xml:lang="en">
<ccts:UniqueID>UNDT000011-SC4</ccts:UniqueID>
<ccts:CategoryCode>SC</ccts:CategoryCode>
<ccts:DictionaryEntryName>Identification Scheme Agency. Identifier
</ccts:DictionaryEntryName>
<ccts:Definition>The identification of the agency that maintains the identification
scheme.
</ccts:Definition>
<ccts:ObjectClass>Identification Scheme Agency</ccts:ObjectClass>
<ccts:PropertyTermName>Identification</ccts:PropertyTermName>
<ccts:RepresentationTermName>Identifier</ccts:RepresentationTermName>
<ccts:PrimitiveType>string</ccts:PrimitiveType>
<ccts:UsageRule>Defaults to the UN/EDIFACT data element 3055 code list.</ccts:UsageRule>
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="schemeAgencyName" type="xsd:string" use="optional">
<xsd:annotation>
<xsd:documentation xml:lang="en">
<ccts:UniqueID>UNDT000011-SC5</ccts:UniqueID>
<ccts:CategoryCode>SC</ccts:CategoryCode>
<ccts:DictionaryEntryName>Identification Scheme Agency. Name. Text
</ccts:DictionaryEntryName>
<ccts:Definition>The name of the agency that maintains the identification scheme.
</ccts:Definition>
<ccts:ObjectClass>Identification Scheme Agency</ccts:ObjectClass>
<ccts:PropertyTermName>Agency Name</ccts:PropertyTermName>
<ccts:RepresentationTermName>Text</ccts:RepresentationTermName>
<ccts:PrimitiveType>string</ccts:PrimitiveType>
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="schemeVersionID" type="xsd:normalizedString" use="optional">
<xsd:annotation>
<xsd:documentation xml:lang="en">
<ccts:UniqueID>UNDT000011-SC6</ccts:UniqueID>
<ccts:CategoryCode>SC</ccts:CategoryCode>
<ccts:DictionaryEntryName>Identification Scheme. Version. Identifier
</ccts:DictionaryEntryName>
<ccts:Definition>The version of the identification scheme.</ccts:Definition>
<ccts:ObjectClass>Identification Scheme</ccts:ObjectClass>
<ccts:PropertyTermName>Version</ccts:PropertyTermName>
<ccts:RepresentationTermName>Identifier</ccts:RepresentationTermName>
<ccts:PrimitiveType>string</ccts:PrimitiveType>
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="schemeDataURI" type="xsd:anyURI" use="optional">
<xsd:annotation>
<xsd:documentation xml:lang="en">
<ccts:UniqueID>UNDT000011-SC7</ccts:UniqueID>
<ccts:CategoryCode>SC</ccts:CategoryCode>
<ccts:DictionaryEntryName>Identification Scheme Data. Uniform Resource. Identifier
</ccts:DictionaryEntryName>
<ccts:Definition>The Uniform Resource Identifier that identifies where the identification
scheme data is located.
</ccts:Definition>
<ccts:ObjectClass>Identification Scheme Data</ccts:ObjectClass>
<ccts:PropertyTermName>Uniform Resource Identifier</ccts:PropertyTermName>
<ccts:RepresentationTermName>Identifier</ccts:RepresentationTermName>
<ccts:PrimitiveType>string</ccts:PrimitiveType>
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="schemeURI" type="xsd:anyURI" use="optional">
<xsd:annotation>
<xsd:documentation xml:lang="en">
<ccts:UniqueID>UNDT000011-SC8</ccts:UniqueID>
<ccts:CategoryCode>SC</ccts:CategoryCode>
<ccts:DictionaryEntryName>Identification Scheme. Uniform Resource. Identifier
</ccts:DictionaryEntryName>
<ccts:Definition>The Uniform Resource Identifier that identifies where the identification
scheme is located.
</ccts:Definition>
<ccts:ObjectClass>Identification Scheme</ccts:ObjectClass>
<ccts:PropertyTermName>Uniform Resource Identifier</ccts:PropertyTermName>
<ccts:RepresentationTermName>Identifier</ccts:RepresentationTermName>
<ccts:PrimitiveType>string</ccts:PrimitiveType>
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
</xsd:extension>
</xsd:simpleContent>
</xsd:complexType>
<!-- ===== CCT: IndicatorType ===== -->
<!-- =================================================================== -->
<xsd:complexType name="IndicatorType">
<xsd:annotation>
<xsd:documentation xml:lang="en">
<ccts:UniqueID>UNDT000012</ccts:UniqueID>
<ccts:CategoryCode>CCT</ccts:CategoryCode>
<ccts:DictionaryEntryName>Indicator. Type</ccts:DictionaryEntryName>
<ccts:VersionID>1.0</ccts:VersionID>
<ccts:Definition>A list of two mutually exclusive Boolean values that express the only possible states
of a Property.
</ccts:Definition>
<ccts:RepresentationTermName>Indicator</ccts:RepresentationTermName>
<ccts:PrimitiveType>string</ccts:PrimitiveType>
</xsd:documentation>
</xsd:annotation>
<xsd:simpleContent>
<xsd:extension base="xsd:string">
<xsd:attribute name="format" type="xsd:string" use="optional">
<xsd:annotation>
<xsd:documentation xml:lang="en">
<ccts:UniqueID>UNDT000012-SC2</ccts:UniqueID>
<ccts:CategoryCode>SC</ccts:CategoryCode>
<ccts:DictionaryEntryName>Indicator. Format. Text</ccts:DictionaryEntryName>
<ccts:Definition>Whether the indicator is numeric, textual or binary.</ccts:Definition>
<ccts:ObjectClass>Indicator</ccts:ObjectClass>
<ccts:PropertyTermName>Format</ccts:PropertyTermName>
<ccts:RepresentationTermName>Text</ccts:RepresentationTermName>
<ccts:PrimitiveType>string</ccts:PrimitiveType>
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
</xsd:extension>
</xsd:simpleContent>
</xsd:complexType>
<!-- ===== CCT: MeasureType ===== -->
<!-- =================================================================== -->
<xsd:complexType name="MeasureType">
<xsd:annotation>
<xsd:documentation xml:lang="en">
<ccts:UniqueID>UNDT000013</ccts:UniqueID>
<ccts:CategoryCode>CCT</ccts:CategoryCode>
<ccts:DictionaryEntryName>Measure. Type</ccts:DictionaryEntryName>
<ccts:VersionID>1.0</ccts:VersionID>
<ccts:Definition>A numeric value determined by measuring an object along with the specified unit of
measure.
</ccts:Definition>
<ccts:RepresentationTermName>Measure</ccts:RepresentationTermName>
<ccts:PrimitiveType>decimal</ccts:PrimitiveType>
</xsd:documentation>
</xsd:annotation>
<xsd:simpleContent>
<xsd:extension base="xsd:decimal">
<xsd:attribute name="unitCode" type="xsd:normalizedString" use="optional">
<xsd:annotation>
<xsd:documentation xml:lang="en">
<ccts:UniqueID>UNDT000013-SC2</ccts:UniqueID>
<ccts:CategoryCode>SC</ccts:CategoryCode>
<ccts:DictionaryEntryName>Measure Unit. Code</ccts:DictionaryEntryName>
<ccts:Definition>The type of unit of measure.</ccts:Definition>
<ccts:ObjectClass>Measure Unit</ccts:ObjectClass>
<ccts:PropertyTermName>Code</ccts:PropertyTermName>
<ccts:RepresentationTermName>Code</ccts:RepresentationTermName>
<ccts:PrimitiveType>string</ccts:PrimitiveType>
<ccts:UsageRule>Reference UNECE Rec. 20 and X12 355</ccts:UsageRule>
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="unitCodeListVersionID" type="xsd:normalizedString" use="optional">
<xsd:annotation>
<xsd:documentation xml:lang="en">
<ccts:UniqueID>UNDT000013-SC3</ccts:UniqueID>
<ccts:CategoryCode>SC</ccts:CategoryCode>
<ccts:DictionaryEntryName>Measure Unit. Code List Version. Identifier
</ccts:DictionaryEntryName>
<ccts:Definition>The version of the measure unit code list.</ccts:Definition>
<ccts:ObjectClass>Measure Unit</ccts:ObjectClass>
<ccts:PropertyTermName>Code List Version</ccts:PropertyTermName>
<ccts:RepresentationTermName>Identifier</ccts:RepresentationTermName>
<ccts:PrimitiveType>string</ccts:PrimitiveType>
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
</xsd:extension>
</xsd:simpleContent>
</xsd:complexType>
<!-- ===== CCT: NumericType ===== -->
<!-- =================================================================== -->
<xsd:complexType name="NumericType">
<xsd:annotation>
<xsd:documentation xml:lang="en">
<ccts:UniqueID>UNDT000014</ccts:UniqueID>
<ccts:CategoryCode>CCT</ccts:CategoryCode>
<ccts:DictionaryEntryName>Numeric. Type</ccts:DictionaryEntryName>
<ccts:VersionID>1.0</ccts:VersionID>
<ccts:Definition>Numeric information that is assigned or is determined by calculation, counting, or
sequencing. It does not require a unit of quantity or unit of measure.
</ccts:Definition>
<ccts:RepresentationTermName>Numeric</ccts:RepresentationTermName>
<ccts:PrimitiveType>string</ccts:PrimitiveType>
</xsd:documentation>
</xsd:annotation>
<xsd:simpleContent>
<xsd:extension base="xsd:decimal">
<xsd:attribute name="format" type="xsd:string" use="optional">
<xsd:annotation>
<xsd:documentation xml:lang="en">
<ccts:UniqueID>UNDT000014-SC2</ccts:UniqueID>
<ccts:CategoryCode>SC</ccts:CategoryCode>
<ccts:DictionaryEntryName>Numeric. Format. Text</ccts:DictionaryEntryName>
<ccts:Definition>Whether the number is an integer, decimal, real number or percentage.
</ccts:Definition>
<ccts:ObjectClass>Numeric</ccts:ObjectClass>
<ccts:PropertyTermName>Format</ccts:PropertyTermName>
<ccts:RepresentationTermName>Text</ccts:RepresentationTermName>
<ccts:PrimitiveType>string</ccts:PrimitiveType>
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
</xsd:extension>
</xsd:simpleContent>
</xsd:complexType>
<!-- ===== CCT: QuantityType ===== -->
<!-- =================================================================== -->
<xsd:complexType name="QuantityType">
<xsd:annotation>
<xsd:documentation xml:lang="en">
<ccts:UniqueID>UNDT000018</ccts:UniqueID>
<ccts:CategoryCode>CCT</ccts:CategoryCode>
<ccts:DictionaryEntryName>Quantity. Type</ccts:DictionaryEntryName>
<ccts:VersionID>1.0</ccts:VersionID>
<ccts:Definition>A counted number of non-monetary units possibly including fractions.</ccts:Definition>
<ccts:RepresentationTermName>Quantity</ccts:RepresentationTermName>
<ccts:PrimitiveType>decimal</ccts:PrimitiveType>
</xsd:documentation>
</xsd:annotation>
<xsd:simpleContent>
<xsd:extension base="xsd:decimal">
<xsd:attribute name="unitCode" type="xsd:normalizedString" use="optional">
<xsd:annotation>
<xsd:documentation xml:lang="en">
<ccts:UniqueID>UNDT000018-SC2</ccts:UniqueID>
<ccts:CategoryCode>SC</ccts:CategoryCode>
<ccts:DictionaryEntryName>Quantity. Unit. Code</ccts:DictionaryEntryName>
<ccts:Definition>The unit of the quantity</ccts:Definition>
<ccts:ObjectClass>Quantity</ccts:ObjectClass>
<ccts:PropertyTermName>Unit Code</ccts:PropertyTermName>
<ccts:RepresentationTermName>Code</ccts:RepresentationTermName>
<ccts:PrimitiveType>string</ccts:PrimitiveType>
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="unitCodeListID" type="xsd:normalizedString" use="optional">
<xsd:annotation>
<xsd:documentation xml:lang="en">
<ccts:UniqueID>UNDT000018-SC3</ccts:UniqueID>
<ccts:CategoryCode>SC</ccts:CategoryCode>
<ccts:DictionaryEntryName>Quantity Unit. Code List. Identifier</ccts:DictionaryEntryName>
<ccts:Definition>The quantity unit code list.</ccts:Definition>
<ccts:ObjectClass>Quantity Unit</ccts:ObjectClass>
<ccts:PropertyTermName>Code List</ccts:PropertyTermName>
<ccts:RepresentationTermName>Identifier</ccts:RepresentationTermName>
<ccts:PrimitiveType>string</ccts:PrimitiveType>
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="unitCodeListAgencyID" type="xsd:normalizedString" use="optional">
<xsd:annotation>
<xsd:documentation xml:lang="en">
<ccts:UniqueID>UNDT000018-SC4</ccts:UniqueID>
<ccts:CategoryCode>SC</ccts:CategoryCode>
<ccts:DictionaryEntryName>Quantity Unit. Code List Agency. Identifier
</ccts:DictionaryEntryName>
<ccts:Definition>The identification of the agency that maintains the quantity unit code
list
</ccts:Definition>
<ccts:ObjectClass>Quantity Unit</ccts:ObjectClass>
<ccts:PropertyTermName>Code List Agency</ccts:PropertyTermName>
<ccts:RepresentationTermName>Identifier</ccts:RepresentationTermName>
<ccts:PrimitiveType>string</ccts:PrimitiveType>
<ccts:UsageRule>Defaults to the UN/EDIFACT data element 3055 code list.</ccts:UsageRule>
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="unitCodeListAgencyName" type="xsd:string" use="optional">
<xsd:annotation>
<xsd:documentation xml:lang="en">
<ccts:UniqueID>UNDT000018-SC5</ccts:UniqueID>
<ccts:CategoryCode>SC</ccts:CategoryCode>
<ccts:DictionaryEntryName>Quantity Unit. Code List Agency Name. Text
</ccts:DictionaryEntryName>
<ccts:Definition>The name of the agency which maintains the quantity unit code list.
</ccts:Definition>
<ccts:ObjectClass>Quantity Unit</ccts:ObjectClass>
<ccts:PropertyTermName>Code List Agency Name</ccts:PropertyTermName>
<ccts:RepresentationTermName>Text</ccts:RepresentationTermName>
<ccts:PrimitiveType>string</ccts:PrimitiveType>
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
</xsd:extension>
</xsd:simpleContent>
</xsd:complexType>
<!-- ===== CCT: TextType ===== -->
<!-- =================================================================== -->
<xsd:complexType name="TextType">
<xsd:annotation>
<xsd:documentation xml:lang="en">
<ccts:UniqueID>UNDT000019</ccts:UniqueID>
<ccts:CategoryCode>CCT</ccts:CategoryCode>
<ccts:DictionaryEntryName>Text. Type</ccts:DictionaryEntryName>
<ccts:VersionID>1.0</ccts:VersionID>
<ccts:Definition>A character string (i.e. a finite set of characters) generally in the form of words of
a language.
</ccts:Definition>
<ccts:RepresentationTermName>Text</ccts:RepresentationTermName>
<ccts:PrimitiveType>string</ccts:PrimitiveType>
</xsd:documentation>
</xsd:annotation>
<xsd:simpleContent>
<xsd:extension base="xsd:string">
<xsd:attribute name="languageID" type="xsd:language" use="optional">
<xsd:annotation>
<xsd:documentation xml:lang="en">
<ccts:UniqueID>UNDT000019-SC2</ccts:UniqueID>
<ccts:CategoryCode>SC</ccts:CategoryCode>
<ccts:DictionaryEntryName>Language. Identifier</ccts:DictionaryEntryName>
<ccts:Definition>The identifier of the language used in the content component.
</ccts:Definition>
<ccts:ObjectClass>Language</ccts:ObjectClass>
<ccts:PropertyTermName>Identification</ccts:PropertyTermName>
<ccts:RepresentationTermName>Identifier</ccts:RepresentationTermName>
<ccts:PrimitiveType>string</ccts:PrimitiveType>
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="languageLocaleID" type="xsd:normalizedString" use="optional">
<xsd:annotation>
<xsd:documentation xml:lang="en">
<ccts:UniqueID>UNDT000019-SC3</ccts:UniqueID>
<ccts:CategoryCode>SC</ccts:CategoryCode>
<ccts:DictionaryEntryName>Language. Locale. Identifier</ccts:DictionaryEntryName>
<ccts:Definition>The identification of the locale of the language.</ccts:Definition>
<ccts:ObjectClass>Language</ccts:ObjectClass>
<ccts:PropertyTermName>Locale</ccts:PropertyTermName>
<ccts:RepresentationTermName>Identifier</ccts:RepresentationTermName>
<ccts:PrimitiveType>string</ccts:PrimitiveType>
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
</xsd:extension>
</xsd:simpleContent>
</xsd:complexType>
</xsd:schema>

View file

@ -1,235 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Licensed to the Koordinierungsstelle für IT-Standards (KoSIT) under
~ one or more contributor license agreements. See the NOTICE file
~ distributed with this work for additional information
~ regarding copyright ownership. KoSIT licenses this file
~ to you under the Apache License, Version 2.0 (the
~ "License"); you may not use this file except in compliance
~ with the License. You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing,
~ software distributed under the License is distributed on an
~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
~ KIND, either express or implied. See the License for the
~ specific language governing permissions and limitations
~ under the License.
-->
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2"
xmlns:udt="urn:oasis:names:specification:ubl:schema:xsd:UnqualifiedDataTypes-2"
xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonExtensionComponents-2"
targetNamespace="urn:oasis:names:specification:ubl:schema:xsd:CommonExtensionComponents-2"
elementFormDefault="qualified" attributeFormDefault="unqualified"
version="2.1">
<!-- ===== Imports ===== -->
<xsd:import namespace="urn:oasis:names:specification:ubl:schema:xsd:UnqualifiedDataTypes-2"
schemaLocation="UBL-UnqualifiedDataTypes-2.1.xsd"/>
<xsd:import namespace="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2"
schemaLocation="UBL-CommonBasicComponents-2.1.xsd"/>
<!-- ===== Includes ===== -->
<xsd:include schemaLocation="UBL-ExtensionContentDataType-2.1.xsd"/>
<!-- ===== Aggregate Element and Type Declarations ===== -->
<xsd:element name="UBLExtensions" type="UBLExtensionsType">
<xsd:annotation>
<xsd:documentation>
A container for all extensions present in the document.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:complexType name="UBLExtensionsType">
<xsd:annotation>
<xsd:documentation>
A container for all extensions present in the document.
</xsd:documentation>
</xsd:annotation>
<xsd:sequence>
<xsd:element ref="UBLExtension" minOccurs="1" maxOccurs="unbounded">
<xsd:annotation>
<xsd:documentation>
A single extension for private use.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
<xsd:element name="UBLExtension" type="UBLExtensionType">
<xsd:annotation>
<xsd:documentation>
A single extension for private use.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:complexType name="UBLExtensionType">
<xsd:annotation>
<xsd:documentation>
A single extension for private use.
</xsd:documentation>
</xsd:annotation>
<xsd:sequence>
<xsd:element ref="cbc:ID" minOccurs="0" maxOccurs="1">
<xsd:annotation>
<xsd:documentation>
An identifier for the Extension assigned by the creator of the extension.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element ref="cbc:Name" minOccurs="0" maxOccurs="1">
<xsd:annotation>
<xsd:documentation>
A name for the Extension assigned by the creator of the extension.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element ref="ExtensionAgencyID" minOccurs="0" maxOccurs="1">
<xsd:annotation>
<xsd:documentation>
An agency that maintains one or more Extensions.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element ref="ExtensionAgencyName" minOccurs="0" maxOccurs="1">
<xsd:annotation>
<xsd:documentation>
The name of the agency that maintains the Extension.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element ref="ExtensionVersionID" minOccurs="0" maxOccurs="1">
<xsd:annotation>
<xsd:documentation>
The version of the Extension.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element ref="ExtensionAgencyURI" minOccurs="0" maxOccurs="1">
<xsd:annotation>
<xsd:documentation>
A URI for the Agency that maintains the Extension.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element ref="ExtensionURI" minOccurs="0" maxOccurs="1">
<xsd:annotation>
<xsd:documentation>
A URI for the Extension.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element ref="ExtensionReasonCode" minOccurs="0" maxOccurs="1">
<xsd:annotation>
<xsd:documentation>
A code for reason the Extension is being included.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element ref="ExtensionReason" minOccurs="0" maxOccurs="1">
<xsd:annotation>
<xsd:documentation>
A description of the reason for the Extension.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element ref="ExtensionContent" minOccurs="1" maxOccurs="1">
<xsd:annotation>
<xsd:documentation>
The definition of the extension content.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
<!-- ===== Basic Element and Type Declarations ===== -->
<xsd:element name="ExtensionAgencyID" type="ExtensionAgencyIDType"/>
<xsd:element name="ExtensionAgencyName" type="ExtensionAgencyNameType"/>
<xsd:element name="ExtensionAgencyURI" type="ExtensionAgencyURIType"/>
<xsd:element name="ExtensionContent" type="ExtensionContentType"/>
<xsd:element name="ExtensionReason" type="ExtensionReasonType"/>
<xsd:element name="ExtensionReasonCode" type="ExtensionReasonCodeType"/>
<xsd:element name="ExtensionURI" type="ExtensionURIType"/>
<xsd:element name="ExtensionVersionID" type="ExtensionVersionIDType"/>
<xsd:complexType name="ExtensionAgencyIDType">
<xsd:simpleContent>
<xsd:extension base="udt:IdentifierType"/>
</xsd:simpleContent>
</xsd:complexType>
<xsd:complexType name="ExtensionAgencyNameType">
<xsd:simpleContent>
<xsd:extension base="udt:TextType"/>
</xsd:simpleContent>
</xsd:complexType>
<xsd:complexType name="ExtensionAgencyURIType">
<xsd:simpleContent>
<xsd:extension base="udt:IdentifierType"/>
</xsd:simpleContent>
</xsd:complexType>
<xsd:complexType name="ExtensionReasonType">
<xsd:simpleContent>
<xsd:extension base="udt:TextType"/>
</xsd:simpleContent>
</xsd:complexType>
<xsd:complexType name="ExtensionReasonCodeType">
<xsd:simpleContent>
<xsd:extension base="udt:CodeType"/>
</xsd:simpleContent>
</xsd:complexType>
<xsd:complexType name="ExtensionURIType">
<xsd:simpleContent>
<xsd:extension base="udt:IdentifierType"/>
</xsd:simpleContent>
</xsd:complexType>
<xsd:complexType name="ExtensionVersionIDType">
<xsd:simpleContent>
<xsd:extension base="udt:IdentifierType"/>
</xsd:simpleContent>
</xsd:complexType>
</xsd:schema>
<!-- ===== Copyright Notice ===== -->
<!--
OASIS takes no position regarding the validity or scope of any
intellectual property or other rights that might be claimed to pertain
to the implementation or use of the technology described in this
document or the extent to which any license under such rights
might or might not be available; neither does it represent that it has
made any effort to identify any such rights. Information on OASIS's
procedures with respect to rights in OASIS specifications can be
found at the OASIS website. Copies of claims of rights made
available for publication and any assurances of licenses to be made
available, or the result of an attempt made to obtain a general
license or permission for the use of such proprietary rights by
implementors or users of this specification, can be obtained from
the OASIS Executive Director.
OASIS invites any interested party to bring to its attention any
copyrights, patents or patent applications, or other proprietary
rights which may cover technology that may be required to
implement this specification. Please address the information to the
OASIS Executive Director.
This document and translations of it may be copied and furnished to
others, and derivative works that comment on or otherwise explain
it or assist in its implementation may be prepared, copied,
published and distributed, in whole or in part, without restriction of
any kind, provided that the above copyright notice and this
paragraph are included on all such copies and derivative works.
However, this document itself may not be modified in any way,
such as by removing the copyright notice or references to OASIS,
except as needed for the purpose of developing OASIS
specifications, in which case the procedures for copyrights defined
in the OASIS Intellectual Property Rights document must be
followed, or as required to translate it into languages other than
English.
The limited permissions granted above are perpetual and will not be
revoked by OASIS or its successors or assigns.
This document and the information contained herein is provided on
an "AS IS" basis and OASIS DISCLAIMS ALL WARRANTIES,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY
WARRANTY THAT THE USE OF THE INFORMATION HEREIN
WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED
WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A
PARTICULAR PURPOSE.
-->

View file

@ -1,81 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Licensed to the Koordinierungsstelle für IT-Standards (KoSIT) under
~ one or more contributor license agreements. See the NOTICE file
~ distributed with this work for additional information
~ regarding copyright ownership. KoSIT licenses this file
~ to you under the Apache License, Version 2.0 (the
~ "License"); you may not use this file except in compliance
~ with the License. You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing,
~ software distributed under the License is distributed on an
~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
~ KIND, either express or implied. See the License for the
~ specific language governing permissions and limitations
~ under the License.
-->
<xsd:schema xmlns:sac="urn:oasis:names:specification:ubl:schema:xsd:SignatureAggregateComponents-2"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonSignatureComponents-2"
targetNamespace="urn:oasis:names:specification:ubl:schema:xsd:CommonSignatureComponents-2"
elementFormDefault="qualified"
attributeFormDefault="unqualified"
version="2.1">
<xsd:import namespace="urn:oasis:names:specification:ubl:schema:xsd:SignatureAggregateComponents-2"
schemaLocation="UBL-SignatureAggregateComponents-2.1.xsd"/>
<xsd:element name="UBLDocumentSignatures" type="UBLDocumentSignaturesType"/>
<xsd:complexType name="UBLDocumentSignaturesType">
<xsd:sequence>
<xsd:element ref="sac:SignatureInformation" minOccurs="1" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
</xsd:schema>
<!-- ===== Copyright Notice ===== --><!--
OASIS takes no position regarding the validity or scope of any
intellectual property or other rights that might be claimed to pertain
to the implementation or use of the technology described in this
document or the extent to which any license under such rights
might or might not be available; neither does it represent that it has
made any effort to identify any such rights. Information on OASIS's
procedures with respect to rights in OASIS specifications can be
found at the OASIS website. Copies of claims of rights made
available for publication and any assurances of licenses to be made
available, or the result of an attempt made to obtain a general
license or permission for the use of such proprietary rights by
implementors or users of this specification, can be obtained from
the OASIS Executive Director.
OASIS invites any interested party to bring to its attention any
copyrights, patents or patent applications, or other proprietary
rights which may cover technology that may be required to
implement this specification. Please address the information to the
OASIS Executive Director.
This document and translations of it may be copied and furnished to
others, and derivative works that comment on or otherwise explain
it or assist in its implementation may be prepared, copied,
published and distributed, in whole or in part, without restriction of
any kind, provided that the above copyright notice and this
paragraph are included on all such copies and derivative works.
However, this document itself may not be modified in any way,
such as by removing the copyright notice or references to OASIS,
except as needed for the purpose of developing OASIS
specifications, in which case the procedures for copyrights defined
in the OASIS Intellectual Property Rights document must be
followed, or as required to translate it into languages other than
English.
The limited permissions granted above are perpetual and will not be
revoked by OASIS or its successors or assigns.
This document and the information contained herein is provided on
an "AS IS" basis and OASIS DISCLAIMS ALL WARRANTIES,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY
WARRANTY THAT THE USE OF THE INFORMATION HEREIN
WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED
WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A
PARTICULAR PURPOSE.
-->

View file

@ -1,73 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Licensed to the Koordinierungsstelle für IT-Standards (KoSIT) under
~ one or more contributor license agreements. See the NOTICE file
~ distributed with this work for additional information
~ regarding copyright ownership. KoSIT licenses this file
~ to you under the Apache License, Version 2.0 (the
~ "License"); you may not use this file except in compliance
~ with the License. You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing,
~ software distributed under the License is distributed on an
~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
~ KIND, either express or implied. See the License for the
~ specific language governing permissions and limitations
~ under the License.
-->
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
targetNamespace="urn:un:unece:uncefact:documentation:2"
xmlns="urn:un:unece:uncefact:documentation:2"
elementFormDefault="qualified"
attributeFormDefault="unqualified"
version="2.1">
</xsd:schema>
<!-- ===== Copyright Notice ===== -->
<!--
OASIS takes no position regarding the validity or scope of any
intellectual property or other rights that might be claimed to pertain
to the implementation or use of the technology described in this
document or the extent to which any license under such rights
might or might not be available; neither does it represent that it has
made any effort to identify any such rights. Information on OASIS's
procedures with respect to rights in OASIS specifications can be
found at the OASIS website. Copies of claims of rights made
available for publication and any assurances of licenses to be made
available, or the result of an attempt made to obtain a general
license or permission for the use of such proprietary rights by
implementors or users of this specification, can be obtained from
the OASIS Executive Director.
OASIS invites any interested party to bring to its attention any
copyrights, patents or patent applications, or other proprietary
rights which may cover technology that may be required to
implement this specification. Please address the information to the
OASIS Executive Director.
This document and translations of it may be copied and furnished to
others, and derivative works that comment on or otherwise explain
it or assist in its implementation may be prepared, copied,
published and distributed, in whole or in part, without restriction of
any kind, provided that the above copyright notice and this
paragraph are included on all such copies and derivative works.
However, this document itself may not be modified in any way,
such as by removing the copyright notice or references to OASIS,
except as needed for the purpose of developing OASIS
specifications, in which case the procedures for copyrights defined
in the OASIS Intellectual Property Rights document must be
followed, or as required to translate it into languages other than
English.
The limited permissions granted above are perpetual and will not be
revoked by OASIS or its successors or assigns.
This document and the information contained herein is provided on
an "AS IS" basis and OASIS DISCLAIMS ALL WARRANTIES,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY
WARRANTY THAT THE USE OF THE INFORMATION HEREIN
WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED
WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A
PARTICULAR PURPOSE.
-->

View file

@ -1,99 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Licensed to the Koordinierungsstelle für IT-Standards (KoSIT) under
~ one or more contributor license agreements. See the NOTICE file
~ distributed with this work for additional information
~ regarding copyright ownership. KoSIT licenses this file
~ to you under the Apache License, Version 2.0 (the
~ "License"); you may not use this file except in compliance
~ with the License. You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing,
~ software distributed under the License is distributed on an
~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
~ KIND, either express or implied. See the License for the
~ specific language governing permissions and limitations
~ under the License.
-->
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns=
"urn:oasis:names:specification:ubl:schema:xsd:CommonExtensionComponents-2"
targetNamespace=
"urn:oasis:names:specification:ubl:schema:xsd:CommonExtensionComponents-2"
elementFormDefault="qualified"
attributeFormDefault="unqualified"
version="2.1">
<!--import here all extension schemas-->
<xsd:import namespace=
"urn:oasis:names:specification:ubl:schema:xsd:CommonSignatureComponents-2"
schemaLocation="UBL-CommonSignatureComponents-2.1.xsd"/>
<!-- ===== Type Declaration ===== -->
<xsd:complexType name="ExtensionContentType">
<xsd:sequence>
<xsd:any namespace="##other" processContents="lax"
minOccurs="1" maxOccurs="1">
<xsd:annotation>
<xsd:documentation>
Any element in any namespace other than the UBL extension
namespace is allowed to be the apex element of an extension.
Only those elements found in the UBL schemas and in the
trees of schemas imported in this module are validated.
Any element for which there is no schema declaration in any
of the trees of schemas passes validation and is not
treated as a schema constraint violation.
</xsd:documentation>
</xsd:annotation>
</xsd:any>
</xsd:sequence>
</xsd:complexType>
</xsd:schema>
<!-- ===== Copyright Notice ===== -->
<!--
OASIS takes no position regarding the validity or scope of any
intellectual property or other rights that might be claimed to pertain
to the implementation or use of the technology described in this
document or the extent to which any license under such rights
might or might not be available; neither does it represent that it has
made any effort to identify any such rights. Information on OASIS's
procedures with respect to rights in OASIS specifications can be
found at the OASIS website. Copies of claims of rights made
available for publication and any assurances of licenses to be made
available, or the result of an attempt made to obtain a general
license or permission for the use of such proprietary rights by
implementors or users of this specification, can be obtained from
the OASIS Executive Director.
OASIS invites any interested party to bring to its attention any
copyrights, patents or patent applications, or other proprietary
rights which may cover technology that may be required to
implement this specification. Please address the information to the
OASIS Executive Director.
This document and translations of it may be copied and furnished to
others, and derivative works that comment on or otherwise explain
it or assist in its implementation may be prepared, copied,
published and distributed, in whole or in part, without restriction of
any kind, provided that the above copyright notice and this
paragraph are included on all such copies and derivative works.
However, this document itself may not be modified in any way,
such as by removing the copyright notice or references to OASIS,
except as needed for the purpose of developing OASIS
specifications, in which case the procedures for copyrights defined
in the OASIS Intellectual Property Rights document must be
followed, or as required to translate it into languages other than
English.
The limited permissions granted above are perpetual and will not be
revoked by OASIS or its successors or assigns.
This document and the information contained herein is provided on
an "AS IS" basis and OASIS DISCLAIMS ALL WARRANTIES,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY
WARRANTY THAT THE USE OF THE INFORMATION HEREIN
WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED
WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A
PARTICULAR PURPOSE.
-->

View file

@ -1,78 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Licensed to the Koordinierungsstelle für IT-Standards (KoSIT) under
~ one or more contributor license agreements. See the NOTICE file
~ distributed with this work for additional information
~ regarding copyright ownership. KoSIT licenses this file
~ to you under the Apache License, Version 2.0 (the
~ "License"); you may not use this file except in compliance
~ with the License. You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing,
~ software distributed under the License is distributed on an
~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
~ KIND, either express or implied. See the License for the
~ specific language governing permissions and limitations
~ under the License.
-->
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
targetNamespace="urn:oasis:names:specification:ubl:schema:xsd:QualifiedDataTypes-2"
xmlns="urn:oasis:names:specification:ubl:schema:xsd:QualifiedDataTypes-2"
elementFormDefault="qualified"
attributeFormDefault="unqualified"
version="2.1">
<!-- ===== Imports ===== -->
<xsd:import namespace="urn:oasis:names:specification:ubl:schema:xsd:UnqualifiedDataTypes-2"
schemaLocation="UBL-UnqualifiedDataTypes-2.1.xsd"/>
<!-- ===== Type Definitions ===== -->
<!--no qualified data types defined at this time-->
</xsd:schema>
<!-- ===== Copyright Notice ===== -->
<!--
OASIS takes no position regarding the validity or scope of any
intellectual property or other rights that might be claimed to pertain
to the implementation or use of the technology described in this
document or the extent to which any license under such rights
might or might not be available; neither does it represent that it has
made any effort to identify any such rights. Information on OASIS's
procedures with respect to rights in OASIS specifications can be
found at the OASIS website. Copies of claims of rights made
available for publication and any assurances of licenses to be made
available, or the result of an attempt made to obtain a general
license or permission for the use of such proprietary rights by
implementors or users of this specification, can be obtained from
the OASIS Executive Director.
OASIS invites any interested party to bring to its attention any
copyrights, patents or patent applications, or other proprietary
rights which may cover technology that may be required to
implement this specification. Please address the information to the
OASIS Executive Director.
This document and translations of it may be copied and furnished to
others, and derivative works that comment on or otherwise explain
it or assist in its implementation may be prepared, copied,
published and distributed, in whole or in part, without restriction of
any kind, provided that the above copyright notice and this
paragraph are included on all such copies and derivative works.
However, this document itself may not be modified in any way,
such as by removing the copyright notice or references to OASIS,
except as needed for the purpose of developing OASIS
specifications, in which case the procedures for copyrights defined
in the OASIS Intellectual Property Rights document must be
followed, or as required to translate it into languages other than
English.
The limited permissions granted above are perpetual and will not be
revoked by OASIS or its successors or assigns.
This document and the information contained herein is provided on
an "AS IS" basis and OASIS DISCLAIMS ALL WARRANTIES,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY
WARRANTY THAT THE USE OF THE INFORMATION HEREIN
WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED
WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A
PARTICULAR PURPOSE.
-->

View file

@ -1,102 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Licensed to the Koordinierungsstelle für IT-Standards (KoSIT) under
~ one or more contributor license agreements. See the NOTICE file
~ distributed with this work for additional information
~ regarding copyright ownership. KoSIT licenses this file
~ to you under the Apache License, Version 2.0 (the
~ "License"); you may not use this file except in compliance
~ with the License. You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing,
~ software distributed under the License is distributed on an
~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
~ KIND, either express or implied. See the License for the
~ specific language governing permissions and limitations
~ under the License.
-->
<xsd:schema xmlns:sbc="urn:oasis:names:specification:ubl:schema:xsd:SignatureBasicComponents-2"
xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:ds="http://www.w3.org/2000/09/xmldsig#"
xmlns="urn:oasis:names:specification:ubl:schema:xsd:SignatureAggregateComponents-2"
targetNamespace="urn:oasis:names:specification:ubl:schema:xsd:SignatureAggregateComponents-2"
elementFormDefault="qualified"
attributeFormDefault="unqualified"
version="2.1">
<xsd:import namespace="urn:oasis:names:specification:ubl:schema:xsd:SignatureBasicComponents-2"
schemaLocation="UBL-SignatureBasicComponents-2.1.xsd"/>
<xsd:import namespace="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2"
schemaLocation="UBL-CommonBasicComponents-2.1.xsd"/>
<!-- ===== Incorporate W3C signature specification-->
<xsd:import namespace="http://www.w3.org/2000/09/xmldsig#"
schemaLocation="UBL-xmldsig-core-schema-2.1.xsd"/>
<!-- ===== Incorporate ETSI signature specifications-->
<xsd:import namespace="http://uri.etsi.org/01903/v1.3.2#"
schemaLocation="UBL-XAdESv132-2.1.xsd"/>
<xsd:import namespace="http://uri.etsi.org/01903/v1.4.1#"
schemaLocation="UBL-XAdESv141-2.1.xsd"/>
<xsd:element name="SignatureInformation" type="SignatureInformationType"/>
<xsd:complexType name="SignatureInformationType">
<xsd:sequence>
<xsd:element ref="cbc:ID" minOccurs="0" maxOccurs="1"/>
<xsd:element ref="sbc:ReferencedSignatureID" minOccurs="0" maxOccurs="1"/>
<xsd:element ref="ds:Signature" minOccurs="0" maxOccurs="1">
<xsd:annotation>
<xsd:documentation>This is a single digital signature as defined by the W3C specification.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:schema>
<!-- ===== Copyright Notice ===== --><!--
OASIS takes no position regarding the validity or scope of any
intellectual property or other rights that might be claimed to pertain
to the implementation or use of the technology described in this
document or the extent to which any license under such rights
might or might not be available; neither does it represent that it has
made any effort to identify any such rights. Information on OASIS's
procedures with respect to rights in OASIS specifications can be
found at the OASIS website. Copies of claims of rights made
available for publication and any assurances of licenses to be made
available, or the result of an attempt made to obtain a general
license or permission for the use of such proprietary rights by
implementors or users of this specification, can be obtained from
the OASIS Executive Director.
OASIS invites any interested party to bring to its attention any
copyrights, patents or patent applications, or other proprietary
rights which may cover technology that may be required to
implement this specification. Please address the information to the
OASIS Executive Director.
This document and translations of it may be copied and furnished to
others, and derivative works that comment on or otherwise explain
it or assist in its implementation may be prepared, copied,
published and distributed, in whole or in part, without restriction of
any kind, provided that the above copyright notice and this
paragraph are included on all such copies and derivative works.
However, this document itself may not be modified in any way,
such as by removing the copyright notice or references to OASIS,
except as needed for the purpose of developing OASIS
specifications, in which case the procedures for copyrights defined
in the OASIS Intellectual Property Rights document must be
followed, or as required to translate it into languages other than
English.
The limited permissions granted above are perpetual and will not be
revoked by OASIS or its successors or assigns.
This document and the information contained herein is provided on
an "AS IS" basis and OASIS DISCLAIMS ALL WARRANTIES,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY
WARRANTY THAT THE USE OF THE INFORMATION HEREIN
WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED
WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A
PARTICULAR PURPOSE.
-->

View file

@ -1,83 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Licensed to the Koordinierungsstelle für IT-Standards (KoSIT) under
~ one or more contributor license agreements. See the NOTICE file
~ distributed with this work for additional information
~ regarding copyright ownership. KoSIT licenses this file
~ to you under the Apache License, Version 2.0 (the
~ "License"); you may not use this file except in compliance
~ with the License. You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing,
~ software distributed under the License is distributed on an
~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
~ KIND, either express or implied. See the License for the
~ specific language governing permissions and limitations
~ under the License.
-->
<xsd:schema xmlns:udt="urn:oasis:names:specification:ubl:schema:xsd:UnqualifiedDataTypes-2"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns="urn:oasis:names:specification:ubl:schema:xsd:SignatureBasicComponents-2"
targetNamespace="urn:oasis:names:specification:ubl:schema:xsd:SignatureBasicComponents-2"
elementFormDefault="qualified"
attributeFormDefault="unqualified"
version="2.1">
<xsd:import namespace="urn:oasis:names:specification:ubl:schema:xsd:QualifiedDataTypes-2"
schemaLocation="UBL-QualifiedDataTypes-2.1.xsd"/>
<xsd:import namespace="urn:oasis:names:specification:ubl:schema:xsd:UnqualifiedDataTypes-2"
schemaLocation="UBL-UnqualifiedDataTypes-2.1.xsd"/>
<xsd:element name="ReferencedSignatureID" type="ReferencedSignatureIDType"/>
<xsd:complexType name="ReferencedSignatureIDType">
<xsd:simpleContent>
<xsd:extension base="udt:IdentifierType"/>
</xsd:simpleContent>
</xsd:complexType>
</xsd:schema>
<!-- ===== Copyright Notice ===== --><!--
OASIS takes no position regarding the validity or scope of any
intellectual property or other rights that might be claimed to pertain
to the implementation or use of the technology described in this
document or the extent to which any license under such rights
might or might not be available; neither does it represent that it has
made any effort to identify any such rights. Information on OASIS's
procedures with respect to rights in OASIS specifications can be
found at the OASIS website. Copies of claims of rights made
available for publication and any assurances of licenses to be made
available, or the result of an attempt made to obtain a general
license or permission for the use of such proprietary rights by
implementors or users of this specification, can be obtained from
the OASIS Executive Director.
OASIS invites any interested party to bring to its attention any
copyrights, patents or patent applications, or other proprietary
rights which may cover technology that may be required to
implement this specification. Please address the information to the
OASIS Executive Director.
This document and translations of it may be copied and furnished to
others, and derivative works that comment on or otherwise explain
it or assist in its implementation may be prepared, copied,
published and distributed, in whole or in part, without restriction of
any kind, provided that the above copyright notice and this
paragraph are included on all such copies and derivative works.
However, this document itself may not be modified in any way,
such as by removing the copyright notice or references to OASIS,
except as needed for the purpose of developing OASIS
specifications, in which case the procedures for copyrights defined
in the OASIS Intellectual Property Rights document must be
followed, or as required to translate it into languages other than
English.
The limited permissions granted above are perpetual and will not be
revoked by OASIS or its successors or assigns.
This document and the information contained herein is provided on
an "AS IS" basis and OASIS DISCLAIMS ALL WARRANTIES,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY
WARRANTY THAT THE USE OF THE INFORMATION HEREIN
WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED
WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A
PARTICULAR PURPOSE.
-->

View file

@ -1,554 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Licensed to the Koordinierungsstelle für IT-Standards (KoSIT) under
~ one or more contributor license agreements. See the NOTICE file
~ distributed with this work for additional information
~ regarding copyright ownership. KoSIT licenses this file
~ to you under the Apache License, Version 2.0 (the
~ "License"); you may not use this file except in compliance
~ with the License. You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing,
~ software distributed under the License is distributed on an
~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
~ KIND, either express or implied. See the License for the
~ specific language governing permissions and limitations
~ under the License.
-->
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:ccts-cct="urn:un:unece:uncefact:data:specification:CoreComponentTypeSchemaModule:2"
xmlns:ccts="urn:un:unece:uncefact:documentation:2"
targetNamespace="urn:oasis:names:specification:ubl:schema:xsd:UnqualifiedDataTypes-2"
elementFormDefault="qualified"
attributeFormDefault="unqualified"
version="2.1">
<!-- ===== Imports ===== -->
<xsd:import schemaLocation="CCTS_CCT_SchemaModule-2.1.xsd"
namespace="urn:un:unece:uncefact:data:specification:CoreComponentTypeSchemaModule:2"/>
<!-- ===== Type Definitions ===== -->
<xsd:complexType name="AmountType">
<xsd:annotation>
<xsd:documentation xml:lang="en">
<ccts:UniqueID>UBLUDT000001</ccts:UniqueID>
<ccts:CategoryCode>UDT</ccts:CategoryCode>
<ccts:DictionaryEntryName>Amount. Type</ccts:DictionaryEntryName>
<ccts:VersionID>1.0</ccts:VersionID>
<ccts:Definition>A number of monetary units specified using a given unit of currency.</ccts:Definition>
<ccts:RepresentationTermName>Amount</ccts:RepresentationTermName>
</xsd:documentation>
</xsd:annotation>
<xsd:simpleContent>
<xsd:restriction base="ccts-cct:AmountType">
<xsd:attribute name="currencyID" type="xsd:normalizedString" use="required">
<xsd:annotation>
<xsd:documentation xml:lang="en">
<ccts:UniqueID>UNDT000001-SC2</ccts:UniqueID>
<ccts:CategoryCode>SC</ccts:CategoryCode>
<ccts:DictionaryEntryName>Amount. Currency. Identifier</ccts:DictionaryEntryName>
<ccts:Definition>The currency of the amount.</ccts:Definition>
<ccts:ObjectClass>Amount Currency</ccts:ObjectClass>
<ccts:PropertyTermName>Identification</ccts:PropertyTermName>
<ccts:RepresentationTermName>Identifier</ccts:RepresentationTermName>
<ccts:PrimitiveType>string</ccts:PrimitiveType>
<ccts:UsageRule>Reference UNECE Rec 9, using 3-letter alphabetic codes.</ccts:UsageRule>
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
</xsd:restriction>
</xsd:simpleContent>
</xsd:complexType>
<xsd:complexType name="BinaryObjectType">
<xsd:annotation>
<xsd:documentation xml:lang="en">
<ccts:UniqueID>UBLUDT000002</ccts:UniqueID>
<ccts:CategoryCode>UDT</ccts:CategoryCode>
<ccts:DictionaryEntryName>Binary Object. Type</ccts:DictionaryEntryName>
<ccts:VersionID>1.0</ccts:VersionID>
<ccts:Definition>A set of finite-length sequences of binary octets.</ccts:Definition>
<ccts:RepresentationTermName>Binary Object</ccts:RepresentationTermName>
<ccts:PrimitiveType>binary</ccts:PrimitiveType>
</xsd:documentation>
</xsd:annotation>
<xsd:simpleContent>
<xsd:restriction base="ccts-cct:BinaryObjectType">
<xsd:attribute name="mimeCode" type="xsd:normalizedString" use="required">
<xsd:annotation>
<xsd:documentation xml:lang="en">
<ccts:UniqueID>UNDT000002-SC3</ccts:UniqueID>
<ccts:CategoryCode>SC</ccts:CategoryCode>
<ccts:DictionaryEntryName>Binary Object. Mime. Code</ccts:DictionaryEntryName>
<ccts:Definition>The mime type of the binary object.</ccts:Definition>
<ccts:ObjectClass>Binary Object</ccts:ObjectClass>
<ccts:PropertyTermName>Mime</ccts:PropertyTermName>
<ccts:RepresentationTermName>Code</ccts:RepresentationTermName>
<ccts:PrimitiveType>string</ccts:PrimitiveType>
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
</xsd:restriction>
</xsd:simpleContent>
</xsd:complexType>
<xsd:complexType name="GraphicType">
<xsd:annotation>
<xsd:documentation xml:lang="en">
<ccts:UniqueID>UBLUDT000003</ccts:UniqueID>
<ccts:CategoryCode>UDT</ccts:CategoryCode>
<ccts:DictionaryEntryName>Graphic. Type</ccts:DictionaryEntryName>
<ccts:VersionID>1.0</ccts:VersionID>
<ccts:Definition>A diagram, graph, mathematical curve, or similar representation.</ccts:Definition>
<ccts:RepresentationTermName>Graphic</ccts:RepresentationTermName>
<ccts:PrimitiveType>binary</ccts:PrimitiveType>
</xsd:documentation>
</xsd:annotation>
<xsd:simpleContent>
<xsd:restriction base="ccts-cct:BinaryObjectType">
<xsd:attribute name="mimeCode" type="xsd:normalizedString" use="required">
<xsd:annotation>
<xsd:documentation xml:lang="en">
<ccts:UniqueID>UNDT000003-SC3</ccts:UniqueID>
<ccts:CategoryCode>SC</ccts:CategoryCode>
<ccts:DictionaryEntryName>Graphic. Mime. Code</ccts:DictionaryEntryName>
<ccts:Definition>The mime type of the graphic object.</ccts:Definition>
<ccts:ObjectClass>Graphic</ccts:ObjectClass>
<ccts:PropertyTermName>Mime</ccts:PropertyTermName>
<ccts:RepresentationTermName>Code</ccts:RepresentationTermName>
<ccts:PrimitiveType>normalizedString</ccts:PrimitiveType>
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
</xsd:restriction>
</xsd:simpleContent>
</xsd:complexType>
<xsd:complexType name="PictureType">
<xsd:annotation>
<xsd:documentation xml:lang="en">
<ccts:UniqueID>UBLUDT000004</ccts:UniqueID>
<ccts:CategoryCode>UDT</ccts:CategoryCode>
<ccts:DictionaryEntryName>Picture. Type</ccts:DictionaryEntryName>
<ccts:VersionID>1.0</ccts:VersionID>
<ccts:Definition>A diagram, graph, mathematical curve, or similar representation.</ccts:Definition>
<ccts:RepresentationTermName>Picture</ccts:RepresentationTermName>
<ccts:PrimitiveType>binary</ccts:PrimitiveType>
</xsd:documentation>
</xsd:annotation>
<xsd:simpleContent>
<xsd:restriction base="ccts-cct:BinaryObjectType">
<xsd:attribute name="mimeCode" type="xsd:normalizedString" use="required">
<xsd:annotation>
<xsd:documentation xml:lang="en">
<ccts:UniqueID>UNDT000004-SC3</ccts:UniqueID>
<ccts:CategoryCode>SC</ccts:CategoryCode>
<ccts:DictionaryEntryName>Picture. Mime. Code</ccts:DictionaryEntryName>
<ccts:Definition>The mime type of the picture object.</ccts:Definition>
<ccts:ObjectClass>Picture</ccts:ObjectClass>
<ccts:PropertyTermName>Mime</ccts:PropertyTermName>
<ccts:RepresentationTermName>Code</ccts:RepresentationTermName>
<ccts:PrimitiveType>normalizedString</ccts:PrimitiveType>
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
</xsd:restriction>
</xsd:simpleContent>
</xsd:complexType>
<xsd:complexType name="SoundType">
<xsd:annotation>
<xsd:documentation xml:lang="en">
<ccts:UniqueID>UBLUDT000005</ccts:UniqueID>
<ccts:CategoryCode>UDT</ccts:CategoryCode>
<ccts:DictionaryEntryName>Sound. Type</ccts:DictionaryEntryName>
<ccts:VersionID>1.0</ccts:VersionID>
<ccts:Definition>An audio representation.</ccts:Definition>
<ccts:RepresentationTermName>Sound</ccts:RepresentationTermName>
<ccts:PrimitiveType>binary</ccts:PrimitiveType>
</xsd:documentation>
</xsd:annotation>
<xsd:simpleContent>
<xsd:restriction base="ccts-cct:BinaryObjectType">
<xsd:attribute name="mimeCode" type="xsd:normalizedString" use="required">
<xsd:annotation>
<xsd:documentation xml:lang="en">
<ccts:UniqueID>UNDT000005-SC3</ccts:UniqueID>
<ccts:CategoryCode>SC</ccts:CategoryCode>
<ccts:DictionaryEntryName>Sound. Mime. Code</ccts:DictionaryEntryName>
<ccts:Definition>The mime type of the sound object.</ccts:Definition>
<ccts:ObjectClass>Sound</ccts:ObjectClass>
<ccts:PropertyTermName>Mime</ccts:PropertyTermName>
<ccts:RepresentationTermName>Code</ccts:RepresentationTermName>
<ccts:PrimitiveType>normalizedString</ccts:PrimitiveType>
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
</xsd:restriction>
</xsd:simpleContent>
</xsd:complexType>
<xsd:complexType name="VideoType">
<xsd:annotation>
<xsd:documentation xml:lang="en">
<ccts:UniqueID>UBLUDT000006</ccts:UniqueID>
<ccts:CategoryCode>UDT</ccts:CategoryCode>
<ccts:DictionaryEntryName>Video. Type</ccts:DictionaryEntryName>
<ccts:VersionID>1.0</ccts:VersionID>
<ccts:Definition>A video representation.</ccts:Definition>
<ccts:RepresentationTermName>Video</ccts:RepresentationTermName>
<ccts:PrimitiveType>binary</ccts:PrimitiveType>
</xsd:documentation>
</xsd:annotation>
<xsd:simpleContent>
<xsd:restriction base="ccts-cct:BinaryObjectType">
<xsd:attribute name="mimeCode" type="xsd:normalizedString" use="required">
<xsd:annotation>
<xsd:documentation xml:lang="en">
<ccts:UniqueID>UNDT000006-SC3</ccts:UniqueID>
<ccts:CategoryCode>SC</ccts:CategoryCode>
<ccts:DictionaryEntryName>Video. Mime. Code</ccts:DictionaryEntryName>
<ccts:Definition>The mime type of the video object.</ccts:Definition>
<ccts:ObjectClass>Video</ccts:ObjectClass>
<ccts:PropertyTermName>Mime</ccts:PropertyTermName>
<ccts:RepresentationTermName>Code</ccts:RepresentationTermName>
<ccts:PrimitiveType>normalizedString</ccts:PrimitiveType>
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
</xsd:restriction>
</xsd:simpleContent>
</xsd:complexType>
<xsd:complexType name="CodeType">
<xsd:annotation>
<xsd:documentation xml:lang="en">
<ccts:UniqueID>UBLUDT000007</ccts:UniqueID>
<ccts:CategoryCode>UDT</ccts:CategoryCode>
<ccts:DictionaryEntryName>Code. Type</ccts:DictionaryEntryName>
<ccts:VersionID>1.0</ccts:VersionID>
<ccts:Definition>A character string (letters, figures, or symbols) that for brevity and/or language
independence may be used to represent or replace a definitive value or text of an attribute,
together with relevant supplementary information.
</ccts:Definition>
<ccts:RepresentationTermName>Code</ccts:RepresentationTermName>
<ccts:PrimitiveType>string</ccts:PrimitiveType>
<ccts:UsageRule>Other supplementary components in the CCT are captured as part of the token and name for
the schema module containing the code list and thus, are not declared as attributes.
</ccts:UsageRule>
</xsd:documentation>
</xsd:annotation>
<xsd:simpleContent>
<xsd:extension base="ccts-cct:CodeType"/>
</xsd:simpleContent>
</xsd:complexType>
<xsd:complexType name="DateTimeType">
<xsd:annotation>
<xsd:documentation xml:lang="en">
<ccts:UniqueID>UBLUDT000008</ccts:UniqueID>
<ccts:CategoryCode>UDT</ccts:CategoryCode>
<ccts:DictionaryEntryName>Date Time. Type</ccts:DictionaryEntryName>
<ccts:VersionID>1.0</ccts:VersionID>
<ccts:Definition>A particular point in the progression of time, together with relevant supplementary
information.
</ccts:Definition>
<ccts:RepresentationTermName>Date Time</ccts:RepresentationTermName>
<ccts:PrimitiveType>string</ccts:PrimitiveType>
<ccts:UsageRule>Can be used for a date and/or time.</ccts:UsageRule>
</xsd:documentation>
</xsd:annotation>
<xsd:simpleContent>
<xsd:extension base="xsd:dateTime"/>
</xsd:simpleContent>
</xsd:complexType>
<xsd:complexType name="DateType">
<xsd:annotation>
<xsd:documentation xml:lang="en">
<ccts:UniqueID>UBLUDT000009</ccts:UniqueID>
<ccts:CategoryCode>UDT</ccts:CategoryCode>
<ccts:DictionaryEntryName>Date. Type</ccts:DictionaryEntryName>
<ccts:VersionID>1.0</ccts:VersionID>
<ccts:Definition>One calendar day according the Gregorian calendar.</ccts:Definition>
<ccts:RepresentationTermName>Date</ccts:RepresentationTermName>
<ccts:PrimitiveType>string</ccts:PrimitiveType>
</xsd:documentation>
</xsd:annotation>
<xsd:simpleContent>
<xsd:extension base="xsd:date"/>
</xsd:simpleContent>
</xsd:complexType>
<xsd:complexType name="TimeType">
<xsd:annotation>
<xsd:documentation xml:lang="en">
<ccts:UniqueID>UBLUDT0000010</ccts:UniqueID>
<ccts:CategoryCode>UDT</ccts:CategoryCode>
<ccts:DictionaryEntryName>Time. Type</ccts:DictionaryEntryName>
<ccts:VersionID>1.0</ccts:VersionID>
<ccts:Definition>An instance of time that occurs every day.</ccts:Definition>
<ccts:RepresentationTermName>Time</ccts:RepresentationTermName>
<ccts:PrimitiveType>string</ccts:PrimitiveType>
</xsd:documentation>
</xsd:annotation>
<xsd:simpleContent>
<xsd:extension base="xsd:time"/>
</xsd:simpleContent>
</xsd:complexType>
<xsd:complexType name="IdentifierType">
<xsd:annotation>
<xsd:documentation xml:lang="en">
<ccts:UniqueID>UBLUDT0000011</ccts:UniqueID>
<ccts:CategoryCode>UDT</ccts:CategoryCode>
<ccts:DictionaryEntryName>Identifier. Type</ccts:DictionaryEntryName>
<ccts:VersionID>1.0</ccts:VersionID>
<ccts:Definition>A character string to identify and uniquely distinguish one instance of an object in an
identification scheme from all other objects in the same scheme, together with relevant
supplementary information.
</ccts:Definition>
<ccts:RepresentationTermName>Identifier</ccts:RepresentationTermName>
<ccts:PrimitiveType>string</ccts:PrimitiveType>
<ccts:UsageRule>Other supplementary components in the CCT are captured as part of the token and name for
the schema module containing the identifier list and thus, are not declared as attributes.
</ccts:UsageRule>
</xsd:documentation>
</xsd:annotation>
<xsd:simpleContent>
<xsd:extension base="ccts-cct:IdentifierType"/>
</xsd:simpleContent>
</xsd:complexType>
<xsd:complexType name="IndicatorType">
<xsd:annotation>
<xsd:documentation xml:lang="en">
<ccts:UniqueID>UBLUDT0000012</ccts:UniqueID>
<ccts:CategoryCode>UDT</ccts:CategoryCode>
<ccts:DictionaryEntryName>Indicator. Type</ccts:DictionaryEntryName>
<ccts:VersionID>1.0</ccts:VersionID>
<ccts:Definition>A list of two mutually exclusive Boolean values that express the only possible states
of a property.
</ccts:Definition>
<ccts:RepresentationTermName>Indicator</ccts:RepresentationTermName>
<ccts:PrimitiveType>string</ccts:PrimitiveType>
</xsd:documentation>
</xsd:annotation>
<xsd:simpleContent>
<xsd:extension base="xsd:boolean"/>
</xsd:simpleContent>
</xsd:complexType>
<xsd:complexType name="MeasureType">
<xsd:annotation>
<xsd:documentation xml:lang="en">
<ccts:UniqueID>UBLUDT0000013</ccts:UniqueID>
<ccts:CategoryCode>UDT</ccts:CategoryCode>
<ccts:DictionaryEntryName>Measure. Type</ccts:DictionaryEntryName>
<ccts:VersionID>1.0</ccts:VersionID>
<ccts:Definition>A numeric value determined by measuring an object using a specified unit of measure.
</ccts:Definition>
<ccts:RepresentationTermName>Measure</ccts:RepresentationTermName>
<ccts:PropertyTermName>Type</ccts:PropertyTermName>
<ccts:PrimitiveType>decimal</ccts:PrimitiveType>
</xsd:documentation>
</xsd:annotation>
<xsd:simpleContent>
<xsd:restriction base="ccts-cct:MeasureType">
<xsd:attribute name="unitCode" type="xsd:normalizedString" use="required">
<xsd:annotation>
<xsd:documentation xml:lang="en">
<ccts:UniqueID>UNDT000013-SC2</ccts:UniqueID>
<ccts:CategoryCode>SC</ccts:CategoryCode>
<ccts:DictionaryEntryName>Measure. Unit. Code</ccts:DictionaryEntryName>
<ccts:Definition>The type of unit of measure.</ccts:Definition>
<ccts:ObjectClass>Measure Unit</ccts:ObjectClass>
<ccts:PropertyTermName>Code</ccts:PropertyTermName>
<ccts:RepresentationTermName>Code</ccts:RepresentationTermName>
<ccts:PrimitiveType>normalizedString</ccts:PrimitiveType>
<ccts:UsageRule>Reference UNECE Rec. 20 and X12 355</ccts:UsageRule>
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
</xsd:restriction>
</xsd:simpleContent>
</xsd:complexType>
<xsd:complexType name="NumericType">
<xsd:annotation>
<xsd:documentation xml:lang="en">
<ccts:UniqueID>UBLUDT0000014</ccts:UniqueID>
<ccts:CategoryCode>UDT</ccts:CategoryCode>
<ccts:DictionaryEntryName>Numeric. Type</ccts:DictionaryEntryName>
<ccts:VersionID>1.0</ccts:VersionID>
<ccts:Definition>Numeric information that is assigned or is determined by calculation, counting, or
sequencing. It does not require a unit of quantity or unit of measure.
</ccts:Definition>
<ccts:RepresentationTermName>Numeric</ccts:RepresentationTermName>
<ccts:PrimitiveType>string</ccts:PrimitiveType>
</xsd:documentation>
</xsd:annotation>
<xsd:simpleContent>
<xsd:extension base="ccts-cct:NumericType"/>
</xsd:simpleContent>
</xsd:complexType>
<xsd:complexType name="ValueType">
<xsd:annotation>
<xsd:documentation xml:lang="en">
<ccts:UniqueID>UBLUDT0000015</ccts:UniqueID>
<ccts:CategoryCode>UDT</ccts:CategoryCode>
<ccts:VersionID>1.0</ccts:VersionID>
<ccts:DictionaryEntryName>Value. Type</ccts:DictionaryEntryName>
<ccts:Definition>Numeric information that is assigned or is determined by calculation, counting, or
sequencing. It does not require a unit of quantity or unit of measure.
</ccts:Definition>
<ccts:RepresentationTermName>Value</ccts:RepresentationTermName>
<ccts:PrimitiveType>string</ccts:PrimitiveType>
</xsd:documentation>
</xsd:annotation>
<xsd:simpleContent>
<xsd:extension base="ccts-cct:NumericType"/>
</xsd:simpleContent>
</xsd:complexType>
<xsd:complexType name="PercentType">
<xsd:annotation>
<xsd:documentation xml:lang="en">
<ccts:UniqueID>UBLUDT0000016</ccts:UniqueID>
<ccts:CategoryCode>UDT</ccts:CategoryCode>
<ccts:VersionID>1.0</ccts:VersionID>
<ccts:DictionaryEntryName>Percent. Type</ccts:DictionaryEntryName>
<ccts:Definition>Numeric information that is assigned or is determined by calculation, counting, or
sequencing and is expressed as a percentage. It does not require a unit of quantity or unit of
measure.
</ccts:Definition>
<ccts:RepresentationTermName>Percent</ccts:RepresentationTermName>
<ccts:PrimitiveType>string</ccts:PrimitiveType>
</xsd:documentation>
</xsd:annotation>
<xsd:simpleContent>
<xsd:extension base="ccts-cct:NumericType"/>
</xsd:simpleContent>
</xsd:complexType>
<xsd:complexType name="RateType">
<xsd:annotation>
<xsd:documentation xml:lang="en">
<ccts:UniqueID>UBLUDT0000017</ccts:UniqueID>
<ccts:CategoryCode>UDT</ccts:CategoryCode>
<ccts:VersionID>1.0</ccts:VersionID>
<ccts:DictionaryEntryName>Rate. Type</ccts:DictionaryEntryName>
<ccts:Definition>A numeric expression of a rate that is assigned or is determined by calculation,
counting, or sequencing. It does not require a unit of quantity or unit of measure.
</ccts:Definition>
<ccts:RepresentationTermName>Rate</ccts:RepresentationTermName>
<ccts:PrimitiveType>string</ccts:PrimitiveType>
</xsd:documentation>
</xsd:annotation>
<xsd:simpleContent>
<xsd:extension base="ccts-cct:NumericType"/>
</xsd:simpleContent>
</xsd:complexType>
<xsd:complexType name="QuantityType">
<xsd:annotation>
<xsd:documentation xml:lang="en">
<ccts:UniqueID>UBLUDT0000018</ccts:UniqueID>
<ccts:CategoryCode>UDT</ccts:CategoryCode>
<ccts:DictionaryEntryName>Quantity. Type</ccts:DictionaryEntryName>
<ccts:VersionID>1.0</ccts:VersionID>
<ccts:Definition>A counted number of non-monetary units, possibly including a fractional part.
</ccts:Definition>
<ccts:RepresentationTermName>Quantity</ccts:RepresentationTermName>
<ccts:PrimitiveType>decimal</ccts:PrimitiveType>
</xsd:documentation>
</xsd:annotation>
<xsd:simpleContent>
<xsd:extension base="ccts-cct:QuantityType"/>
</xsd:simpleContent>
</xsd:complexType>
<xsd:complexType name="TextType">
<xsd:annotation>
<xsd:documentation xml:lang="en">
<ccts:UniqueID>UBLUDT0000019</ccts:UniqueID>
<ccts:CategoryCode>UDT</ccts:CategoryCode>
<ccts:DictionaryEntryName>Text. Type</ccts:DictionaryEntryName>
<ccts:VersionID>1.0</ccts:VersionID>
<ccts:Definition>A character string (i.e. a finite set of characters), generally in the form of words of
a language.
</ccts:Definition>
<ccts:RepresentationTermName>Text</ccts:RepresentationTermName>
<ccts:PrimitiveType>string</ccts:PrimitiveType>
</xsd:documentation>
</xsd:annotation>
<xsd:simpleContent>
<xsd:extension base="ccts-cct:TextType"/>
</xsd:simpleContent>
</xsd:complexType>
<xsd:complexType name="NameType">
<xsd:annotation>
<xsd:documentation xml:lang="en">
<ccts:UniqueID>UBLUDT0000020</ccts:UniqueID>
<ccts:CategoryCode>UDT</ccts:CategoryCode>
<ccts:DictionaryEntryName>Name. Type</ccts:DictionaryEntryName>
<ccts:VersionID>1.0</ccts:VersionID>
<ccts:Definition>A character string that constitutes the distinctive designation of a person, place,
thing or concept.
</ccts:Definition>
<ccts:RepresentationTermName>Name</ccts:RepresentationTermName>
<ccts:PrimitiveType>string</ccts:PrimitiveType>
</xsd:documentation>
</xsd:annotation>
<xsd:simpleContent>
<xsd:extension base="ccts-cct:TextType"/>
</xsd:simpleContent>
</xsd:complexType>
</xsd:schema><!-- ===== Copyright Notice ===== --><!--
OASIS takes no position regarding the validity or scope of any
intellectual property or other rights that might be claimed to pertain
to the implementation or use of the technology described in this
document or the extent to which any license under such rights
might or might not be available; neither does it represent that it has
made any effort to identify any such rights. Information on OASIS's
procedures with respect to rights in OASIS specifications can be
found at the OASIS website. Copies of claims of rights made
available for publication and any assurances of licenses to be made
available, or the result of an attempt made to obtain a general
license or permission for the use of such proprietary rights by
implementors or users of this specification, can be obtained from
the OASIS Executive Director.
OASIS invites any interested party to bring to its attention any
copyrights, patents or patent applications, or other proprietary
rights which may cover technology that may be required to
implement this specification. Please address the information to the
OASIS Executive Director.
This document and translations of it may be copied and furnished to
others, and derivative works that comment on or otherwise explain
it or assist in its implementation may be prepared, copied,
published and distributed, in whole or in part, without restriction of
any kind, provided that the above copyright notice and this
paragraph are included on all such copies and derivative works.
However, this document itself may not be modified in any way,
such as by removing the copyright notice or references to OASIS,
except as needed for the purpose of developing OASIS
specifications, in which case the procedures for copyrights defined
in the OASIS Intellectual Property Rights document must be
followed, or as required to translate it into languages other than
English.
The limited permissions granted above are perpetual and will not be
revoked by OASIS or its successors or assigns.
This document and the information contained herein is provided on
an "AS IS" basis and OASIS DISCLAIMS ALL WARRANTIES,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY
WARRANTY THAT THE USE OF THE INFORMATION HEREIN
WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED
WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A
PARTICULAR PURPOSE.
-->

View file

@ -1,499 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Licensed to the Koordinierungsstelle für IT-Standards (KoSIT) under
~ one or more contributor license agreements. See the NOTICE file
~ distributed with this work for additional information
~ regarding copyright ownership. KoSIT licenses this file
~ to you under the Apache License, Version 2.0 (the
~ "License"); you may not use this file except in compliance
~ with the License. You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing,
~ software distributed under the License is distributed on an
~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
~ KIND, either express or implied. See the License for the
~ specific language governing permissions and limitations
~ under the License.
-->
<!--
Library: OASIS Universal Business Language (UBL) 2.1 OS
http://docs.oasis-open.org/ubl/os-UBL-2.1/
Release Date: 04 November 2013
Module: UBL-XAdESv132-2.1.xsd
Generated on: 2011-02-21 17:20(UTC)
This is a copy of http://uri.etsi.org/01903/v1.3.2/XAdES.xsd modified
only to change the importing URI for the XML DSig schema.
-->
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ds="http://www.w3.org/2000/09/xmldsig#"
targetNamespace="http://uri.etsi.org/01903/v1.3.2#" xmlns="http://uri.etsi.org/01903/v1.3.2#"
elementFormDefault="qualified">
<xsd:import namespace="http://www.w3.org/2000/09/xmldsig#" schemaLocation="UBL-xmldsig-core-schema-2.1.xsd"/>
<!-- Start auxiliary types definitions: AnyType, ObjectIdentifierType,
EncapsulatedPKIDataType and containers for time-stamp tokens -->
<!-- Start AnyType -->
<xsd:element name="Any" type="AnyType"/>
<xsd:complexType name="AnyType" mixed="true">
<xsd:sequence minOccurs="0" maxOccurs="unbounded">
<xsd:any namespace="##any" processContents="lax"/>
</xsd:sequence>
<xsd:anyAttribute namespace="##any"/>
</xsd:complexType>
<!-- End AnyType -->
<!-- Start ObjectIdentifierType-->
<xsd:element name="ObjectIdentifier" type="ObjectIdentifierType"/>
<xsd:complexType name="ObjectIdentifierType">
<xsd:sequence>
<xsd:element name="Identifier" type="IdentifierType"/>
<xsd:element name="Description" type="xsd:string" minOccurs="0"/>
<xsd:element name="DocumentationReferences" type="DocumentationReferencesType" minOccurs="0"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="IdentifierType">
<xsd:simpleContent>
<xsd:extension base="xsd:anyURI">
<xsd:attribute name="Qualifier" type="QualifierType" use="optional"/>
</xsd:extension>
</xsd:simpleContent>
</xsd:complexType>
<xsd:simpleType name="QualifierType">
<xsd:restriction base="xsd:string">
<xsd:enumeration value="OIDAsURI"/>
<xsd:enumeration value="OIDAsURN"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:complexType name="DocumentationReferencesType">
<xsd:sequence maxOccurs="unbounded">
<xsd:element name="DocumentationReference" type="xsd:anyURI"/>
</xsd:sequence>
</xsd:complexType>
<!-- End ObjectIdentifierType-->
<!-- Start EncapsulatedPKIDataType-->
<xsd:element name="EncapsulatedPKIData" type="EncapsulatedPKIDataType"/>
<xsd:complexType name="EncapsulatedPKIDataType">
<xsd:simpleContent>
<xsd:extension base="xsd:base64Binary">
<xsd:attribute name="Id" type="xsd:ID" use="optional"/>
<xsd:attribute name="Encoding" type="xsd:anyURI" use="optional"/>
</xsd:extension>
</xsd:simpleContent>
</xsd:complexType>
<!-- End EncapsulatedPKIDataType -->
<!-- Start time-stamp containers types -->
<!-- Start GenericTimeStampType -->
<xsd:element name="Include" type="IncludeType"/>
<xsd:complexType name="IncludeType">
<xsd:attribute name="URI" type="xsd:anyURI" use="required"/>
<xsd:attribute name="referencedData" type="xsd:boolean" use="optional"/>
</xsd:complexType>
<xsd:element name="ReferenceInfo" type="ReferenceInfoType"/>
<xsd:complexType name="ReferenceInfoType">
<xsd:sequence>
<xsd:element ref="ds:DigestMethod"/>
<xsd:element ref="ds:DigestValue"/>
</xsd:sequence>
<xsd:attribute name="Id" type="xsd:ID" use="optional"/>
<xsd:attribute name="URI" type="xsd:anyURI" use="optional"/>
</xsd:complexType>
<xsd:complexType name="GenericTimeStampType" abstract="true">
<xsd:sequence>
<xsd:choice minOccurs="0">
<xsd:element ref="Include" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element ref="ReferenceInfo" maxOccurs="unbounded"/>
</xsd:choice>
<xsd:element ref="ds:CanonicalizationMethod" minOccurs="0"/>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="EncapsulatedTimeStamp" type="EncapsulatedPKIDataType"/>
<xsd:element name="XMLTimeStamp" type="AnyType"/>
</xsd:choice>
</xsd:sequence>
<xsd:attribute name="Id" type="xsd:ID" use="optional"/>
</xsd:complexType>
<!-- End GenericTimeStampType -->
<!-- Start XAdESTimeStampType -->
<xsd:element name="XAdESTimeStamp" type="XAdESTimeStampType"/>
<xsd:complexType name="XAdESTimeStampType">
<xsd:complexContent>
<xsd:restriction base="GenericTimeStampType">
<xsd:sequence>
<xsd:element ref="Include" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element ref="ds:CanonicalizationMethod" minOccurs="0"/>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="EncapsulatedTimeStamp" type="EncapsulatedPKIDataType"/>
<xsd:element name="XMLTimeStamp" type="AnyType"/>
</xsd:choice>
</xsd:sequence>
<xsd:attribute name="Id" type="xsd:ID" use="optional"/>
</xsd:restriction>
</xsd:complexContent>
</xsd:complexType>
<!-- End XAdESTimeStampType -->
<!-- Start OtherTimeStampType -->
<xsd:element name="OtherTimeStamp" type="OtherTimeStampType"/>
<xsd:complexType name="OtherTimeStampType">
<xsd:complexContent>
<xsd:restriction base="GenericTimeStampType">
<xsd:sequence>
<xsd:element ref="ReferenceInfo" maxOccurs="unbounded"/>
<xsd:element ref="ds:CanonicalizationMethod" minOccurs="0"/>
<xsd:choice>
<xsd:element name="EncapsulatedTimeStamp" type="EncapsulatedPKIDataType"/>
<xsd:element name="XMLTimeStamp" type="AnyType"/>
</xsd:choice>
</xsd:sequence>
<xsd:attribute name="Id" type="xsd:ID" use="optional"/>
</xsd:restriction>
</xsd:complexContent>
</xsd:complexType>
<!-- End OtherTimeStampType -->
<!-- End time-stamp containers types -->
<!-- End auxiliary types definitions-->
<!-- Start container types -->
<!-- Start QualifyingProperties -->
<xsd:element name="QualifyingProperties" type="QualifyingPropertiesType"/>
<xsd:complexType name="QualifyingPropertiesType">
<xsd:sequence>
<xsd:element name="SignedProperties" type="SignedPropertiesType" minOccurs="0"/>
<xsd:element name="UnsignedProperties" type="UnsignedPropertiesType" minOccurs="0"/>
</xsd:sequence>
<xsd:attribute name="Target" type="xsd:anyURI" use="required"/>
<xsd:attribute name="Id" type="xsd:ID" use="optional"/>
</xsd:complexType>
<!-- End QualifyingProperties -->
<!-- Start SignedProperties-->
<xsd:element name="SignedProperties" type="SignedPropertiesType"/>
<xsd:complexType name="SignedPropertiesType">
<xsd:sequence>
<xsd:element name="SignedSignatureProperties" type="SignedSignaturePropertiesType" minOccurs="0"/>
<xsd:element name="SignedDataObjectProperties" type="SignedDataObjectPropertiesType" minOccurs="0"/>
</xsd:sequence>
<xsd:attribute name="Id" type="xsd:ID" use="optional"/>
</xsd:complexType>
<!-- End SignedProperties-->
<!-- Start UnsignedProperties-->
<xsd:element name="UnsignedProperties" type="UnsignedPropertiesType"/>
<xsd:complexType name="UnsignedPropertiesType">
<xsd:sequence>
<xsd:element name="UnsignedSignatureProperties" type="UnsignedSignaturePropertiesType" minOccurs="0"/>
<xsd:element name="UnsignedDataObjectProperties" type="UnsignedDataObjectPropertiesType" minOccurs="0"/>
</xsd:sequence>
<xsd:attribute name="Id" type="xsd:ID" use="optional"/>
</xsd:complexType>
<!-- End UnsignedProperties-->
<!-- Start SignedSignatureProperties-->
<xsd:element name="SignedSignatureProperties" type="SignedSignaturePropertiesType"/>
<xsd:complexType name="SignedSignaturePropertiesType">
<xsd:sequence>
<xsd:element name="SigningTime" type="xsd:dateTime" minOccurs="0"/>
<xsd:element name="SigningCertificate" type="CertIDListType" minOccurs="0"/>
<xsd:element name="SignaturePolicyIdentifier" type="SignaturePolicyIdentifierType" minOccurs="0"/>
<xsd:element name="SignatureProductionPlace" type="SignatureProductionPlaceType" minOccurs="0"/>
<xsd:element name="SignerRole" type="SignerRoleType" minOccurs="0"/>
</xsd:sequence>
<xsd:attribute name="Id" type="xsd:ID" use="optional"/>
</xsd:complexType>
<!-- End SignedSignatureProperties-->
<!-- Start SignedDataObjectProperties-->
<xsd:element name="SignedDataObjectProperties" type="SignedDataObjectPropertiesType"/>
<xsd:complexType name="SignedDataObjectPropertiesType">
<xsd:sequence>
<xsd:element name="DataObjectFormat" type="DataObjectFormatType" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element name="CommitmentTypeIndication" type="CommitmentTypeIndicationType" minOccurs="0"
maxOccurs="unbounded"/>
<xsd:element name="AllDataObjectsTimeStamp" type="XAdESTimeStampType" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element name="IndividualDataObjectsTimeStamp" type="XAdESTimeStampType" minOccurs="0"
maxOccurs="unbounded"/>
</xsd:sequence>
<xsd:attribute name="Id" type="xsd:ID" use="optional"/>
</xsd:complexType>
<!-- End SignedDataObjectProperties-->
<!-- Start UnsignedSignatureProperties-->
<xsd:element name="UnsignedSignatureProperties" type="UnsignedSignaturePropertiesType"/>
<xsd:complexType name="UnsignedSignaturePropertiesType">
<xsd:choice maxOccurs="unbounded">
<xsd:element name="CounterSignature" type="CounterSignatureType"/>
<xsd:element name="SignatureTimeStamp" type="XAdESTimeStampType"/>
<xsd:element name="CompleteCertificateRefs" type="CompleteCertificateRefsType"/>
<xsd:element name="CompleteRevocationRefs" type="CompleteRevocationRefsType"/>
<xsd:element name="AttributeCertificateRefs" type="CompleteCertificateRefsType"/>
<xsd:element name="AttributeRevocationRefs" type="CompleteRevocationRefsType"/>
<xsd:element name="SigAndRefsTimeStamp" type="XAdESTimeStampType"/>
<xsd:element name="RefsOnlyTimeStamp" type="XAdESTimeStampType"/>
<xsd:element name="CertificateValues" type="CertificateValuesType"/>
<xsd:element name="RevocationValues" type="RevocationValuesType"/>
<xsd:element name="AttrAuthoritiesCertValues" type="CertificateValuesType"/>
<xsd:element name="AttributeRevocationValues" type="RevocationValuesType"/>
<xsd:element name="ArchiveTimeStamp" type="XAdESTimeStampType"/>
<xsd:any namespace="##other"/>
</xsd:choice>
<xsd:attribute name="Id" type="xsd:ID" use="optional"/>
</xsd:complexType>
<!-- End UnsignedSignatureProperties-->
<!-- Start UnsignedDataObjectProperties-->
<xsd:element name="UnsignedDataObjectProperties" type="UnsignedDataObjectPropertiesType"/>
<xsd:complexType name="UnsignedDataObjectPropertiesType">
<xsd:sequence>
<xsd:element name="UnsignedDataObjectProperty" type="AnyType" maxOccurs="unbounded"/>
</xsd:sequence>
<xsd:attribute name="Id" type="xsd:ID" use="optional"/>
</xsd:complexType>
<!-- End UnsignedDataObjectProperties-->
<!-- Start QualifyingPropertiesReference-->
<xsd:element name="QualifyingPropertiesReference" type="QualifyingPropertiesReferenceType"/>
<xsd:complexType name="QualifyingPropertiesReferenceType">
<xsd:attribute name="URI" type="xsd:anyURI" use="required"/>
<xsd:attribute name="Id" type="xsd:ID" use="optional"/>
</xsd:complexType>
<!-- End QualifyingPropertiesReference-->
<!-- End container types -->
<!-- Start SigningTime element -->
<xsd:element name="SigningTime" type="xsd:dateTime"/>
<!-- End SigningTime element -->
<!-- Start SigningCertificate -->
<xsd:element name="SigningCertificate" type="CertIDListType"/>
<xsd:complexType name="CertIDListType">
<xsd:sequence>
<xsd:element name="Cert" type="CertIDType" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="CertIDType">
<xsd:sequence>
<xsd:element name="CertDigest" type="DigestAlgAndValueType"/>
<xsd:element name="IssuerSerial" type="ds:X509IssuerSerialType"/>
</xsd:sequence>
<xsd:attribute name="URI" type="xsd:anyURI" use="optional"/>
</xsd:complexType>
<xsd:complexType name="DigestAlgAndValueType">
<xsd:sequence>
<xsd:element ref="ds:DigestMethod"/>
<xsd:element ref="ds:DigestValue"/>
</xsd:sequence>
</xsd:complexType>
<!-- End SigningCertificate -->
<!-- Start SignaturePolicyIdentifier -->
<xsd:element name="SignaturePolicyIdentifier" type="SignaturePolicyIdentifierType"/>
<xsd:complexType name="SignaturePolicyIdentifierType">
<xsd:choice>
<xsd:element name="SignaturePolicyId" type="SignaturePolicyIdType"/>
<xsd:element name="SignaturePolicyImplied"/>
</xsd:choice>
</xsd:complexType>
<xsd:complexType name="SignaturePolicyIdType">
<xsd:sequence>
<xsd:element name="SigPolicyId" type="ObjectIdentifierType"/>
<xsd:element ref="ds:Transforms" minOccurs="0"/>
<xsd:element name="SigPolicyHash" type="DigestAlgAndValueType"/>
<xsd:element name="SigPolicyQualifiers" type="SigPolicyQualifiersListType" minOccurs="0"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="SigPolicyQualifiersListType">
<xsd:sequence>
<xsd:element name="SigPolicyQualifier" type="AnyType" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
<xsd:element name="SPURI" type="xsd:anyURI"/>
<xsd:element name="SPUserNotice" type="SPUserNoticeType"/>
<xsd:complexType name="SPUserNoticeType">
<xsd:sequence>
<xsd:element name="NoticeRef" type="NoticeReferenceType" minOccurs="0"/>
<xsd:element name="ExplicitText" type="xsd:string" minOccurs="0"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="NoticeReferenceType">
<xsd:sequence>
<xsd:element name="Organization" type="xsd:string"/>
<xsd:element name="NoticeNumbers" type="IntegerListType"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="IntegerListType">
<xsd:sequence>
<xsd:element name="int" type="xsd:integer" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
<!-- End SignaturePolicyIdentifier -->
<!-- Start CounterSignature -->
<xsd:element name="CounterSignature" type="CounterSignatureType"/>
<xsd:complexType name="CounterSignatureType">
<xsd:sequence>
<xsd:element ref="ds:Signature"/>
</xsd:sequence>
</xsd:complexType>
<!-- End CounterSignature -->
<!-- Start DataObjectFormat -->
<xsd:element name="DataObjectFormat" type="DataObjectFormatType"/>
<xsd:complexType name="DataObjectFormatType">
<xsd:sequence>
<xsd:element name="Description" type="xsd:string" minOccurs="0"/>
<xsd:element name="ObjectIdentifier" type="ObjectIdentifierType" minOccurs="0"/>
<xsd:element name="MimeType" type="xsd:string" minOccurs="0"/>
<xsd:element name="Encoding" type="xsd:anyURI" minOccurs="0"/>
</xsd:sequence>
<xsd:attribute name="ObjectReference" type="xsd:anyURI" use="required"/>
</xsd:complexType>
<!-- End DataObjectFormat -->
<!-- Start CommitmentTypeIndication -->
<xsd:element name="CommitmentTypeIndication" type="CommitmentTypeIndicationType"/>
<xsd:complexType name="CommitmentTypeIndicationType">
<xsd:sequence>
<xsd:element name="CommitmentTypeId" type="ObjectIdentifierType"/>
<xsd:choice>
<xsd:element name="ObjectReference" type="xsd:anyURI" maxOccurs="unbounded"/>
<xsd:element name="AllSignedDataObjects"/>
</xsd:choice>
<xsd:element name="CommitmentTypeQualifiers" type="CommitmentTypeQualifiersListType" minOccurs="0"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="CommitmentTypeQualifiersListType">
<xsd:sequence>
<xsd:element name="CommitmentTypeQualifier" type="AnyType" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
<!-- End CommitmentTypeIndication -->
<!-- Start SignatureProductionPlace -->
<xsd:element name="SignatureProductionPlace" type="SignatureProductionPlaceType"/>
<xsd:complexType name="SignatureProductionPlaceType">
<xsd:sequence>
<xsd:element name="City" type="xsd:string" minOccurs="0"/>
<xsd:element name="StateOrProvince" type="xsd:string" minOccurs="0"/>
<xsd:element name="PostalCode" type="xsd:string" minOccurs="0"/>
<xsd:element name="CountryName" type="xsd:string" minOccurs="0"/>
</xsd:sequence>
</xsd:complexType>
<!-- End SignatureProductionPlace -->
<!-- Start SignerRole -->
<xsd:element name="SignerRole" type="SignerRoleType"/>
<xsd:complexType name="SignerRoleType">
<xsd:sequence>
<xsd:element name="ClaimedRoles" type="ClaimedRolesListType" minOccurs="0"/>
<xsd:element name="CertifiedRoles" type="CertifiedRolesListType" minOccurs="0"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="ClaimedRolesListType">
<xsd:sequence>
<xsd:element name="ClaimedRole" type="AnyType" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="CertifiedRolesListType">
<xsd:sequence>
<xsd:element name="CertifiedRole" type="EncapsulatedPKIDataType" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
<!-- End SignerRole -->
<xsd:element name="AllDataObjectsTimeStamp" type="XAdESTimeStampType"/>
<xsd:element name="IndividualDataObjectsTimeStamp" type="XAdESTimeStampType"/>
<xsd:element name="SignatureTimeStamp" type="XAdESTimeStampType"/>
<!-- Start CompleteCertificateRefs -->
<xsd:element name="CompleteCertificateRefs" type="CompleteCertificateRefsType"/>
<xsd:complexType name="CompleteCertificateRefsType">
<xsd:sequence>
<xsd:element name="CertRefs" type="CertIDListType"/>
</xsd:sequence>
<xsd:attribute name="Id" type="xsd:ID" use="optional"/>
</xsd:complexType>
<!-- End CompleteCertificateRefs -->
<!-- Start CompleteRevocationRefs-->
<xsd:element name="CompleteRevocationRefs" type="CompleteRevocationRefsType"/>
<xsd:complexType name="CompleteRevocationRefsType">
<xsd:sequence>
<xsd:element name="CRLRefs" type="CRLRefsType" minOccurs="0"/>
<xsd:element name="OCSPRefs" type="OCSPRefsType" minOccurs="0"/>
<xsd:element name="OtherRefs" type="OtherCertStatusRefsType" minOccurs="0"/>
</xsd:sequence>
<xsd:attribute name="Id" type="xsd:ID" use="optional"/>
</xsd:complexType>
<xsd:complexType name="CRLRefsType">
<xsd:sequence>
<xsd:element name="CRLRef" type="CRLRefType" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="CRLRefType">
<xsd:sequence>
<xsd:element name="DigestAlgAndValue" type="DigestAlgAndValueType"/>
<xsd:element name="CRLIdentifier" type="CRLIdentifierType" minOccurs="0"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="CRLIdentifierType">
<xsd:sequence>
<xsd:element name="Issuer" type="xsd:string"/>
<xsd:element name="IssueTime" type="xsd:dateTime"/>
<xsd:element name="Number" type="xsd:integer" minOccurs="0"/>
</xsd:sequence>
<xsd:attribute name="URI" type="xsd:anyURI" use="optional"/>
</xsd:complexType>
<xsd:complexType name="OCSPRefsType">
<xsd:sequence>
<xsd:element name="OCSPRef" type="OCSPRefType" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="OCSPRefType">
<xsd:sequence>
<xsd:element name="OCSPIdentifier" type="OCSPIdentifierType"/>
<xsd:element name="DigestAlgAndValue" type="DigestAlgAndValueType" minOccurs="0"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="ResponderIDType">
<xsd:choice>
<xsd:element name="ByName" type="xsd:string"/>
<xsd:element name="ByKey" type="xsd:base64Binary"/>
</xsd:choice>
</xsd:complexType>
<xsd:complexType name="OCSPIdentifierType">
<xsd:sequence>
<xsd:element name="ResponderID" type="ResponderIDType"/>
<xsd:element name="ProducedAt" type="xsd:dateTime"/>
</xsd:sequence>
<xsd:attribute name="URI" type="xsd:anyURI" use="optional"/>
</xsd:complexType>
<xsd:complexType name="OtherCertStatusRefsType">
<xsd:sequence>
<xsd:element name="OtherRef" type="AnyType" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
<!-- End CompleteRevocationRefs-->
<xsd:element name="AttributeCertificateRefs" type="CompleteCertificateRefsType"/>
<xsd:element name="AttributeRevocationRefs" type="CompleteRevocationRefsType"/>
<xsd:element name="SigAndRefsTimeStamp" type="XAdESTimeStampType"/>
<xsd:element name="RefsOnlyTimeStamp" type="XAdESTimeStampType"/>
<!-- Start CertificateValues -->
<xsd:element name="CertificateValues" type="CertificateValuesType"/>
<xsd:complexType name="CertificateValuesType">
<xsd:choice minOccurs="0" maxOccurs="unbounded">
<xsd:element name="EncapsulatedX509Certificate" type="EncapsulatedPKIDataType"/>
<xsd:element name="OtherCertificate" type="AnyType"/>
</xsd:choice>
<xsd:attribute name="Id" type="xsd:ID" use="optional"/>
</xsd:complexType>
<!-- End CertificateValues -->
<!-- Start RevocationValues-->
<xsd:element name="RevocationValues" type="RevocationValuesType"/>
<xsd:complexType name="RevocationValuesType">
<xsd:sequence>
<xsd:element name="CRLValues" type="CRLValuesType" minOccurs="0"/>
<xsd:element name="OCSPValues" type="OCSPValuesType" minOccurs="0"/>
<xsd:element name="OtherValues" type="OtherCertStatusValuesType" minOccurs="0"/>
</xsd:sequence>
<xsd:attribute name="Id" type="xsd:ID" use="optional"/>
</xsd:complexType>
<xsd:complexType name="CRLValuesType">
<xsd:sequence>
<xsd:element name="EncapsulatedCRLValue" type="EncapsulatedPKIDataType" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="OCSPValuesType">
<xsd:sequence>
<xsd:element name="EncapsulatedOCSPValue" type="EncapsulatedPKIDataType" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="OtherCertStatusValuesType">
<xsd:sequence>
<xsd:element name="OtherValue" type="AnyType" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
<!-- End RevocationValues-->
<xsd:element name="AttrAuthoritiesCertValues" type="CertificateValuesType"/>
<xsd:element name="AttributeRevocationValues" type="RevocationValuesType"/>
<xsd:element name="ArchiveTimeStamp" type="XAdESTimeStampType"/>
</xsd:schema>

View file

@ -1,46 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Licensed to the Koordinierungsstelle für IT-Standards (KoSIT) under
~ one or more contributor license agreements. See the NOTICE file
~ distributed with this work for additional information
~ regarding copyright ownership. KoSIT licenses this file
~ to you under the Apache License, Version 2.0 (the
~ "License"); you may not use this file except in compliance
~ with the License. You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing,
~ software distributed under the License is distributed on an
~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
~ KIND, either express or implied. See the License for the
~ specific language governing permissions and limitations
~ under the License.
-->
<!--
Library: OASIS Universal Business Language (UBL) 2.1 OS
http://docs.oasis-open.org/ubl/os-UBL-2.1/
Release Date: 04 November 2013
Module: UBL-XAdESv141-2.1.xsd
Generated on: 2011-02-21 17:20(UTC)
This is a copy of http://uri.etsi.org/01903/v1.4.1/XAdESv141.xsd modified
only to change the importing URI for the XAdES v1.3.2 schema.
-->
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xades="http://uri.etsi.org/01903/v1.3.2#"
targetNamespace="http://uri.etsi.org/01903/v1.4.1#" xmlns="http://uri.etsi.org/01903/v1.4.1#"
elementFormDefault="qualified">
<xsd:import namespace="http://uri.etsi.org/01903/v1.3.2#" schemaLocation="UBL-XAdESv132-2.1.xsd"/>
<!-- Start CertificateValues -->
<xsd:element name="TimeStampValidationData" type="ValidationDataType"/>
<xsd:complexType name="ValidationDataType">
<xsd:sequence>
<xsd:element ref="xades:CertificateValues" minOccurs="0"/>
<xsd:element ref="xades:RevocationValues" minOccurs="0"/>
</xsd:sequence>
<xsd:attribute name="Id" type="xsd:ID" use="optional"/>
<xsd:attribute name="UR" type="xsd:anyURI" use="optional"/>
</xsd:complexType>
<xsd:element name="ArchiveTimeStampV2" type="xades:XAdESTimeStampType"/>
</xsd:schema>

View file

@ -1,332 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Licensed to the Koordinierungsstelle für IT-Standards (KoSIT) under
~ one or more contributor license agreements. See the NOTICE file
~ distributed with this work for additional information
~ regarding copyright ownership. KoSIT licenses this file
~ to you under the Apache License, Version 2.0 (the
~ "License"); you may not use this file except in compliance
~ with the License. You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing,
~ software distributed under the License is distributed on an
~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
~ KIND, either express or implied. See the License for the
~ specific language governing permissions and limitations
~ under the License.
-->
<!--
Library: OASIS Universal Business Language (UBL) 2.1 OS
http://docs.oasis-open.org/ubl/os-UBL-2.1/
Release Date: 04 November 2013
Module: UBL-xmldsig-core-schema-2.1.xsd
Generated on: 2010-08-13 19:10(UTC)
This is a copy of http://www.w3.org/TR/xmldsig-core/xmldsig-core-schema.xsd
modified only to remove these PUBLIC and SYSTEM identifiers from the DOCTYPE:
PUBLIC "-//W3C//DTD XMLSchema 200102//EN"
"http://www.w3.org/2001/XMLSchema.dtd"
-->
<!DOCTYPE schema
[
<!ATTLIST schema
xmlns:ds CDATA #FIXED "http://www.w3.org/2000/09/xmldsig#">
<!ENTITY dsig 'http://www.w3.org/2000/09/xmldsig#'>
<!ENTITY % p ''>
<!ENTITY % s ''>
]>
<schema xmlns:ds="http://www.w3.org/2000/09/xmldsig#"
xmlns="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://www.w3.org/2000/09/xmldsig#"
version="0.1" elementFormDefault="qualified">
<!-- Basic Types Defined for Signatures -->
<simpleType name="CryptoBinary">
<restriction base="base64Binary">
</restriction>
</simpleType>
<!-- Start Signature -->
<element name="Signature" type="ds:SignatureType"/>
<complexType name="SignatureType">
<sequence>
<element ref="ds:SignedInfo"/>
<element ref="ds:SignatureValue"/>
<element ref="ds:KeyInfo" minOccurs="0"/>
<element ref="ds:Object" minOccurs="0" maxOccurs="unbounded"/>
</sequence>
<attribute name="Id" type="ID" use="optional"/>
</complexType>
<element name="SignatureValue" type="ds:SignatureValueType"/>
<complexType name="SignatureValueType">
<simpleContent>
<extension base="base64Binary">
<attribute name="Id" type="ID" use="optional"/>
</extension>
</simpleContent>
</complexType>
<!-- Start SignedInfo -->
<element name="SignedInfo" type="ds:SignedInfoType"/>
<complexType name="SignedInfoType">
<sequence>
<element ref="ds:CanonicalizationMethod"/>
<element ref="ds:SignatureMethod"/>
<element ref="ds:Reference" maxOccurs="unbounded"/>
</sequence>
<attribute name="Id" type="ID" use="optional"/>
</complexType>
<element name="CanonicalizationMethod" type="ds:CanonicalizationMethodType"/>
<complexType name="CanonicalizationMethodType" mixed="true">
<sequence>
<any namespace="##any" minOccurs="0" maxOccurs="unbounded"/>
<!-- (0,unbounded) elements from (1,1) namespace -->
</sequence>
<attribute name="Algorithm" type="anyURI" use="required"/>
</complexType>
<element name="SignatureMethod" type="ds:SignatureMethodType"/>
<complexType name="SignatureMethodType" mixed="true">
<sequence>
<element name="HMACOutputLength" minOccurs="0" type="ds:HMACOutputLengthType"/>
<any namespace="##other" minOccurs="0" maxOccurs="unbounded"/>
<!-- (0,unbounded) elements from (1,1) external namespace -->
</sequence>
<attribute name="Algorithm" type="anyURI" use="required"/>
</complexType>
<!-- Start Reference -->
<element name="Reference" type="ds:ReferenceType"/>
<complexType name="ReferenceType">
<sequence>
<element ref="ds:Transforms" minOccurs="0"/>
<element ref="ds:DigestMethod"/>
<element ref="ds:DigestValue"/>
</sequence>
<attribute name="Id" type="ID" use="optional"/>
<attribute name="URI" type="anyURI" use="optional"/>
<attribute name="Type" type="anyURI" use="optional"/>
</complexType>
<element name="Transforms" type="ds:TransformsType"/>
<complexType name="TransformsType">
<sequence>
<element ref="ds:Transform" maxOccurs="unbounded"/>
</sequence>
</complexType>
<element name="Transform" type="ds:TransformType"/>
<complexType name="TransformType" mixed="true">
<choice minOccurs="0" maxOccurs="unbounded">
<any namespace="##other" processContents="lax"/>
<!-- (1,1) elements from (0,unbounded) namespaces -->
<element name="XPath" type="string"/>
</choice>
<attribute name="Algorithm" type="anyURI" use="required"/>
</complexType>
<!-- End Reference -->
<element name="DigestMethod" type="ds:DigestMethodType"/>
<complexType name="DigestMethodType" mixed="true">
<sequence>
<any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
</sequence>
<attribute name="Algorithm" type="anyURI" use="required"/>
</complexType>
<element name="DigestValue" type="ds:DigestValueType"/>
<simpleType name="DigestValueType">
<restriction base="base64Binary"/>
</simpleType>
<!-- End SignedInfo -->
<!-- Start KeyInfo -->
<element name="KeyInfo" type="ds:KeyInfoType"/>
<complexType name="KeyInfoType" mixed="true">
<choice maxOccurs="unbounded">
<element ref="ds:KeyName"/>
<element ref="ds:KeyValue"/>
<element ref="ds:RetrievalMethod"/>
<element ref="ds:X509Data"/>
<element ref="ds:PGPData"/>
<element ref="ds:SPKIData"/>
<element ref="ds:MgmtData"/>
<any processContents="lax" namespace="##other"/>
<!-- (1,1) elements from (0,unbounded) namespaces -->
</choice>
<attribute name="Id" type="ID" use="optional"/>
</complexType>
<element name="KeyName" type="string"/>
<element name="MgmtData" type="string"/>
<element name="KeyValue" type="ds:KeyValueType"/>
<complexType name="KeyValueType" mixed="true">
<choice>
<element ref="ds:DSAKeyValue"/>
<element ref="ds:RSAKeyValue"/>
<any namespace="##other" processContents="lax"/>
</choice>
</complexType>
<element name="RetrievalMethod" type="ds:RetrievalMethodType"/>
<complexType name="RetrievalMethodType">
<sequence>
<element ref="ds:Transforms" minOccurs="0"/>
</sequence>
<attribute name="URI" type="anyURI"/>
<attribute name="Type" type="anyURI" use="optional"/>
</complexType>
<!-- Start X509Data -->
<element name="X509Data" type="ds:X509DataType"/>
<complexType name="X509DataType">
<sequence maxOccurs="unbounded">
<choice>
<element name="X509IssuerSerial" type="ds:X509IssuerSerialType"/>
<element name="X509SKI" type="base64Binary"/>
<element name="X509SubjectName" type="string"/>
<element name="X509Certificate" type="base64Binary"/>
<element name="X509CRL" type="base64Binary"/>
<any namespace="##other" processContents="lax"/>
</choice>
</sequence>
</complexType>
<complexType name="X509IssuerSerialType">
<sequence>
<element name="X509IssuerName" type="string"/>
<element name="X509SerialNumber" type="integer"/>
</sequence>
</complexType>
<!-- End X509Data -->
<!-- Begin PGPData -->
<element name="PGPData" type="ds:PGPDataType"/>
<complexType name="PGPDataType">
<choice>
<sequence>
<element name="PGPKeyID" type="base64Binary"/>
<element name="PGPKeyPacket" type="base64Binary" minOccurs="0"/>
<any namespace="##other" processContents="lax" minOccurs="0"
maxOccurs="unbounded"/>
</sequence>
<sequence>
<element name="PGPKeyPacket" type="base64Binary"/>
<any namespace="##other" processContents="lax" minOccurs="0"
maxOccurs="unbounded"/>
</sequence>
</choice>
</complexType>
<!-- End PGPData -->
<!-- Begin SPKIData -->
<element name="SPKIData" type="ds:SPKIDataType"/>
<complexType name="SPKIDataType">
<sequence maxOccurs="unbounded">
<element name="SPKISexp" type="base64Binary"/>
<any namespace="##other" processContents="lax" minOccurs="0"/>
</sequence>
</complexType>
<!-- End SPKIData -->
<!-- End KeyInfo -->
<!-- Start Object (Manifest, SignatureProperty) -->
<element name="Object" type="ds:ObjectType"/>
<complexType name="ObjectType" mixed="true">
<sequence minOccurs="0" maxOccurs="unbounded">
<any namespace="##any" processContents="lax"/>
</sequence>
<attribute name="Id" type="ID" use="optional"/>
<attribute name="MimeType" type="string" use="optional"/> <!-- add a grep facet -->
<attribute name="Encoding" type="anyURI" use="optional"/>
</complexType>
<element name="Manifest" type="ds:ManifestType"/>
<complexType name="ManifestType">
<sequence>
<element ref="ds:Reference" maxOccurs="unbounded"/>
</sequence>
<attribute name="Id" type="ID" use="optional"/>
</complexType>
<element name="SignatureProperties" type="ds:SignaturePropertiesType"/>
<complexType name="SignaturePropertiesType">
<sequence>
<element ref="ds:SignatureProperty" maxOccurs="unbounded"/>
</sequence>
<attribute name="Id" type="ID" use="optional"/>
</complexType>
<element name="SignatureProperty" type="ds:SignaturePropertyType"/>
<complexType name="SignaturePropertyType" mixed="true">
<choice maxOccurs="unbounded">
<any namespace="##other" processContents="lax"/>
<!-- (1,1) elements from (1,unbounded) namespaces -->
</choice>
<attribute name="Target" type="anyURI" use="required"/>
<attribute name="Id" type="ID" use="optional"/>
</complexType>
<!-- End Object (Manifest, SignatureProperty) -->
<!-- Start Algorithm Parameters -->
<simpleType name="HMACOutputLengthType">
<restriction base="integer"/>
</simpleType>
<!-- Start KeyValue Element-types -->
<element name="DSAKeyValue" type="ds:DSAKeyValueType"/>
<complexType name="DSAKeyValueType">
<sequence>
<sequence minOccurs="0">
<element name="P" type="ds:CryptoBinary"/>
<element name="Q" type="ds:CryptoBinary"/>
</sequence>
<element name="G" type="ds:CryptoBinary" minOccurs="0"/>
<element name="Y" type="ds:CryptoBinary"/>
<element name="J" type="ds:CryptoBinary" minOccurs="0"/>
<sequence minOccurs="0">
<element name="Seed" type="ds:CryptoBinary"/>
<element name="PgenCounter" type="ds:CryptoBinary"/>
</sequence>
</sequence>
</complexType>
<element name="RSAKeyValue" type="ds:RSAKeyValueType"/>
<complexType name="RSAKeyValueType">
<sequence>
<element name="Modulus" type="ds:CryptoBinary"/>
<element name="Exponent" type="ds:CryptoBinary"/>
</sequence>
</complexType>
<!-- End KeyValue Element-types -->
<!-- End Signature -->
</schema>

View file

@ -1,153 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Licensed to the Koordinierungsstelle für IT-Standards (KoSIT) under
~ one or more contributor license agreements. See the NOTICE file
~ distributed with this work for additional information
~ regarding copyright ownership. KoSIT licenses this file
~ to you under the Apache License, Version 2.0 (the
~ "License"); you may not use this file except in compliance
~ with the License. You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing,
~ software distributed under the License is distributed on an
~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
~ KIND, either express or implied. See the License for the
~ specific language governing permissions and limitations
~ under the License.
-->
<xsd:schema xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2"
xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2"
xmlns:ext="urn:oasis:names:specification:ubl:schema:xsd:CommonExtensionComponents-2"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns="urn:oasis:names:specification:ubl:schema:xsd:CreditNote-2"
targetNamespace="urn:oasis:names:specification:ubl:schema:xsd:CreditNote-2"
elementFormDefault="qualified"
attributeFormDefault="unqualified"
version="2.1">
<xsd:import namespace="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2"
schemaLocation="../common/UBL-CommonAggregateComponents-2.1.xsd"/>
<xsd:import namespace="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2"
schemaLocation="../common/UBL-CommonBasicComponents-2.1.xsd"/>
<xsd:import namespace="urn:oasis:names:specification:ubl:schema:xsd:CommonExtensionComponents-2"
schemaLocation="../common/UBL-CommonExtensionComponents-2.1.xsd"/>
<xsd:element name="CreditNote" type="CreditNoteType"/>
<xsd:complexType name="CreditNoteType">
<xsd:sequence>
<xsd:element ref="ext:UBLExtensions" minOccurs="0" maxOccurs="1"/>
<xsd:element ref="cbc:UBLVersionID" minOccurs="0" maxOccurs="1"/>
<xsd:element ref="cbc:CustomizationID" minOccurs="0" maxOccurs="1"/>
<xsd:element ref="cbc:ProfileID" minOccurs="0" maxOccurs="1"/>
<xsd:element ref="cbc:ProfileExecutionID" minOccurs="0" maxOccurs="1"/>
<xsd:element ref="cbc:ID" minOccurs="1" maxOccurs="1"/>
<xsd:element ref="cbc:CopyIndicator" minOccurs="0" maxOccurs="1"/>
<xsd:element ref="cbc:UUID" minOccurs="0" maxOccurs="1"/>
<xsd:element ref="cbc:IssueDate" minOccurs="1" maxOccurs="1"/>
<xsd:element ref="cbc:IssueTime" minOccurs="0" maxOccurs="1"/>
<xsd:element ref="cbc:TaxPointDate" minOccurs="0" maxOccurs="1"/>
<xsd:element ref="cbc:CreditNoteTypeCode" minOccurs="0" maxOccurs="1"/>
<xsd:element ref="cbc:Note" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element ref="cbc:DocumentCurrencyCode" minOccurs="0" maxOccurs="1"/>
<xsd:element ref="cbc:TaxCurrencyCode" minOccurs="0" maxOccurs="1"/>
<xsd:element ref="cbc:PricingCurrencyCode" minOccurs="0" maxOccurs="1"/>
<xsd:element ref="cbc:PaymentCurrencyCode" minOccurs="0" maxOccurs="1"/>
<xsd:element ref="cbc:PaymentAlternativeCurrencyCode"
minOccurs="0"
maxOccurs="1"/>
<xsd:element ref="cbc:AccountingCostCode" minOccurs="0" maxOccurs="1"/>
<xsd:element ref="cbc:AccountingCost" minOccurs="0" maxOccurs="1"/>
<xsd:element ref="cbc:LineCountNumeric" minOccurs="0" maxOccurs="1"/>
<xsd:element ref="cbc:BuyerReference" minOccurs="0" maxOccurs="1"/>
<xsd:element ref="cac:InvoicePeriod" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element ref="cac:DiscrepancyResponse" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element ref="cac:OrderReference" minOccurs="0" maxOccurs="1"/>
<xsd:element ref="cac:BillingReference" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element ref="cac:DespatchDocumentReference"
minOccurs="0"
maxOccurs="unbounded"/>
<xsd:element ref="cac:ReceiptDocumentReference"
minOccurs="0"
maxOccurs="unbounded"/>
<xsd:element ref="cac:ContractDocumentReference"
minOccurs="0"
maxOccurs="unbounded"/>
<xsd:element ref="cac:AdditionalDocumentReference"
minOccurs="0"
maxOccurs="unbounded"/>
<xsd:element ref="cac:StatementDocumentReference"
minOccurs="0"
maxOccurs="unbounded"/>
<xsd:element ref="cac:OriginatorDocumentReference"
minOccurs="0"
maxOccurs="unbounded"/>
<xsd:element ref="cac:Signature" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element ref="cac:AccountingSupplierParty" minOccurs="1" maxOccurs="1"/>
<xsd:element ref="cac:AccountingCustomerParty" minOccurs="1" maxOccurs="1"/>
<xsd:element ref="cac:PayeeParty" minOccurs="0" maxOccurs="1"/>
<xsd:element ref="cac:BuyerCustomerParty" minOccurs="0" maxOccurs="1"/>
<xsd:element ref="cac:SellerSupplierParty" minOccurs="0" maxOccurs="1"/>
<xsd:element ref="cac:TaxRepresentativeParty" minOccurs="0" maxOccurs="1"/>
<xsd:element ref="cac:Delivery" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element ref="cac:DeliveryTerms" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element ref="cac:PaymentMeans" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element ref="cac:PaymentTerms" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element ref="cac:TaxExchangeRate" minOccurs="0" maxOccurs="1"/>
<xsd:element ref="cac:PricingExchangeRate" minOccurs="0" maxOccurs="1"/>
<xsd:element ref="cac:PaymentExchangeRate" minOccurs="0" maxOccurs="1"/>
<xsd:element ref="cac:PaymentAlternativeExchangeRate"
minOccurs="0"
maxOccurs="1"/>
<xsd:element ref="cac:AllowanceCharge" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element ref="cac:TaxTotal" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element ref="cac:LegalMonetaryTotal" minOccurs="1" maxOccurs="1"/>
<xsd:element ref="cac:CreditNoteLine" minOccurs="1" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
</xsd:schema>
<!-- ===== Copyright Notice ===== --><!--
OASIS takes no position regarding the validity or scope of any
intellectual property or other rights that might be claimed to pertain
to the implementation or use of the technology described in this
document or the extent to which any license under such rights
might or might not be available; neither does it represent that it has
made any effort to identify any such rights. Information on OASIS's
procedures with respect to rights in OASIS specifications can be
found at the OASIS website. Copies of claims of rights made
available for publication and any assurances of licenses to be made
available, or the result of an attempt made to obtain a general
license or permission for the use of such proprietary rights by
implementors or users of this specification, can be obtained from
the OASIS Executive Director.
OASIS invites any interested party to bring to its attention any
copyrights, patents or patent applications, or other proprietary
rights which may cover technology that may be required to
implement this specification. Please address the information to the
OASIS Executive Director.
This document and translations of it may be copied and furnished to
others, and derivative works that comment on or otherwise explain
it or assist in its implementation may be prepared, copied,
published and distributed, in whole or in part, without restriction of
any kind, provided that the above copyright notice and this
paragraph are included on all such copies and derivative works.
However, this document itself may not be modified in any way,
such as by removing the copyright notice or references to OASIS,
except as needed for the purpose of developing OASIS
specifications, in which case the procedures for copyrights defined
in the OASIS Intellectual Property Rights document must be
followed, or as required to translate it into languages other than
English.
The limited permissions granted above are perpetual and will not be
revoked by OASIS or its successors or assigns.
This document and the information contained herein is provided on
an "AS IS" basis and OASIS DISCLAIMS ALL WARRANTIES,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY
WARRANTY THAT THE USE OF THE INFORMATION HEREIN
WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED
WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A
PARTICULAR PURPOSE.
-->

View file

@ -1,156 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Licensed to the Koordinierungsstelle für IT-Standards (KoSIT) under
~ one or more contributor license agreements. See the NOTICE file
~ distributed with this work for additional information
~ regarding copyright ownership. KoSIT licenses this file
~ to you under the Apache License, Version 2.0 (the
~ "License"); you may not use this file except in compliance
~ with the License. You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing,
~ software distributed under the License is distributed on an
~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
~ KIND, either express or implied. See the License for the
~ specific language governing permissions and limitations
~ under the License.
-->
<xsd:schema xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2"
xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2"
xmlns:ext="urn:oasis:names:specification:ubl:schema:xsd:CommonExtensionComponents-2"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2"
targetNamespace="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2"
elementFormDefault="qualified"
attributeFormDefault="unqualified"
version="2.1">
<xsd:import namespace="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2"
schemaLocation="../common/UBL-CommonAggregateComponents-2.1.xsd"/>
<xsd:import namespace="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2"
schemaLocation="../common/UBL-CommonBasicComponents-2.1.xsd"/>
<xsd:import namespace="urn:oasis:names:specification:ubl:schema:xsd:CommonExtensionComponents-2"
schemaLocation="../common/UBL-CommonExtensionComponents-2.1.xsd"/>
<xsd:element name="Invoice" type="InvoiceType"/>
<xsd:complexType name="InvoiceType">
<xsd:sequence>
<xsd:element ref="ext:UBLExtensions" minOccurs="0" maxOccurs="1"/>
<xsd:element ref="cbc:UBLVersionID" minOccurs="0" maxOccurs="1"/>
<xsd:element ref="cbc:CustomizationID" minOccurs="0" maxOccurs="1"/>
<xsd:element ref="cbc:ProfileID" minOccurs="0" maxOccurs="1"/>
<xsd:element ref="cbc:ProfileExecutionID" minOccurs="0" maxOccurs="1"/>
<xsd:element ref="cbc:ID" minOccurs="1" maxOccurs="1"/>
<xsd:element ref="cbc:CopyIndicator" minOccurs="0" maxOccurs="1"/>
<xsd:element ref="cbc:UUID" minOccurs="0" maxOccurs="1"/>
<xsd:element ref="cbc:IssueDate" minOccurs="1" maxOccurs="1"/>
<xsd:element ref="cbc:IssueTime" minOccurs="0" maxOccurs="1"/>
<xsd:element ref="cbc:DueDate" minOccurs="0" maxOccurs="1"/>
<xsd:element ref="cbc:InvoiceTypeCode" minOccurs="0" maxOccurs="1"/>
<xsd:element ref="cbc:Note" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element ref="cbc:TaxPointDate" minOccurs="0" maxOccurs="1"/>
<xsd:element ref="cbc:DocumentCurrencyCode" minOccurs="0" maxOccurs="1"/>
<xsd:element ref="cbc:TaxCurrencyCode" minOccurs="0" maxOccurs="1"/>
<xsd:element ref="cbc:PricingCurrencyCode" minOccurs="0" maxOccurs="1"/>
<xsd:element ref="cbc:PaymentCurrencyCode" minOccurs="0" maxOccurs="1"/>
<xsd:element ref="cbc:PaymentAlternativeCurrencyCode"
minOccurs="0"
maxOccurs="1"/>
<xsd:element ref="cbc:AccountingCostCode" minOccurs="0" maxOccurs="1"/>
<xsd:element ref="cbc:AccountingCost" minOccurs="0" maxOccurs="1"/>
<xsd:element ref="cbc:LineCountNumeric" minOccurs="0" maxOccurs="1"/>
<xsd:element ref="cbc:BuyerReference" minOccurs="0" maxOccurs="1"/>
<xsd:element ref="cac:InvoicePeriod" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element ref="cac:OrderReference" minOccurs="0" maxOccurs="1"/>
<xsd:element ref="cac:BillingReference" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element ref="cac:DespatchDocumentReference"
minOccurs="0"
maxOccurs="unbounded"/>
<xsd:element ref="cac:ReceiptDocumentReference"
minOccurs="0"
maxOccurs="unbounded"/>
<xsd:element ref="cac:StatementDocumentReference"
minOccurs="0"
maxOccurs="unbounded"/>
<xsd:element ref="cac:OriginatorDocumentReference"
minOccurs="0"
maxOccurs="unbounded"/>
<xsd:element ref="cac:ContractDocumentReference"
minOccurs="0"
maxOccurs="unbounded"/>
<xsd:element ref="cac:AdditionalDocumentReference"
minOccurs="0"
maxOccurs="unbounded"/>
<xsd:element ref="cac:ProjectReference" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element ref="cac:Signature" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element ref="cac:AccountingSupplierParty" minOccurs="1" maxOccurs="1"/>
<xsd:element ref="cac:AccountingCustomerParty" minOccurs="1" maxOccurs="1"/>
<xsd:element ref="cac:PayeeParty" minOccurs="0" maxOccurs="1"/>
<xsd:element ref="cac:BuyerCustomerParty" minOccurs="0" maxOccurs="1"/>
<xsd:element ref="cac:SellerSupplierParty" minOccurs="0" maxOccurs="1"/>
<xsd:element ref="cac:TaxRepresentativeParty" minOccurs="0" maxOccurs="1"/>
<xsd:element ref="cac:Delivery" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element ref="cac:DeliveryTerms" minOccurs="0" maxOccurs="1"/>
<xsd:element ref="cac:PaymentMeans" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element ref="cac:PaymentTerms" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element ref="cac:PrepaidPayment" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element ref="cac:AllowanceCharge" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element ref="cac:TaxExchangeRate" minOccurs="0" maxOccurs="1"/>
<xsd:element ref="cac:PricingExchangeRate" minOccurs="0" maxOccurs="1"/>
<xsd:element ref="cac:PaymentExchangeRate" minOccurs="0" maxOccurs="1"/>
<xsd:element ref="cac:PaymentAlternativeExchangeRate"
minOccurs="0"
maxOccurs="1"/>
<xsd:element ref="cac:TaxTotal" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element ref="cac:WithholdingTaxTotal" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element ref="cac:LegalMonetaryTotal" minOccurs="1" maxOccurs="1"/>
<xsd:element ref="cac:InvoiceLine" minOccurs="1" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
</xsd:schema>
<!-- ===== Copyright Notice ===== --><!--
OASIS takes no position regarding the validity or scope of any
intellectual property or other rights that might be claimed to pertain
to the implementation or use of the technology described in this
document or the extent to which any license under such rights
might or might not be available; neither does it represent that it has
made any effort to identify any such rights. Information on OASIS's
procedures with respect to rights in OASIS specifications can be
found at the OASIS website. Copies of claims of rights made
available for publication and any assurances of licenses to be made
available, or the result of an attempt made to obtain a general
license or permission for the use of such proprietary rights by
implementors or users of this specification, can be obtained from
the OASIS Executive Director.
OASIS invites any interested party to bring to its attention any
copyrights, patents or patent applications, or other proprietary
rights which may cover technology that may be required to
implement this specification. Please address the information to the
OASIS Executive Director.
This document and translations of it may be copied and furnished to
others, and derivative works that comment on or otherwise explain
it or assist in its implementation may be prepared, copied,
published and distributed, in whole or in part, without restriction of
any kind, provided that the above copyright notice and this
paragraph are included on all such copies and derivative works.
However, this document itself may not be modified in any way,
such as by removing the copyright notice or references to OASIS,
except as needed for the purpose of developing OASIS
specifications, in which case the procedures for copyrights defined
in the OASIS Intellectual Property Rights document must be
followed, or as required to translate it into languages other than
English.
The limited permissions granted above are perpetual and will not be
revoked by OASIS or its successors or assigns.
This document and the information contained herein is provided on
an "AS IS" basis and OASIS DISCLAIMS ALL WARRANTIES,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY
WARRANTY THAT THE USE OF THE INFORMATION HEREIN
WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED
WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A
PARTICULAR PURPOSE.
-->

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -1,756 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Licensed to the Koordinierungsstelle für IT-Standards (KoSIT) under
~ one or more contributor license agreements. See the NOTICE file
~ distributed with this work for additional information
~ regarding copyright ownership. KoSIT licenses this file
~ to you under the Apache License, Version 2.0 (the
~ "License"); you may not use this file except in compliance
~ with the License. You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing,
~ software distributed under the License is distributed on an
~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
~ KIND, either express or implied. See the License for the
~ specific language governing permissions and limitations
~ under the License.
-->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:rep="http://www.xoev.de/de/validator/varl/1 "
xmlns:s="http://www.xoev.de/de/validator/framework/1/scenarios"
xmlns:in="http://www.xoev.de/de/validator/framework/1/createreportinput"
xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
xmlns:xd="http://www.oxygenxml.com/ns/doc/xsl"
xmlns:html="http://www.w3.org/1999/xhtml"
exclude-result-prefixes="xs"
version="2.0">
<xsl:output method="xml" indent="yes"/>
<xsl:param name="input-document" required="yes"/>
<xsl:variable name="custom-levels" as="element(s:customLevel)*" select="//s:customLevel"/>
<xsl:template match="in:createReportInput">
<xsl:variable name="validationStepResults" as="element(rep:validationStepResult)*">
<xsl:apply-templates select="in:validationResultsWellformedness"/>
<xsl:apply-templates select="in:validationResultsXmlSchema"/>
<xsl:apply-templates select="in:validationResultsSchematron"/>
</xsl:variable>
<xsl:variable name="report" as="document-node(element(rep:report))">
<xsl:document>
<rep:report>
<xsl:attribute name="valid">
<xsl:choose>
<xsl:when test="s:noScenarioMatched">false</xsl:when>
<xsl:when test="$validationStepResults[@valid = 'false']">false</xsl:when>
<xsl:otherwise>true</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
<xsl:apply-templates select="in:engine" mode="copy-to-report-ns"/>
<xsl:apply-templates select="in:timestamp" mode="copy-to-report-ns"/>
<xsl:apply-templates select="in:documentIdentification" mode="copy-to-report-ns"/>
<xsl:choose>
<xsl:when test="s:scenario">
<rep:scenarioMatched>
<xsl:sequence select="s:scenario"/>
<xsl:call-template name="document-data"/>
<rep:validationResult>
<xsl:sequence select="$validationStepResults"/>
</rep:validationResult>
</rep:scenarioMatched>
</xsl:when>
<xsl:otherwise>
<rep:noScenarioMatched>
</rep:noScenarioMatched>
</xsl:otherwise>
</xsl:choose>
</rep:report>
</xsl:document>
</xsl:variable>
<rep:report varlVersion="1.0.0">
<xsl:copy-of select="$report/rep:report/(node()|@*)"/>
<xsl:apply-templates select="$report" mode="assessment"/>
</rep:report>
</xsl:template>
<!-- Overwrite this template in customisation layer to generate a documentData element -->
<xsl:template name="document-data"/>
<!-- ************************************************************************************** -->
<!-- * * -->
<!-- * Syntax checks (well-formedness and XML Schema * -->
<!-- * * -->
<!-- ************************************************************************************** -->
<xsl:template match="in:validationResultsWellformedness|in:validationResultsXmlSchema">
<xsl:variable name="id" as="xs:string"
select="if (self::inValidationResultsWellformedness) then 'val-xml' else 'val-xsd'"/>
<xsl:variable name="messages" as="element(rep:message)*">
<xsl:apply-templates select="in:xmlSyntaxError">
<xsl:with-param name="parent-id" select="$id"/>
</xsl:apply-templates>
</xsl:variable>
<!-- Skip output for implicit validation steps (i. e., wellformedness implemenation) unless there is anything to tell -->
<xsl:if test="exists($messages) or exists(s:resource)">
<rep:validationStepResult id="{$id}"
valid="{if ($messages[@level = ('warning', 'error')]) then false() else true()}">
<xsl:sequence select="s:resource"/>
<xsl:sequence select="$messages"/>
</rep:validationStepResult>
</xsl:if>
</xsl:template>
<xsl:template match="in:xmlSyntaxError">
<xsl:param name="parent-id" as="xs:string" required="yes"/>
<xsl:variable name="id" select="concat($parent-id, '.', count(preceding-sibling::xmlSyntaxError) + 1)"/>
<xsl:variable name="level" select="if (@severity = 'SEVERITY_WARNING') then 'warning' else 'error'"/>
<rep:message id="{$id}" level="{$level}">
<xsl:apply-templates select="*"/>
<xsl:value-of select="in:message"/>
</rep:message>
</xsl:template>
<xsl:template match="in:xmlSyntaxError/in:*" priority="-1"/>
<xsl:template match="in:xmlSyntaxError/in:rowNumber[. != '-1']">
<xsl:attribute name="lineNumber" select="."/>
</xsl:template>
<xsl:template match="in:xmlSyntaxError/in:columnNumber[. != '-1']">
<xsl:attribute name="columnNumber" select="."/>
</xsl:template>
<!-- ************************************************************************************** -->
<!-- * * -->
<!-- * Schematron (SVRL) * -->
<!-- * * -->
<!-- ************************************************************************************** -->
<xsl:template match="in:validationResultsSchematron">
<xsl:variable name="schematron-output" as="element(svrl:schematron-output)?"
select="in:results/svrl:schematron-output"/>
<xsl:if test="empty($schematron-output)">
<xsl:message terminate="yes">Unexpected result from schematron validation - there is no
svrl:schematron-output element!
</xsl:message>
</xsl:if>
<xsl:variable name="id" as="xs:string"
select="concat('val-sch.',1 + count(preceding-sibling::in:validationResultsSchematron))"/>
<xsl:variable name="messages" as="element(rep:message)*">
<xsl:apply-templates select="$schematron-output/(svrl:failed-assert|svrl:successful-report)">
<xsl:with-param name="parent-id" select="$id"/>
</xsl:apply-templates>
</xsl:variable>
<rep:validationStepResult id="{$id}"
valid="{if ($messages[@level = ('warning', 'error')]) then false() else true()}">
<xsl:sequence select="s:resource"/>
<xsl:sequence select="$messages"/>
</rep:validationStepResult>
</xsl:template>
<xsl:template match="svrl:failed-assert|svrl:successful-report">
<xsl:param name="parent-id" as="xs:string" required="yes"/>
<xsl:variable name="id"
select="concat($parent-id, '.', count(preceding-sibling::failed-assert | preceding-sibling::successful-report) + 1)"/>
<rep:message id="{$id}">
<xsl:apply-templates select="in:location/*"/>
<xsl:attribute name="level">
<xsl:choose>
<xsl:when test="(@flag,@role) = ('fatal', 'error')">error</xsl:when>
<xsl:when test="(@flag,@role) = ('warning', 'warn')">warning</xsl:when>
<xsl:when test="(@flag,@role) = ('information', 'info')">information</xsl:when>
<xsl:when test="@role = ('information', 'info')">warning</xsl:when>
<xsl:otherwise>error</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
<xsl:apply-templates select="@location"/>
<xsl:apply-templates select="@id"/>
<xsl:value-of select="svrl:text"/>
</rep:message>
</xsl:template>
<xsl:template match="svrl:*/@location">
<xsl:attribute name="xpathLocation" select="."/>
</xsl:template>
<xsl:template match="svrl:failed-assert/@id">
<xsl:attribute name="code" select="."/>
</xsl:template>
<xsl:template match="svrl:successful-report/@id">
<xsl:attribute name="code" select="."/>
</xsl:template>
<!-- ************************************************************************************** -->
<!-- * Validation helpers * -->
<!-- ************************************************************************************** -->
<!-- Identity template -->
<xsl:template mode="copy-to-report-ns" match="@*">
<xsl:copy/>
</xsl:template>
<xsl:template mode="copy-to-report-ns" match="element()" priority="5">
<xsl:element name="rep:{local-name()}">
<xsl:apply-templates mode="copy-to-report-ns" select="node()|@*"/>
</xsl:element>
</xsl:template>
<!-- ************************************************************************************** -->
<!-- * * -->
<!-- * Assessment * -->
<!-- * * -->
<!-- ************************************************************************************** -->
<xd:doc>
<xd:desc>
<xd:p>Dies ist das zentrale Template des Skripts. Angewandt auf ein
report-Dokument ergänzt es dieses um eine Handlungsempfehlung in Form eines
<xd:i>accept</xd:i>
oder <xd:i>reject</xd:i> Elements.
</xd:p>
</xd:desc>
</xd:doc>
<xsl:template match="rep:report" mode="assessment">
<rep:assessment>
<xsl:variable name="element-name" as="xs:string">
<xsl:choose>
<xsl:when test="empty(s:scenario)">reject</xsl:when>
<xsl:when test="//rep:message[rep:custom-level(.) = 'error']">reject</xsl:when>
<xsl:otherwise>accept</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:element name="rep:{$element-name}" exclude-result-prefixes="#all">
<xsl:call-template name="explanations"/>
</xsl:element>
</rep:assessment>
</xsl:template>
<xd:doc>
<xd:desc>
<xd:p>Ermittelt für eine während der Validierung ausgegebene Fehlernachricht deren
Fehlerlevel <xd:i>(error, warning, information)</xd:i> gemäß der
benutzerspezifischen Qualifizierung.
</xd:p>
<xd:p>Jede Fehlernachricht hat im Rahmen der Validierung ein solches Fehlerlevel
erhalten (siehe Attribut <xd:i>@level</xd:i>). Im Regelfall entspricht die
benutzerspezifische Qualifizierung unverändert diesem Level. Nutzer können jedoch im
Rahmen der Bewertung eigene Qualifizierungen vereinbaren und in dem als Parameter
<xd:ref name="assessment" type="parameter"/>
übergebenen
<xd:i>assessment</xd:i>
Element für bestimmte, anhand des Fehlercodes identifizierten Fehlermeldungen eine
eigene Qualifizierung als <xd:i>customLevel</xd:i> festlegen.
</xd:p>
<xd:p>Dies kann z. B. genutzt werden, um einen <xd:i>error</xd:i>, der ansonsten zur
Rückweisung der Nachricht führen würde, zumindest zeitweilig als
<xd:i>warning</xd:i>
zu qualifizieren, so dass eine entsprechende
Dokumenteninstanz trotz einer Warnung angenommen und verarbeitet würde.
</xd:p>
<xd:p>Die Funktion prüft für eine Fehlernachricht, ob deren <xd:i>@code</xd:i> Attribut
Bestandteil der für ein bestimmtes <xd:i>customLevel</xd:i> des
<xd:ref
name="assessment" type="parameter"/>
Parameters angegebenen Fehlercodes ist.
Falls ja, dann gilt das jeweilige <xd:i>customLevel</xd:i>. Andernfalls wird der im
Rahmen der Validierung ermittelte Fehlerlevel unverändert übernommen.
</xd:p>
</xd:desc>
<xd:param name="message">Eine im Rahmen der Validierung ausgegebene
Fehlernachricht
</xd:param>
<xd:return/>
</xd:doc>
<xsl:function name="rep:custom-level" as="xs:string">
<xsl:param name="message" as="element(rep:message)"/>
<xsl:variable name="cl" as="element(s:customLevel)?"
select="$custom-levels[tokenize(., '\s+') = $message/@code]"/>
<xsl:value-of select="if ($cl) then $cl/@level else $message/@level"/>
</xsl:function>
<xsl:template name="explanations">
<rep:explanation>
<xsl:call-template name="html:html"/>
</rep:explanation>
</xsl:template>
<xsl:template name="html:html">
<html xmlns="http://www.w3.org/1999/xhtml" data-report-type="report">
<xsl:call-template name="html:head"/>
<body>
<xsl:call-template name="html:document"/>
</body>
</html>
</xsl:template>
<xd:doc>
<xd:desc>
<xd:p>Generiert das <xd:i>head</xd:i> Element eines eingebetteten HTML Dokuments,
welches den Prüf- und Bewertungsbericht visualisiert und die Handlungsempfehlung
begründet
</xd:p>
</xd:desc>
</xd:doc>
<xsl:template name="html:head" as="element(html:head)">
<head xmlns="http://www.w3.org/1999/xhtml">
<title>Prüfbericht</title>
<style>
body{
font-family: Calibri;
width: 230mm;
}
.metadata dt {
float: left;
width: 230px;
clear: left;
}
.metadata dd {
margin-left: 250px;
}
table{
border-collapse: collapse;
width: 100%;
}
table.tbl-errors{
font-size: smaller;
}
table.document{
font-size: smaller;
}
table.document td {vertical-align:top;}
.tbl-errors td{
border: 1px solid lightgray;
padding: 2px;
vertical-align: top;
}
thead{
font-weight: bold;
background-color: #f0f0f0;
padding-top: 6pt;
padding-bottom: 2pt;
}
.tbl-meta td{
padding-right: 1em;
}
td.pos{
padding-left: 3pt;
width: 5%;
color: gray
}
td.element{
width: 95%;
word-wrap: break-word;
}
td.element:before{
content: attr(title);
color: gray;
}
div.attribute{
display: inline;
font-style: italic;
color: gray;
}
div.attribute:before{
content: attr(title) '=';
}
div.val{
display: inline;
font-weight: bold;
}
td.level1{
padding-left: 2mm;
}
td.level2{
padding-left: 5mm;
}
td.level3{
padding-left: 10mm;
}
td.level4{
padding-left: 15mm;
}
td.level5{
padding-left: 20mm;
}
td.level6{
padding-left: 25mm;
}
tr{
vertical-align: bottom;
border-bottom: 1px solid #c0c0c0;
}
.error{
color: red;
}
.warning{
}
p.important{
font-weight: bold;
text-align: left;
background-color: #e0e0e0;
padding: 3pt;
}
td.right{
text-align: right
}
</style>
</head>
</xsl:template>
<xsl:template name="html:document" xmlns="http://www.w3.org/1999/xhtml">
<h1>Prüfbericht</h1>
<xsl:call-template name="html:document-metadata"/>
<xsl:call-template name="html:conformance"/>
<xsl:if test="//rep:message">
<xsl:call-template name="html:validationresults"/>
</xsl:if>
<xsl:call-template name="html:assessment"/>
<!-- this is the extension -->
<xsl:if test="$input-document instance of document-node(element())">
<xsl:call-template name="html:contentdoc">
<xsl:with-param name="invoice" select="$input-document"/>
</xsl:call-template>
</xsl:if>
<xsl:call-template name="html:epilog"/>
</xsl:template>
<xd:doc>
<xd:desc>
<xd:p>Generiert am Beginn eines eingebetteten HTML Dokuments, welches den Prüf- und
Bewertungsbericht visualisiert und die Handlungsempfehlung begründet, eine Übersicht
mit Metadaten des geprüften Dokuments.
</xd:p>
</xd:desc>
</xd:doc>
<xsl:template name="html:document-metadata" as="element()+">
<div class="metadata">
<p class="important">
<xsl:text>Angaben zum geprüften Dokument</xsl:text>
</p>
<dl>
<dt>Referenz:</dt>
<dd>
<xsl:value-of select="rep:documentIdentification/rep:documentReference"/>
</dd>
<dt>Zeitpunkt der Prüfung:</dt>
<dd>
<xsl:value-of select="format-dateTime(rep:timestamp, '[D].[M].[Y] [H]:[m]:[s]')"/>
</dd>
<dt>Erkannter Dokumenttyp:</dt>
<dd>
<xsl:choose>
<xsl:when test="rep:scenarioMatched">
<xsl:value-of select="rep:scenarioMatched/s:scenario/s:name"/>
</xsl:when>
<xsl:otherwise>
<b class="error">unbekannt</b>
</xsl:otherwise>
</xsl:choose>
</dd>
</dl>
<xsl:call-template name="html:documentdata"/>
</div>
</xsl:template>
<xsl:template name="html:documentdata"/>
<xd:doc>
<xd:desc>
<xd:p>Generiert am Ende eines eingebetteten HTML Dokuments, welches den Prüf- und
Bewertungsbericht visualisiert und die Handlungsempfehlung begründet, eine Übersicht
mit Metadaten zum Prüfmodul.
</xd:p>
</xd:desc>
</xd:doc>
<xsl:template name="html:epilog" as="element()+">
<p class="info" xmlns="http://www.w3.org/1999/xhtml">
<xsl:text>Dieser Prüfbericht wurde erstellt mit </xsl:text>
<xsl:value-of select="rep:engine/rep:name"/>
<xsl:text>.</xsl:text>
</p>
</xsl:template>
<xd:doc>
<xd:desc>
<xd:p>Generiert in dem eingebetetteten HTML Dokument eine Tabelle mit den während der
Validierung ausgegebenen Daten.
</xd:p>
</xd:desc>
</xd:doc>
<xsl:template name="html:validationresults" as="element()*">
<p>Übersicht der Validierungsergebnisse:</p>
<table class="tbl-errors">
<thead>
<tr>
<th>Prüfschritt</th>
<th>Fehler</th>
<th>Warnungen</th>
<th>Informationen</th>
</tr>
</thead>
<tbody>
<xsl:for-each select="//rep:validationResult/rep:validationStepResult">
<xsl:variable name="step-id" select="@id"/>
<tr>
<td>
<xsl:value-of select="s:resource/s:name"/>
<xsl:text> (</xsl:text>
<xsl:value-of select="@id"/>
<xsl:text>)</xsl:text>
</td>
<td style="width: 30mm;">
<xsl:value-of
select="count(rep:message[@level eq 'error'])"/>
</td>
<td style="width: 30mm;">
<xsl:value-of
select="count(rep:message[@level eq 'warning'])"/>
</td>
<td style="width: 30mm;">
<xsl:value-of
select="count(rep:message[@level eq 'information'])"
/>
</td>
</tr>
</xsl:for-each>
</tbody>
</table>
<p>Validierungsergebnisse im Detail:</p>
<table xmlns="http://www.w3.org/1999/xhtml" class="tbl-errors">
<thead>
<tr>
<th style="width: 30mm;">Pos</th>
<th style="width: 25mm;">Code</th>
<th style="width: 25mm;">Adj. Grad (Grad)</th>
<th>Text</th>
</tr>
</thead>
<tbody>
<xsl:for-each select="//rep:message">
<tr>
<xsl:attribute name="class">
<xsl:value-of select="rep:custom-level(.)"/>
</xsl:attribute>
<td rowspan="2">
<xsl:value-of select="@id"/>
</td>
<td rowspan="2">
<xsl:value-of select="@code"/>
</td>
<td rowspan="2">
<xsl:value-of select="rep:custom-level(.)"/>
<xsl:if test="not(rep:custom-level(.) eq @level)">
<xsl:value-of select="concat(' (', @level, ')')"/>
</xsl:if>
</td>
<td>
<xsl:value-of select="normalize-space(.)"/>
</td>
</tr>
<tr>
<xsl:attribute name="class">
<xsl:value-of select="rep:custom-level(.)"/>
</xsl:attribute>
<td>
<xsl:if test="@xpathLocation">
<xsl:text>Pfad: </xsl:text><xsl:value-of select="@xpathLocation"/>
</xsl:if>
<xsl:if test="@lineNumber">
<xsl:text> Zeile: </xsl:text><xsl:value-of select="@lineNumber"/>
</xsl:if>
<xsl:if test="@columnNumber">
<xsl:text> Spalte: </xsl:text><xsl:value-of select="@columnNumber"/>
</xsl:if>
</td>
</tr>
</xsl:for-each>
</tbody>
</table>
</xsl:template>
<xd:doc>
<xd:desc>
<xd:p>Generiert in dem eingebetteten HTML Dokument eine Aussage zur Konformität des
geprüften Dokuments zu den formalen Vorgaben.
</xd:p>
</xd:desc>
</xd:doc>
<xsl:template name="html:conformance">
<xsl:variable name="e" as="xs:integer" select="count(//rep:message[@level eq 'error'])"/>
<xsl:variable name="w" as="xs:integer" select="count(//rep:message[@level eq 'warning'])"/>
<xsl:choose>
<xsl:when test="rep:scenarioMatched">
<p class="important" xmlns="http://www.w3.org/1999/xhtml">
<b>Konformitätsprüfung:</b>
<xsl:text>Das geprüfte Dokument enthält </xsl:text>
<xsl:choose>
<xsl:when test="$e + $w eq 0">
<xsl:text>weder Fehler noch Warnungen. Es ist konform zu den formalen Vorgaben.</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="concat($e, ' Fehler / ', $w, ' Warnungen. Es ist ')"/>
<b>nicht konform</b>
<xsl:text> zu den formalen Vorgaben.</xsl:text>
</xsl:otherwise>
</xsl:choose>
</p>
</xsl:when>
<xsl:otherwise>
<p class="important" xmlns="http://www.w3.org/1999/xhtml">
<b>Konformitätsprüfung:</b>
<xsl:text>Das geprüfte Dokument entspricht keinen zulässigen Dokumenttyp und ist damit </xsl:text>
<b>nicht konform</b>
<xsl:text> zu den formalen Vorgaben.</xsl:text>
</p>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xd:doc>
<xd:desc>
<xd:p>Generiert in dem eingebetteten HTML Dokument die Aussage zur
Handlungsempfehlung.
</xd:p>
</xd:desc>
</xd:doc>
<xsl:template name="html:assessment" xmlns="http://www.w3.org/1999/xhtml">
<xsl:variable name="e1" as="xs:integer" select="count(//message[@level eq 'error'])"/>
<xsl:variable name="e2" as="xs:integer"
select="count(//rep:message[rep:custom-level(.) eq 'error'])"/>
<xsl:choose>
<xsl:when test="empty(rep:scenarioMatched)">
<p class="important error">Bewertung: Es wird empfohlen das Dokument zurückzuweisen.</p>
</xsl:when>
<xsl:when test="$e1 eq 0 and $e2 eq 0">
<p class="important">Bewertung: Es wird empfohlen das Dokument anzunehmen und weiter zu verarbeiten.</p>
</xsl:when>
<xsl:when test="$e1 gt 0 and $e2 eq 0">
<p class="important">Bewertung: Es wird empfohlen das Dokument anzunehmen und zu verarbeiten, da die
vorhandenen Fehler derzeit toleriert werden.
</p>
</xsl:when>
<xsl:otherwise>
<p class="important error">Bewertung: Es wird empfohlen das Dokument zurückzuweisen.</p>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="html:contentdoc">
<xsl:param name="invoice" as="document-node(element())"/>
<p class="important">
<xsl:text>Inhalt des Rechnungsdokuments:</xsl:text>
</p>
<table class="document" xmlns="http://www.w3.org/1999/xhtml">
<xsl:apply-templates select="$invoice/*" mode="html:contentdoc"/>
</table>
</xsl:template>
<xd:doc>
<xd:desc>
<xd:p>Eine Element wird als eine Zeile in einer Tabelle visualisiert. Die erste Spalte
enthält die Zeilennummer, die zweite Attribute und Text des Elements
</xd:p>
</xd:desc>
</xd:doc>
<xsl:template match="*" mode="html:contentdoc">
<xsl:variable name="line-number" as="xs:string">
<xsl:number select="." count="*" level="any" format="0001"/>
</xsl:variable>
<tr class="row" xmlns="http://www.w3.org/1999/xhtml" id="{$line-number}">
<td class="pos">
<xsl:value-of select="$line-number"/>
</td>
<td class="element {concat('level',count(ancestor-or-self::*))}" title="{local-name()}">
<xsl:apply-templates select="text()" mode="html:contentdoc"/>
<xsl:apply-templates select="@*" mode="html:contentdoc"/>
</td>
</tr>
<xsl:apply-templates select="*" mode="html:contentdoc"/>
</xsl:template>
<xd:doc>
<xd:desc>
<xd:p>Ein Textbereich (in der Zeile des Elements)</xd:p>
</xd:desc>
</xd:doc>
<xsl:template match="text()" mode="html:contentdoc">
<div class="val" xmlns="http://www.w3.org/1999/xhtml">
<xsl:value-of select="."/>
</div>
</xsl:template>
<xsl:template match="element(*, xs:base64Binary)/text()" priority="10" mode="html:contentdoc">
<div class="val" xmlns="http://www.w3.org/1999/xhtml">
<xsl:text>[ … ]</xsl:text>
</div>
</xsl:template>
<xsl:template match="@xsi:schemaLocation" mode="html:contentdoc"/>
<xd:doc>
<xd:desc>
<xd:p>Ein Attributbereich (in der Zeile des Elements)</xd:p>
</xd:desc>
</xd:doc>
<xsl:template match="@*" mode="html:contentdoc">
<div class="attribute" title="{local-name(.)}" xmlns="http://www.w3.org/1999/xhtml">
<xsl:value-of select="."/>
</div>
</xsl:template>
</xsl:stylesheet>

View file

@ -1,607 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Licensed to the Koordinierungsstelle für IT-Standards (KoSIT) under
~ one or more contributor license agreements. See the NOTICE file
~ distributed with this work for additional information
~ regarding copyright ownership. KoSIT licenses this file
~ to you under the Apache License, Version 2.0 (the
~ "License"); you may not use this file except in compliance
~ with the License. You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing,
~ software distributed under the License is distributed on an
~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
~ KIND, either express or implied. See the License for the
~ specific language governing permissions and limitations
~ under the License.
-->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:rep="http://www.xoev.de/de/validator/varl/1 "
xmlns:s="http://www.xoev.de/de/validator/framework/1/scenarios"
xmlns:in="http://www.xoev.de/de/validator/framework/1/createreportinput"
xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
xmlns:xd="http://www.oxygenxml.com/ns/doc/xsl"
xmlns:html="http://www.w3.org/1999/xhtml"
exclude-result-prefixes="xs"
version="2.0">
<xsl:output method="xml" indent="yes"/>
<xsl:param name="input-document" as="document-node(element())" required="yes"/>
<xsl:variable name="custom-levels" as="element(s:customLevel)*" select="//s:customLevel"/>
<xsl:template match="in:createReportInput">
<xsl:variable name="validationStepResults" as="element(rep:validationStepResult)*">
<xsl:apply-templates select="in:validationResultsWellformedness"/>
<xsl:apply-templates select="in:validationResultsXmlSchema"/>
<xsl:apply-templates select="in:validationResultsSchematron"/>
</xsl:variable>
<xsl:variable name="report" as="document-node(element(rep:report))">
<xsl:document>
<rep:report valid="{if ($validationStepResults[@valid = 'false']) then false() else true()}">
<xsl:apply-templates select="in:engine" mode="copy-to-report-ns"/>
<xsl:apply-templates select="in:timestamp" mode="copy-to-report-ns"/>
<xsl:apply-templates select="in:documentIdentification" mode="copy-to-report-ns"/>
<xsl:apply-templates select="s:scenario" mode="copy-to-report-ns"/>
<xsl:call-template name="document-data"/>
<rep:validationResult>
<xsl:sequence select="$validationStepResults"/>
</rep:validationResult>
</rep:report>
</xsl:document>
</xsl:variable>
<xsl:variable name="report-with-ids" as="document-node(element(rep:report))">
<xsl:document>
<xsl:apply-templates select="$report" mode="add-ids"/>
</xsl:document>
</xsl:variable>
<rep:report varlVersion="1.0.0">
<xsl:copy-of select="$report-with-ids/rep:report/(node()|@*)"/>
<xsl:apply-templates select="$report-with-ids"/>
</rep:report>
</xsl:template>
<!-- Overwrite in customisation layer to generate a documentData element -->
<xsl:template name="document-data"/>
<!-- ************************************************************************************** -->
<!-- * * -->
<!-- * Syntax checks (well-formedness and XML Schema * -->
<!-- * * -->
<!-- ************************************************************************************** -->
<xsl:template match="in:validationResultsWellformedness|in:validationResultsXmlSchema">
<xsl:variable name="messages" as="element(rep:message)*">
<xsl:apply-templates select="in:xmlSyntaxError"/>
</xsl:variable>
<!-- Skip output for implicit validation steps (i. e., wellformedness implemenation) unless there is anything to tell -->
<xsl:if test="exists($messages) or exists(s:resource)">
<rep:validationStepResult valid="{if ($messages[@level = ('warning', 'error')]) then false() else true()}">
<xsl:apply-templates mode="copy-to-report-ns" select="s:resource"/>
<xsl:sequence select="$messages"/>
</rep:validationStepResult>
</xsl:if>
</xsl:template>
<xsl:template match="in:xmlSyntaxError">
<rep:message level="{if (@severity = 'SEVERITY_WARNING') then 'warning' else 'error'}">
<xsl:apply-templates select="in:location/*"/>
<xsl:value-of select="in:message"/>
</rep:message>
</xsl:template>
<xsl:template match="in:xmlSyntaxError/in:rowNumber">
<xsl:attribute name="lineNumber" select="."/>
</xsl:template>
<xsl:template match="in:xmlSyntaxError/in:columnNumber">
<xsl:attribute name="columnNumber" select="."/>
</xsl:template>
<!-- ************************************************************************************** -->
<!-- * * -->
<!-- * Schematron (SVRL) * -->
<!-- * * -->
<!-- ************************************************************************************** -->
<xsl:template match="in:validationResultsSchematron">
<xsl:variable name="schematron-output" as="element(svrl:schematron-output)?" select="in:results/svrl:schematron-output"/>
<xsl:if test="empty($schematron-output)">
<xsl:message terminate="yes">Unexpected result from schematron validation - there is no svrl:schematron-output element!</xsl:message>
</xsl:if>
<xsl:variable name="messages" as="element(rep:message)*">
<xsl:apply-templates select="$schematron-output/(svrl:failed-assert|svrl:successful-report)"/>
</xsl:variable>
<rep:validationStepResult valid="{if ($messages[@level = ('warning', 'error')]) then false() else true()}">
<xsl:apply-templates mode="copy-to-report-ns" select="s:resource"/>
<xsl:sequence select="$messages"/>
</rep:validationStepResult>
</xsl:template>
<xsl:template match="svrl:failed-assert|svrl:successful-report">
<rep:message>
<xsl:apply-templates select="in:location/*"/>
<xsl:attribute name="level">
<xsl:choose>
<xsl:when test="(@flag,@role) = ('fatal', 'error')">error</xsl:when>
<xsl:when test="(@flag,@role) = ('warning', 'warn')">warning</xsl:when>
<xsl:when test="(@flag,@role) = ('information', 'info')">information</xsl:when>
<xsl:when test="@role = ('information', 'info')">warning</xsl:when>
<xsl:otherwise>error</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
<xsl:apply-templates select="@location"/>
<xsl:apply-templates select="@id"/>
<xsl:value-of select="svrl:text"/>
</rep:message>
</xsl:template>
<xsl:template match="svrl:*/@location">
<xsl:attribute name="xpathLocation" select="."/>
</xsl:template>
<xsl:template match="svrl:failed-assert/@id">
<xsl:attribute name="code" select="."/>
</xsl:template>
<xsl:template match="svrl:successful-report/@id">
<xsl:attribute name="code" select="."/>
</xsl:template>
<!-- ************************************************************************************** -->
<!-- * Validation helpers * -->
<!-- ************************************************************************************** -->
<!-- Identity template -->
<xsl:template mode="copy-to-report-ns" match="element()|@*">
<xsl:copy>
<xsl:apply-templates mode="copy-to-report-ns" select="node()|@*"/>
</xsl:copy>
</xsl:template>
<xsl:template mode="copy-to-report-ns" match="element()" priority="5">
<xsl:element name="rep:{local-name()}">
<xsl:apply-templates mode="copy-to-report-ns" select="node()|@*"/>
</xsl:element>
</xsl:template>
<xsl:template mode="copy-to-report-ns" match="s:*" priority="10">
<xsl:copy>
<xsl:apply-templates mode="copy-to-report-ns" select="node()|@*"/>
</xsl:copy>
</xsl:template>
<xsl:template match="node()|@*" mode="add-ids">
<xsl:copy>
<xsl:apply-templates select="node()|@*" mode="add-ids"/>
</xsl:copy>
</xsl:template>
<xsl:template match="rep:validationStepResult" mode="add-ids">
<xsl:copy>
<xsl:attribute name="id">
<xsl:text>step_</xsl:text>
<xsl:number level="multiple" count="rep:validationStepResult"/>
</xsl:attribute>
<xsl:apply-templates select="node()|@*" mode="add-ids"/>
</xsl:copy>
</xsl:template>
<xsl:template match="rep:message" mode="add-ids">
<xsl:copy>
<xsl:attribute name="id">
<xsl:text>message_</xsl:text>
<xsl:number level="multiple" count="rep:message | rep:validationStepResult"/>
</xsl:attribute>
<xsl:apply-templates select="node()|@*" mode="add-ids"/>
</xsl:copy>
</xsl:template>
<!-- ************************************************************************************** -->
<!-- * * -->
<!-- * Assessment (ohne HTML) * -->
<!-- * * -->
<!-- ************************************************************************************** -->
<xd:doc>
<xd:desc>
<xd:p>Dies ist das zentrale Template des Skripts. Angewandt auf ein
validationReport-Dokument, und unter Nutzung des <xd:ref name="assessment"
type="parameter"/> Parameters wird eine Handlungsempfehlung in Form eines
<xd:i>accept</xd:i> oder <xd:i>reject</xd:i> Elements erstellt, welches eine
Begründung der jeweiligen Empfehlung enthalten kann.</xd:p>
<xd:p>Das Template realisiert eine Funktion f:validationReport, assessment →
suggestion</xd:p>
</xd:desc>
</xd:doc>
<xsl:template match="rep:report">
<xsl:variable name="element-name" select="if (//rep:message[rep:custom-level(.) = 'error']) then 'reject' else 'accept'"/>
<rep:assessment>
<xsl:element name="rep:{$element-name}" exclude-result-prefixes="#all">
<rep:explanation>
<html xmlns="http://www.w3.org/1999/xhtml" data-report-type="devreport-{$element-name}">
<xsl:call-template name="html:head"/>
<body>
<xsl:call-template name="html:document"/>
</body>
</html>
</rep:explanation>
</xsl:element>
</rep:assessment>
</xsl:template>
<xd:doc>
<xd:desc>
<xd:p>Ermittelt für eine während der Validierung ausgegebene Fehlernachricht deren
Fehlerlevel <xd:i>(error, warning, information)</xd:i> gemäß der
benutzerspezifischen Qualifizierung.</xd:p>
<xd:p>Jede Fehlernachricht hat im Rahmen der Validierung ein solches Fehlerlevel
erhalten (siehe Attribut <xd:i>@level</xd:i>). Im Regelfall entspricht die
benutzerspezifische Qualifizierung unverändert diesem Level. Nutzer können jedoch im
Rahmen der Bewertung eigene Qualifizierungen vereinbaren und in dem als Parameter
<xd:ref name="assessment" type="parameter"/> übergebenen <xd:i>assessment</xd:i>
Element für bestimmte, anhand des Fehlercodes identifizierten Fehlermeldungen eine
eigene Qualifizierung als <xd:i>customLevel</xd:i> festlegen.</xd:p>
<xd:p>Dies kann z. B. genutzt werden, um einen <xd:i>error</xd:i>, der ansonsten zur
Rückweisung der Nachricht führen würde, zumindest zeitweilig als
<xd:i>warning</xd:i> zu qualifizieren, so dass eine entsprechende
Dokumenteninstanz trotz einer Warnung angenommen und verarbeitet würde.</xd:p>
<xd:p>Die Funktion prüft für eine Fehlernachricht, ob deren <xd:i>@code</xd:i> Attribut
Bestandteil der für ein bestimmtes <xd:i>customLevel</xd:i> des <xd:ref
name="assessment" type="parameter"/> Parameters angegebenen Fehlercodes ist.
Falls ja, dann gilt das jeweilige <xd:i>customLevel</xd:i>. Andernfalls wird der im
Rahmen der Validierung ermittelte Fehlerlevel unverändert übernommen.</xd:p>
</xd:desc>
<xd:param name="message">Eine im Rahmen der Validierung ausgegebene
Fehlernachricht</xd:param>
<xd:return/>
</xd:doc>
<xsl:function name="rep:custom-level" >
<xsl:param name="message" as="element(rep:message)"/>
<xsl:variable name="cl" as="element(s:customLevel)?"
select="$custom-levels[tokenize(., '\s+') = $message/@code]"/>
<xsl:value-of select="if ($cl) then $cl/@level else $message/@level"/>
</xsl:function>
<!-- ************************************************************************************** -->
<!-- * * -->
<!-- * HTML * -->
<!-- * * -->
<!-- ************************************************************************************** -->
<xsl:template name="html:document">
<xsl:call-template name="html:report-header"/>
<xsl:call-template name="html:prolog"/>
<!-- TODO: documentData -->
<xsl:call-template name="html:conformance"/>
<xsl:if test="//rep:message">
<xsl:call-template name="html:messagetable"/>
</xsl:if>
<xsl:call-template name="html:assessment"/>
<xsl:call-template name="html:epilog"/>
</xsl:template>
<xd:doc>
<xd:desc>
<xd:p>Generiert das <xd:i>head</xd:i> Element eines eingebetteten HTML Dokuments,
welches den Prüf- und Bewertungsbericht visualisiert und die Handlungsempfehlung
begründet</xd:p>
</xd:desc>
</xd:doc>
<xsl:template name="html:head" as="element(html:head)">
<head xmlns="http://www.w3.org/1999/xhtml">
<title>Pruefbericht der KoSIT</title>
<style>
body{
font-family: Calibri;
width: 230mm;
}
table{
border-collapse: collapse;
width: 100%;
}
table.tbl-errors{
font-size: 10pt;
}
.tbl-errors td{
border: 1px solid lightgray;
padding: 2px;
vertical-align: top;
}
thead{
font-weight: bold;
background-color: #f0f0f0;
padding-top: 6pt;
padding-bottom: 2pt;
}
.tbl-meta td{
padding-right: 1em;
}
tr{
vertical-align: bottom;
border-bottom: 1px solid #c0c0c0;
}
tr.error{
font-weight: bold;
color: red;
}
tr.warning{
font-weight: bold;
}
tr.pos{
font-weight: bold;
}
p.important{
font-weight: bold;
text-align: left;
background-color: #e0e0e0;
padding: 3pt;
}
td.right{
text-align: right
}</style>
</head>
</xsl:template>
<xd:doc>
<xd:desc>
<xd:p>Generiert die Überschrift des eines eingebetteten HTML Dokuments, welches den
Prüf- und Bewertungsbericht visualisiert und die Handlungsempfehlung
begründet</xd:p>
</xd:desc>
</xd:doc>
<xsl:template name="html:report-header" as="element()+">
<h1 xmlns="http://www.w3.org/1999/xhtml">Prüfbericht der KoSIT</h1>
</xsl:template>
<xd:doc>
<xd:desc>
<xd:p>Generiert am Beginn eines eingebetteten HTML Dokuments, welches den Prüf- und
Bewertungsbericht visualisiert und die Handlungsempfehlung begründet, eine Übersicht
mit Metadaten des geprüften Dokuments.</xd:p>
</xd:desc>
</xd:doc>
<xsl:template name="html:prolog" as="element()+">
<h2 xmlns="http://www.w3.org/1999/xhtml">
<xsl:text>Angaben zum geprüften Dokument</xsl:text>
</h2>
<table class="tbl-meta" xmlns="http://www.w3.org/1999/xhtml">
<xsl:if test="/*/@id">
<tr>
<td colspan="2">Prüfbericht Nr.</td>
<td colspan="3">
<xsl:value-of select="/*/@id"/>
</td>
</tr>
</xsl:if>
<tr>
<td colspan="2">Dokument:</td>
<td colspan="3">
<xsl:value-of select="rep:documentIdentification/rep:documentReference"/>
</td>
</tr>
<tr>
<td colspan="2">Szenario:</td>
<td colspan="3">
<xsl:value-of select="s:scenario/@name"/>
</td>
</tr>
<tr>
<td colspan="2">Zeitpunkt:</td>
<td colspan="3">
<xsl:value-of select="format-dateTime(rep:timestamp, '[D].[M].[Y] [H]:[m]:[s]')"
/>
</td>
</tr>
<tr>
<td colspan="2">Validierungsschritte:</td>
<td>Fehler</td>
<td>Warnung</td>
<td>Information</td>
</tr>
<xsl:for-each select="/rep:validationResults/rep:validationStepResult">
<xsl:variable name="step-id" select="@id"/>
<tr>
<td>
<xsl:value-of select="@id"/>
</td>
<td>
<xsl:value-of select="s:resource/s:resouceName"/>
</td>
<td>
<xsl:value-of
select="count(//rep:message[@step eq $step-id and @level eq 'error'])"/>
</td>
<td>
<xsl:value-of
select="count(//rep:message[@step eq $step-id and @level eq 'warning'])"/>
</td>
<td>
<xsl:value-of
select="count(//rep:message[@step eq $step-id and @level eq 'information'])"
/>
</td>
</tr>
</xsl:for-each>
</table>
</xsl:template>
<xd:doc>
<xd:desc>
<xd:p>Generiert am Ende eines eingebetteten HTML Dokuments, welches den Prüf- und
Bewertungsbericht visualisiert und die Handlungsempfehlung begründet, eine Übersicht
mit Metadaten zum Prüfmodul.</xd:p>
</xd:desc>
</xd:doc>
<xsl:template name="html:epilog" as="element()+">
<p class="info" xmlns="http://www.w3.org/1999/xhtml">
<xsl:text>Erstellt mit: </xsl:text>
<xsl:value-of select="rep:engine/rep:name"/>
<xsl:text> für das InstructionSet </xsl:text>
<em>
<xsl:value-of select="rep:engine/rep:info[@key eq 'title']"/>
</em>
<xsl:text> vom </xsl:text>
<xsl:value-of
select="format-dateTime(xs:dateTime(rep:engine/rep:info[@key eq 'version']), '[D].[M].[Y]')"/>
<xsl:text>.</xsl:text>
</p>
</xsl:template>
<xd:doc>
<xd:desc>
<xd:p>Generiert in dem eingebetetteten HTML Dokument eine Tabelle mit den während der
Validierung ausgegebenen Daten.</xd:p>
</xd:desc>
</xd:doc>
<xsl:template name="html:messagetable" as="element()">
<table xmlns="http://www.w3.org/1999/xhtml" class="tbl-errors">
<xsl:call-template name="html:messagetable.head"/>
<tbody>
<xsl:for-each select="//rep:message">
<xsl:call-template name="html:messagetable.row"/>
</xsl:for-each>
</tbody>
</table>
</xsl:template>
<xd:doc>
<xd:desc>
<xd:p>Generiert in der HTML-Tabelle der Validierungsnachtichten in dem eingebetteten
HTML Dokument dn Tabellenkopf</xd:p>
</xd:desc>
</xd:doc>
<xsl:template name="html:messagetable.head" xmlns="http://www.w3.org/1999/xhtml">
<thead>
<tr>
<th>Pos</th>
<th>Code</th>
<th>CustomLevel (Level)</th>
<th>Step</th>
<th>Text</th>
</tr>
</thead>
</xsl:template>
<xd:doc>
<xd:desc>
<xd:p>Generiert in der HTML-Tabelle der Validierungsnachtichten in dem eingebetteten
HTML Dokument eine oder mehrere Zeilen pro Validierungsnachricht</xd:p>
</xd:desc>
</xd:doc>
<xsl:template name="html:messagetable.row" xmlns="http://www.w3.org/1999/xhtml">
<tr>
<xsl:attribute name="class">
<xsl:value-of select="rep:custom-level(.)"/>
</xsl:attribute>
<td>
<xsl:value-of select="position()"/>
</td>
<td>
<xsl:value-of select="@code"/>
</td>
<td>
<xsl:value-of select="rep:custom-level(.)"/>
<xsl:if test="not(rep:custom-level(.) eq @level)">
<xsl:value-of select="concat(' (', @level, ')')"/>
</xsl:if>
</td>
<td>
<xsl:value-of select="@step"/>
</td>
<td>
<xsl:value-of select="normalize-space(.)"/>
</td>
</tr>
<tr>
<td colspan="4"/>
<td>
<xsl:value-of select="@location"/>
</td>
</tr>
</xsl:template>
<xd:doc>
<xd:desc>
<xd:p>Generiert in dem eingebetteten HTML Dokument eine Aussage zur Konformität des
geprüften Dokuments zu den formalen Vorgaben.</xd:p>
</xd:desc>
</xd:doc>
<xsl:template name="html:conformance">
<xsl:variable name="e" as="xs:integer" select="count(//rep:message[@level eq 'error'])"/>
<xsl:variable name="w" as="xs:integer" select="count(//rep:message[@level eq 'warning'])"/>
<p class="important" xmlns="http://www.w3.org/1999/xhtml">
<b>Konformitätsprüfung: </b>
<xsl:text>Das geprüfte Dokument enthält </xsl:text>
<xsl:choose>
<xsl:when test="$e + $w eq 0">
<xsl:text>weder Fehler noch Warnungen. Es ist konform zu den formalen Vorgaben.</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="concat($e, ' Fehler / ', $w, ' Warnungen. Es ist ')"/>
<b>nicht konform</b>
<xsl:text> zu den formalen Vorgaben.</xsl:text>
</xsl:otherwise>
</xsl:choose>
</p>
</xsl:template>
<xd:doc>
<xd:desc>
<xd:p>Generiert in dem eingebetteten HTML Dokument die Aussage zur
Handlungsempfehlung.</xd:p>
</xd:desc>
</xd:doc>
<xsl:template name="html:assessment">
<xsl:variable name="e1" as="xs:integer" select="count(//message[@level eq 'error'])"/>
<xsl:variable name="e2" as="xs:integer"
select="count(//rep:message[rep:custom-level(.) eq 'error'])"/>
<p class="important" xmlns="http://www.w3.org/1999/xhtml">
<b>Bewertung: </b>
<xsl:choose>
<xsl:when test="$e1 eq 0 and $e2 eq 0">
<xsl:text>Es wird empfohlen das Dokument anzunehmen un weiter zu verarbeiten.</xsl:text>
</xsl:when>
<xsl:when test="$e1 gt 0 and $e2 eq 0">
<xsl:text>Es wird empfohlen das Dokument anzunehmen und zu verarbeiten, da die vorhandenen Fehler derzeit toleriert werden.</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>Es wird empfohlen das Dokument zurückzuweisen.</xsl:text>
</xsl:otherwise>
</xsl:choose>
</p>
</xsl:template>
</xsl:stylesheet>

View file

@ -2,4 +2,14 @@
<simple xmlns="http://validator.kosit.de/test-sample">
<inner>asldkfj</inner>
<content>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<!--nothing-->
</head>
<body>
<div>some data</div>
</body>
</html>
</content>
</simple>

View file

@ -1,7 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://validator.kosit.de/test-sample" version="1.0" xml:lang="en"
targetNamespace="http://validator.kosit.de/test-sample"
xmlns="http://www.w3.org/1999/xhtml" elementFormDefault="qualified">
targetNamespace="http://validator.kosit.de/test-sample" elementFormDefault="qualified">
<xs:element name="simple" type="tns:SimpleType" />
<xs:element name="foo" type="tns:SimpleType" />
@ -9,6 +8,7 @@
<xs:complexType name="SimpleType">
<xs:sequence>
<xs:element name="inner" type="xs:string" />
<xs:element name="content" type="xs:anyType" />
</xs:sequence>
</xs:complexType>
</xs:schema>
</xs:schema>

View file

@ -1,90 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Licensed to the Koordinierungsstelle für IT-Standards (KoSIT) under
~ one or more contributor license agreements. See the NOTICE file
~ distributed with this work for additional information
~ regarding copyright ownership. KoSIT licenses this file
~ to you under the Apache License, Version 2.0 (the
~ "License"); you may not use this file except in compliance
~ with the License. You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing,
~ software distributed under the License is distributed on an
~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
~ KIND, either express or implied. See the License for the
~ specific language governing permissions and limitations
~ under the License.
-->
<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>

View file

@ -1,87 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Licensed to the Koordinierungsstelle für IT-Standards (KoSIT) under
~ one or more contributor license agreements. See the NOTICE file
~ distributed with this work for additional information
~ regarding copyright ownership. KoSIT licenses this file
~ to you under the Apache License, Version 2.0 (the
~ "License"); you may not use this file except in compliance
~ with the License. You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing,
~ software distributed under the License is distributed on an
~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
~ KIND, either express or implied. See the License for the
~ specific language governing permissions and limitations
~ under the License.
-->
<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>

View file

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.example.org/reference" elementFormDefault="qualified">
<complexType name="ReferenzTyp">
<sequence>
<element name="some" type="string"></element>
</sequence>
</complexType>
</schema>

View file

@ -1,9 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.example.org/reference" xmlns:tns="http://www.example.org/reference" elementFormDefault="qualified">
<complexType name="ReferenzTyp">
<sequence>
<element name="some" type="string"></element>
</sequence>
</complexType>
</schema>

View file

@ -1,101 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Licensed to the Koordinierungsstelle für IT-Standards (KoSIT) under
~ one or more contributor license agreements. See the NOTICE file
~ distributed with this work for additional information
~ regarding copyright ownership. KoSIT licenses this file
~ to you under the Apache License, Version 2.0 (the
~ "License"); you may not use this file except in compliance
~ with the License. You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing,
~ software distributed under the License is distributed on an
~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
~ KIND, either express or implied. See the License for the
~ specific language governing permissions and limitations
~ under the License.
-->
<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>

View file

@ -1,96 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Licensed to the Koordinierungsstelle für IT-Standards (KoSIT) under
~ one or more contributor license agreements. See the NOTICE file
~ distributed with this work for additional information
~ regarding copyright ownership. KoSIT licenses this file
~ to you under the Apache License, Version 2.0 (the
~ "License"); you may not use this file except in compliance
~ with the License. You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing,
~ software distributed under the License is distributed on an
~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
~ KIND, either express or implied. See the License for the
~ specific language governing permissions and limitations
~ under the License.
-->
<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>