mbeckerle commented on a change in pull request #24: Make TDML Runner not strip
all attributes
URL: https://github.com/apache/incubator-daffodil/pull/24#discussion_r159962600
##########
File path:
daffodil-lib/src/main/scala/edu/illinois/ncsa/daffodil/xml/XMLUtils.scala
##########
@@ -671,13 +676,27 @@ object XMLUtils {
case xsiNilAttr @ PrefixedAttribute("xsi", "nil", Text("true"), _)
if (xsiNilAttr.getNamespace(e) == null) => {
true
}
- case attr => {
- if (ns.length > 0) {
- !ns.contains(NS(attr.getNamespace(e)))
- } else {
- false
- }
+ case dafIntAttr @ PrefixedAttribute(pre, _, _, _) if (pre ne null)
&& (dafIntAttr.getNamespace(e) ==
XMLUtils.DAFFODIL_INTERNAL_NAMESPACE.toString) => {
+ Assert.invariant(pre != "")
+ false // drop dafint attributes.
}
+ case xsiTypeAttr @ PrefixedAttribute(_, "type", _, _) if
(NS(xsiTypeAttr.getNamespace(e)) == XMLUtils.XSI_NAMESPACE) =>
+ false // drop xsi:type attributes for now. Such time as we add
+ // support for them, we would need to not remove them.
+ // TODO: actually check xsi:type attributes are correct - but this
+ // requires schema-aware comparison.
+ case xsiTypeAttr @ PrefixedAttribute("xsi", "type", _, _) =>
+ false // drop xsi:type attributes for now. Even if prefix xsi is
not defined.
+ // This just avoids having to edit many tests to add in the
xmlns:xsi=....
+ // namespace declaration.
+ case attr =>
+ true // keep all other attributes
+ // {
Review comment:
Remove commented code.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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