You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@daffodil.apache.org by "stevedlawrence (via GitHub)" <gi...@apache.org> on 2023/08/14 16:15:42 UTC

[GitHub] [daffodil] stevedlawrence commented on a diff in pull request #1067: Make include/import logic more precise and consistent

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


##########
daffodil-cli/src/main/scala/org/apache/daffodil/cli/Main.scala:
##########
@@ -226,14 +226,30 @@ class CLIConf(arguments: Array[String], stdout: PrintStream, stderr: PrintStream
   implicit def rootNSConverter = org.rogach.scallop.singleArgConverter[RefQName](qnameConvert _)
 
   implicit def fileResourceURIConverter = singleArgConverter[URI]((s: String) => {

Review Comment:
   The CLI behavior is every so slightly different since it doesn't need to do any relative look up, since there is not importing schema.  It also looks for files before looking at the classpath, since that is usually what CLI users expect. I'll add a comment.



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

Review Comment:
   Will do.



-- 
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: commits-unsubscribe@daffodil.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org