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

Bad diagnostic when using dynamic separator the value of which is NUL (ascii 0)



    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.3.0
    • 2.4.0
    • None
    • None


      This test actually shows up two bugs.

      One bug, which appears in both 2.2.0 and 2.3.0 is that if you have

      dfdl:separator="{ ./sep }"

      and the value of the sep element is a string containing a single NUL character, then on 2.2.0 it complains the separator cannot be an empty string. Clearly this string is not empty.

      On 2.3.0, the diagnostic message also complains about what is in the string somewhat differently however. The message is:

      [error] Schema Definition Error: The property 'null' cannot start or end with the string " ", did you mean to use '%SP;' instead?
      Schema context: sequence[2] Location line 80 column 10 in file:/home/mbeckerle-unencrypted/DFDLSchemas/CSV/src/test/resources/com/tresys/my.dfdl.xsd

      Note that there are two problems here. First is "The property 'null' cannot ...." that's broken because the property name isn't being provided. Instead it somehow has 'null' as the property name.

      Second it somehow thinks there is whitespace/space in the delimiter.

      The DFDL schema and test data file are attached to this bug.  If placed in the same directory, the test can be run from the CLI using:

      daffodil -v parse  -s my.dfdl.xsd  my2.csv

      The data consists of a header row, then a set of data row lines. Each data row begins with a single character, which goes into the Sep element, and that element's value is to be used as the separator for the remaining elements of the row.

      When this value of Sep is an ordinary character such as "," or "|", things work fine.

      When this value of Sep is an Ascii NUL, these errors occur.




        1. my2.csv
          0.1 kB
          Mike Beckerle
        2. my.dfdl.xsd
          4 kB
          Mike Beckerle



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