You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@daffodil.apache.org by "Michael Beckerle (JIRA)" <ji...@apache.org> on 2019/03/08 19:35:00 UTC

[jira] [Comment Edited] (DAFFODIL-2092) Bad diagnostic when using dynamic separator the value of which is NUL (ascii 0)

    [ https://issues.apache.org/jira/browse/DAFFODIL-2092?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16788234#comment-16788234 ] 

Michael Beckerle edited comment on DAFFODIL-2092 at 3/8/19 7:34 PM:
--------------------------------------------------------------------

This problem happens because the data file my2.csv has an extra LF at the end.

This LF is parsed as the SEP for another record. Then it tries to convert this to a separator, but separator is a whitespace separated list, so you get a SchemaDefinitionError because a whitespace separated list cannot begin with a whitespace character.

So this is not a bug.

The diagnostic message is still erroneous. This should state that for the separator property, it is a whitespace-separated list of delimiters, but contains only whitespace characters, and should display those characters using the utility routine that replaces whitespace characters with the little glyphy versions of them. (Or alternatively, provide a hex dump of them., or both.)


was (Author: mbeckerle):
This problem happens because the data file my2.csv has an extra LF at the end.

This LF is parsed as the SEP for another record. Then it tries to convert this to a separator, but separator is a whitespace separated list, so you get a SchemaDefinitionError because a whitespace separated list cannot begin with a whitespace character.

So this is not a bug.

The diagnostic message is still erroneous. This should state that for the separator property, it is a whitespace-separated list of delimiters, but contains only whitespace characters, and should display those characters using the utility routine that replaces whitespace characters with the little glyphy versions of them. (Or alternatively, provide a hex dump of them., or both.)

 

 

 

 

> Bad diagnostic when using dynamic separator the value of which is NUL (ascii 0)
> -------------------------------------------------------------------------------
>
>                 Key: DAFFODIL-2092
>                 URL: https://issues.apache.org/jira/browse/DAFFODIL-2092
>             Project: Daffodil
>          Issue Type: Bug
>    Affects Versions: 2.3.0
>            Reporter: Michael Beckerle
>            Priority: Major
>         Attachments: my.dfdl.xsd, my2.csv
>
>
> 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
> {code:java}
> dfdl:separator="{ ./sep }"{code}
> 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:
> {code:java}
> [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{code}
> 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:
> {code:java}
> daffodil -v parse  -s my.dfdl.xsd  my2.csv{code}
> 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.
>  
>  



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