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 "End"
    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)

Reply via email to