~juan457/+junk/zorba

« back to all changes in this revision

Viewing changes to test/rbkt/Queries/zorba/index/numbers2.xq

  • Committer: Markos Zaharioudakis
  • Date: 2012-07-11 15:38:39 UTC
  • mfrom: (10924 zorba)
  • mto: This revision was merged to the branch mainline in revision 10932.
  • Revision ID: markos_za@yahoo.com-20120711153839-0mkh15cg2ubknchd
work in progress

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
import module namespace num = "http://www.w3.org/TestModules/numbers" at "numbers.xqlib";
 
2
 
 
3
import module namespace ddl = "http://www.zorba-xquery.com/modules/store/static/collections/ddl";
 
4
import module namespace dml = "http://www.zorba-xquery.com/modules/store/static/collections/dml";
 
5
import module namespace iddl = "http://www.zorba-xquery.com/modules/store/static/indexes/ddl";
 
6
import module namespace idml = "http://www.zorba-xquery.com/modules/store/static/indexes/dml";
 
7
 
 
8
declare namespace err = "http://www.w3.org/2005/xqt-errors";
 
9
 
 
10
import module namespace schema = "http://www.zorba-xquery.com/modules/schema";
 
11
 
 
12
import schema namespace s = "http://www.zorba-xquery.com/numbers.xsd" at "numbers.xsd";
 
13
 
 
14
declare variable $doc :=
 
15
<numbers>
 
16
<s:long>1</s:long>
 
17
<s:integer>2</s:integer>
 
18
<untyped>3</untyped>
 
19
</numbers>
 
20
;
 
21
 
 
22
declare variable $vdoc := validate lax { $doc };
 
23
 
 
24
 
 
25
ddl:create($num:collname2);
 
26
 
 
27
iddl:create($num:idx-g-h-untyped);
 
28
 
 
29
dml:insert-nodes($num:collname2, $vdoc);
 
30
 
 
31
 
 
32
schema:schema-type(data(dml:collection($num:collname2)//s:long))
 
33
,
 
34
"
 
35
 
 
36
TEST 1:
 
37
 
 
38
"
 
39
,
 
40
try
 
41
{
 
42
  idml:probe-index-point-value($num:idx-g-h-untyped, 3) 
 
43
}
 
44
catch *
 
45
{
 
46
  <exception>{$err:code} : {$err:description}</exception>
 
47
}
 
48
,
 
49
"
 
50
 
 
51
TEST 2:
 
52
 
 
53
"
 
54
,
 
55
{
 
56
  delete node dml:collection($num:collname2)/untyped;
 
57
 
 
58
  idml:probe-index-point-general($num:idx-g-h-untyped, 3)
 
59
  ,
 
60
  "
 
61
  "
 
62
  ,
 
63
  idml:probe-index-point-value($num:idx-g-h-untyped, 2)
 
64
}
 
65
,
 
66
"
 
67
"
 
68