diff --git a/.gitignore b/.gitignore index af77ecd..bc3c63d 100644 --- a/.gitignore +++ b/.gitignore @@ -36,3 +36,6 @@ src/generated .settings .vscode *.code-workspace + +# Testing stuff +xrechnung diff --git a/CHANGELOG.md b/CHANGELOG.md index 195e912..ec9e2ce 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,16 +5,36 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + ## next version (unreleased) -# Added +### Added - Support java.xml.transform.Source/java.xml.transform.StreamSource as Input -# Changed +### Changed - Inputs are NOT read into memory (e.g. Byte-Array) prior processing within the validator. This reduces memory consumption. +## UNRELEASED +### Fixed +- Validator was creating invalid createReportInput xml in case of no scenrio match + +## 1.2.0 +### Added + +- Provide access to schematron result through [Result.java](https://github.com/itplr-kosit/validator/blob/master/src/main/java/de/kosit/validationtool/api/Result.java) + - *Result#getFailedAsserts()* returns a list of failed asserts found by schematron + - *Result#isSchematronValid()* convinience access to evaluate whether schematron was processed without any *FailedAsserts* +### Changed + +- *Result#getAcceptRecommendation()* does not _only_ work when _acceptMatch_ is configured in the scenario + - schema correctness is a precondition, if the checked instance is not valid, this evaluates to _REJECTED_ + - if _acceptMatch_ is configured, the result is based on the boolean result of the xpath expression evaluated against the generated report + - if *no* _acceptMatch_ is configured, the result is based on evaluation of schema and schematron correctness + - _UNDEFINED_ is only returned, when processing is stopped somehow +- *Result#isAcceptable()* can now evaluate to true, when no _acceptMatch_ is configured (see above) + ## 1.1.3 ### Fixed diff --git a/README.md b/README.md index 832ddf6..483ba8b 100644 --- a/README.md +++ b/README.md @@ -66,6 +66,10 @@ java -jar validationtool--standalone.jar --help A concrete example with a specific validator configuration can be found on [GitHub](https://github.com/itplr-kosit/validator-configuration-xrechnung) +### Application User Interface (API / embedded usage) + +The validator can also be used in own Java Applications via the API. Details can be [found here](./docs/api.md). + ### Daemon-Mode You can also start the validator as an HTTP-Server. Just start it in _Daemon-Mode_ with the `-D` option. @@ -86,6 +90,4 @@ You can HTTP-POST to `/` and the response will return the report document as de Additionally there is the GET `/health` endpoint which can be used by monitoring systems. -### Application User Interface (embedded usage) -The validator can also be used in own Java Applications via the API. Details can be [found here](./docs/api.md). diff --git a/docs/api.md b/docs/api.md index e537f83..e628b3b 100644 --- a/docs/api.md +++ b/docs/api.md @@ -4,7 +4,8 @@ The Validator offers an API which allows you to integrate Validator in your own ## Dependency Management -Currently, we *do not* deploy to Maven Central or similar. Hence you need to build and optionally deploy the Validator artifacts to your own shared repository (see for example [Maven Documentation](https://maven.apache.org/guides/mini/guide-3rd-party-jars-local.html)). +Currently, we *do not* deploy to Maven Central or similar. Hence you need to build and optionally deploy the Validator artifacts to your own +shared (or local) repository (see for example [Maven Documentation](https://maven.apache.org/guides/mini/guide-3rd-party-jars-local.html)). ### Maven @@ -28,7 +29,8 @@ dependencies { ## Usage -Prerequisite for use is a valid [scenario definition](configurations.md) and the a folder with all necessary artifacts for validation (repository) either on the filesystem or on the classpath. +Prerequisite for use is a valid [scenario definition](configurations.md) and the a folder with all necessary artifacts for validation +(repository) either on the filesystem or on the classpath. The following example demonstrates loading scenario.xml and whole configuration from classpath and validating one XML document: @@ -81,14 +83,19 @@ public class StandardExample { } ``` -The `Result` interface has more methods to retrieve details about XSD validation errors and Schematron messages. +The `Result` interface has convenience methods to retrieve details about XSD validation errors and Schematron messages and other processing results. See +[Result.java](https://github.com/itplr-kosit/validator/blob/master/src/main/java/de/kosit/validationtool/api/Result.java) for details. -Initializing all XML artifacts and XSLT-executables is expensive. The `Check` instance is *threadsafe* and keeps all artifacts. Therefore, we recommend the re-use of an `Check` instance. - -* Batch use is serial and *not parallel* +Initializing all XML artifacts and XSLT-executables is expensive. The `Check` instance is *threadsafe* and keeps all artifacts. Therefore, +we recommend the re-use of an `Check` instance. The only input `de.kosit.validationtool.api.Input` which can be created by various methods of `de.kosit.validationtool.api.InputFactory`. -The `InputFactory` calculates a hash sum for each Input which is also written to the Report. _SHA-256_ from the JDK is the default algorithm. It can be changed using the `read`-methods of `InputFactory`. +The `InputFactory` calculates a hash sum for each Input which is also written to the Report. _SHA-256_ from the JDK is the default algorithm. +It can be changed using the `read`-methods of `InputFactory`. + +The main interface [Check.java](https://github.com/itplr-kosit/validator/blob/master/src/main/java/de/kosit/validationtool/api/Check.java) +allows using a batch interface (processing list of [Inputs](https://github.com/itplr-kosit/validator/blob/master/src/main/java/de/kosit/validationtool/api/Input.java)). +However, there is no parallel processing implemented at the moment. ## Accept Recommendation and Accept Match @@ -96,14 +103,21 @@ A tri-state Object `AcceptRecommendation` can be retrieved from the `Result` usi The three defined states are: -1. `UNDEFINED` i.e. the evaluation of the overall validation could not be computed. -2. `ACCEPTABLE` i.e. the recommendation is to accept input based on the evaluation of the overall validation. -3. `REJECT` i.e. the recommendation is to reject input based on the evaluation of the overall validation. +1. `ACCEPTABLE` i.e. the recommendation is to accept input based on the evaluation of the overall validation. +1. `REJECT` i.e. the recommendation is to reject input based on the evaluation of the overall validation. +1. `UNDEFINED` i.e. the evaluation of the overall validation could not be computed (overall processing is incomplete) -By default it is `UNDEFINED`. +The accept recommendation is based on either: + +1. schema and schematron validation results +1. if configured based on _acceptMatch_ configuration of the scenario (see below) ### Accept Match in Scenario Configuration -For your own configuration you can add an `acceptMatch` element in each scenario. It can contain in XPATH expression over your own defined `Report` to compute a boolean. An XPATH expression evaluating to true will lead to an `ACCEPTABLE` amd otherwise to a `REJECT` recommendation. +For your own configuration you can add an `acceptMatch` element in each scenario. It can contain in XPATH expression over your own +defined `Report` to compute a boolean value. An XPATH expression evaluating to true will lead to an `ACCEPTABLE` and otherwise to a `REJECT` +recommendation. -This allows to have own control over what validation result is to be considered acceptable for your own application context. +This allows to have control over what validation result is to be considered _acceptable_ for your own application context. E.g. you can +overrule schematron validation errors with _acceptMatch_ configuration and consider certain errors as _acceptable_. Nevertheless you can *not* +overrule schema errors with accept match. diff --git a/pom.xml b/pom.xml index eb579b7..ab51b8e 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ KoSIT XML Prüftool Implementierung de.kosit - 1.2.0-SNAPSHOT + 1.3.0-SNAPSHOT validationtool KoSIT XML Validator against XSD and Schematron based on defined scenarios. diff --git a/src/main/java/de/kosit/validationtool/api/Result.java b/src/main/java/de/kosit/validationtool/api/Result.java index 5581e29..a32adb2 100644 --- a/src/main/java/de/kosit/validationtool/api/Result.java +++ b/src/main/java/de/kosit/validationtool/api/Result.java @@ -2,6 +2,7 @@ package de.kosit.validationtool.api; import java.util.List; +import org.oclc.purl.dsdl.svrl.FailedAssert; import org.oclc.purl.dsdl.svrl.SchematronOutput; import org.w3c.dom.Document; @@ -69,6 +70,13 @@ public interface Result { */ List getSchematronResult(); + /** + * Returns {@link org.oclc.purl.dsdl.svrl.FailedAssert FailedAsserts} of a schematron evaluation. + * + * @return list of {@link org.oclc.purl.dsdl.svrl.FailedAssert FailedAsserts}, if any, empty list otherwise + */ + List getFailedAsserts(); + /** * Liefert ein true, wenn keine Schema-Violations vorhanden sind. * @@ -82,4 +90,11 @@ public interface Result { * @return true wenn well-formed */ boolean isWellformed(); + + /** + * Returns true, if schematron has been checked and the result does not contain any {@link FailedAssert FailedAsserts}. + * + * @return true, if valid + */ + boolean isSchematronValid(); } diff --git a/src/main/java/de/kosit/validationtool/impl/DefaultResult.java b/src/main/java/de/kosit/validationtool/impl/DefaultResult.java index b878cee..e8be8ac 100644 --- a/src/main/java/de/kosit/validationtool/impl/DefaultResult.java +++ b/src/main/java/de/kosit/validationtool/impl/DefaultResult.java @@ -127,12 +127,19 @@ public class DefaultResult implements Result { * * @return die {@link FailedAssert} */ + @Override public List getFailedAsserts() { return filterSchematronResult(FailedAssert.class); } private List filterSchematronResult(final Class type) { - return getSchematronResult().stream().filter(type::isInstance).map(type::cast).collect(Collectors.toList()); + return getSchematronResult() != null + ? getSchematronResult().stream().filter(type::isInstance).map(type::cast).collect(Collectors.toList()) + : Collections.emptyList(); } + @Override + public boolean isSchematronValid() { + return getSchematronResult() != null && getFailedAsserts().isEmpty(); + } } diff --git a/src/main/java/de/kosit/validationtool/impl/ScenarioRepository.java b/src/main/java/de/kosit/validationtool/impl/ScenarioRepository.java index e360a23..6992329 100644 --- a/src/main/java/de/kosit/validationtool/impl/ScenarioRepository.java +++ b/src/main/java/de/kosit/validationtool/impl/ScenarioRepository.java @@ -164,6 +164,7 @@ public class ScenarioRepository { private ScenarioType createFallback() { final ScenarioType t = new ScenarioType(); + t.setFallback(true); t.setName("Fallback-Scenario"); t.setMatch("count(/)<0"); final CreateReportType reportType = new CreateReportType(); diff --git a/src/main/java/de/kosit/validationtool/impl/model/BaseScenario.java b/src/main/java/de/kosit/validationtool/impl/model/BaseScenario.java index b3f60c9..c92ebaa 100644 --- a/src/main/java/de/kosit/validationtool/impl/model/BaseScenario.java +++ b/src/main/java/de/kosit/validationtool/impl/model/BaseScenario.java @@ -70,6 +70,11 @@ public abstract class BaseScenario { private ResourceType resourceType; } + @XmlTransient + @Getter + @Setter + private boolean fallback; + private XPathExecutable matchExecutable; private XPathExecutable acceptExecutable; diff --git a/src/main/java/de/kosit/validationtool/impl/tasks/ComputeAcceptanceAction.java b/src/main/java/de/kosit/validationtool/impl/tasks/ComputeAcceptanceAction.java index e24ba4c..f4c5ca2 100644 --- a/src/main/java/de/kosit/validationtool/impl/tasks/ComputeAcceptanceAction.java +++ b/src/main/java/de/kosit/validationtool/impl/tasks/ComputeAcceptanceAction.java @@ -2,15 +2,19 @@ package de.kosit.validationtool.impl.tasks; import static org.apache.commons.lang3.StringUtils.isNotBlank; +import org.oclc.purl.dsdl.svrl.FailedAssert; + import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import de.kosit.validationtool.api.AcceptRecommendation; +import net.sf.saxon.s9api.SaxonApiException; import net.sf.saxon.s9api.XPathSelector; /** - * Berechnet die Akzeptanz-Empfehlung gemäß konfigurierten 'acceptMatch' des aktuellen Szenarios. + * Computes a {@link AcceptRecommendation} for this instance. This is either based on an 'acceptMatch'-configuration of + * the active scenario or based on overall evaluation about schema and semantic (schematron) correctness of the * * @author Andreas Penski */ @@ -20,23 +24,49 @@ public class ComputeAcceptanceAction implements CheckAction { @Override public void check(final Bag results) { - final String acceptMatch = results.getScenarioSelectionResult().getObject().getAcceptMatch(); - if (isNotBlank(acceptMatch)) { - - try { - - final XPathSelector selector = results.getScenarioSelectionResult().getObject().getAcceptSelector(); - selector.setContextItem(results.getReport()); - results.setAcceptStatus(selector.effectiveBooleanValue() ? AcceptRecommendation.ACCEPTABLE : AcceptRecommendation.REJECT); - } catch (final Exception e) { - log.error("Fehler bei Evaluierung des Accept-Status: {}", e.getMessage(), e); + if (preCondtionsMatch(results)) { + final String acceptMatch = results.getScenarioSelectionResult().getObject().getAcceptMatch(); + if (results.getSchemaValidationResult().isValid() && isNotBlank(acceptMatch)) { + evaluateAcceptanceMatch(results); + } else { + evaluateSchemaAndSchematron(results); } + } else { + results.setAcceptStatus(AcceptRecommendation.REJECT); } } - @Override - public boolean isSkipped(final Bag results) { - return results.getReport() == null; + private void evaluateSchemaAndSchematron(final Bag results) { + if (results.getSchemaValidationResult().isValid() && isSchematronValid(results)) { + results.setAcceptStatus(AcceptRecommendation.ACCEPTABLE); + } else { + results.setAcceptStatus(AcceptRecommendation.REJECT); + } + } + + private boolean isSchematronValid(final Bag results) { + return !hasSchematronErrors(results); + } + + private boolean hasSchematronErrors(final Bag results) { + return results.getReportInput().getValidationResultsSchematron().stream().map(e -> e.getResults().getSchematronOutput()) + .flatMap(e -> e.getActivePatternAndFiredRuleAndFailedAssert().stream()).anyMatch(FailedAssert.class::isInstance); + } + + private static void evaluateAcceptanceMatch(final Bag results) { + try { + final XPathSelector selector = results.getScenarioSelectionResult().getObject().getAcceptSelector(); + selector.setContextItem(results.getReport()); + results.setAcceptStatus(selector.effectiveBooleanValue() ? AcceptRecommendation.ACCEPTABLE : AcceptRecommendation.REJECT); + } catch (final SaxonApiException e) { + final String msg = "Error evaluating accept recommendation: %s"; + log.error(msg); + results.addProcessingError(msg); + } + } + + private static boolean preCondtionsMatch(final Bag results) { + return results.getReport() != null && results.getSchemaValidationResult() != null && results.getScenarioSelectionResult() != null; } } diff --git a/src/main/java/de/kosit/validationtool/impl/tasks/ScenarioSelectionAction.java b/src/main/java/de/kosit/validationtool/impl/tasks/ScenarioSelectionAction.java index c66eead..63a11f6 100644 --- a/src/main/java/de/kosit/validationtool/impl/tasks/ScenarioSelectionAction.java +++ b/src/main/java/de/kosit/validationtool/impl/tasks/ScenarioSelectionAction.java @@ -20,6 +20,7 @@ package de.kosit.validationtool.impl.tasks; import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; import de.kosit.validationtool.impl.ScenarioRepository; import de.kosit.validationtool.impl.model.Result; @@ -35,6 +36,7 @@ import net.sf.saxon.s9api.XdmNode; * @author Andreas Penski */ @RequiredArgsConstructor +@Slf4j public class ScenarioSelectionAction implements CheckAction { private final ScenarioRepository repository; @@ -47,16 +49,21 @@ public class ScenarioSelectionAction implements CheckAction { if (results.getParserResult().isValid()) { scenarioTypeResult = determineScenario(results.getParserResult().getObject()); } else { - scenarioTypeResult = new Result<>(repository.getFallbackScenario()); + scenarioTypeResult = new Result<>(this.repository.getFallbackScenario()); } results.setScenarioSelectionResult(scenarioTypeResult); - report.setScenario(scenarioTypeResult.getObject()); + if (!scenarioTypeResult.getObject().isFallback()) { + report.setScenario(scenarioTypeResult.getObject()); + log.info("Schenario {} identified for {}", scenarioTypeResult.getObject().getName(), results.getInput().getName()); + } else { + log.error("No valid schenario configuration found for {}", results.getInput().getName()); + } } private Result determineScenario(final XdmNode document) { final Result result = this.repository.selectScenario(document); if (result.isInvalid()) { - return new Result<>(repository.getFallbackScenario()); + return new Result<>(this.repository.getFallbackScenario()); } return result; } diff --git a/src/test/java/de/kosit/validationtool/cmd/CommandlineApplicationTest.java b/src/test/java/de/kosit/validationtool/cmd/CommandlineApplicationTest.java index 687841d..1207a1a 100644 --- a/src/test/java/de/kosit/validationtool/cmd/CommandlineApplicationTest.java +++ b/src/test/java/de/kosit/validationtool/cmd/CommandlineApplicationTest.java @@ -138,7 +138,7 @@ public class CommandlineApplicationTest { final String[] args = new String[] { "-s", Paths.get(Simple.SCENARIOS).toString(), "-o", this.output.toString(), "-r", Paths.get(Simple.REPOSITORY).toString(), Paths.get(Simple.EXAMPLES).toString() }; CommandLineApplication.mainProgram(args); - assertThat(this.commandLine.getErrorOutput()).contains("Processing 5 object(s) completed"); + assertThat(this.commandLine.getErrorOutput()).contains("Processing 6 object(s) completed"); } @Test diff --git a/src/test/java/de/kosit/validationtool/cmd/ExtractHtmlActionTest.java b/src/test/java/de/kosit/validationtool/cmd/ExtractHtmlActionTest.java index 9c308a1..75c0449 100644 --- a/src/test/java/de/kosit/validationtool/cmd/ExtractHtmlActionTest.java +++ b/src/test/java/de/kosit/validationtool/cmd/ExtractHtmlActionTest.java @@ -22,7 +22,6 @@ package de.kosit.validationtool.cmd; import static org.assertj.core.api.Assertions.assertThat; import java.io.IOException; -import java.net.URL; import java.nio.file.Files; import java.nio.file.Path; import java.util.stream.Collectors; @@ -34,6 +33,7 @@ import org.junit.Test; import de.kosit.validationtool.api.InputFactory; import de.kosit.validationtool.impl.Helper; +import de.kosit.validationtool.impl.Helper.Simple; import de.kosit.validationtool.impl.tasks.CheckAction; /** @@ -43,7 +43,6 @@ import de.kosit.validationtool.impl.tasks.CheckAction; */ public class ExtractHtmlActionTest { - private static final URL REPORT = SerializeReportActionTest.class.getResource("/examples/results/report.xml"); private ExtractHtmlContentAction action; @@ -51,24 +50,24 @@ public class ExtractHtmlActionTest { @Before public void setup() throws IOException { - tmpDirectory = Files.createTempDirectory("checktool"); - action = new ExtractHtmlContentAction(Helper.loadTestRepository(), tmpDirectory); + this.tmpDirectory = Files.createTempDirectory("checktool"); + this.action = new ExtractHtmlContentAction(Helper.loadTestRepository(), this.tmpDirectory); } @After public void tearDown() throws IOException { - FileUtils.deleteDirectory(tmpDirectory.toFile()); + FileUtils.deleteDirectory(this.tmpDirectory.toFile()); } @Test public void testSimple() throws IOException { - CheckAction.Bag b = new CheckAction.Bag(InputFactory.read(REPORT)); - assertThat(action.isSkipped(b)).isTrue(); - b.setReport(Helper.load(REPORT)); - action.check(b); - assertThat(action.isSkipped(b)).isFalse(); - action.check(b); + final CheckAction.Bag b = new CheckAction.Bag(InputFactory.read(Simple.SIMPLE_VALID)); + assertThat(this.action.isSkipped(b)).isTrue(); + b.setReport(Helper.load(Simple.SIMPLE_VALID.toURL())); + this.action.check(b); + assertThat(this.action.isSkipped(b)).isFalse(); + this.action.check(b); assertThat(b.isStopped()).isFalse(); - assertThat(Files.list(tmpDirectory).collect(Collectors.toList())).hasSize(1); + assertThat(Files.list(this.tmpDirectory).collect(Collectors.toList())).hasSize(1); } } diff --git a/src/test/java/de/kosit/validationtool/cmd/PrintReportActionTest.java b/src/test/java/de/kosit/validationtool/cmd/PrintReportActionTest.java index e28b7ab..e1b16f4 100644 --- a/src/test/java/de/kosit/validationtool/cmd/PrintReportActionTest.java +++ b/src/test/java/de/kosit/validationtool/cmd/PrintReportActionTest.java @@ -21,8 +21,7 @@ package de.kosit.validationtool.cmd; import static org.assertj.core.api.Assertions.assertThat; -import java.io.IOException; -import java.net.URL; +import java.net.MalformedURLException; import org.junit.After; import org.junit.Before; @@ -30,6 +29,7 @@ import org.junit.Test; import de.kosit.validationtool.api.InputFactory; import de.kosit.validationtool.impl.Helper; +import de.kosit.validationtool.impl.Helper.Simple; import de.kosit.validationtool.impl.tasks.CheckAction; /** @@ -37,34 +37,33 @@ import de.kosit.validationtool.impl.tasks.CheckAction; */ public class PrintReportActionTest { - private static final URL REPORT = SerializeReportActionTest.class.getResource("/examples/results/report.xml"); private CommandLine commandLine; private PrintReportAction action; @Before - public void setup() throws IOException { - commandLine = new CommandLine(); - commandLine.activate(); - action = new PrintReportAction(); + public void setup() { + this.commandLine = new CommandLine(); + this.commandLine.activate(); + this.action = new PrintReportAction(); } @After - public void tearDownd() throws IOException { - commandLine.deactivate(); + public void tearDown() { + this.commandLine.deactivate(); } @Test - public void testSimpleSerialize() { - CheckAction.Bag b = new CheckAction.Bag(InputFactory.read(REPORT)); - b.setReport(Helper.load(REPORT)); - assertThat(action.isSkipped(b)).isFalse(); - action.check(b); + public void testSimpleSerialize() throws MalformedURLException { + final CheckAction.Bag b = new CheckAction.Bag(InputFactory.read(Simple.SIMPLE_VALID)); + b.setReport(Helper.load(Simple.SIMPLE_VALID.toURL())); + assertThat(this.action.isSkipped(b)).isFalse(); + this.action.check(b); assertThat(b.isStopped()).isFalse(); - assertThat(commandLine.getOutput()).isNotEmpty(); - // assertThat(commandLine.getOutput()).contains("xml".getBytes(), "someXml")).getObject(); + } + + static Bag createBag(final boolean schemaValid, final boolean schematronValid) { + final Result schemaResult = schemaValid ? new Result<>(true) + : new Result<>(Collections.singletonList(new XMLSyntaxError())); + final List schematronResult = schematronValid ? Collections.emptyList() : createSchematronError(); + return createBag(schemaResult, schematronResult); + } + + private static List createSchematronError() { + final ValidationResultsSchematron v = new ValidationResultsSchematron(); + final SchematronOutput out = new SchematronOutput(); + final FailedAssert f = new FailedAssert(); + out.getActivePatternAndFiredRuleAndFailedAssert().add(f); + final Results r = new Results(); + r.setSchematronOutput(out); + v.setResults(r); + return Collections.singletonList(v); + } + + static Bag createBag(final Result schemaResult, + final Collection schematronResult) { + final CreateReportInput reportInput = new CreateReportInput(); + reportInput.getValidationResultsSchematron().addAll(schematronResult); + final Bag b = createBag(InputFactory.read("".getBytes(), "someCheck"), true, reportInput); + b.setSchemaValidationResult(schemaResult); + b.setReport(createReport()); + return b; + } } diff --git a/src/test/resources/examples/results/report.xml b/src/test/resources/examples/results/report.xml deleted file mode 100644 index ed8de55..0000000 --- a/src/test/resources/examples/results/report.xml +++ /dev/null @@ -1,330 +0,0 @@ - - - - - - KoSIT POC - - 2017-09-01T13:13:59.055+02:00 - - - SHA-256 - 4exhW9EJxAbhlZLHZ3mYZ3/hWGG5e6mIpiTAlGTpQ7s= - - - /C:/Developer/source/init/eRechnung-Check/src/test/resources/examples/UBLReady/UBLReady_EU_UBL-NL_20170102_FULL.xml - - - - UBL 2.1 Invoice - urn:oasis:names:specification:ubl:schema:xsd:Invoice-2 - /invoice:Invoice - - - UBL 2.1 Invoice - resources/eRechnung/UBL-2.1/xsdrt/maindoc/UBL-Invoice-2.1.xsd - - - - - BII Rules for Invoice - resources/eRechnung/UBL-2.1/xsl/BIIRULES-UBL-T10.xsl - - - - - openPEPPOL Rules for Invoice - resources/eRechnung/UBL-2.1/xsl/OPENPEPPOL-UBL-T10.xsl - - - - - Report für eRechnung - resources/eRechnung/report.xsl - - - - - - - UBL 2.1 Invoice - resources/eRechnung/UBL-2.1/xsdrt/maindoc/UBL-Invoice-2.1.xsd - - - - - BII Rules for Invoice - resources/eRechnung/UBL-2.1/xsl/BIIRULES-UBL-T10.xsl - - - [CL-T10-R010]-Coded allowance and charge reasons SHOULD belong to the UNCL 4465 code list BII2 subset - - - - - openPEPPOL Rules for Invoice - resources/eRechnung/UBL-2.1/xsl/OPENPEPPOL-UBL-T10.xsl - - - [EUGEN-T10-R026]-A currency code element MUST have a list identifier attribute 'ISO4217'. - - - [EUGEN-T10-R041]-The VAT identifier for the supplier SHOULD be prefixed with country code for companies - with VAT registration in EU countries - - - [EUGEN-T10-R054]-A party legal entity company identifier SHOULD have a scheme identifier attribute. - - - [EUGEN-T10-R029]-An allowance charge reason code MUST have a list identifier attribute 'UNCL4465'. - - - [EUGEN-T10-R029]-An allowance charge reason code MUST have a list identifier attribute 'UNCL4465'. - - - [EUGEN-T10-R029]-An allowance charge reason code MUST have a list identifier attribute 'UNCL4465'. - - - - - - - - - Pruefbericht der KoSIT - - - -

