[ 
https://issues.apache.org/jira/browse/DAFFODIL-785?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Michael Beckerle closed DAFFODIL-785.
-------------------------------------

> Assert execution timing for sequence is incorrect.
> --------------------------------------------------
>
>                 Key: DAFFODIL-785
>                 URL: https://issues.apache.org/jira/browse/DAFFODIL-785
>             Project: Daffodil
>          Issue Type: Bug
>          Components: Back End, General
>    Affects Versions: s10
>            Reporter: Michael Beckerle
>            Priority: Major
>             Fix For: 2.2.0
>
>
> If you have a sequence (presumably same bug will occur for choice), and it 
> begins with an annotation containing a dfdl:assert with testKind expression, 
> then that is supposed to execute *after* the sequence children have been 
> evaluated. This is consistent with elements and element refs, where an 
> assert/discriminator with testKind=expression executes AFTER the element 
> itself has been parsed. 
> This is confusing for sequences and choices because the assert will appear 
> lexically before the rest of the sequence/choice children, but it executes 
> after. (Perhaps we should issue a warning because the workaround - described 
> below - is actually a better & clearer way to write a schema.)
> (When testKind=pattern, they execute before)
> Same goes for discriminators. 
> (Errata 3.25: Section 9. Evaluation Order for Statement Annotations)
> Currently seems to execute before.
> This is low priority because the workaround is easy. Just put the assert 
> inside it's own sequence, and then insert *that* sequence below all the other 
> things in the enclosing sequence.
> You have to do this:
> <sequence>
>      ... where the assert was...
>     <element .../>
>     <element.../>
>     <sequence>
>          ... new location for assert ...
>     </sequence>
> </sequence>
> So the annotation moves below, but is still first in the sequence that 
> directly contains it, but that sequence is otherwise empty.



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

Reply via email to