~zorba-coders/zorba/bug1151967

« back to all changes in this revision

Viewing changes to test/rbkt/Queries/zorba/zorba-query/url-schema-resolver2.xq

  • Committer: Paul J. Lucas
  • Date: 2013-08-15 00:14:17 UTC
  • mfrom: (11597 lp_zorba)
  • mto: This revision was merged to the branch mainline in revision 11598.
  • Revision ID: paul@lucasmail.org-20130815001417-g22x9plxc8fv73zd
MergeĀ fromĀ trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
import module namespace xqxq = 'http://www.zorba-xquery.com/modules/xqxq';
 
1
import module namespace zq = 'http://zorba.io/modules/zorba-query';
2
2
 
3
3
import module namespace ddl =
4
4
    "http://www.zorba-xquery.com/modules/store/dynamic/collections/w3c/ddl";
5
5
import module namespace dml =
6
6
    "http://www.zorba-xquery.com/modules/store/dynamic/collections/w3c/dml";
7
7
 
8
 
declare namespace resolver = 'http://www.zorba-xquery.com/modules/xqxq/url-resolver';
 
8
declare namespace resolver = 'http://zorba.io/modules/zorba-query/url-resolver';
9
9
declare namespace op = "http://zorba.io/options/features";
10
10
declare namespace f = "http://zorba.io/features";
11
11
 
12
12
declare function resolver:url-resolver($namespace as xs:string, $entity as xs:string) {
13
13
  if ($entity = 'schema')
14
14
  then
15
 
    dml:collection("http://www.zorba-xquery.com/modules/xqxq")//xs:schema[@targetNamespace=$namespace]
 
15
    dml:collection("http://zorba.io/modules/zorba-query")//xs:schema[@targetNamespace=$namespace]
16
16
  else
17
17
    ()
18
18
};
19
19
 
20
 
declare variable $coll := "http://www.zorba-xquery.com/modules/xqxq";
 
20
declare variable $coll := "http://zorba.io/modules/zorba-query";
21
21
declare variable $schema := doc("test.xsd");
22
22
ddl:create($coll);
23
23
 
24
24
dml:apply-insert-nodes-first($coll, $schema);
25
 
variable $query-key := xqxq:prepare-main-module(
 
25
variable $query-key := zq:prepare-main-module(
26
26
  "import schema namespace test = 'http://test'; validate {<test:test><test:subtest>a</test:subtest><test:subtest2>a</test:subtest2></test:test>}",
27
27
  resolver:url-resolver#2, ());
28
 
xqxq:evaluate($query-key)
 
28
zq:evaluate($query-key)