All rules · pint-om · error
IBR-079-OM
The document must not contain empty elements.
Reviewed
Why this rule exists
An empty element asserts that a value exists while providing none. That is worse than omitting the element, because downstream systems treat presence as meaning.
Why it usually happens
- Serializing every field in a template regardless of whether the source value was null
- Mapping an empty string from a database column into an element rather than skipping it
How to fix it
Configure the serializer to omit elements whose value is null or empty, rather than emitting empty tags.
<cbc:Note></cbc:Note>
<!-- omit the element entirely when there is no note -->
The official rule
When Goods or Services identification (BTOM-019) is 'Goods' then Item classification identifier (IBT-158, HS code) must be provided except when Invoice transaction type (BTOM-001) is 'Simplified Tax Invoice' (01000000000000000000)
Verbatim from the published artefact. We execute the official Schematron unmodified, so this is exactly what an Access Point checks.
Schematron test
$isSimplified or not(cac:Item/cac:ItemSpecificationDocumentReference[cbc:ID/@schemeName='MP']/cbc:DocumentTypeCode='G') or cac:Item/cac:CommodityClassification/cbc:ItemClassificationCode[@listID='HS']
Applied to nodes matching cac:InvoiceLine | cac:CreditNoteLine
Rule-pack versions
| Rule-pack | Layer | Severity | Applies to |
|---|---|---|---|
| pint-om-1.0.1 | pint-om | error | billing/creditnote, billing/invoice, self-billing/creditnote, self-billing/invoice |
| pint-om-1.0.0 | pint-om | error | billing/creditnote, billing/invoice, self-billing/creditnote, self-billing/invoice |
Check your own invoice
Paste your XML and see every rule that fires, not just this one. Free, no sign-up, and we never store the document.
Open the validator