stevedlawrence commented on a change in pull request #343: Daffodil 2302 fixes
external variables API difficulties
URL: https://github.com/apache/incubator-daffodil/pull/343#discussion_r400889559
##########
File path:
daffodil-core/src/main/scala/org/apache/daffodil/compiler/RootSpec.scala
##########
@@ -33,4 +33,9 @@ case class RootSpec(ns: Option[NS], name: String) {
val nsStr = ns.getOrElse("")
"{" + nsStr + "}" + name
}
+}
+
+object RootSpec {
+ def makeRootSpec(optName: Option[String], optNamespace:Option[String]) =
+ optName.map{ RootSpec(optNamespace.map{ NS(_)}, _) }
Review comment:
Maybe this is really minor, and maybe even an existing bug, but if someone
calls one of our new compileSource methods passing in only a namespace but no
root (e.g. ``compileSource(source, None, Some("http://example.com"))``, we end
up just ignoring the namespace and using the logic to find the first element
That doesn't seem completely unreasonable, and probably isn't worth fixing
in this PR since it's unrelated, but maybe create a new bug for that if we want
a different behavior? Seems like a namespace without a name means someone
accidentally messed up.
----------------------------------------------------------------
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