stevedlawrence commented on code in PR #1085:
URL: https://github.com/apache/daffodil/pull/1085#discussion_r1325991150


##########
daffodil-core/src/main/scala/org/apache/daffodil/core/dsom/ElementBase.scala:
##########
@@ -985,6 +985,7 @@ trait ElementBase
       "Facets minLength and maxLength are allowed only on types string and 
hexBinary.",
     )
     typeDef match {
+      case _ if hasRepType => (repTypeElementDecl.minLength, 
repTypeElementDecl.maxLength)

Review Comment:
   This change is basically the same as before, the case just changes a little 
bit (see the line removed below), so functionally nothing was really changed. 
And it looks like things to work as expected.
   
   If I add a min/maxLength restriction to  the logical type, then limited 
validation does correctly check the length of the calculated enumeration 
string. Note that it seems unlikely that schemas will use both min/maxLength 
and enums on a restriction, but if they to it seems to work. Maybe this 
min/maxLength caclulation is not what is used for facet checking?
   
   Also, if I add min/maxLength to the repType simple type, then it erros. 
min/maxLength facets are only valid on xs:string types, and repType must be a 
string type.
   
   I'll add some tests to make sure this works as expected and isn't broken in 
the future.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to