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

Steve Lawrence commented on DAFFODIL-2296:
------------------------------------------

I think this might actually be fixed by the changes Lola is working on.

In NACHA, there is a choice that looks something like this:

{code:xml}
<xs:choice>
  <xs:element ref="Elem1" minOccurs="0" dfdl:ocurrsCountKind="{  ... }" ... />
  <xs:element ref="Elem2" minOccurs="0" dfdl:ocurrsCountKind="{  ... }" ... />
  <xs:element ref="Elem3" minOccurs="0" dfdl:ocurrsCountKind="{  ... }" ... />
</xs:choice>
{code}

So all branches of a choice are optional.

To determine which branch of this chocie to unparse, we generate a hash map 
that maps infoset events to branches. So for example, if we see a Start(Elem2) 
event, we know to unparse the Elem2 branch.

Before commit 356291c3f5cbd82832bc68f7f573b292a46feb3d for DAFFODIL-2280, this 
map could contain an infoset End event in the case where certain branches are 
optional. This way, if we saw an End event, we would unparse that optional 
branch (or whatever was the first branch that could be entirely missing from 
the infoset, due to defaultables or OVC or optionality).

But this commit changed that logic so it would just always use a defaultable 
branch if it didn't recognize the infoset event it saw. This is reasonable and 
makes it so we no longer need to calculate this EndEvent things. Unfortunately, 
it appears to have broken the logic for finding defaultable branches, and will 
sometimes return a NadaParser.

But I believe Lola's work for fixing isHidden changes how default branches are 
found, which I think should fix this.

> NACHA failing some tests with "Abort: NadaUnparsers are all supposed to 
> optimize out"
> -------------------------------------------------------------------------------------
>
>                 Key: DAFFODIL-2296
>                 URL: https://issues.apache.org/jira/browse/DAFFODIL-2296
>             Project: Daffodil
>          Issue Type: Bug
>          Components: Middle &quot;End&quot;
>    Affects Versions: 2.5.0
>            Reporter: Mike Beckerle
>            Assignee: Mike Beckerle
>            Priority: Major
>             Fix For: 2.6.0
>
>
> On the 2.6.0 development branch, git hash: 
> 356291c3f5cbd82832bc68f7f573b292a46feb3d
> These two NACHA tests fail. NACHA is a DFDL schema published on github that 
> is portable to Daffodil and IBM DFDL.
> TestNACHA.test_ppd_valid_1
> TestNACHA.test_ccd_valid_1



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

Reply via email to