No empty XML elements

Warning PEPPOL-EN16931-R008 Peppol

Document MUST not contain empty elements. (still status warning)

Recommendation: The invoice remains valid but should be corrected so that it can be processed automatically.
What is wrong

At least one XML element with no child elements contains no text or only whitespace. Such empty elements are not permitted in the document.

What the rule means

An empty element does not convey a value. Removing unused elements or providing a value prevents empty information from appearing in the document.

Please remove empty XML elements

The document contains at least one empty XML element. You can adjust the invoice so that it no longer contains empty elements.

What to do
  1. Find elements in the XML that have no child elements and contain no text.
  2. Remove unused empty elements or provide the missing content.
  3. Generate the invoice again and validate it once more.
Technical details

The test fails for each element with no child elements whose normalized text content is empty.

Where the rule applies

The rule applies to all XML elements in the document that have no child elements.

Context (rule/@context)
//*[not(*) and not(normalize-space())]
Test expression (assert/@test)
false