IBAN with Whitespace throws exception
That should not happen, hence we need to make the rule more robust:
We should add a warning, if the IBAN has whitespaces.
C:\Users\swaligora\Documents\E-Rechnung\validationtool-1.2.0>java -jar validationtool-1.2.0-standalone.jar -s scenarios\scenarios.xml ubl_1.xml
2020-07-08 09:21:00 [INFO] Creating default scenario repository (alongside scenario definition)
2020-07-08 09:21:00 [INFO] Loading scenarios from file:///C:/Users/swaligora/Documents/E-Rechnung/validationtool-1.2.0/scenarios/scenarios.xml
2020-07-08 09:21:00 [INFO] Load schema from source file:/C:/Users/swaligora/Documents/E-Rechnung/validationtool-1.2.0/validationtool-1.2.0-standalone.jar!/xsd/scenarios.xsd
2020-07-08 09:21:00 [INFO] Loaded scenarios for Prüftool-Konfiguration XRechnung 1.2.2 by KoSIT from 2019-12-30. The following scenarios are available:
EN16931 CIUS XRechnung (UBL Invoice)
EN16931 CIUS XRechnung (UBL CreditNote)
EN16931 CIUS XRechnung (CII)
2020-07-08 09:21:00 [INFO] Loading scenario content from file:/C:/Users/swaligora/Documents/E-Rechnung/validationtool-1.2.0/scenarios/
2020-07-08 09:21:01 [INFO] Loading XSLT script from resources/ubl/2.1/xsl/EN16931-UBL-validation.xsl
2020-07-08 09:21:02 [INFO] Loading XSLT script from resources/xrechnung/1.2.2/xsl/XRechnung-UBL-validation-Invoice.xsl
2020-07-08 09:21:02 [INFO] Loading XSLT script from resources/xrechnung-report.xsl
2020-07-08 09:21:03 [INFO] Loading XSLT script from resources/ubl/2.1/xsl/EN16931-UBL-validation.xsl
2020-07-08 09:21:03 [INFO] Loading XSLT script from resources/xrechnung/1.2.2/xsl/XRechnung-UBL-validation-CreditNote.xsl
2020-07-08 09:21:03 [INFO] Loading XSLT script from resources/xrechnung-report.xsl
2020-07-08 09:21:03 [INFO] Loading XSLT script from resources/cii/16b/xsl/EN16931-CII-validation.xsl
2020-07-08 09:21:04 [INFO] Loading XSLT script from resources/xrechnung/1.2.2/xsl/XRechnung-CII-validation.xsl
2020-07-08 09:21:04 [INFO] Loading XSLT script from resources/xrechnung-report.xsl
2020-07-08 09:21:04 [INFO] Setup completed in 3697ms
2020-07-08 09:21:04 [INFO] Checking content of ubl_1.xml
Error evaluating (fn:not(...) or fn:matches(...) and xs:integer(fn:replace(...)) mod 97 eq 1) in xsl:when/@test on line 521 column 823 of XRechnung-UBL-validation-Invoice.xsl:
FORG0001: Cannot convert string " 300 606 0301 113 147 56131414" to an integer
In template rule with match="document-node()//element(Q{urn:oasis:names:specification:ubl:schema:xsd:Invoice-2}Invoice)/element(Q{urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2}PaymentMeans)" on line 517 of XRechnung-UBL-validation-Invoice.xsl
invoked by xsl:apply-templates at file:/C:/Users/swaligora/Documents/E-Rechnung/validationtool-1.2.0/scenarios/resources/xrechnung/1.2.2/xsl/XRechnung-UBL-validation-Invoice.xsl#319
In template rule with match="document-node()//element(Q{urn:oasis:names:specification:ubl:schema:xsd:Invoice-2}Invoice)" on line 207 of XRechnung-UBL-validation-Invoice.xsl
invoked by built-in template rule (text-only)
In template rule with match="/" on line 169 of XRechnung-UBL-validation-Invoice.xsl
invoked by xsl:apply-templates at file:/C:/Users/swaligora/Documents/E-Rechnung/validationtool-1.2.0/scenarios/resources/xrechnung/1.2.2/xsl/XRechnung-UBL-validation-Invoice.xsl#196
In template rule with match="/" on line 169 of XRechnung-UBL-validation-Invoice.xsl
2020-07-08 09:21:04 [ERROR] Error processing schematron validation Schematron rules for Invoice - CIUS XRechnung (UBL)
net.sf.saxon.s9api.SaxonApiException: Cannot convert string " 300 606 0301 113 147 56131414" to an integer
at net.sf.saxon.s9api.XsltTransformer.transform(XsltTransformer.java:364)
at de.kosit.validationtool.impl.tasks.SchematronValidationAction.validate(SchematronValidationAction.java:79)
at de.kosit.validationtool.impl.tasks.SchematronValidationAction.lambda$validate$0(SchematronValidationAction.java:62)
at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1654)
at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:913)
at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:578)
at de.kosit.validationtool.impl.tasks.SchematronValidationAction.validate(SchematronValidationAction.java:62)
at de.kosit.validationtool.impl.tasks.SchematronValidationAction.check(SchematronValidationAction.java:96)
at de.kosit.validationtool.impl.DefaultCheck.runCheckInternal(DefaultCheck.java:115)
at de.kosit.validationtool.cmd.InternalCheck.checkInput(InternalCheck.java:61)
at de.kosit.validationtool.cmd.CommandLineApplication.processActions(CommandLineApplication.java:236)
at de.kosit.validationtool.cmd.CommandLineApplication.mainProgram(CommandLineApplication.java:135)
at de.kosit.validationtool.cmd.CommandLineApplication.main(CommandLineApplication.java:110)
Caused by: ValidationException: Cannot convert string " 300 606 0301 113 147 56131414" to an integer
at net.sf.saxon.type.ValidationFailure.makeException(ValidationFailure.java:392)
at net.sf.saxon.expr.CastExpression.doCast(CastExpression.java:377)
at net.sf.saxon.expr.CastExpression.evaluateItem(CastExpression.java:393)
at net.sf.saxon.expr.CastExpression.evaluateItem(CastExpression.java:30)
at net.sf.saxon.expr.ArithmeticExpression.evaluateItem(ArithmeticExpression.java:422)
at net.sf.saxon.expr.ArithmeticExpression.evaluateItem(ArithmeticExpression.java:26)
at net.sf.saxon.expr.CompareToIntegerConstant.effectiveBooleanValue(CompareToIntegerConstant.java:178)
at net.sf.saxon.expr.AndExpression.effectiveBooleanValue(AndExpression.java:145)
at net.sf.saxon.expr.OrExpression.effectiveBooleanValue(OrExpression.java:133)
at net.sf.saxon.expr.instruct.Choose.choose(Choose.java:918)
at net.sf.saxon.expr.instruct.Choose.processLeavingTail(Choose.java:892)
at net.sf.saxon.expr.instruct.Block.processLeavingTail(Block.java:735)
at net.sf.saxon.expr.instruct.TemplateRule.applyLeavingTail(TemplateRule.java:352)
at net.sf.saxon.trans.Mode.applyTemplates(Mode.java:532)
at net.sf.saxon.expr.instruct.ApplyTemplates$ApplyTemplatesPackage.processLeavingTail(ApplyTemplates.java:557)
at net.sf.saxon.trans.rules.TextOnlyCopyRuleSet.process(TextOnlyCopyRuleSet.java:73)
at net.sf.saxon.trans.Mode.applyTemplates(Mode.java:495)
at net.sf.saxon.expr.instruct.ApplyTemplates.apply(ApplyTemplates.java:300)
at net.sf.saxon.expr.instruct.ApplyTemplates.processLeavingTail(ApplyTemplates.java:255)
at net.sf.saxon.expr.instruct.Block.processLeavingTail(Block.java:735)
at net.sf.saxon.expr.instruct.Instruction.process(Instruction.java:132)
at net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(ElementCreator.java:352)
at net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(ElementCreator.java:299)
at net.sf.saxon.expr.instruct.TemplateRule.applyLeavingTail(TemplateRule.java:352)
at net.sf.saxon.trans.Mode.applyTemplates(Mode.java:532)
at net.sf.saxon.trans.XsltController.applyTemplates(XsltController.java:747)
at net.sf.saxon.s9api.AbstractXsltTransformer.applyTemplatesToSource(AbstractXsltTransformer.java:347)
at net.sf.saxon.s9api.XsltTransformer.transform(XsltTransformer.java:349)
... 16 more
2020-07-08 09:21:04 [ERROR] Report input has errors [cvc-complex-type.2.4.b: The content of element 'ns2:validationResultsSchematron' is not complete. One of '{"http://www.xoev.de/de/validator/framework/1/createreportinput":results}' is expected. At row -1 at pos -1]
Error evaluating (fn:exists(...)) on line 177 column 42 of default-report.xsl:
XTMM9000: Processing terminated by xsl:message at line 177 in default-report.xsl
In template rule with match="element(Q{http://www.xoev.de/de/validator/framework/1/createreportinput}validationResultsSchematron)" on line 174 of default-report.xsl
invoked by xsl:apply-templates at file:/C:/Users/swaligora/Documents/E-Rechnung/validationtool-1.2.0/scenarios/resources/default-report.xsl#36
In template rule with match="element(Q{http://www.xoev.de/de/validator/framework/1/createreportinput}createReportInput)" on line 32 of default-report.xsl
invoked by unknown caller (null)
In template rule with match="element(Q{http://www.xoev.de/de/validator/framework/1/createreportinput}createReportInput)" on line 32 of default-report.xsl
invoked by built-in template rule (text-only)
2020-07-08 09:21:04 [ERROR] Can not create final report
C:\Users\swaligora\Documents\E-Rechnung\validationtool-1.2.0>
Edited by Lukas Kumai