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 2018/12/13 19:36:00 UTC

[jira] [Commented] (DAFFODIL-1477) ES now allowed in terminator - causes a test to fail now.

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

Michael Beckerle commented on DAFFODIL-1477:
--------------------------------------------

We shouldn't revert this back to old behavior. 

It is important to allow %ES; in terminators if not delimited (not scanning for delimiters), even if it is alone as the only entry.

This is needed for formats where there is an optional terminator (terminator appears if length is less than maximum. No terminator if the data is the max length). Common in mil-std-2045 and many other mil-std data formats.  These schemas were using %WSP*; to mean "nothing", but that's just incorrect of course if the data just so happens to look like a whitespace character, this will absorb it, thereby clobbering the parse. What we need is to be able to write:

dfdl:terminator="{ if (fn:string-length(../field) eq 50) '%ES;' else '%DEL;' }"

This has %ES; ALONE as the only value of terminator. This should only be legal if the dfdl:lengthKind is *not* delimited. 

> ES now allowed in terminator - causes a test to fail now.
> ---------------------------------------------------------
>
>                 Key: DAFFODIL-1477
>                 URL: https://issues.apache.org/jira/browse/DAFFODIL-1477
>             Project: Daffodil
>          Issue Type: Bug
>          Components: Back End, General
>    Affects Versions: 2.0.0
>            Reporter: Michael Beckerle
>            Priority: Major
>             Fix For: 2.3.0
>
>
> In accordance with the DFDL v1.0 spec change to terminator, 
> If we remove the check for %ES; from the code for terminator, then  test
> test_entity_fail_03 fails with:
> Parse Error: Term('CompiledExpression(: %ES;)') - element.a: Found delimiter (,) for element.root::LocalComplexTypeDef::sequence when looking for Term(<DFA lookingFor=':' /> <DFA lookingFor='%ES;' /> <DFA lookingFor=',' />) for element.root::LocalComplexTypeDef::sequence::element.a before element.b
> Schema context: element.a Location line 100 column 12 in file:/tmp/sch39093359406659818781.dfdl.xsd
> Data location was preceding byte 1 limit(bytes) 3
> It isn't handling the case where the separator of the sequence is found, not the terminator, because one of the list of terminators is ES, which effectively makes that terminator optional.
> We may simply want to put back in the restriction that prohibits ES from terminators altogether.
> For now I have moved this test to scala-debug



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