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

Leftover Data Check not Working as Expected with No Trailing Newline

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 3.1.0
    • CLI, Usability
    • None

    Description

      Leftover Data Check not behaving as expected:

      sequence of two elements, separated by a pipe "|"
      the first is a delimited-length string, and the second is an explicit length integer, length size 3 bytes.

      [dfdl] (0.14.0)$ echo -n "string|1234" | ./daffodil-cli/target/start parse -s ./daffodil-cli/src/test/resources/edu/illinois/ncsa/daffodil/CLI/cli_schema.dfdl.xsd -r leftover
      <ex:leftover xmlns:ex="http://example.com">
      <ex:e3>string</ex:e3>
      <ex:e4>123</ex:e4>
      </ex:leftover>

      The parse seems to ignore the extra digit, and only parses 3 bytes.

      However, if I change the input to "string|123", the parse complains about leftover data:

      [dfdl] (0.14.0)$ echo -n "string|123" | ./daffodil-cli/target/start parse -s ./daffodil-cli/src/test/resources/edu/illinois/ncsa/daffodil/CLI/cli_schema.dfdl.xsd -r leftover
      [error] Left over data. 10 bytes available. Location: byte 10
      UTF-8 text starting at byte 8 is: (23)
      Data (hex) starting at byte 8 is: (0x3233)
      <ex:leftover xmlns:ex="http://example.com">
      <ex:e3>string</ex:e3>
      <ex:e4>123</ex:e4>
      </ex:leftover>

      I'm in the process of writing up some TDML tests as well for this.

      Attachments

        Activity

          People

            Unassigned Unassigned
            daffodil-jchab Jessie Chab
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: