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 17:50:00 UTC

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

Mike Beckerle created DAFFODIL-2656:
---------------------------------------

             Summary: 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


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)