You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@daffodil.apache.org by "mbeckerle (via GitHub)" <gi...@apache.org> on 2025/01/09 17:55:06 UTC
Re: [PR] Add annotations and facet check for PrefixLengthType [daffodil]
mbeckerle commented on code in PR #1334:
URL: https://github.com/apache/daffodil/pull/1334#discussion_r1909231609
##########
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} ($adjustedLen) failed check due to ${check.errMsg}"
Review Comment:
DFDL Workgroup has discussed and there is general agreement this is the correct interpretation.
Spec will be clarified. See: https://github.com/OpenGridForum/DFDL/issues/64
--
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: commits-unsubscribe@daffodil.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org