Description
This schema has a direct dispatch where a choice branch is an array:
<xs:include schemaLocation="org/apache/daffodil/xsd/DFDLGeneralFormat.dfdl.xsd" /> <xs:annotation> <xs:appinfo source="http://www.ogf.org/dfdl/"> <dfdl:format ref="ex:GeneralFormat" lengthKind="implicit" representation="binary" /> </xs:appinfo> </xs:annotation> <xs:element name="root"> <xs:complexType> <xs:sequence> <xs:element name="index" type="xs:int" /> <xs:choice dfdl:choiceDispatchKey="{ xs:string(./index) } "> <xs:element name="values1" type="xs:int" minOccurs="1" maxOccurs="2" dfdl:choiceBranchKey="1" /> <xs:element name="values2" type="xs:int" dfdl:choiceBranchKey="2" /> </xs:choice> </xs:sequence> </xs:complexType> </xs:element>
org.apache.daffodil.exceptions.Abort: Not to be called on choice branches.
org.apache.daffodil.exceptions.Assert$.abort(Assert.scala:129)
org.apache.daffodil.exceptions.Assert$.usageError(Assert.scala:117)
org.apache.daffodil.dsom.ChoiceBranchImpliedSequence.emptyFormatFactory(SequenceGroup.scala:413)
org.apache.daffodil.dsom.AnnotatedMixin.$anonfun$formatAnnotation$1(AnnotatedSchemaComponent.scala:352)
at org.apache.daffodil.exceptions.Assert$.abort(Assert.scala:129)
at org.apache.daffodil.exceptions.Assert$.usageError(Assert.scala:117)
at org.apache.daffodil.dsom.ChoiceBranchImpliedSequence.emptyFormatFactory(SequenceGroup.scala:413)
at org.apache.daffodil.dsom.AnnotatedMixin.$anonfun$formatAnnotation$1(AnnotatedSchemaComponent.scala:352
...
If i remove the choice dispatch or change maxOccurs="1" the exception goes away.