Steve Lawrence created DAFFODIL-1964:

             Summary: Unparsing ArrayCombinator assertion failure
                 Key: DAFFODIL-1964
             Project: Daffodil
          Issue Type: Bug
          Components: Back End, Unparsing
    Affects Versions: 2.1.0
            Reporter: Steve Lawrence
             Fix For: 2.2.0

A user reported an error when unparsing in the array combinator.

The schema looks something like this:
  <xs:element name="foo" ... />
  <xs:element name="bar" minOccurs="1" maxOccurs="6" 
          <xs:appinfo source="";>
            <dfdl:discriminator>{ expression }</dfdl:discriminator>
        <xs:sequence dfdl:hiddenGroupRef="hiddenGrouPRef" />
        <xs:group ref="someGroupWithRequiredElement"/>

With XML that looks like this:

So the bar element is an array that requires at least one instance, but the 
infoset has zero instances. Trying to unparse this resultsin the following:

org.apache.daffodil.exceptions.Abort: Invariant broken: 

The expected result is to return an UnaparseError about expecting a start array 
event but not getting one. I think the assertion just needs to be changed to an 
UnparseError, since there is clearly a case where the assertion doesn't hold.

This message was sent by Atlassian JIRA

Reply via email to