support xr 2.2 validation

This commit is contained in:
jstaerk
2022-07-09 13:21:06 +02:00
parent 695adb1530
commit 973bee4cea
5 changed files with 1155 additions and 9 deletions

View File

@@ -180,20 +180,16 @@ public class LibraryTest extends ResourceCase {
String res = zfv.validate(tempFile.getAbsolutePath());
/** We're releasing XR in the (published) version 2.2, unfortunately as of 2022-05-10 the validating schematrons only support 1.1, thus throw this error:*/
assertThat(res).valueByXPath("count(//error)")
.asInt()
.isEqualTo(1);
assertThat(res).valueByXPath("//error").asString().isEqualTo("[BR-DE-21] Das Element \"Specification identifier\" (BT-24) soll syntaktisch der Kennung des Standards XRechnung entsprechen. (From /xslt/XR_21/XRechnung-CII-validation.xslt)");
.isEqualTo(0);
assertThat(res).valueByXPath("/validation/summary/@status")
.asString()
.isEqualTo("invalid");// expect to be valid because XR notices are, well, only notices
.isEqualTo("valid");// expect to be valid because XR notices are, well, only notices
assertThat(res).valueByXPath("/validation/xml/summary/@status")
.asString()
.isEqualTo("invalid");
/** end of errors due to version mismatch*/
.isEqualTo("valid");
assertThat(res).valueByXPath("count(//notice)")
.asInt()
.isEqualTo(0);