[
https://issues.apache.org/jira/browse/DAFFODIL-2660?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Dave Thompson closed DAFFODIL-2660.
-----------------------------------
Verified the specified commit (commit 357f22499a8b7be2f282e905803dc3aaee081094)
is included in the latest pull from the daffodil repository.
Verified, via review, changes identified in the commit comment were
implemented.
Verified the affected daffodil subproject sbt test suites executed
successfully, including the added tests.
> prefixLengthType needs to evaluate asserts before using the prefix value
> ------------------------------------------------------------------------
>
> Key: DAFFODIL-2660
> URL: https://issues.apache.org/jira/browse/DAFFODIL-2660
> Project: Daffodil
> Issue Type: Bug
> Components: Back End, Diagnostics
> Affects Versions: 3.2.1
> Reporter: Mike Beckerle
> Assignee: Olabusayo Kilo
> Priority: Major
> Fix For: 4.0.0
>
>
> We want to use lengthKind 'prefixed' and avoid the complexity of
> dfdl:outputValueCalc and dfdl:lengthKind 'explicit' with a length expression.
> But... using prefixed is much less robust, because the prefix value is
> currently used to pull data (when parsing) and assertions expressed on the
> prefixLengthType seem to never be evaluated.
> E.g., below we have a prefixed-length field named 'payload'.
> The range is only 0 to 32768, but this assert never executes.
> {code:java}
> ...
> <complexType>
> <sequence>
> <element name="payload" type="xs:hexBinary"
> dfdl:lengthKind="prefixed"
> dfdl:prefixIncludesPrefixLength="no"
> dfdl:prefixLengthType="p8:bufferPayload"/>
> </sequence>
> </complexType>
> ...
> <simpleType name="bufferPayload">
> <annotation>
> <appinfo source="http://www.ogf.org/dfdl/">
> <dfdl:assert>{ dfdl:checkConstraints(.) }</dfdl:assert>
> </appinfo>
> </annotation>
> <restriction base="p8:unsignedLong">
> <minInclusive value="0"/>
> <maxInclusive value="32768"/>
> </restriction>
> </simpleType> {code}
> The assert needs to execute before the prefix value is used as a length.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)