Misleading error msg (when imported module not found)

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Misleading error msg (when imported module not found)

Hans-Juergen Rennau
Dear Saxon team,

I observed a misleading error message that you may care to correct, occasionally.

Scenario: module1 has an erroneous import declaration so that it cannot find the imported module module2.
Observed message:

Error on line 4 column 68 of demo-module1.xq:
  XQST0034 XQuery static error near #...ng) as node() { i:bar($uri) };#:
    Duplicate definition of function m:foo (see line 5 in
Error on line 2 column 1 of demo-module0.xq:
  XQST0034: Static errors were reported in the imported library module
Static error(s) in query

This is misleading, as there is only one function "foo" - see below for complete code. The real error is that the import hint cannot be resolved.

Kind regards,

PS: Note that the import hint in demo-module1.xq is wrong because of the base uri declaration. It should be "tt/demo-module2.xq", rather than "demo-module2.xq". (After correction, the program works fine.) The only problem is the misleading error message.

xqueryx demo-module0.xq uri=dummy.xml

import module namespace m="http://www.ttools.org/xquery-functions" at "tmp/demo-module1.xq";
declare variable $uri external;

module namespace m="http://www.ttools.org/xquery-functions";
import module namespace i="http://www.ttools.org/xquery-functions" at "demo-module2.xq";
declare base-uri "..";
declare function m:foo($uri as xs:string) {i:bar($uri)};

module namespace m="http://www.ttools.org/xquery-functions";
declare base-uri "..";
declare function m:bar($uri as xs:string) {doc($uri)};

New Year. New Location. New Benefits. New Data Center in Ashburn, VA.
GigeNET is offering a free month of service with a new server in Ashburn.
Choose from 2 high performing configs, both with 100TB of bandwidth.
Higher redundancy.Lower latency.Increased capacity.Completely compliant.
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]