stevedlawrence commented on a change in pull request #654:
URL: https://github.com/apache/daffodil/pull/654#discussion_r725089432



##########
File path: 
daffodil-runtime1/src/main/scala/org/apache/daffodil/infoset/SAXInfosetOutputter.scala
##########
@@ -180,14 +180,50 @@ class SAXInfosetOutputter(xmlReader: 
DFDL.DaffodilParseXMLReader,
     attrs
   }
 
+  /**
+   * Copied (with slight modification) from Scala-XML NamespaceBinding.scala to
+   * ensure we use the same logic to convert NamespaceBindings to mappings as
+   * other InfosetOutputters that use NamespaceBinding.buildString(stop)
+   */
+  private def shadowRedefined(start: NamespaceBinding, stop: 
NamespaceBinding): NamespaceBinding = {
+    def prefixList(x: NamespaceBinding): List[String] =
+      if ((x == null) || (x eq stop)) Nil
+      else x.prefix :: prefixList(x.parent)
+    def fromPrefixList(l: List[String]): NamespaceBinding = l match {
+      case Nil     => stop
+      case x :: xs => new NamespaceBinding(x, start.getURI(x), 
fromPrefixList(xs))

Review comment:
       This code is copied straight from Scala XML to get consistent behavior, 
I don't actually know what cases they're trying to cover, it might not even be 
possible with the way we use namespace bindings. I'll see if I can figure it 
out. 




-- 
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]


Reply via email to