mbeckerle commented on code in PR #1334:
URL: https://github.com/apache/daffodil/pull/1334#discussion_r1799401889
##########
daffodil-runtime1/src/main/scala/org/apache/daffodil/runtime1/processors/parsers/BinaryNumberTraits.scala:
##########
@@ -103,6 +103,18 @@ trait PrefixedLengthParserMixin {
"Prefixed length result must be non-negative after
dfdl:prefixIncludesPrefixLength adjustment , but was: %d",
adjustedLen
)
+ // do checks on facets expressed on prefixLengthType
+ val optSTRD = plElement.erd.optSimpleTypeRuntimeData
+ if (optSTRD.isDefined) {
+ val strd = optSTRD.get
+ val check = strd.executeCheck(plElement)
+ if (check.isError) {
+ val pe = state.toProcessingError(
+ s"The calculated value of ${prefixedLengthERD.namedQName}
($parsedLen) failed check due to ${check.errMsg}"
Review Comment:
This check is also supposed to happen on unparsing.
We don't normally validate facets while unparsing (yet), so it might not be
quite so easy as the parse side.
If deferring the unparse feature, please add a JIRA ticket.
--
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]