Skip to content

Resolver goes to Internet for XQuery module's namespace URI #229

@galtm

Description

@galtm

I'm trying to upgrade the xspec/xspec repo to use a version 6 resolver instead of a version 5 one. Some of the tests failed because the resolver seems to be fetching a resource from the Internet based on the XQuery module's namespace URI. While investigating locally, I found that the process failed when my computer had an Internet connection and passed when it didn't. I'm using Windows locally, but on GitHub, the failures happened across platforms (Windows, macOS, and Linux), with Saxon 12.5 and 11.6.

Is it correct that the resolver is going to the XQuery module's namespace URI on the Internet instead of treating the namespace URI as merely a symbolic identifier?

If so, is there a better workaround than setting XML_CATALOG_ACCESS_EXTERNAL_DOCUMENT="" where needed? (I can't use that setting for all test cases because some of them need access.)

Reproducing the problem

I unwrapped the XSpec parts of the test case and made a very small, self-contained one.

  1. Unzip the attached ZIP-file into some directory
  2. In that directory, also place a saxon-12.5 subdirectory containing the Saxon-HE 12.5 Java distribution and place a xmlresolver-6.0.13 subdirectory containing the XML Resolver.
  3. From that directory, execute java -cp "saxon-12.5\saxon-he-12.5.jar;xmlresolver-6.0.13\lib\xmlresolver-6.0.13.jar" net.sf.saxon.Query -q:resolver-uses-internet.xq (if using Linux or macOS, presumably use forward slashes and colon path separator)

With no internet connection, step 3 works as expected:

<?xml version="1.0" encoding="UTF-8"?>Hello

With an internet connection, it fails like this:

Static error in {<} of https://www.datypic.com/functx/
  XPST0003  The file imported for module http://www.functx.com is not a valid XQuery library
  module. The content starts: <?xml version="1.0" encoding="...
Static error(s) in query

resolver-uses-internet.zip

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions