EDIFACT Syntax 3/4 repeat separator - UNA not working?

80 views
Skip to first unread message

Mateusz Janiak

unread,
Jan 1, 2022, 2:55:47 PM1/1/22
to Smooks Users

Dear Smooks Users,
I am trying to parse an INSDES D98A EDIFACT message using Smooks Cartridge 2.0.0-M3.
I found myself trying to fix an unkown problem for days and I have finally found a problem which is related to the following EDIFACT element:

LIN+10'
PIA+5+974561:SA+123:SA'

Elements 5+974561:SA and 123:SA' are repeating elements. As it is with EDIFACT for Syntax 3 i.e. UNA:+.? 'UNB+UNOC:3+(...) the repeat separator is "*" so the example above would not work. If changed to

PIA+5+974561:SA*123:SA' it works fine.
However when using syntax 4 i.e. UNA:+.? 'UNB+UNOC:4+(...) I should be able to manually specify the repeat separator. However even if I specify it with UNA like:
UNA:+.?*' the parsing fails.

It should be working without specifying UNA completely due to that part:

                        <xsd:element name="RepeatSeparator" type="xsd:string" default="*" dfdl:length="1" dfdl:lengthKind="explicit" dfdl:escapeSchemeRef="" dfdl:textTrimKind="none">
                                <xsd:annotation>
                                        <xsd:appinfo source="http://www.ogf.org/dfdl/">
                                                <!-- If v3 syntax then assume field separator -->
                                                <dfdl:setVariable ref="ibmEdiFmt:RepeatSep" value="{if (. eq ' ') then ../FieldSeparator else .}"/>
                                        </xsd:appinfo>
                                </xsd:annotation>
                        </xsd:element>

of the EDIFACT-Service-Segments-4.1.xsd file (it copied the FieldSeparator = '+') but it does not work.

I need a way to parse the following pretty standard line:
PIA+5+974561:SA+123:SA'

Does anyone know how this can be solved with smooks cartridges?

Regards,
Mateusz

Claude Mamo

unread,
Jan 1, 2022, 3:13:24 PM1/1/22
to smook...@googlegroups.com
Welcome to the forum Mateusz and happy New Year ;-). Are you able to reproduce this behaviour with the latest EDIFACT cartridge snapshot (2.0.0-RC1-SNAPSHOT)?

Claude

--
You received this message because you are subscribed to the Google Groups "Smooks Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to smooks-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/smooks-user/59ff05d0-ba18-4f0e-8e3e-b326a6eedd68n%40googlegroups.com.

Mateusz Janiak

unread,
Jan 5, 2022, 1:53:25 AM1/5/22
to Smooks Users
Hello Claude,

thank you very much - it seems resolved with 2.0.0-RC1-SNAPSHOT version.

Mateusz
Reply all
Reply to author
Forward
0 new messages