Bug #2641
closedIndirect module imports do not work anymore in Saxon 9.7 HE
100%
Description
Hi,
As I tried to upgrade from Saxon 9.6 HE to Saxon 9.7 HE, I have found out that indirect importing of modules no longer works. I have prepared a minimal reproducer (please see below), and I would appreciate your feedback as to whether this could really be a bug in Saxon 9.7 HE, or maybe I'm overlooking something obvious.
Assume the following test setting:
test.xq
(:
import module namespace f="http://saxon.zaytsev.net/test/functions" at "test-direct.xqm", "test-indirect.xqm";
:)
import module namespace f="http://saxon.zaytsev.net/test/functions" at "test-direct.xqm";
f:wrapEchoString("Hello, wolrd!")
test-direct.xqm
module namespace f="http://saxon.zaytsev.net/test/functions";
import module namespace i="http://saxon.zaytsev.net/test/functions" at "test-indirect.xqm";
declare function f:wrapEchoString($s as xs:string) as xs:string {
i:echoString($s)
};
test-indirect.xqm
module namespace f="http://saxon.zaytsev.net/test/functions";
declare function f:echoString($s as xs:string) as xs:string {
$s
};
test.sh
#!/bin/bash
for version in 9.6 9.7; do
echo "Saxon $version:"
java -cp saxon-$version/saxon9he.jar net.sf.saxon.Query test.xq
echo
done
The output of test.sh when run on my machine is reproduced below:
$ ./test.sh
Saxon 9.6:
<?xml version="1.0" encoding="UTF-8"?>Hello, world!
Saxon 9.7:
Static error on line 5 at column 18 of file:/home/zaytsev/src/saxon/test-logical.mod.xq
XPST0017: Cannot find a matching 1-argument function named
{http://saxon.zaytsev.net/test/functions}echoString()
Static error(s) in query
As soon as I import test-indirect.xqm directly (see the first commented out line in test.xq), the test succeeds for both versions of Saxon. I'm thoroughly perplexed by this behavior, since it appears that in Saxon 9.7 HE the importing module should know about all of the dependencies of the imported modules and import them directly, which, obviously, hinders modularization.
Many thanks!
Files
Please register to edit this issue