Avoid 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

The XML contains at least one element without child elements whose content is empty or consists only of whitespace. The check reports this as a warning.

What the rule means

Empty elements contain no usable information and should not be part of the invoice document.

Please remove or fill in empty XML elements

At least one XML element in the invoice is empty or contains only whitespace. You can resolve the message by removing the element or providing suitable content.

What to do
  1. Look in the XML for elements with no content and no child elements.
  2. Remove empty elements that are not needed, or fill them with a suitable value.
  3. Generate the invoice again and validate it once more.
Technical details

The context selects every element that has no child elements and whose normalized content is empty. The test expression false always fails.

Where the rule applies

The rule applies to all XML elements without child elements whose content is empty or consists only of whitespace.

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