You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@daffodil.apache.org by GitBox <gi...@apache.org> on 2018/10/26 20:33:53 UTC

[GitHub] stevedlawrence commented on a change in pull request #128: Ignore minLength when lengthKind=explicit

stevedlawrence commented on a change in pull request #128: Ignore minLength when lengthKind=explicit
URL: https://github.com/apache/incubator-daffodil/pull/128#discussion_r228658050
 
 

 ##########
 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:
   Should this check also be done at runtime if dfdl:lengthKind="explicit" but dfdl:length is an expression? Or is that a validation error that might already handle?

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services