In Mustang Version 2.10.0 we noticed a problem regarding empty elements in the document.
Example:
final TradeParty tradeParty = new TradeParty();
tradeParty.setAdditionalAddress(null);
Results in the following Output:
Which results in the following validaiton error:
<error type="27" location="/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction[1]/ram:ApplicableHeaderTradeAgreement[1]/ram:BuyerTradeParty[1]/ram:PostalTradeAddress[1]/ram:LineTwo[1]" criterion="false()">Document MUST not contain empty elements. [ID PEPPOL-EN16931-R008] from /xslt/XR_30/XRechnung-CII-validation.xslt)</error>
Should this not be ignored in case of null or an empty (trimmed) string? I fixed it by testing the string before calling the method, but it might be more comfortable if the library does it internally?
This "requirement" is relatively new (XRechnung 3), and strange, if you ask me, but please feel invited to submit a PR to only write non-empty elements
Hi,
In Mustang Version 2.10.0 we noticed a problem regarding empty elements in the document.
Example:
Results in the following Output:![image](https://github.com/ZUGFeRD/mustangproject/assets/71561900/181eda60-69fa-4034-8174-2ebc105b66e4)
Which results in the following validaiton error:
<error type="27" location="/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction[1]/ram:ApplicableHeaderTradeAgreement[1]/ram:BuyerTradeParty[1]/ram:PostalTradeAddress[1]/ram:LineTwo[1]" criterion="false()">Document MUST not contain empty elements. [ID PEPPOL-EN16931-R008] from /xslt/XR_30/XRechnung-CII-validation.xslt)</error>
Should this not be ignored in case of null or an empty (trimmed) string? I fixed it by testing the string before calling the method, but it might be more comfortable if the library does it internally?
Thanks for the help.