smooks-edi-cartridge icon indicating copy to clipboard operation
smooks-edi-cartridge copied to clipboard

Characters to escape are hard-coded in IBM_EDI_Format.dfdl.xsd

Open cjmamo opened this issue 4 months ago • 0 comments

Describe the bug

The characters to escape are hard-coded in IBM_EDI_Format.dfdl.xsd. This means that during unparsing, when non-default delimiters are used, characters which should not be escaped are escaped anyway.

Solving this bug is tricky because there isn't an easy way to dynamically set the characters to be escaped from the DFDL schema. This issue has been reported to the Daffodil team and a JIRA issue was created.

To Reproduce

Go to the XML-to-EDI example and remove the workaround that declares a new escape scheme. Run the example and the following will be printed to the console:

HDR*1*0*59.97*64.92*4.95*Wed Nov 15 13?:45?:28 EST 2006
CUS*user1*Harry^Fletcher*SD
ORD*1*1*364*The 40-Year-Old Virgin*29.98
ORD*2*1*299*Pulp Fiction*29.99

Expected behavior

Referencing the earlier example, the expected output should be:

HDR*1*0*59.97*64.92*4.95*Wed Nov 15 13:45:28 EST 2006
CUS*user1*Harry^Fletcher*SD
ORD*1*1*364*The 40-Year-Old Virgin*29.98
ORD*2*1*299*Pulp Fiction*29.99

Environment

  • Smooks: 2.0.0-RC3

cjmamo avatar Feb 17 '24 09:02 cjmamo