Description
According to the spec,
"[dfdl:hexBinary] behaves identically to the XPath 2.0 constructor function of the same name, with one exception. The argument can also be a long, unsignedLong, or any subtype thereof, and in that case a xs:hexBinary value containing a number of hex digits is produced."
However, dfdl:hexBinary does not seem to handle string input as xs:hexBinary does.
Tests hexBinary_unparse_10 and hexBinary_unparse_13 use xs:hexBinary and dfdl:hexBinary, respectively. They both use outputValueCalc to set the document value to the output of hexBinary('a1'). xs:hexBinary converts this to the hexBinary string 'a1.' The dfdl:hexBinary test fails with the following error:
[error] Test edu.illinois.ncsa.daffodil.section05.simple_types.TestSimpleTypesUnparse.test_hexBinary_unparse_13 failed: edu.illinois.ncsa.daffodil.tdml.TDMLException: Schema Definition Error: For input string: "a1" [error] Schema context: element.hb_11. Location line 71 column 6 in file:/tmp/SimpleTypes-binary1717967500202954306.dfdl.xsd. [error] at edu.illinois.ncsa.daffodil.tdml.UnparserTestCase$$anonfun$runProcessor$7.apply(TDMLRunner.scala:747) [error] at edu.illinois.ncsa.daffodil.tdml.UnparserTestCase$$anonfun$runProcessor$7.apply(TDMLRunner.scala:747) [error] at scala.util.Either$LeftProjection.foreach(Either.scala:302) [error] at edu.illinois.ncsa.daffodil.tdml.UnparserTestCase.runProcessor(TDMLRunner.scala:747) [error] at edu.illinois.ncsa.daffodil.tdml.TestCase.run(TDMLRunner.scala:533) [error] at edu.illinois.ncsa.daffodil.tdml.DFDLTestSuite.runOneTestWithDataVolumes(TDMLRunner.scala:314) [error] at edu.illinois.ncsa.daffodil.tdml.DFDLTestSuite.runOneTest(TDMLRunner.scala:302) [error] at edu.illinois.ncsa.daffodil.tdml.Runner.runOneTest(RunnerFactory.scala:48) [error] at edu.illinois.ncsa.daffodil.section05.simple_types.TestSimpleTypesUnparse.test_hexBinary_unparse_13(TestSimpleTypesUnparse.scala:54) [error] ... [error] Caused by: Schema Definition Error: For input string: "a1" [error] Schema context: element.hb_11. Location line 71 column 6 in file:/tmp/SimpleTypes-binary1717967500202954306.dfdl.xsd. [error] at edu.illinois.ncsa.daffodil.dpath.CompiledDPath.runExpressionForConstant(DPathRuntime.scala:100) [error] at edu.illinois.ncsa.daffodil.dpath.DFDLPathExpressionParser.compile(DFDLExpressionParser.scala:73) [error] at edu.illinois.ncsa.daffodil.dsom.ExpressionCompiler$.compileExpression(CompiledExpression.scala:204) [error] at edu.illinois.ncsa.daffodil.dsom.ExpressionCompiler$.compile(CompiledExpression.scala:178) [error] at edu.illinois.ncsa.daffodil.processors.ExpressionEvaluatorBase$$anonfun$expr$1.apply(PrimitivesExpressions.scala:183) [error] at edu.illinois.ncsa.daffodil.processors.ExpressionEvaluatorBase$$anonfun$expr$1.apply(PrimitivesExpressions.scala:182) [error] at edu.illinois.ncsa.daffodil.dsom.oolag.OOLAG$OOLAGValue.liftedTree1$1(OOLAG.scala:586) [error] at edu.illinois.ncsa.daffodil.dsom.oolag.OOLAG$OOLAGValue.value$lzycompute(OOLAG.scala:584) [error] at edu.illinois.ncsa.daffodil.dsom.oolag.OOLAG$OOLAGValue.value(OOLAG.scala:582) [error] at edu.illinois.ncsa.daffodil.processors.ExpressionEvaluatorBase.expr$lzycompute(PrimitivesExpressions.scala:182) [error] at edu.illinois.ncsa.daffodil.processors.ExpressionEvaluatorBase.expr(PrimitivesExpressions.scala:181) [error] at edu.illinois.ncsa.daffodil.grammar.ElementBaseGrammarMixin$class.ovcCompiledExpression(ElementBaseGrammarMixin.scala:636) [error] at edu.illinois.ncsa.daffodil.dsom.ElementBase.ovcCompiledExpression$lzycompute(ElementBase.scala:79) [error] at edu.illinois.ncsa.daffodil.dsom.ElementBase.ovcCompiledExpression(ElementBase.scala:79) [error] at edu.illinois.ncsa.daffodil.dsom.ElementBase.edu$illinois$ncsa$daffodil$dsom$ElementBase$$createElementRuntimeData(ElementBase.scala:421) [error] at edu.illinois.ncsa.daffodil.dsom.ElementBase$$anonfun$elementRuntimeData$1.apply(ElementBase.scala:347) [error] at edu.illinois.ncsa.daffodil.dsom.ElementBase$$anonfun$elementRuntimeData$1.apply(ElementBase.scala:335) [error] at edu.illinois.ncsa.daffodil.dsom.oolag.OOLAG$OOLAGValue.liftedTree1$1(OOLAG.scala:586) [error] at edu.illinois.ncsa.daffodil.dsom.oolag.OOLAG$OOLAGValue.value$lzycompute(OOLAG.scala:584) [error] at edu.illinois.ncsa.daffodil.dsom.oolag.OOLAG$OOLAGValue.value(OOLAG.scala:582) [error] at edu.illinois.ncsa.daffodil.dsom.ElementBase.elementRuntimeData$lzycompute(ElementBase.scala:335) [error] at edu.illinois.ncsa.daffodil.dsom.ElementBase.elementRuntimeData(ElementBase.scala:335) [error] at edu.illinois.ncsa.daffodil.dsom.ElementBase.runtimeData$lzycompute(ElementBase.scala:257) [error] at edu.illinois.ncsa.daffodil.dsom.ElementBase.runtimeData(ElementBase.scala:257) [error] at edu.illinois.ncsa.daffodil.compiler.ProcessorFactory$$anonfun$5.apply(Compiler.scala:116) [error] at edu.illinois.ncsa.daffodil.compiler.ProcessorFactory$$anonfun$5.apply(Compiler.scala:116) [error] at edu.illinois.ncsa.daffodil.dsom.oolag.OOLAG$OOLAGValue.liftedTree1$1(OOLAG.scala:586) [error] at edu.illinois.ncsa.daffodil.dsom.oolag.OOLAG$OOLAGValue.value$lzycompute(OOLAG.scala:584) [error] at edu.illinois.ncsa.daffodil.dsom.oolag.OOLAG$OOLAGValue.value(OOLAG.scala:582) [error] at edu.illinois.ncsa.daffodil.dsom.oolag.OOLAG$OOLAGValue.valueAsAny(OOLAG.scala:580) [error] at edu.illinois.ncsa.daffodil.dsom.oolag.OOLAG$OOLAGHost$$anonfun$checkErrors$2.apply$mcV$sp(OOLAG.scala:288) [error] at edu.illinois.ncsa.daffodil.dsom.oolag.OOLAG$OOLAGHost$$anonfun$checkErrors$2.apply(OOLAG.scala:288) [error] at edu.illinois.ncsa.daffodil.dsom.oolag.OOLAG$OOLAGHost$$anonfun$checkErrors$2.apply(OOLAG.scala:288) [error] at edu.illinois.ncsa.daffodil.dsom.oolag.OOLAG$.keepGoing(OOLAG.scala:77) [error] at edu.illinois.ncsa.daffodil.dsom.oolag.OOLAG$OOLAGHost.checkErrors(OOLAG.scala:288) [error] at edu.illinois.ncsa.daffodil.dsom.oolag.OOLAG$OOLAGHost.isError(OOLAG.scala:347) [error] at edu.illinois.ncsa.daffodil.compiler.ProcessorFactory.edu$illinois$ncsa$daffodil$compiler$ProcessorFactory$$super$isError(Compiler.scala:129) [error] at edu.illinois.ncsa.daffodil.compiler.ProcessorFactory$$anonfun$isError$1$$anonfun$apply$mcZ$sp$2.apply$mcZ$sp(Compiler.scala:129) [error] at edu.illinois.ncsa.daffodil.compiler.ProcessorFactory$$anonfun$isError$1$$anonfun$apply$mcZ$sp$2.apply(Compiler.scala:120) [error] at edu.illinois.ncsa.daffodil.compiler.ProcessorFactory$$anonfun$isError$1$$anonfun$apply$mcZ$sp$2.apply(Compiler.scala:120) [error] at edu.illinois.ncsa.daffodil.dsom.oolag.OOLAG$.keepGoing(OOLAG.scala:77) [error] at edu.illinois.ncsa.daffodil.compiler.ProcessorFactory$$anonfun$isError$1.apply$mcZ$sp(Compiler.scala:120) [error] at edu.illinois.ncsa.daffodil.compiler.ProcessorFactory$$anonfun$isError$1.apply(Compiler.scala:120) [error] at edu.illinois.ncsa.daffodil.compiler.ProcessorFactory$$anonfun$isError$1.apply(Compiler.scala:120) [error] at scala.util.DynamicVariable.withValue(DynamicVariable.scala:58) [error] at edu.illinois.ncsa.daffodil.ExecutionMode$$anonfun$usingCompilerMode$1.apply(ExecutionMode.scala:79) [error] at edu.illinois.ncsa.daffodil.ExecutionMode$$anonfun$usingCompilerMode$1.apply(ExecutionMode.scala:79) [error] at edu.illinois.ncsa.daffodil.compiler.ProcessorFactory.isError(Compiler.scala:120) [error] at edu.illinois.ncsa.daffodil.compiler.Compiler.compileSource(Compiler.scala:319) [error] at edu.illinois.ncsa.daffodil.tdml.TestCase.edu$illinois$ncsa$daffodil$tdml$TestCase$$compileProcessor(TDMLRunner.scala:398) [error] at edu.illinois.ncsa.daffodil.tdml.TestCase.getProcessor(TDMLRunner.scala:415) [error] at edu.illinois.ncsa.daffodil.tdml.UnparserTestCase.runProcessor(TDMLRunner.scala:742) [error] ... 63 more
The tests mentioned above are found in the following files:
daffodil-test/src/test/resources/edu/illinois/ncsa/daffodil/section05/simple_types/SimpleTypesUnparse.tdml
daffodil-test/src/test/scala-debug/edu/illinois/ncsa/daffodil/section05/simple_types/TestSimpleTypesDebug.scala
daffodil-test/src/test/scala/edu/illinois/ncsa/daffodil/section05/simple_types/TestSimpleTypesUnparse.scala