~zorba-coders/zorba/image-module-head

« back to all changes in this revision

Viewing changes to test/rbkt/Queries/zorba/xqxq/uri-mapper2.xq

  • Committer: Zorba Build Bot
  • Author(s): chillery+launchpad at lambda
  • Date: 2012-10-26 15:13:54 UTC
  • mfrom: (11110.1.2 move-xqxq-core)
  • Revision ID: chillery+buildbot@lambda.nu-20121026151354-ojxq78uovjc6czno
Moved XQXQ into Zorba core. Approved: Juan Zacarias, Matthias Brantner, Chris Hillery

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
import module namespace xqxq = 'http://www.zorba-xquery.com/modules/xqxq';
 
2
 
 
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";
 
8
 
 
9
declare function mapper:uri-mapper($namespace as xs:string, $entity as xs:string)
 
10
{
 
11
  if ($namespace = 'http://test' and $entity = 'schema')
 
12
  then resolve-uri('test.xsd')
 
13
  else ()
 
14
};
 
15
 
 
16
variable $queryID := xqxq:prepare-main-module
 
17
(
 
18
  "import schema namespace test = 'http://test'; validate{<test:test><test:subtest>a</test:subtest><test:subtest2>a</test:subtest2></test:test>}", 
 
19
  (),
 
20
  mapper:uri-mapper#2
 
21
);
 
22
xqxq:evaluate($queryID)