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

Warning needed for misplaced discriminators

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.5.0
    • 3.0.0
    • Front End

    Description

      Daffodil should issue a warning, possibly even an SDE, about misplaced discriminators:

      I observed that many things with discriminators are coded like this:
      ```
      <xs:sequence>
      <xs:annotation><xs:appinfo source="http://www.ogf.org/dfdl/">
      <dfdl:discriminator ....../>
      </xs:appinfo></xs:annotation>
      ....rest of sequence...
      </xs:sequence>
      ```
      So, it's quite unintuitive, but that discriminator will be executed AFTER the rest of the sequence.
      I'm not sure why we decided that is how DFDL should work, but to get the discriminator to run BEFORE the rest of the sequence, which is typically what you want from a discriminator, you must nest it within ANOTHER sequence inside the first like so:
      ```
      <xs:sequence>
      <xs:sequence>
      <xs:annotation><xs:appinfo source="http://www.ogf.org/dfdl/">
      <dfdl:discriminator ....../>
      </xs:appinfo></xs:annotation>
      </xs:sequence>
      ....rest of sequence...
      </xs:sequence>
      ```
      Daffodil should issue warnings about the former style (which can also occur on choices), since it is so unintuitive.

      But for PCAP, all the discrimnators have to change.

      See: https://github.com/DFDLSchemas/PCAP/issues/4

      Attachments

        Activity

          People

            Steinberger Rick
            mbeckerle Mike Beckerle
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: