mbeckerle commented on a change in pull request #223: Daffodil 1444 schema comp
simple types
URL: https://github.com/apache/incubator-daffodil/pull/223#discussion_r289838166
##########
File path:
daffodil-core/src/main/scala/org/apache/daffodil/dsom/SchemaComponent.scala
##########
@@ -169,36 +156,19 @@ trait SchemaComponent
/**
* Elements only e.g., /foo/ex:bar
*/
- final lazy val slashPath: String = {
- val thisOne = "/" + diagnosticDebugName
- val encElem = enclosingElement
- if (encElem.isDefined)
- encElem.get.slashPath + thisOne
- else
- thisOne
- }
+ final lazy val slashPath: String =
+ scPath.filter { _.isInstanceOf[ElementBase] }.map { _.diagnosticDebugName
}.mkString("/")
override def toString = diagnosticDebugName
/**
- * Includes instances. Ie., a global element will appear inside an element
ref.
- * a global group inside a group ref, a global type inside an element or for
- * derived simple types inside another simple type, etc.
+ * Does not include instances. Ie., walks up lexical nest only.
Review comment:
Yes. We will have to use the processor's node-stack at runtime to provide
the dynamic nest, as we will only have the lexical nest at schema compile time.
We may be able to do better once I have the back reference table in that can
provide all the context backpointers where something is being reused. There may
be exactly one usage, in which case it is unambiguous.
----------------------------------------------------------------
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