Hi Mike,

Thank you for the explanation. Yes, I see that is how Daffodil behaves.

But, but, but, ...

Does it make sense? If a data format specifies that instances contain 1 to 5 
string values separated by forward slashes, then any of these instances should 
be valid:

              a
              a/b
              a/b/c
              a/b/c/d
              a/b/c/d/e

But you are saying that only the last instance is valid when 
separatorSuppressionPolicy=never is also specified. You are saying that 
instances must always contain 5 values (a zero-length string is a value):

              a////
              a/b///
              a/b/c//
              a/b/c/d/
              a/b/c/d/e

To my mind, the constraints form a logical inconsistency. The constraints

              minOccurs=1
              maxOccurs=5

specifies instances contain 1 to 5 values

The constraint

              separatorSuppressionPolicy=never

specifies instances must contain exactly 5 values.

Therefore, the constraints form a logical inconsistency, don't they?

/Roger

From: Beckerle, Mike <mbecke...@owlcyberdefense.com>
Sent: Tuesday, April 20, 2021 10:34 AM
To: users@daffodil.apache.org
Subject: [EXT] Re: Is separatorSuppressionPolicy=never meaningless?

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<mailto:coste...@mitre.org>>
Sent: Tuesday, April 20, 2021 9:44 AM
To: users@daffodil.apache.org<mailto:users@daffodil.apache.org> 
<users@daffodil.apache.org<mailto: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