Common Offending Empty Elements That Trigger PEPPOL-EN16931-R008
| Offending Tag | Typical ERP Cause | Correct Peppol BIS 3.0 Fix |
|---|---|---|
| Blank invoice memo/comment box serialized as whitespace | Omit | |
| Address line 2 is NULL in customer master record | Conditionally render only when address2.trim() != ''. | |
| Optional delivery block rendered with zero child tags | Remove empty parent wrapper elements recursively. | |
| Cost center not populated on sales order | Strip empty optional tags in serializer / XSLT. |
Before vs After: Stripping Empty Elements for PEPPOL-EN16931-R008
<!-- BROKEN: Triggers PEPPOL-EN16931-R008 fatal error -->
<cbc:Note> </cbc:Note>
<cac:PostalAddress>
<cbc:StreetName>Meir 42</cbc:StreetName>
<cbc:AdditionalStreetName/>
<cbc:CityName>Antwerpen</cbc:CityName>
<cac:Country><cbc:IdentificationCode>BE</cbc:IdentificationCode></cac:Country>
</cac:PostalAddress>
<!-- FIXED: Blank optional tags omitted completely -->
<cac:PostalAddress>
<cbc:StreetName>Meir 42</cbc:StreetName>
<cbc:CityName>Antwerpen</cbc:CityName>
<cac:Country><cbc:IdentificationCode>BE</cbc:IdentificationCode></cac:Country>
</cac:PostalAddress>
Why XML Schema (XSD) Passes While Peppol Schematron Rejects
Standard UBL 2.1 XSD validation permits empty string values in many optional elements like cbc:Note or cbc:StreetName. However, Peppol BIS Billing 3.0 adds Schematron assertion PEPPOL-EN16931-R008 (normalize-space(.) != '') to prevent downstream AP systems from overwriting valid fields with blank strings or crashing on null attributes.
One-Pass Serializer Guard Against Empty Nodes
Never emit static XML templates with empty placeholders like <cbc:Note>{{note}}</cbc:Note>. Instead, build your XML DOM programmatically and run a bottom-up pruning pass that deletes any element with zero child elements, zero attributes, and textContent.trim() === ''. Test the final output in CheckPeppol — our validator scans every leaf element and prints the exact offending tag names.
Frequently Asked Questions
Does whitespace like spaces or tabs count as an empty element in Peppol?
Yes. PEPPOL-EN16931-R008 uses XPath normalize-space(), so <cbc:Note> </cbc:Note> or a newline-only tag fails identically to <cbc:Note/>.
What if a mandatory field is empty?
You cannot delete a mandatory element like cbc:ID or cbc:RegistrationName — you must populate it with valid business data instead.
Does CheckPeppol detect PEPPOL-EN16931-R008?
Yes. CheckPeppol's local DOMParser validator automatically inspects every leaf node and flags empty or whitespace-only tags with their exact tag names.