So both of anyEmpty and trailingEmpty are used by EDIFACT.  The X12 EDI format, 
which is conceptually similar uses trailingEmptyStrict.

I don't know of any publicly available X12 DFDL schema, but IBM has some 
tutorial about X12 here:
https://www.ibm.com/docs/en/integration-bus/9.0.0?topic=SSMKHH_9.0.0/com.ibm.etools.mft.samples.x12.doc/doc/overview.htm

Here's a nice example of what an X12 EDI Purchase Order looks like:
https://www.1edisource.com/resources/edi-transactions-sets/edi-850/

X12 is an ANSI Standard, mostly used by US companies domestically and 
internationally. I've ready that non-US companies use UN/EDIFACT, for which 
there is a demo (partial) DFDL Schema on github.

I took at look at EDIFACT. The schema uses an old now-obsolete DFDL property 
called separatorPolicy='suppressed' which is the same thing as the new property 
separatorSuppressionPolicy="anyEmpty".

This is for the sequence of lines (segments) that begin with 3 character 
identifiers. Using 'anyEmpty' means blank lines are not allowed.

separatorPolicy="suppressedAtEndLax" (now 
separatorSuppressionPolicy='trailingEmpty') is used within a line (segment)

Here's a snippet of one EDIFACT message (not a whole message) from the DFDL 
Schemas github site.

UNA:+.?*'
UNB+UNOC:4+5790000274017:14+5708601000836:14+990420:1137+17++INVOIC++++1'
UNH+30+INVOIC:D:03B:UN'
BGM+380+539602'
DTM+137:19990420:102'
RFF+CO:01671727'
NAD+BY+5708601000836::9'
RFF+VA:UK37499919'
NAD+SU++IBM UK'
RFF+VA:UK19430839'
RFF+ADE:00000767'
NAD+DP+++MyCompany+MyStreet+MyTown++1234+UK'
CUX+2:GBP:9'
LIN+1++V0370246:IN'
IMD+F++:::Collectors edition of The Hobbit with Tolkien?'s original colours on 
sleeve'
QTY+47:5:PCE'
....


________________________________
From: Roger L Costello <coste...@mitre.org>
Sent: Tuesday, April 20, 2021 10:22 AM
To: users@daffodil.apache.org <users@daffodil.apache.org>
Subject: Only two meaningful values of separatorSuppressionPolicy?

Hi Folks,

I think these are the only meaningful values of separatorSuppressionPolicy:

        trailingEmptyStrict
        trailingEmpty

With those, a data format designer can specify what instances are legal and 
what instances are illegal. For example, suppose a data format specifies that 
instances contain 1-5 string data items separated by forward slashes. If the 
data format designer wants to prohibit instances from having empty trailing 
separators like this:

        a/b///

then the data format designer specifies 
separatorSuppressionPolicy=trailingEmptyStrict

If the data format designer wants to allow empty trailing separators, then the 
data format designer specifies separatorSuppressionPolicy=trailingEmpty

I don't think the other values of separatorSuppressionPolicy are meaningful. I 
am eager to be proven wrong.

/Roger

Reply via email to