[
https://issues.apache.org/jira/browse/DAFFODIL-2143?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16857038#comment-16857038
]
Michael Beckerle commented on DAFFODIL-2143:
--------------------------------------------
Notes on fixing this issue:
There is a grammar primitive InitiatedContent. The grammar rule that inserts
this can have a guard that insists on there being an associated point of
uncertainty.
E.g., if the immediately enclosing model group is a choice, then there is one.
If the immediately enclosing model group is a sequence, then this must be an
element, and it cannot be scalar. Furthermore, it must have a variable number
of occurrences according to min/maxOccurs, AND to the dfdl:occursCountKind.
(E.g., occursCountKind 'expression' has no points of uncertainty.)
Even given that guard, the runtime for InitiatedContent must be specialized for
arrays. Arrays with occursCountKind 'implicit' can have some number of required
children (where there is no point of uncertainty), followed by some number of
optional children where there is a point of uncertainty.
The DFDL spec is clear that only "optional" children are affected by
initiatedContent="yes", so array element occurrences whose index is less than
minOccurs, when minOccurs is significant (e.g., not dfdl:occursCountKind
'parsed') do not have a point of uncertainty with respect to an
initiatedContent discriminator. So the parser for initiatedContent must
consider the array Index relative to minOccurs in some cases to decide whether
there is a PoU to discriminate, or not.
> dfdl:initiatedContent="yes" on sequence should only affect optional children
> ----------------------------------------------------------------------------
>
> Key: DAFFODIL-2143
> URL: https://issues.apache.org/jira/browse/DAFFODIL-2143
> Project: Daffodil
> Issue Type: Bug
> Components: Back End
> Affects Versions: 2.4.0
> Reporter: Michael Beckerle
> Priority: Major
> Fix For: 2.4.0
>
>
> EDIFACT uses sequences which have dfdl:initiatedContent="yes" but one or more
> of the child elements of the sequence is required, not optional.
> Daffodil appears to execute a discriminator=true behavior even for these
> required elements, which means the point of uncertainty being discriminated
> is some enclosing one, as the element itself in the sequence doesn't have one.
> The DFDL Spec clearly says that the initiatedContent only affects optional
> elements.
> The right thing is for a required child to ignore initiatedContent.
> If all children of a sequence are required and the sequence has
> initiatedContent, that should at least be a warning, because the
> initiatedContent property would then be entirely ignored. This case does come
> up in EDIFACT.
>
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)