Common Offending Empty Elements That Trigger PEPPOL-EN16931-R008

Offending TagTypical ERP CauseCorrect Peppol BIS 3.0 Fix
Blank invoice memo/comment box serialized as whitespaceOmit unless trimmed text length > 0.
Address line 2 is NULL in customer master recordConditionally render only when address2.trim() != ''.
Optional delivery block rendered with zero child tagsRemove empty parent wrapper elements recursively.
Cost center not populated on sales orderStrip 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>

Validate your XML locally — zero server upload

Test Peppol BIS 3.0 (UBL 2.1) and Factur-X (CII) invoices in milliseconds or search live Peppol Participant IDs.

Open XML Validator Live Peppol ID Lookup

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.

Related Peppol & EN 16931 Guides