jadams-tresys commented on a change in pull request #128: Ignore minLength when
lengthKind=explicit
URL: https://github.com/apache/incubator-daffodil/pull/128#discussion_r228937529
##########
File path:
daffodil-core/src/main/scala/org/apache/daffodil/dsom/RuntimePropertyMixins.scala
##########
@@ -367,9 +367,14 @@ trait ElementRuntimeValuedPropertiesMixin
case (Implicit, Binary, HexBinary) => (LengthUnits.Bytes,
maxLengthLong) // fixed length
case (Implicit, Text, String) => (lengthUnits, maxLengthLong) // fixed
length
case (Implicit, Text, AnySimpleType) => (lengthUnits,
textOutputMinLength) // fixed length
- case (Explicit, Text, String) => (lengthUnits, minLengthLong)
- case (Explicit, Binary, HexBinary) => (LengthUnits.Bytes,
minLengthLong)
- case (Explicit, Text, AnySimpleType) => (lengthUnits,
textOutputMinLength)
+ case (Explicit, Text, String) => (lengthUnits, 0L)
+ case (Explicit, Binary, HexBinary) => (LengthUnits.Bytes, 0L)
+ case (Explicit, Text, AnySimpleType) => {
+ if (optLengthConstant.isDefined && (optLengthConstant.get <
minLengthLong))
+ SDE("Explicit dfdl:length of %d is out of range for facet
textOutputMinLength='%d'",
+ optLengthConstant.get, textOutputMinLength)
+ (lengthUnits, 0L)
+ }
Review comment:
Actually, I just double checked and it seems that there already is runtime
validation and this check is unnecessary and can be set to (lengthUnits, 0L)
like the other cases for lengthKind Explicit
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services