stevedlawrence commented on code in PR #1067:
URL: https://github.com/apache/daffodil/pull/1067#discussion_r1293694849


##########
daffodil-lib/src/main/scala/org/apache/daffodil/lib/xml/XMLUtils.scala:
##########
@@ -1299,6 +1303,121 @@ Differences were (path, expected, actual):
       }
     } else maybePrefix(nsb.parent, uri)
   }
+
+  /**
+   * Resolves an xs:include/xs:import schemaLocation to a URI
+   *
+   * Attempts to resolve a schemaLocation using a provided URI and contextURI, 
where the context
+   * is the URI of the schema importing this schemaLocation.
+   *
+   * If schemaLocation is not a valid URI, an IllegalArgumentException is 
thrown.
+   *
+   * If schemaLocation is not an absolute URI, then only the path component 
should be provided,
+   * or an IllegalArgumentException is thrown.
+   *
+   * If schemaLocation is not an absolute URI, and the path component is 
relative, then
+   * optContextURI must be provided or a usage exception is thrown.
+   *
+   * Returns None if this fails to resolve the schemaLocation to an URI that 
exists. If this
+   * successfully resolves, it returns a Some containing a tuple of the URI 
and a boolean that
+   * is true if a relative schemaLocation path was resolved absolutely on the 
classpath and
+   * false otherwise. This capability may be disabled in the future.
+   */
+  def resolveSchemaLocation(

Review Comment:
   Agreed. I think he biggest obstacle is the XML catalog support, which I 
think is handled slightly different in the DaffodilXMLLoader and in the IIBase 
stuff. It also requires state for finding/loading the XML Catalog, so it felt a 
bit bigger task than I wanted to take on in this PR, which is relatively small 
and localized. I'll open a clean up ticket for 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]

Reply via email to