Skip to content

Validation issue: UBL-SR-53 not enforced for AccountingCustomerParty PartyTaxScheme (missing CompanyID) #1027

@wiknabe

Description

@wiknabe

Description

I believe Mustang Validator has an issue with the correct enforcement of the UBL-SR-53 rule.

According to the Peppol / EN16931 rule set, CompanyID (VAT Identifier) must be stated when providing PartyTaxScheme/TaxScheme/ID.

However, Mustang currently validates an invoice as correct, even though it violates this rule.
When cross-checking the same invoice with the official KoSIT XRechnung Validator, it is correctly rejected.


Steps to Reproduce

  1. Validate the attached XRechnung invoice using Mustang CLI. ubl_incorrect_test.xml
  2. Mustang reports the invoice as valid.
  3. Validate the exact same file using the KoSIT Validator.
  4. KoSIT rejects the invoice due to rule UBL-SR-53.

Problematic XML Fragment

The invoice contains the following block under cac:AccountingCustomerParty:

<cac:PartyTaxScheme>
    <cac:TaxScheme>
        <cbc:ID>VAT</cbc:ID>
    </cac:TaxScheme>
</cac:PartyTaxScheme>

Mustang Output

java -Xmx1G -Dfile.encoding=UTF-8 -jar Mustang-CLI-2.21.0.jar --action validate --source ubl_incorrect_test.xml [main] INFO com.helger.schematron.xslt.SchematronResourceXSLTCache - Compiling XSLT instance [cpPath=/xslt/en16931schematron/EN16931-UBL-validation.xslt; urlResolved=true; URL=jar:file:/xrechnung/Mustang-CLI-2.21.0.jar!/xslt/en16931schematron/EN16931-UBL-validation.xslt]
[main] INFO com.helger.schematron.api.xslt.AbstractSchematronXSLTBasedResource - Applying Schematron XSLT on XML instance
[main] INFO com.helger.schematron.xslt.SchematronResourceXSLTCache - Compiling XSLT instance [cpPath=/xslt/XR_30/XRechnung-UBL-validation.xslt; urlResolved=true; URL=jar:file:/xrechnung/Mustang-CLI-2.21.0.jar!/xslt/XR_30/XRechnung-UBL-validation.xslt]
[main] WARN com.helger.xml.transform.LoggingTransformErrorListener - [warn] Transformation warning (net.sf.saxon.trans.XPathException: A function that computes atomic values should use xsl:sequence rather than xsl:value-of)
[main] WARN com.helger.xml.transform.LoggingTransformErrorListener - [warn] Transformation warning (net.sf.saxon.trans.XPathException: A function that computes atomic values should use xsl:sequence rather than xsl:value-of)
[main] INFO com.helger.schematron.api.xslt.AbstractSchematronXSLTBasedResource - Applying Schematron XSLT on XML instance
[main] INFO org.mustangproject.validator.ZUGFeRDValidator - Parsed PDF:absent XML:valid Signature:null Checksum:271FB8540559EBEA23E93CD9C2DA9C0505592247 Profile:urn:cen.eu:en16931:2017#compliant#urn:xeinkauf.de:kosit:xrechnung_3.0 Version:2 Took:2933ms Errors:[] ErrorIDs: []
<?xml version="1.0" encoding="UTF-8"?>

<validation filename="ubl_incorrect_test.xml" datetime="2026-02-04 12:31:45">
  <xml>
    <info>
      <version>2</version>
      <profile>urn:cen.eu:en16931:2017#compliant#urn:xeinkauf.de:kosit:xrechnung_3.0</profile>
      <validator version="2.21.0"/>
      <rules>
        <fired>11</fired>
        <failed>0</failed>
      </rules>
      <duration unit="ms">2685</duration>
    </info>
    <summary status="valid"/>
  </xml>
  <summary status="valid"/>
</validation>

KoSIT Output

java -jar validator-1.6.0-standalone.jar -s validator-configuration-xrechnung_3.0.2_2025-07-10/scenarios.xml ubl_incorrect_test.xml 
KoSIT Validator version 1.6.0
Loading scenarios from  file:///xrechnung/validator-configuration-xrechnung_3.0.2_2025-07-10/scenarios.xml
Using repository  file:///xrechnung/validator-configuration-xrechnung_3.0.2_2025-07-10/

Loaded "Validator Configuration XRechnung 3.0.2" by Coordination Office for IT Standards (KoSIT) from 2025-07-09 
The following scenarios are available:
  * EN16931 XRechnung (UBL Invoice)
  * EN16931 XRechnung Extension (UBL Invoice)
  * EN16931 XRechnung CVD (UBL Invoice)
  * EN16931 XRechnung (UBL CreditNote)
  * EN16931 XRechnung CVD (UBL CreditNote)
  * EN16931 XRechnung (CII)
  * EN16931 XRechnung Extension (CII)
  * EN16931 XRechnung CVD (CII)
  * EN16931 (UBL Invoice)
  * EN16931 (UBL CreditNote)
  * EN16931 (CII)


Processing of 1 objects started
Processing of 1 objects completed in 299ms
Results:
-------------------------------------------------------------------------------------------------------------------------------------------------------
|File                                                       |Schema |Schematron|Acceptance|Error/Description                                           |
|/xrechnung/ubl_incorrect_test.xml        |   Y   |    N     |  REJECT  |[UBL-SR-53]- CompanyID (VAT Identifier) must be stated when |
|                                                           |       |          |          |providing the PartyTaxScheme/TaxScheme/ID.                  |
-------------------------------------------------------------------------------------------------------------------------------------------------------
Acceptable:  0  Rejected:  1


##############################
#     Validation failed!     #
##############################

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions