You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@daffodil.apache.org by "Steve Lawrence (Jira)" <ji...@apache.org> on 2020/09/11 16:50:00 UTC

[jira] [Resolved] (DAFFODIL-2277) Warning needed for misplaced discriminators

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

Steve Lawrence resolved DAFFODIL-2277.
--------------------------------------
    Resolution: Fixed

Fixed in commit 8afd9727f53f99cb1e7f21f08769be8727b73989

> Warning needed for misplaced discriminators
> -------------------------------------------
>
>                 Key: DAFFODIL-2277
>                 URL: https://issues.apache.org/jira/browse/DAFFODIL-2277
>             Project: Daffodil
>          Issue Type: Bug
>          Components: Front End
>    Affects Versions: 2.5.0
>            Reporter: Mike Beckerle
>            Assignee: Rick
>            Priority: Major
>              Labels: beginner
>             Fix For: 3.0.0
>
>
> 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]



--
This message was sent by Atlassian Jira
(v8.3.4#803005)