Prüfbericht der KoSIT

-

Angaben zum geprüften Dokument

- - - - - - - - - - - - - - - - - - -
Dokument: - /C:/Developer/source/init/eRechnung-Check/src/test/resources/examples/UBLReady/UBLReady_EU_UBL-NL_20170102_FULL.xml -
Szenario: -
Zeitpunkt:1.9.2017 13:13:59
Validierungsschritte:FehlerWarnungInformation
-

Konformitätsprüfung:Das geprüfte Dokument enthält 4 Fehler / 3 - Warnungen. Es ist nicht konform zu den formalen Vorgaben. -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
PosCodeCustomLevel (Level)StepText
1CL-T10-R010warning - [CL-T10-R010]-Coded allowance and charge reasons SHOULD belong to the UNCL 4465 - code list BII2 subset -
- -
2EUGEN-T10-R026error - [EUGEN-T10-R026]-A currency code element MUST have a list identifier attribute - 'ISO4217'. -
- -
3EUGEN-T10-R041warning - [EUGEN-T10-R041]-The VAT identifier for the supplier SHOULD be prefixed with - country code for companies with VAT registration in EU countries -
- -
4EUGEN-T10-R054warning - [EUGEN-T10-R054]-A party legal entity company identifier SHOULD have a scheme - identifier attribute. -
- -
5EUGEN-T10-R029error - [EUGEN-T10-R029]-An allowance charge reason code MUST have a list identifier - attribute 'UNCL4465'. -
- -
6EUGEN-T10-R029error - [EUGEN-T10-R029]-An allowance charge reason code MUST have a list identifier - attribute 'UNCL4465'. -
- -
7EUGEN-T10-R029error - [EUGEN-T10-R029]-An allowance charge reason code MUST have a list identifier - attribute 'UNCL4465'. -
- -
-

