Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.2.0
-
None
Description
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.