Uploaded image for project: 'Daffodil'
  1. Daffodil
  2. DFDL-434

assert and discriminator syntax is too fussy

XMLWordPrintableJSON

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • s10
    • s5
    • Front End
    • None

      If you use the body form of an assert or discriminator the { } surrounding the expression must be the VERY FIRST characters, and VERY LAST characters.

      Otherwise you get an unscrutible error about it being impossible to convert a string to a boolean.

      This is too fussy and fragile.

      First, if you do blow it on the syntax of the expression one should get a useful Schema Definition Error.

      Second, we should be a little more tolerant i.e., any whitespace before the

      { and any after the }

      should be trimmed away. Otherwise you have no choice but to put in CDATA to prevent line wrapping from perhaps inserting whitespace that breaks things.

      I.e., This doesn't work due to whitespace before the

      { and after the }

      :

      <dfdl:discriminator>

      { if (../ex:presenceBit = 0) then false() else if (dfdl:occursIndex() = 1) then true() else if (..[dfdl:occursIndex()-1]/ex:repeatBit = 0) then false() else true() }

      </dfdl:discriminator>

      You must use <![CDATA[ ... ]]> to prevent line wrapping from breaking this.

              efinnegan Elizabeth Finnegan
              mbeckerle.dfdl Mike Beckerle
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: