fatalEN 16931syntax binding ruleUBL
A UBL invoice shall not include an AdditionalDocumentReference simultaneously referring an Invoice Object Identifier and an Attachment
One AdditionalDocumentReference is being used both as an invoiced object identifier and as a supporting document.
Split them into two separate AdditionalDocumentReference groups: one with DocumentTypeCode 130 for the invoiced object, another for the attachment.
UBL — context /ubl:Invoice | /cn:CreditNote
not(//cac:AdditionalDocumentReference[cbc:DocumentTypeCode = '130']/cac:Attachment)
Nothing is stored, and the whole invoice is checked, not just this rule. A PDF only works if it is Factur-X / ZUGFeRD — a PDF with the invoice XML inside it.