Resolver goes to Internet for XQuery module's namespace URI #229
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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.
saxon-12.5subdirectory containing the Saxon-HE 12.5 Java distribution and place axmlresolver-6.0.13subdirectory containing the XML Resolver.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:
With an internet connection, it fails like this:
resolver-uses-internet.zip
I will investigate. In the meantime, could you try with 5.3.0, please? I still consider the 6.x branch a little bit "beta".
Sure. Has 5.3.0 been released yet? (I'm not in a big hurry.)
Thanks for investigating.
Yes. It went out yesterday shortly before or after 6.0.13.
I see 5.3.0 listed at Maven Central, but the XSpec repo's script is trying to get it from https://github.com/xmlresolver/xmlresolver/releases/download/5.3.0/xmlresolver-5.3.0.zip which doesn't seem to be there. Is it supposed to be?
Ah. That I might have to do by hand. I'll do that first thing tomorrow.
The 5.3.0 release is now on package releases page. Apologies for the inconvenience.
Thanks! Version 5.3.0 works fine. I don't mind deferring the update to v6.
Okay. I'm very curious about why 6.0.13 reports different results. I will investigate that in the next few days. Thanks again for reporting it!
I can't reproduce this. Can you confirm that it works if you use 5.3.0 and fails if you use 6.0.13 and change nothing else? Here's what I get:
And it works the same way with or without an internet connection.
What's especially strange is that the message you quoted is
But there are no occurrences of
https://www.datypic.com/in your test case at all.It feels very strongly like something else is going on.
Yes, it works with 5.3.0, and it fails with 6.0.13 if my Internet connection is on.
In my repro steps, the XQuery library module has
and if I point a web browser to
http://www.functx.com/then it redirects tohttps://www.datypic.com/functx/. Maybe that's where the datypic.com part is coming from in the error message.That is truly puzzling. I will dig in and take a closer look tomorrow.
I'm sure you're right about the URI. If it's easy for you to test with 6.0.12, I'd be curious to know if this is in any way related to the changes I just made. I'm guessing not, but since I'm completely perplexed, I wouldn't bet the cost of lunch at a cheap diner on it.
For me, 6.0.12 and 6.0.13 behave the same way.
v6.0.14 does the trick. Thanks!
Cool Thank you. I recommend you stick with 5.3.0 until 6.1.0 comes out. I expect that to be "soon" but as you can see, there are still some rough edges in the 6.x codebase.