You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@daffodil.apache.org by "Michael Beckerle (JIRA)" <ji...@apache.org> on 2018/12/13 22:53:00 UTC

[jira] [Created] (DAFFODIL-2036) poor diagnostic - choice with sequences as branches with all optional content.

Michael Beckerle created DAFFODIL-2036:
------------------------------------------

             Summary: poor diagnostic - choice with sequences as branches with all optional content.
                 Key: DAFFODIL-2036
                 URL: https://issues.apache.org/jira/browse/DAFFODIL-2036
             Project: Daffodil
          Issue Type: Bug
          Components: Middle &quot;End&quot;
    Affects Versions: 2.2.0
            Reporter: Michael Beckerle


Suppose you have this choice:

<choice>
   <sequence>
       <element name="x" ... minOccurs="0"/>
    </sequence>
    <sequence>
       <element name="y" ... minOccurs="0"/>
    </sequence>
</choice>
<element name="foo" .../>

You get an SDE with this message:

Schema Definition Error: UPA violation. Multiple choice branches begin with {http://example.com}foo
Note that elements with dfdl:outputValueCalc cannot be used to distinguish choice branches.
The offending choice branches are:
sequence[1] at Location in file:/tmp/s1_5963264522094411444.dfdl.xsd
sequence[2] at Location in file:/tmp/s1_5963264522094411444.dfdl.xsd

This occurs because the two branches of the choice meet the letter of the law by bing sequences which are considered "required", but as their content is all optional and they have no framing, they are conceptually optional. 

So there's really no way to look at the infoset and decide which arm of the choice.

The error here should be that the content of a choice branch is entirely optional which isn't allowed. 



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