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 17:49:00 UTC

[jira] [Commented] (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=16788111#comment-16788111 ] 

Michael Beckerle commented on DAFFODIL-2092:
--------------------------------------------

On 2.2.0, the error you get is:
{code:java}
[error] Schema Definition Error: Property separator cannot be empty string.{code}
which is not correct because the string isn't empty, it should contain a single NUL character/byte.

> 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)