Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Empty Element in Document #364

Open
RichardCox09 opened this issue Mar 20, 2024 · 1 comment
Open

Empty Element in Document #364

RichardCox09 opened this issue Mar 20, 2024 · 1 comment

Comments

@RichardCox09
Copy link

RichardCox09 commented Mar 20, 2024

Hi,

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:
image

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.

@jstaerk
Copy link
Collaborator

jstaerk commented Mar 20, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants