mbeckerle commented on a change in pull request #654:
URL: https://github.com/apache/daffodil/pull/654#discussion_r725086029
##########
File path:
daffodil-test/src/test/resources/org/apache/daffodil/section06/namespaces/multiFile.tdml
##########
@@ -77,5 +77,50 @@
</tdml:dfdlInfoset>
</tdml:infoset>
</tdml:parserTestCase>
+
+ <tdml:parserTestCase name="complexIncludesNamespaces_01" root="root"
+ model="test05sch1.dfdl.xsd">
+ <tdml:document>
+ <tdml:documentPart type="text">1ab</tdml:documentPart>
+ </tdml:document>
+ <tdml:infoset>
+ <tdml:dfdlInfoset>
+ <tns:root xmlns:nsB="nsB" xmlns:tns="nsA">
Review comment:
Can you add a comment about what was fixed that this test shows is
fixed, i.e., just allude to what was happening before?
I think this test case, and the fact that use of "tns" here is very
confusing, really speaks to DFDL-schema authoring style: i.e., why the "tns"
convention has to be used carefully. In general element references should avoid
using tns prefix. One can use "tns" in QNames that refer to types, groups,
named DFDL formats, DFDL variables, etc., but elements really want to be local
in no-namespace (elementFormDefault='unqualified') or in element references to
their definitions, use a more unique and meaningful prefix.
##########
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:
Given the kind of fix this is, and the nature of this fix, I think these
cases that CodeCov is complaining about need coverage.
--
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]