Uploaded image for project: 'Daffodil'
  1. Daffodil
  2. DFDL-1311

StringDelimitedUnparser expects node to be simple

XMLWordPrintableJSON

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Blocking Blocking
    • 2.0.0
    • None
    • Unparsing
    • None

      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

              dthompson David Thompson
              slawrence Steve Lawrence
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: