[ 
https://issues.apache.org/jira/browse/DAFFODIL-2808?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17713050#comment-17713050
 ] 

Olabusayo Kilo commented on DAFFODIL-2808:
------------------------------------------

That's correct. When we use limited validation or full validation, we get the 
validation error.

We use checkConstraints extensively in OTH-Gold...and avoiding that isn't a 
viable option since we use it where we have no separators and we need to guide 
parsing based on the facets.

The good news is this bug doesn't appear in 3.4.0 so going down to that version 
was the workaround I went with

> Incorrect Validation Error on Optional Element with Children
> ------------------------------------------------------------
>
>                 Key: DAFFODIL-2808
>                 URL: https://issues.apache.org/jira/browse/DAFFODIL-2808
>             Project: Daffodil
>          Issue Type: Bug
>          Components: Back End
>    Affects Versions: 3.5.0
>            Reporter: Olabusayo Kilo
>            Priority: Major
>         Attachments: optionElementTest.scala, optionalElement.tdml
>
>
> 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
> {code:scala}
>         val occurrence = {
>           val maybeLastChild = state.infoset.maybeLastChild
>           if (maybeLastChild.isEmpty || maybeLastChild.get.erd != erd)
>             0
>           else
>             maybeLastChild.get.numChildren
>         }
> {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to