mbeckerle commented on code in PR #831:
URL: https://github.com/apache/daffodil/pull/831#discussion_r951438972
##########
daffodil-tdml-processor/src/main/scala/org/apache/daffodil/tdml/processor/DaffodilTDMLDFDLProcessor.scala:
##########
@@ -160,9 +160,15 @@ final class TDMLDFDLProcessorFactory private (
optRootName: Option[String],
optRootNamespace: Option[String],
tunables: Map[String, String]): TDML.CompileResult = {
-
- val res = compileProcessor(schemaSource, useSerializedProcessor,
optRootName, optRootNamespace)
- res
+ if (schemaSource.isXSD) {
+ val res = compileProcessor(schemaSource, useSerializedProcessor,
optRootName, optRootNamespace)
+ res
+ } else {
+ val dp = compiler.reload(schemaSource)
+ val diags = dp.getDiagnostics
+ Assert.invariant(diags.forall{! _.isError })
+ Right((diags, new DaffodilTDMLDFDLProcessor(dp)))
+ }
Review Comment:
I could do this, but I didn't because I deemed coverage of this particular
functionality to be quite thorough in other places. This save/restore is used
everywhere. Every TDML test, for example by default serializes and restores the
processor before executing. So it's really just these two specific lines, and
they are correct by inspection.
--
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]