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

Apache Daffodil default triad separator clashes with the comma as EDIFACT decimal separator #200

Open
uliSchuster opened this issue Jun 27, 2022 · 0 comments

Comments

@uliSchuster
Copy link
Contributor

Apache Daffodil uses both a decimal separator (textStandardDecimalSeparator) and a thousand group separator (textStandardGroupingSeparator). The group separator by default is the comma. Setting the decimal separator to be the comma as well leads to a clash. This situation arises during EDIFACT parsing either if the comma is set in the service string advise – i.e., UNA:+,? ' – or when setting the comma as default decimal separator when configuring smooks – e.g.,

val reader = EdifactReaderConfigurator(schemaUri)
reader.setDecimalSign(",")
smooks.setReaderConfig(reader)

The resulting error is

org.smooks.api.SmooksException: Failed to filter source
[..]
Caused by: org.smooks.api.SmooksException: Schema Definition Error: Non-distinct property ',' found in: textStandardGroupingSeparator, textStandardDecimalSeparator
Schema context: E0017 Location line 3334 column 14 in jar:file:.m2/repository/org/smooks/cartridges/edi/edi-schemas/2.0.0-RC1/edi-schemas-2.0.0-RC1.jar!/EDIFACT-Common/EDIFACT-Service-Segments-4.1.dfdl.xsd

A workaround is to set the Daffodil triad separator to some character that is not used in EDIFACT, like reader.setDecimalSign(",").setTriadSeparator("~"). However, it would be great if the smooks EDIFACT cartridge would take care of this issue in its default configuration

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

No branches or pull requests

1 participant