This commit is contained in:
jstaerk
2025-09-01 10:38:54 +02:00
parent b8800b3506
commit dadf0de4b0
4 changed files with 22 additions and 1 deletions

View File

@@ -14,6 +14,7 @@ public class ValidationContext {
private String profile = null;
private String signature = null;
private boolean isValid = true;
private boolean hasPDF = false;
protected Logger logger;
private String filename;
@@ -22,6 +23,14 @@ public class ValidationContext {
results = new Vector<>();
}
public void setHasPDF() {
hasPDF=true;
}
public boolean hasPDF() {
return hasPDF;
}
public void addResultItem(ValidationResultItem vr) throws IrrecoverableValidationError {
results.add(vr);

View File

@@ -374,6 +374,14 @@ public class XMLValidator extends Validator {
addUnsupportedProfileResultItem();
}
}
} else {
// no CII -> has to be UBL
if (context.hasPDF()) {
final ValidationResultItem vri = new ValidationResultItem(ESeverity.error, "Factur-X/ZUGFeRD and Order-X are always strictly CII only, no UBL allowed.").setSection(17)
.setPart(EPart.fx);
context.addResultItem(vri);
}
}
if (xsltFilename != null) {

View File

@@ -121,6 +121,7 @@ public class ZUGFeRDValidator {
// Avoid reading again from file
pdfv.setFilenameAndContents(contextFilename, content);
context.setHasPDF();
optionsRecognized = true;
finalStringResult.append("<pdf>");
try {