Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.1.0
-
None
Description
Per DFDL Erratum 5.18, if the dfdl:lengthKind is explicit, the facet minLength is NOT used to determine the target length. The target length is the value of the length expression (or constant) directly. The minLength facet is only used for validation (if enabled).
Code in Daffodil e.g., UnparseTargetLengthInCharactersEv, MinLengthInBitsEv, and UnparseTargetLengthInBitsEv, all take minLength into account even for lengthKind explicit, and do not consider whether the expression is a constant or not. (That check occurs elsewhere, so need not be taken into account, but minLength needs to be disregarded as far as the target length is concerned, but still kept around for validation purposes.)
Similarly, for types other than string/hexBinary that are text, textOutputMinLength should be ignored if dfdl:lengthKind is explicit, though it is an error if the length is a constant and is out of range for textOutputMinLength. (Similarly for minLength/maxLength, except that is an SDW)