stevedlawrence commented on code in PR #1202:
URL: https://github.com/apache/daffodil/pull/1202#discussion_r1546344131
##########
daffodil-lib/src/main/scala/org/apache/daffodil/lib/util/SchemaUtils.scala:
##########
@@ -100,7 +100,23 @@ object SchemaUtils {
): Elem = {
val fileAttrib =
if (fileName == "") Null
- else Attribute(XMLUtils.INT_PREFIX, "file", Text(fileName), Null)
+ else {
+ // if dafint isn't part of schema scope, add it
+ lazy val dafintPrefixAttr =
+ Attribute("xmlns", XMLUtils.INT_PREFIX, XMLUtils.INT_NS, Null)
Review Comment:
Below on line 113/129 we have `xmlns:dafint={dafintURI}`, so we already do
something similar to this. But I guess that doesn't work if `schemaScope !=
TopScope` on line 108/124? Maybe instead of adding this as an attribute here or
on line 113, we should just do the `combineScopes` thing like near line 122/138
and always add dafint as a namspace prefix? So we just do it in one place like
this:
```scala
scope = XMLUtils.combineScopes(XMLUtils.INT_PREFIX, XMUtils.INT_NS, scope)
```
I assume `combineScopes` handles if INT_PREFIX is already defined and just
ignores it,?
--
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]