Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
3.2.1
-
None
Description
When an element has prefixed lengthKind, prefixIncludesPrefixLength='yes' the prefixLengthKind itself is derived from xs:unsignedInt and has implicit lengthKind (hence, length 4 bytes) and representation is 'binary'.
This should work to subtract 4 bytes from the value of the prefix to get the value of the length of the content.
However, I get this backtrace:
java.util.NoSuchElementException: None.get at scala.None$.get(Option.scala:529) at scala.None$.get(Option.scala:527) at org.apache.daffodil.grammar.ElementBaseGrammarMixin.prefixedLengthAdjustmentInUnits(ElementBaseGrammarMixin.scala:201) at org.apache.daffodil.grammar.ElementBaseGrammarMixin.prefixedLengthAdjustmentInUnits$(ElementBaseGrammarMixin.scala:193) at org.apache.daffodil.dsom.AbstractElementRef.prefixedLengthAdjustmentInUnits$lzycompute(ElementRef.scala:38) at org.apache.daffodil.dsom.AbstractElementRef.prefixedLengthAdjustmentInUnits(ElementRef.scala:38) at org.apache.daffodil.grammar.primitives.SpecifiedLengthPrefixed.pladj$lzycompute(SpecifiedLength.scala:156) at org.apache.daffodil.grammar.primitives.SpecifiedLengthPrefixed.pladj(SpecifiedLength.scala:156)
It seems to be because Daffodil is assuming there will be a lengthEv for the length of the prefix, but if the prefixLengthType itself uses lengthKind 'implicit' there will not be a lengthEv (currently).