[
https://issues.apache.org/jira/browse/DAFFODIL-2429?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17230825#comment-17230825
]
Mike Beckerle commented on DAFFODIL-2429:
-----------------------------------------
This idea was discussed by the DFDL Workgroup on 2020-11-12.
Per current DFDL policy an experimental feature should be created in an
implementation and experience with it written up to propose the new feature.
So this should be a "dfdlx:" prefixed attribute name.
It may be better to put the property on dfdl:defineVariable rather than on the
specific setVariable or newVariableInstance statements.
Also consider whether the property should be "input", "output", "both" to match
the names dfdl:inputValueCalc, dfdl:outputValueCalc.
> newVariableInstance and setVariable require 'direction' property
> -----------------------------------------------------------------
>
> Key: DAFFODIL-2429
> URL: https://issues.apache.org/jira/browse/DAFFODIL-2429
> Project: Daffodil
> Issue Type: Bug
> Components: Back End, Front End
> Affects Versions: 3.0.0
> Reporter: Mike Beckerle
> Priority: Major
>
> I have updated the PCAP schema on github to illustrate this issue.
>
> This is a pull request (code review) of the changes
> [https://github.com/DFDLSchemas/PCAP/pull/10]
>
> In the PCAP schema the IPSrcGrp group ref appears immediately before the
> IPSrc element. Similarly the IPDestGrp reference appears immediately before
> the IPDest element.
>
> These groups contain elements which are the individual binary bytes of the IP
> Source and IP Dest addresses. They are 4 unsigned bytes.
> When parsing these are parsed and then their values concatenated as strings
> into a string like "1.2.3.4".
>
> When unparsing, these groups use dfdl:outputValueCalc to take apart a string
> like "1.2.3.4" (which appears in the infoset after parsing), back into its
> individual digits 1, 2, 3, 4, and creates an unsignedByte value of each
> number.
>
> The problem is, these groups are absolute nonsense if you view the
> dfdl:newVariableInstance defaultValue expression as being evaluated at parse
> time. The expression is for use *only* at unparse time and immediately does a
> forward reference to the following IPSrc member containing the "1.2.3.4" type
> string.
>
> Without some sort of additional property on dfdl:newVariableInstance and
> dfdl:setVariable to indicate that this only should be evaluated at unparse
> time, there is no way to suppress evaluation and perform it only at unparse
> time.
>
> I suggest we need an additional property on newVariableInstance and
> setVariable which I suggest is called 'direction', with values 'parse',
> 'unparse', 'both'. This property defaults to 'both', but if set to 'unparse'
> only evaluates the expression (and binds/sets variable) during that direction
> of processing.
>
> ...mikeb{color:#888888}
> {color}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)