Michael Beckerle created DAFFODIL-1975:
------------------------------------------

             Summary: Incorrect separator behavior - missing separator for 
empty sequence (non-backward compatible)
                 Key: DAFFODIL-1975
                 URL: https://issues.apache.org/jira/browse/DAFFODIL-1975
             Project: Daffodil
          Issue Type: Bug
          Components: Back End
    Affects Versions: 2.1.0
            Reporter: Michael Beckerle
             Fix For: 2.2.0


Consider the following

{{    <xs:element name="NS_13a">
      <xs:complexType>
        <xs:sequence dfdl:separator=","  dfdl:separatorPosition="infix"><!-- 
OUTER -->
            <xs:sequence> <!-- INNER -->
              <xs:annotation>
              <xs:appinfo source="http://www.ogf.org/dfdl/";>
                <dfdl:assert>{fn:true()}</dfdl:assert>
              </xs:appinfo>
              </xs:annotation>
          </xs:sequence>
          <xs:element name="e2" type="xs:int" minOccurs="1" 
maxOccurs="unbounded" dfdl:textNumberPattern="#####"
               dfdl:occursCountKind="implicit" />
        </xs:sequence>
      </xs:complexType>
    </xs:element>}}

The sequence labeled INNER has no syntax, only an assertion. However, the OUTER 
sequence specifies infix separator.

Per clarifying discussion on the DFDL workgroup mailing list, and tests with 
IBM DFDL, daffodil behavior is wrong if it suppresses the separator after the 
INNER sequence. Separator suppression applies only to "optional" children, not 
required children. All model group instances are considered required, even if 
empty. 

Hence, valid data to match the above schema looks like

,1,2,3

The leading comma there is required. 

Daffodil must be doing something clever to detect that this initial sequence is 
empty and so is suppressing the separator for it. But this is incorrect.

Test test_NumSeq_13a illustrates the bug. (Test added as part of sequence and 
separators refactoring 2018-08-01)

Fixing this may cause many tests to break. This is a major 
non-backward-compatible change, and so should be fixed carefully. Schemas 
outside of daffodil for delimited formats may be impacted also. 






--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to