[
https://issues.apache.org/jira/browse/DAFFODIL-2167?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16873416#comment-16873416
]
Steve Lawrence commented on DAFFODIL-2167:
------------------------------------------
Here is a minimal schema that reproduces the issue seen with NITF:
{code:xml}
<xs:element name="Root" dfdl:terminator="%NL;">
<xs:complexType>
<xs:sequence>
<xs:element name="Arr" type="xs:string" minOccurs="0" maxOccurs="2"
dfdl:length="1" dfdl:lengthKind="explicit" />
<xs:element name="OVC" type="xs:string" dfdl:outputValueCalc="{
../Arr[1] }"
dfdl:length="1" dfdl:lengthKind="explicit" />
<xs:element name="End" type="xs:string"
dfdl:length="1" dfdl:lengthKind="explicit" />
</xs:sequence>
</xs:complexType>
</xs:element>
{code}
You get the above exception when you unparse the following:
{code:xml}
<ex:Root xmlns:ex="http://example.com">
<Arr>1</Arr>
<Arr>2</Arr>
<OVC>8</OVC>
<End>9</End>
</ex:Root>
{code}
The core issue appears to be related to an OVC element immediately following an
array. There's some kindof interaction and the infoset inputter state gets
messed up.
> NITF schema fails to unparse with exception
> -------------------------------------------
>
> Key: DAFFODIL-2167
> URL: https://issues.apache.org/jira/browse/DAFFODIL-2167
> Project: Daffodil
> Issue Type: Bug
> Components: Back End
> Reporter: Steve Lawrence
> Assignee: Steve Lawrence
> Priority: Blocker
> Fix For: 2.4.0
>
>
> Fails with the following exception:
> {code:java}
> java.lang.ClassCastException: org.apache.daffodil.infoset.DISimple cannot be
> cast to org.apache.daffodil.infoset.DIArray, took 7.024 sec
> [error] at
> org.apache.daffodil.infoset.InfosetInputter.handleStartElement(InfosetInputter.scala:311)
> [error] at
> org.apache.daffodil.infoset.InfosetInputter.reallyFill(InfosetInputter.scala:262)
> [error] at
> org.apache.daffodil.infoset.InfosetInputter.fill(InfosetInputter.scala:247)
> [error] at
> org.apache.daffodil.util.CursorImplMixin.doAdvance(Cursor.scala:226)
> [error] at org.apache.daffodil.util.CursorImplMixin.advance(Cursor.scala:176)
> [error] at org.apache.daffodil.util.CursorImplMixin.advance$(Cursor.scala:173)
> [error] at
> org.apache.daffodil.infoset.InfosetInputter.advance(InfosetInputter.scala:54)
> [error] at
> org.apache.daffodil.processors.unparsers.UStateMain.advance(UState.scala:483)
> [error] at org.apache.daffodil.util.Cursor.advanceMaybe(Cursor.scala:118)
> [error] at org.apache.daffodil.util.Cursor.advanceMaybe$(Cursor.scala:117)
> [error] at
> org.apache.daffodil.processors.unparsers.UState.advanceMaybe(UState.scala:72)
> [error] at
> org.apache.daffodil.processors.unparsers.UStateMain.advanceOrError(UState.scala:501)
> [error] at
> org.apache.daffodil.processors.unparsers.OVCStartEndStrategy.unparseBegin(ElementUnparser.scala:476)
> {code}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)