HR-BR-33

Račun ne smije sadržavati prazne xml elemente osim elementa s elektroničkim potpisom računa.

In English The invoice must not contain empty XML elements, except the element holding the invoice's electronic signature.

error: the document is invalid

Why it fails

  • An element is empty or holds only whitespace, for example <cbc:Note/> or <cbc:Telephone></cbc:Telephone>, often written by a template for a field nobody filled in.

How to fix it

Leave out every element without a value. The only exception is the signature container, sig:UBLDocumentSignatures.

What the rule checks

As the rule set's publisher wrote it. The rule runs on every element the context matches, and fails where the test is false; the validator reports the line of that element.

Context
//*[not(*) and not(normalize-space()) and not(ancestor-or-self::sig:UBLDocumentSignatures)]
Test
false()

Checked with Croatia eRačun Invoice (UBL), Croatia eRačun Credit Note (UBL)