stevedlawrence commented on a change in pull request #343: WIP: Daf 2302 ext var
URL: https://github.com/apache/incubator-daffodil/pull/343#discussion_r400121147
##########
File path: daffodil-cli/src/main/scala/org/apache/daffodil/Main.scala
##########
@@ -686,17 +687,14 @@ object Main extends Logging {
}
def createProcessorFromSchema(schema: URI, rootNS: Option[RefQName], path:
Option[String],
- extVars: Seq[Binding],
tunables: Map[String, String],
mode: ValidationMode.Type) = {
- val compiler = Compiler()
-
- compiler.setExternalDFDLVariables(extVars)
- compiler.setTunables(tunables)
-
- rootNS match {
- case None => // nothing
- case Some(RefQName(_, root, ns)) =>
compiler.setDistinguishedRootNode(root, ns.toStringOrNullIfNoNS)
+ val compiler = {
+ val c = Compiler().withTunables(tunables)
+ rootNS match {
+ case None => c
+ case Some(RefQName(_, root, ns)) => c.withDistinguishedRootNode(root,
ns.toStringOrNullIfNoNS)
Review comment:
While were making API changes, does it really make sense to have
withDistinguishedRootNode on the compiler? Should that only be a method on the
ProcessorFactory? Every compiled schema is likely going to have a different
root node, so setting it on the compiler feels wrong. Should we deprecated
setDistinguishedRootNode and not add withDistinguishedRootNode?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services