Bewertung:Es wird empfohlen das Dokument zurückzuweisen. -

-

Erstellt mit: KoSIT POC für das InstructionSet - - vom . -

- - -
-
-
-
\ No newline at end of file diff --git a/src/test/resources/examples/simple/input/foo.xml b/src/test/resources/examples/simple/input/foo.xml index b84fe4f..7122648 100644 --- a/src/test/resources/examples/simple/input/foo.xml +++ b/src/test/resources/examples/simple/input/foo.xml @@ -2,4 +2,7 @@ asldkfj + + + \ No newline at end of file diff --git a/src/test/resources/examples/simple/input/withManualReject.xml b/src/test/resources/examples/simple/input/withManualReject.xml new file mode 100644 index 0000000..ed81f6d --- /dev/null +++ b/src/test/resources/examples/simple/input/withManualReject.xml @@ -0,0 +1,8 @@ + + + + asldkfj + + directly transferred, so this is part of the report + + \ No newline at end of file diff --git a/src/test/resources/examples/simple/scenarios.xml b/src/test/resources/examples/simple/scenarios.xml index 47e5ec8..3a99296 100644 --- a/src/test/resources/examples/simple/scenarios.xml +++ b/src/test/resources/examples/simple/scenarios.xml @@ -47,7 +47,7 @@ report.xsl - count(//cri:xmlSyntaxError) = 0 + count(//test:rejected) = 0