1
import module namespace xqxq = 'http://www.zorba-xquery.com/modules/xqxq';
3
declare namespace resolver = 'http://www.zorba-xquery.com/modules/xqxq/url-resolver';
4
declare namespace mapper = 'http://www.zorba-xquery.com/modules/xqxq/uri-mapper';
5
declare namespace op = "http://www.zorba-xquery.com/options/features";
6
declare namespace f = "http://www.zorba-xquery.com/features";
7
declare option op:enable "f:hof";
9
declare function resolver:url-resolver($namespace as xs:string, $entity as xs:string) {
10
if($namespace = 'http://foo')
11
then "module namespace test = 'http://test'; declare function test:foo(){'foo'};"
15
declare function mapper:uri-mapper($namespace as xs:string, $entity as xs:string)
17
if($namespace = 'http://test')
22
variable $queryID := xqxq:prepare-main-module
24
"import module namespace test = 'http://test'; test:foo()",
25
resolver:url-resolver#2, mapper:uri-mapper#2
27
xqxq:evaluate($queryID)