You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@daffodil.apache.org by "Mike Beckerle (Jira)" <ji...@apache.org> on 2020/07/22 16:16:00 UTC

[jira] [Commented] (DAFFODIL-2371) Multiple discriminator behavior is not correct

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

Mike Beckerle commented on DAFFODIL-2371:
-----------------------------------------

I don't have a specific test for this as yet, but I am observing something strange.

If I have a discriminator and then an assert like this:
{code:java}
<sequence>
 <sequence><annotation><appinfo ...>
   <dfdl:discriminator>{ fn:true() }</dfdl:discriminator>
 </appinfo></annotation></sequence>
 <sequence><annotation><appinfo ...>
   <dfdl:assert>{ $myVar }</dfdl:assert><!-- myVar has value true -->
 </appinfo></annotation></sequence>
{code}
Then under trace I see the first "assert" (the discriminator) evaluate and the trace says discriminator false -> true.

But when it evaluates the second assert, it says discriminator true -> false, like it is resetting it. But the assert statement should have no effect on the discriminator.

A subsequent parse failure then behaves as if the discriminator is not set.

 

 

> Multiple discriminator behavior is not correct
> ----------------------------------------------
>
>                 Key: DAFFODIL-2371
>                 URL: https://issues.apache.org/jira/browse/DAFFODIL-2371
>             Project: Daffodil
>          Issue Type: Bug
>          Components: Back End
>            Reporter: Steve Lawrence
>            Assignee: Steve Lawrence
>            Priority: Major
>             Fix For: 3.0.0
>
>
> When a discriminator evaluates to true, Daffodil always resolves the nearest in-scope point of uncertainty, even if it has already been resolved by another discriminator. This means if there are multiple discriminators, we may resolve the same PoU repeatedly, essentially making true discriminators no-ops. 
> Based on recent clarifications by the DFDL-WG, a descriminator that evalutes to true should instead resolve the nearest *unresolved* point of uncertainty. This means multiple discriminators evaluating to true will result in multiple PoU's being resolved.



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