Project

Profile

Help

Bug #2641

closed

Indirect module imports do not work anymore in Saxon 9.7 HE

Added by Yury Zaytsev over 8 years ago. Updated over 8 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
XQuery conformance
Sprint/Milestone:
-
Start date:
2016-02-23
Due date:
% Done:

100%

Estimated time:
Legacy ID:
Applies to branch:
9.7
Fix Committed on Branch:
9.7
Fixed in Maintenance Release:
Platforms:

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

test.tar.gz (494 Bytes) test.tar.gz Minimal reproducer Yury Zaytsev, 2016-02-23 17:42

Please register to edit this issue

Also available in: Atom PDF