The separatorSuppresssionPolicy 'never' used with a variable-length array, 
means that there will always be separators for maxOccurs items. That is, the 
separators are never suppressed even for optional item occurrences that are 
absent.

So CSV-style data with separatorSuppressionPolicy 'never' and minOccurs 0, 
maxOccurs 10 always requires 9 separators.

E.g.,

a/b/c///////

always 9 (for infix separator). Never any fewer, never any additional.

maxOccurs="unbounded" is not allowed with separatorSuppressionPolicy 'never'.





________________________________
From: Roger L Costello <coste...@mitre.org>
Sent: Tuesday, April 20, 2021 9:44 AM
To: users@daffodil.apache.org <users@daffodil.apache.org>
Subject: Is separatorSuppressionPolicy=never meaningless?

Hi Folks,

separatorSuppressionPolicy=never means separators are never omitted.

I have convinced myself that there are no instances that would ever raise an 
error due to separatorSuppressionPolicy=never

Case #1: Suppose the schema specifies that instances must contain exactly 3 
string data items, separated by forward slashes. There is no data for the 3rd 
data item. Then instances must look like this:

        a/b/

The instance cannot omit the last separator because the schema specifies 
exactly 3 data items. So, separatorSuppressionPolicy=never has no effect in 
this case.

Case #2: Suppose the schema specifies that instances contain 1 to 3 string data 
items, separated by forward slashes. There is no data for the 3rd data item. 
Then this is a valid instance:

        a/b

Since there may be less than 3 data items, there are no omitted separators in 
the instance. Again, separatorSuppressionPolicy=never has no effect in this 
case.

I think those are the only two cases possible. In both cases 
separatorSuppressionPolicy=never has no effect. I conclude that 
separatorSuppressionPolicy=never is meaningless. I look forward to being proven 
wrong.

/Roger

Reply via email to