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 2022/02/14 18:02:00 UTC

[jira] [Commented] (DAFFODIL-2656) prefixed length element has no dfdl:contentLength nor dfdl:valueLength

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

Mike Beckerle commented on DAFFODIL-2656:
-----------------------------------------

I have not isolated this down to a small test case that can be incorporated into Daffodil yet.

The schema I am using isn't public, but for those with access to it the problem is reproducible:
 * daffodil 3.3.0-SNAPSHOT with githash 9043425760dae277eff36087a2e715c70793db9c
 * repository git@hqapp01.columbia.tresys.com:mbeckerle/p8-schema.git
 * branch daf-2656 (git hash ba9d0beeabfbc009b10cd8ef3e0e07f545054e1d)
 * run testAddressPollingList to reproduce the problem. 

 

 

> prefixed length element has no dfdl:contentLength nor dfdl:valueLength
> ----------------------------------------------------------------------
>
>                 Key: DAFFODIL-2656
>                 URL: https://issues.apache.org/jira/browse/DAFFODIL-2656
>             Project: Daffodil
>          Issue Type: Bug
>          Components: Back End
>    Affects Versions: 3.2.1
>            Reporter: Mike Beckerle
>            Priority: Major
>
> When an element has a prefixed lengthKind, then it should be possible to refer, at parse time, to the dfdl:contentLength or dfdl:valueLength of that element. 
> For complex types, both should be the same, and should be the value of the prefix, adjusted for prefixIncludesPrefixLength (I.e., with that length subtracted if prefixIncludesPrefixLength is 'yes')
> This bug report was created as I am unable to get the valueLength or contentLength of a prefixedLength complexType element.
> In this specific case, I am trying to do a dfdl:inputValueCalc of an element where the expression refers to dfdl:contentLength(../..), i.e., the enclosing (2 levels up) element, which is of prefixed lengthKind. The purpose of this is because I want an element containing the message length, even though the message length is determined using lengthKind 'prefixed', because I want to check that the message length is greater than or equal to the minimum message length, and not greater than the maximum message length. 
> These functions can also apply to simpleType elements with lengthKind 'prefixed'. I don't know if they work there or not. 
> For simple types, the dfdl:contentLength is the value of the prefix, adjusted as just stated. When parsing, the dfdl:valueLength of a simpleType element with representation 'text' is possibly smaller due to dfdl:textTrimKind='padChar' and removal of padding characters. That is, dfdl:valueLength excludes padding and filling for simple types when parsing. 
>  



--
This message was sent by Atlassian Jira
(v8.20.1#820001)