[
https://issues.apache.org/jira/browse/DAFFODIL-1651?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17694030#comment-17694030
]
Steve Lawrence commented on DAFFODIL-1651:
------------------------------------------
I think that might be correct? I'm not sure which version of mil-std-2045 your
regression suite uses, but looking at older versions of mil-std-2045, we have
this:
{code:xml}
<xs:element name="group_size" dfdl:outputValueCalc=" { ... *
dfdl:valueLength(../future_use_group_data/partialWord, 'bits')) }" ... />
{code}
In this case, partialWord is an optional element, which we treat like arrays
behind the scenes (see related issue DAFFODIL-2013).
So older version of this schema maybe have been silently broken, since value
length of arrays was broken. Note that the latest version of the mil-std-2045
schema does have this same expression anymore (maybe because it was silently
broken?), so this might not be an issue with an updated schema.
> Unparse: dfdl:content/valueLength of an Array returns unexpected result
> -----------------------------------------------------------------------
>
> Key: DAFFODIL-1651
> URL: https://issues.apache.org/jira/browse/DAFFODIL-1651
> Project: Daffodil
> Issue Type: Bug
> Components: General, Unparsing
> Affects Versions: 2.0.0
> Reporter: Steve Lawrence
> Assignee: Mike McGann
> Priority: Major
> Fix For: 3.5.0
>
>
> When trying to get the dfdl:contentLength of dfdl:valueLength of an array,
> Daffodil returns the length of it's parent, rather than the array. This is
> because the NodeType.Exists parameter type ends up creating a DownArrayExists
> recipe, which does not change the current node. Either we need to disallow
> getting the content/valueLength of an array and require the user to wrap the
> array in a complex type, or we need to allow it and modify/add parsers to
> store value/contentLength of an array.
> Alternatively, we maybe be able to do some magic where we get the start pos
> of the first child and the end pos of the last child and return that length.
> It's not immeidately clear if that is correct.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)