Uploaded image for project: 'Daffodil'
  1. Daffodil
  2. DAFFODIL-1975

Incorrect separator behavior - missing separator for empty sequence (non-backward compatible)

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.1.0
    • 2.4.0
    • Back End, Compatibility
    • None

    Description

      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.

      Attachments

        Activity

          People

            dfthompson Dave Thompson
            mbeckerle Mike Beckerle
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: