Description
Attached are two cases, both of which contain:
<xs:simpleType name="SomeEnumType" dfdlx:repType="xs:unsignedByte">
<xs:restriction base="xs:unsignedShort">
<xs:enumeration value="55" dfdlx:repValues="0" />
<xs:enumeration value="56" dfdlx:repValues="1" />
<xs:enumeration value="57" dfdlx:repValues="2" />
</xs:restriction>
</xs:simpleType>
In some cases this could potentially make sense (eg. when the document format is such that unsignedByte is automatically 8 bits), but we probably want to disallow this entirely.
In b.dfdl.xsd, the entire document is using representation='text'. This fails with a somewhat reasonable error:
[error] Schema Definition Error: Type UnsignedShort with dfdl:representation='text' cannot have dfdl:lengthKind='implicit'
Schema context: element reference tns:a Location line 1 in file:/home/bsloane/Documents/incubator-daffodil/test/test/b.dfdl.xsd
[error] Schema Definition Error: Type UnsignedShort cannot have lengthKind='implicit' when representation='text'
Schema context: element reference tns:a Location line 1 in file:/home/bsloane/Documents/incubator-daffodil/test/test/b.dfdl.xsd
in c.dfdl.xsd, the document is useing representation='binary', and fails with an unhandled exception:
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!Unable to render embedded object: File ( An unexpected exception occurred. This is a bug) not found. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Please report this bug and help us fix it:
https://daffodil.apache.org/community/#issue-tracker
Please include the following exception, the command you ran, and any input, schema, or tdml files used that led to this bug.java.util.NoSuchElementException: None.get at scala.None$.get(Option.scala:349) at scala.None$.get(Option.scala:347) at org.apache.daffodil.grammar.primitives.TypeValueCalc.repTypeUnparser$lzycompute(PrimitivesExpressions.scala:264) at org.apache.daffodil.grammar.primitives.TypeValueCalc.repTypeUnparser(PrimitivesExpressions.scala:264) at org.apache.daffodil.grammar.primitives.TypeValueCalc.unparser$lzycompute(PrimitivesExpressions.scala:276) at org.apache.daffodil.grammar.primitives.TypeValueCalc.unparser(PrimitivesExpressions.scala:272) at org.apache.daffodil.grammar.Gram.maybeUnparser(GrammarTerm.scala:146) at org.apache.daffodil.grammar.primitives.ElementCombinatorBase.eRepTypeUnparser$lzycompute(ElementCombinator.scala:421) at org.apache.daffodil.grammar.primitives.ElementCombinatorBase.eRepTypeUnparser(ElementCombinator.scala:421) at org.apache.daffodil.grammar.primitives.ElementParseAndUnspecifiedLength.unparser$lzycompute(ElementCombinator.scala:332) at org.apache.daffodil.grammar.primitives.ElementParseAndUnspecifiedLength.unparser(ElementCombinator.scala:327) at org.apache.daffodil.grammar.primitives.ElementCombinator.unparser$lzycompute(ElementCombinator.scala:143) at org.apache.daffodil.grammar.primitives.ElementCombinator.unparser(ElementCombinator.scala:119) at org.apache.daffodil.grammar.Prod.unparser$lzycompute(Production.scala:92) at org.apache.daffodil.grammar.Prod.unparser(Production.scala:84) at org.apache.daffodil.grammar.Prod.unparser$lzycompute(Production.scala:92) at org.apache.daffodil.grammar.Prod.unparser(Production.scala:84) at org.apache.daffodil.compiler.ProcessorFactory.$anonfun$unparser$1(Compiler.scala:106) at org.apache.daffodil.oolag.OOLAG$OOLAGValueBase.liftedTree1$1(OOLAG.scala:549) at org.apache.daffodil.oolag.OOLAG$OOLAGValueBase.valueAsAny$lzycompute(OOLAG.scala:547) at org.apache.daffodil.oolag.OOLAG$OOLAGValueBase.valueAsAny(OOLAG.scala:544) at org.apache.daffodil.oolag.OOLAG$OOLAGValue.value$lzycompute(OOLAG.scala:594) at org.apache.daffodil.oolag.OOLAG$OOLAGValue.value(OOLAG.scala:594) at org.apache.daffodil.compiler.ProcessorFactory.unparser$lzycompute(Compiler.scala:105) at org.apache.daffodil.compiler.ProcessorFactory.unparser(Compiler.scala:105) at org.apache.daffodil.compiler.ProcessorFactory.$anonfun$new$4(Compiler.scala:127) at org.apache.daffodil.oolag.OOLAG$OOLAGValueBase.liftedTree1$1(OOLAG.scala:549) at org.apache.daffodil.oolag.OOLAG$OOLAGValueBase.valueAsAny$lzycompute(OOLAG.scala:547) at org.apache.daffodil.oolag.OOLAG$OOLAGValueBase.valueAsAny(OOLAG.scala:544) at org.apache.daffodil.oolag.OOLAG$OOLAGHost.$anonfun$checkErrors$2(OOLAG.scala:286) at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:12) at org.apache.daffodil.oolag.OOLAG$.keepGoing(OOLAG.scala:60) at org.apache.daffodil.oolag.OOLAG$OOLAGHost.checkErrors(OOLAG.scala:286) at org.apache.daffodil.oolag.OOLAG$OOLAGHost.checkErrors$(OOLAG.scala:277) at org.apache.daffodil.dsom.SchemaComponentImpl.checkErrors(SchemaComponent.scala:38) at org.apache.daffodil.oolag.OOLAG$OOLAGHost.isError(OOLAG.scala:345) at org.apache.daffodil.oolag.OOLAG$OOLAGHost.isError$(OOLAG.scala:344) at org.apache.daffodil.compiler.ProcessorFactory.super$isError(Compiler.scala:141) at org.apache.daffodil.compiler.ProcessorFactory.$anonfun$isError$3(Compiler.scala:141) at scala.runtime.java8.JFunction0$mcZ$sp.apply(JFunction0$mcZ$sp.java:12) at org.apache.daffodil.oolag.OOLAG$.keepGoing(OOLAG.scala:60) at org.apache.daffodil.compiler.ProcessorFactory.$anonfun$isError$1(Compiler.scala:132) at scala.runtime.java8.JFunction0$mcZ$sp.apply(JFunction0$mcZ$sp.java:12) at scala.util.DynamicVariable.withValue(DynamicVariable.scala:58) at org.apache.daffodil.ExecutionMode$.$anonfun$usingCompilerMode$1(ExecutionMode.scala:64) at org.apache.daffodil.compiler.ProcessorFactory.isError(Compiler.scala:132) at org.apache.daffodil.compiler.Compiler.compileSource(Compiler.scala:359) at org.apache.daffodil.Main$.$anonfun$createProcessorFromSchema$1(Main.scala:704) at org.apache.daffodil.util.Timer$.getTimeResult(Timer.scala:76) at org.apache.daffodil.util.Timer$.getResult(Timer.scala:35) at org.apache.daffodil.Main$.createProcessorFromSchema(Main.scala:703) at org.apache.daffodil.Main$.run(Main.scala:816) at org.apache.daffodil.Main$.main(Main.scala:1351) at org.apache.daffodil.Main.main(Main.scala)