Uploaded image for project: 'Daffodil'
  1. Daffodil
  2. DAFFODIL-2162

direct dispatch choice that has an array branch causes abort during compilation

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Blocker
    • Resolution: Fixed
    • None
    • 2.4.0
    • Front End
    • None

    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.

      Attachments

        Activity

          People

            mbeckerle Mike Beckerle
            slawrence Steve Lawrence
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: