Yes, I think there is a bug.

I will try to recreate on 3.1.0 development branch.
________________________________
From: Roger L Costello <coste...@mitre.org>
Sent: Tuesday, April 20, 2021 9:13 AM
To: users@daffodil.apache.org <users@daffodil.apache.org>
Subject: Bug in Daffodil?

Hi Folks,

Consider a data format which specifies that instance documents must contain a 
sequence of 1 to 3 string data items and the data items are to be separated by 
forward slashes. If there is no data for the third data item and the data 
format specifies separatorSuppressionPolicy=trailingEmptyStrict, then this 
instance is invalid because it has a trailing separator:

        a/b/

Daffodil should throw an error with that instance, but doesn't.

On the other hand, if the data format specifies a sequence of 1 to 4 string 
data items, then Daffodil throws an error on the above instance.

That is, Daffodil does not throw an error on the above instance with this 
schema:

  <xs:element name="file">
    <xs:complexType>
      <xs:sequence dfdl:separator="/" dfdl:separatorPosition="infix"
        dfdl:separatorSuppressionPolicy="trailingEmptyStrict">
        <xs:element name="value" type="xs:string" minOccurs="1" maxOccurs="3" />
      </xs:sequence>
    </xs:complexType>
  </xs:element>

But Daffodil does throw an error on the above instance with this schema:

  <xs:element name="file">
    <xs:complexType>
      <xs:sequence dfdl:separator="/" dfdl:separatorPosition="infix"
        dfdl:separatorSuppressionPolicy="trailingEmptyStrict">
        <xs:element name="value" type="xs:string" minOccurs="1" maxOccurs="4" />
      </xs:sequence>
    </xs:complexType>
  </xs:element>

Is that a bug in Daffodil?

/roger

Reply via email to