[
https://issues.apache.org/jira/browse/DAFFODIL-2962?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17905254#comment-17905254
]
Steve Lawrence commented on DAFFODIL-2962:
------------------------------------------
I've looked this have have a fix in the works.
Unfortunately, nillable complex elements are kindof broken and always have the
possibility for this error to occur. Unfortunately, it may feel a little bit
random since it only happens when Daffodil converts the internal infoset to XML
under pretty specific circumstances. But those circumstances are not that
uncommon, essentially you need a nillble complex element that isn't nilled and
enough children to trigger the issue. The more children a complex nillable
complex element has the more likely it is, but it can happen even with only one
child. And if you set the "infosetWalkSkipMin" tunable to 0, it's almost
guaranteed to happen.
The best workaround is probably to just avoid nillable complex elements
entirely and find another way to model the data. At the core they are simply
broken.
But I did find two different workarounds that do not trigger the issue:
1. Use the ScalaXmlInfosetOuputter, the way it is implemented just happens to
avoid the issue.
2. Set the "infosetWalkerSkipMin" and "infosetWalkerSkipMax" tunables to some
very large number. This essentially prevents Daffodil from converting the
infoset to XML until it's completely finished parsing, which avoids the
particular issue. But this can lead to extra memory usage since Daffodil will
hold the entire infoset in memory until it's complete. Normally it essentially
streams out the infoset as parts of it are done.
> Expression Evaluation Error: Element does not have a value.
> -----------------------------------------------------------
>
> Key: DAFFODIL-2962
> URL: https://issues.apache.org/jira/browse/DAFFODIL-2962
> Project: Daffodil
> Issue Type: Bug
> Components: Back End
> Affects Versions: 3.9.0
> Reporter: Robert Bathmann
> Assignee: Steve Lawrence
> Priority: Major
> Attachments: noValueTest.tdml
>
>
> Consider the DFDL schema in the attached TDML file. It describes an array of
> line-delimited elements containing a nillable complex element within a direct
> dispatch choice. A simple pattern discriminator is placed on the line element.
> This schema works properly for six occurrences of the line element. However,
> adding a seventh line results in the error:
> {code:java}
> Schema Definition Error: Failed to start infoset complex element: Expression
> Evaluation Error: Element does not have a value.{code}
> Removing the discriminator, the dispatch key and branch key, or changing the
> innermost complex element to nillable="false" allows the larger document to
> be parsed.
> If additional structures are added within the nillable complex element, this
> error can be reproduced with a smaller number of line elements. This is not
> illustrated within the TDML for simplicity.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)