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

Mike Beckerle commented on DAFFODIL-2375:
-----------------------------------------

Confirmed that this is actually behaving according to DFDL spec.

Unparsing does not evaluate choiceDispatchKey expressions (because those 
usually depend on fields that have outputValueCalc depending on what's in the 
choice).

What we do need is to improve diagnostics, or at least issue a warning so that 
people won't get stuck on this. When unparsing a choice and there is more than 
one branch with no elements in it, only the first such can EVER be chosen for 
unparse if there is no corresponding element that forces selection of some 
other choice branch. So that means such a choice is almost certainly not going 
to unparse correctly. We need a warning to that effect: "choice branch that can 
never be unparsed."

> Multiple calls to setVariable when unparsing choice branches
> ------------------------------------------------------------
>
>                 Key: DAFFODIL-2375
>                 URL: https://issues.apache.org/jira/browse/DAFFODIL-2375
>             Project: Daffodil
>          Issue Type: Bug
>          Components: Back End
>    Affects Versions: 2.7.0
>            Reporter: Josh Adams
>            Assignee: Josh Adams
>            Priority: Major
>             Fix For: 3.0.0
>
>          Time Spent: 40m
>  Remaining Estimate: 0h
>
> Discovered this issue while working on a schema project.
> While the schema parses fine, for some reason multiple SetVariable parsers 
> are getting instantiated for the same variable, which causes a double-set 
> error to occur.
>  
> See test_choiceBranchVariables in 
> daffodil-test/src/test/scala/org/apache/daffodil/section07/variables/TestVariables.scala
>  for a test that demonstrates this issue.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to