Description
If we have a scheme like so, with default lengthKind="delimited"
<xs:element name="root1"> |
<xs:complexType> |
<xs:sequence dfdl:separator=";"> |
<xs:element name="one" type="xs:string" /> |
<xs:element name="two" type="xs:string" /> |
<xs:choice> |
<xs:element name="c1" type="xs:string" /> |
<xs:element name="c2" type="xs:string" /> |
</xs:choice> |
</xs:sequence> |
</xs:complexType> |
</xs:element> |
And the infoset:
<root1> |
<one> |
<foo>1</foo> |
</one> |
</root1> |
Then we end up getting into StringLengthDelimited trying to cast a DIComplex (one) to a DISimple. Of course one should be a simple type, but it's not in the schema and we aren't doing a check somewhere the ensure it is a simple type. I don't think this is a problem with StringDelimitedUnparser, but somewhere else (maybe in the InfosetSource or NextElementResolver?)
See test_unexpectedChildNone in daffodil-test/src/test/scala-debug/edu/illinois/ncsa/daffodil/unparser/TestInfosetDebug.scala