Uploaded image for project: 'Daffodil'
  1. Daffodil
  2. DAFFODIL-785

Assert execution timing for sequence is incorrect.


    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Duplicate
    • Affects Version/s: s10
    • Fix Version/s: 2.2.0
    • Component/s: Back End, General
    • Labels:


      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:

      ... where the assert was...
      <element .../>
      ... new location for assert ...

      So the annotation moves below, but is still first in the sequence that directly contains it, but that sequence is otherwise empty.


          Issue Links



              • Assignee:
                mbeckerle Michael Beckerle
              • Votes:
                0 Vote for this issue
                1 Start watching this issue


                • Created: