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

Incorrect Validation Error on Optional Element with Children

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.5.0
    • 3.5.0
    • Back End
    • None

    Description

      When you have an optional element with children element, daffodil calculates the number of occurrences it has by looking at the number of children it has, rather than calculating the number of times it appears. This results in an validation error saying the element occurred NUM_OF_CHILDREN_TIME when it was expected.

      Attached is a TDML test that shows this incorrect validation error

      I narrowed down the error to src/main/scala/org/apache/daffodil/runtime1/processors/parsers/SequenceChildBases.scala line 543 in endArray

              val occurrence = {
                val maybeLastChild = state.infoset.maybeLastChild
                if (maybeLastChild.isEmpty || maybeLastChild.get.erd != erd)
                  0
                else
                  maybeLastChild.get.numChildren
              }
      

      Attachments

        1. optionalElement.tdml
          3 kB
          Olabusayo Kilo
        2. optionElementTest.scala
          0.3 kB
          Olabusayo Kilo

        Activity

          People

            slawrence Steve Lawrence
            okilo@tresys.com Olabusayo Kilo
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: