You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@daffodil.apache.org by "Dave Thompson (Jira)" <ji...@apache.org> on 2021/01/29 15:04:00 UTC

[jira] [Commented] (DAFFODIL-1007) Leftover Data Check not Working as Expected with No Trailing Newline

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

Dave Thompson commented on DAFFODIL-1007:
-----------------------------------------

Modified the commands in initial write-up with current paths and executed with the following results.

It appears that this issue has been resolved. With the -n option "string|123" no longer causes an error and "string|1234" and "string|12345" error with the extra data getting identified.

RESULTS:

incubator-daffodil]$ echo -n "string|123" | daffodil-cli/target/universal/stage/bin/daffodil parse -s ./daffodil-cli/src/it/resources/org/apache/daffodil/CLI/cli_schema.dfdl.xsd -r leftover
<?xml version="1.0" encoding="UTF-8"?>
<ex:leftover xmlns:ex="http://example.com">
  <e3>string</e3>
  <e4>123</e4>
</ex:leftover>

 

$ echo -n "string|1234" | daffodil-cli/target/universal/stage/bin/daffodil parse -s ./daffodil-cli/src/it/resources/org/apache/daffodil/CLI/cli_schema.dfdl.xsd -r leftover
<?xml version="1.0" encoding="UTF-8"?>
<ex:leftover xmlns:ex="http://example.com">
  <e3>string</e3>
  <e4>123</e4>
</ex:leftover>
[warning] Left over data. Consumed 80 bit(s) with at least 8 bit(s) remaining.
Left over data (Hex) starting at byte 11 is: (0x34...)
Left over data (UTF-8) starting at byte 11 is: (4...)

 

$ echo -n "string|12345" | daffodil-cli/target/universal/stage/bin/daffodil parse -s ./daffodil-cli/src/it/resources/org/apache/daffodil/CLI/cli_schema.dfdl.xsd -r leftover
<?xml version="1.0" encoding="UTF-8"?>
<ex:leftover xmlns:ex="http://example.com">
  <e3>string</e3>
  <e4>123</e4>
</ex:leftover>
[warning] Left over data. Consumed 80 bit(s) with at least 16 bit(s) remaining.
Left over data (Hex) starting at byte 11 is: (0x3435...)
Left over data (UTF-8) starting at byte 11 is: (45...)

 

> Leftover Data Check not Working as Expected with No Trailing Newline
> --------------------------------------------------------------------
>
>                 Key: DAFFODIL-1007
>                 URL: https://issues.apache.org/jira/browse/DAFFODIL-1007
>             Project: Daffodil
>          Issue Type: Bug
>          Components: CLI, Usability
>            Reporter: Jessie Chab
>            Priority: Major
>              Labels: reverify
>
> 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.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)