Merge lp:~zorba-coders/zorba/update3.0_zorba-query-module into lp:zorba
- update3.0_zorba-query-module
- Merge into trunk
Status: | Merged | ||||||||
---|---|---|---|---|---|---|---|---|---|
Merged at revision: | 11597 | ||||||||
Proposed branch: | lp:~zorba-coders/zorba/update3.0_zorba-query-module | ||||||||
Merge into: | lp:zorba | ||||||||
Diff against target: |
3009 lines (+594/-598) 48 files modified
ChangeLog (+1/-0) doc/zorba/xqdoc/images/modules.svg (+5/-5) doc/zorba/xqdoc/images/modules_new.svg (+5/-5) modules/CMakeLists.txt (+1/-1) modules/zorba-query/CMakeLists.txt (+1/-1) modules/zorba-query/zorba-query.xq (+203/-208) modules/zorba-query/zorba-query.xq.src/zorba-query.cpp (+102/-102) modules/zorba-query/zorba-query.xq.src/zorba-query.h (+60/-60) test/fots_driver/cli.xq (+2/-2) test/fots_driver/environment.xq (+24/-24) test/fots_driver/evaluate.xq (+17/-17) test/fots_driver/execute.xq (+16/-16) test/fots_driver/fots-driver.xq (+14/-14) test/rbkt/Queries/zorba/zorba-query/bind-context-item.xq (+4/-4) test/rbkt/Queries/zorba/zorba-query/bind-variable.xq (+4/-4) test/rbkt/Queries/zorba/zorba-query/delete.spec (+1/-1) test/rbkt/Queries/zorba/zorba-query/delete.xq (+4/-4) test/rbkt/Queries/zorba/zorba-query/error-in-query.xq (+3/-3) test/rbkt/Queries/zorba/zorba-query/evaluate-sequential.xq (+4/-4) test/rbkt/Queries/zorba/zorba-query/evaluate-sequential2.spec (+1/-1) test/rbkt/Queries/zorba/zorba-query/evaluate-sequential2.xq (+4/-4) test/rbkt/Queries/zorba/zorba-query/evaluate-updating.xq (+4/-4) test/rbkt/Queries/zorba/zorba-query/evaluate-updating2.spec (+1/-1) test/rbkt/Queries/zorba/zorba-query/evaluate-updating2.xq (+3/-3) test/rbkt/Queries/zorba/zorba-query/evaluate.xq (+3/-3) test/rbkt/Queries/zorba/zorba-query/evaluate2.xq (+4/-4) test/rbkt/Queries/zorba/zorba-query/evaluate3.spec (+1/-1) test/rbkt/Queries/zorba/zorba-query/evaluate3.xq (+3/-3) test/rbkt/Queries/zorba/zorba-query/external-module.xq (+3/-3) test/rbkt/Queries/zorba/zorba-query/get-external-variables.xq (+4/-4) test/rbkt/Queries/zorba/zorba-query/is-bound-context-item.xq (+3/-3) test/rbkt/Queries/zorba/zorba-query/is-bound-variable.xq (+7/-7) test/rbkt/Queries/zorba/zorba-query/is-bound-variable2.spec (+1/-1) test/rbkt/Queries/zorba/zorba-query/is-bound-variable2.xq (+3/-3) test/rbkt/Queries/zorba/zorba-query/is-sequential.xq (+5/-5) test/rbkt/Queries/zorba/zorba-query/is-updating.xq (+7/-7) test/rbkt/Queries/zorba/zorba-query/multiple-queries.xq (+7/-7) test/rbkt/Queries/zorba/zorba-query/prepare-library-module.xq (+2/-2) test/rbkt/Queries/zorba/zorba-query/query-plan.xq (+5/-5) test/rbkt/Queries/zorba/zorba-query/query-plan2.xq (+6/-6) test/rbkt/Queries/zorba/zorba-query/query-plan3.xq (+7/-7) test/rbkt/Queries/zorba/zorba-query/query-plan4.xq (+7/-7) test/rbkt/Queries/zorba/zorba-query/uri-mapper.xq (+5/-5) test/rbkt/Queries/zorba/zorba-query/uri-mapper2.xq (+5/-5) test/rbkt/Queries/zorba/zorba-query/url-module-resolver.xq (+4/-4) test/rbkt/Queries/zorba/zorba-query/url-schema-resolver.xq (+4/-4) test/rbkt/Queries/zorba/zorba-query/url-schema-resolver2.xq (+6/-6) test/rbkt/Queries/zorba/zorba-query/url-schema-resolver3.xq (+8/-8) |
||||||||
To merge this branch: | bzr merge lp:~zorba-coders/zorba/update3.0_zorba-query-module | ||||||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Sorin Marian Nasoi | Approve | ||
Chris Hillery | Approve | ||
Review via email: mp+179756@code.launchpad.net |
Commit message
Update 3.0 for xqxq
Renamed xqxq module to zorba-query module (zq module)
Description of the change
Update 3.0 for xqxq
Renamed xqxq module to zorba-query module (zq module)
- 11596. By sorin.marian.nasoi <email address hidden>
-
Re-added changes that were wrongfully reverted in r11402.1.5.
Approved: Chris Hillery, Sorin Marian Nasoi - 11597. By Juan Zacarias
-
XQXQ module modifications:
Changed namespace to zorba.io
Renamed module to zorba-query module (zq module)
Zorba Build Bot (zorba-buildbot) wrote : | # |
Zorba Build Bot (zorba-buildbot) wrote : | # |
Voting criteria failed for the following merge proposals:
https:/
Votes: {'Pending': 2}
Zorba Build Bot (zorba-buildbot) wrote : | # |
Validation queue result for https:/
Stage "CommitZorba" failed.
Check console output at http://
Zorba Build Bot (zorba-buildbot) wrote : | # |
Validation queue starting for the following merge proposals:
https:/
Progress dashboard at http://
Zorba Build Bot (zorba-buildbot) wrote : | # |
Voting criteria failed for the following merge proposals:
https:/
Votes: {'Pending': 2}
Zorba Build Bot (zorba-buildbot) wrote : | # |
Validation queue result for https:/
Stage "CommitZorba" failed.
Check console output at http://
Chris Hillery (ceejatec) wrote : | # |
Two small issues:
1. The module version number should be changed back to 1.0, since the name has changed so it's not the same module anymore. Don't forget to update both CMakeLists.txt and the module text itself, as well as (at least) FOTS driver where it is imported.
2. Can you try remove the word "XQuery" as much as possible from the module XQDoc? eg, instead of "XQuery program", just write "query", I think. In the main header comment, you could spell out that a query is either an XQuery or a JSONiq query.
Sorin: it looks like all the changes to FOTS driver are mechanical, eg. changing xqxq: to zq:. However, please review to make sure there are no surprises there.
- 11598. By Juan Zacarias
-
Cosmetic Changes for ZQ module.
- 11599. By Juan Zacarias
-
merged with trunk
- 11600. By Chris Hillery
-
Changed additional uses of "XQuery" and "program"; a bit of doc cleanup.
Chris Hillery (ceejatec) wrote : | # |
I cleaned up a few more references to "XQuery" in the doc, and a couple other doc bits. Looks good now.
Sorin Marian Nasoi (sorin.marian.nasoi) : | # |
Zorba Build Bot (zorba-buildbot) wrote : | # |
Validation queue starting for the following merge proposals:
https:/
Progress dashboard at http://
Zorba Build Bot (zorba-buildbot) wrote : | # |
Validation queue starting for the following merge proposals:
https:/
Progress dashboard at http://
Zorba Build Bot (zorba-buildbot) wrote : | # |
Validation queue succeeded - proposal merged!
Zorba Build Bot (zorba-buildbot) wrote : | # |
Validation queue result for https:/
Stage "CommitZorba" failed.
Check console output at http://
Preview Diff
1 | === modified file 'ChangeLog' |
2 | --- ChangeLog 2013-08-09 23:05:46 +0000 |
3 | +++ ChangeLog 2013-08-14 06:22:56 +0000 |
4 | @@ -70,6 +70,7 @@ |
5 | that are not objects/arrays). |
6 | * Bug fix: selector value in object/array navigation is always cast to |
7 | string/integer |
8 | + * Renamed xqxq module to zorba-query module(zq module). |
9 | |
10 | version 2.9 |
11 | |
12 | |
13 | === modified file 'doc/zorba/xqdoc/images/modules.svg' |
14 | --- doc/zorba/xqdoc/images/modules.svg 2013-08-07 05:28:39 +0000 |
15 | +++ doc/zorba/xqdoc/images/modules.svg 2013-08-14 06:22:56 +0000 |
16 | @@ -594,10 +594,10 @@ |
17 | <text text-anchor="middle" x="1306" y="-511.8" font-family="Times,serif" font-size="14.00">Programming Languages</text> |
18 | </a> |
19 | </g> |
20 | -<g id="graph100" class="cluster"><title>clusterZorbaProgrammingLanguagesXQXQ</title> |
21 | -<a xlink:title="Zorba/Programming Languages/XQXQ"> |
22 | +<g id="graph100" class="cluster"><title>clusterZorbaProgrammingLanguagesZQ</title> |
23 | +<a xlink:title="Zorba/Programming Languages/ZQ"> |
24 | <polygon fill="lightsteelblue" stroke="black" points="1308,-421 1308,-496 1382,-496 1382,-421 1308,-421"/> |
25 | -<text text-anchor="middle" x="1345" y="-480.8" font-family="Times,serif" font-size="14.00">XQXQ</text> |
26 | +<text text-anchor="middle" x="1345" y="-480.8" font-family="Times,serif" font-size="14.00">ZQ</text> |
27 | </a> |
28 | </g> |
29 | <g id="graph101" class="cluster"><title>clusterZorbaProgrammingLanguagesXSLT</title> |
30 | @@ -1895,9 +1895,9 @@ |
31 | </g> |
32 | <!-- 45 --> |
33 | <g id="node178" class="node"><title>45</title> |
34 | -<a xlink:href="../modules_zorba_programming_languages_XQXQ.html" xlink:title="(Zorba-core) module uri=http://www.zorba-xquery.com/modules/xqxq"> |
35 | +<a xlink:href="../modules_zorba_programming_languages_ZQ.html" xlink:title="(Zorba-core) module uri=http://zorba.io/modules/zorba-query"> |
36 | <ellipse fill="white" stroke="white" cx="1345" cy="-447" rx="28.3955" ry="18"/> |
37 | -<text text-anchor="middle" x="1345" y="-443.3" font-family="Times,serif" font-size="14.00" fill="red">xqxq</text> |
38 | +<text text-anchor="middle" x="1345" y="-443.3" font-family="Times,serif" font-size="14.00" fill="red">zorba-query</text> |
39 | </a> |
40 | </g> |
41 | <!-- 51 --> |
42 | |
43 | === modified file 'doc/zorba/xqdoc/images/modules_new.svg' |
44 | --- doc/zorba/xqdoc/images/modules_new.svg 2013-08-07 05:28:39 +0000 |
45 | +++ doc/zorba/xqdoc/images/modules_new.svg 2013-08-14 06:22:56 +0000 |
46 | @@ -594,10 +594,10 @@ |
47 | <text text-anchor="middle" x="1306" y="-511.8" font-family="Times,serif" font-size="14.00">Programming Languages</text> |
48 | </a> |
49 | </g> |
50 | -<g id="graph100" class="cluster"><title>clusterZorbaProgrammingLanguagesXQXQ</title> |
51 | -<a xlink:title="Zorba/Programming Languages/XQXQ"> |
52 | +<g id="graph100" class="cluster"><title>clusterZorbaProgrammingLanguagesZQ</title> |
53 | +<a xlink:title="Zorba/Programming Languages/ZQ"> |
54 | <polygon fill="lightsteelblue" stroke="black" points="1308,-421 1308,-496 1382,-496 1382,-421 1308,-421"/> |
55 | -<text text-anchor="middle" x="1345" y="-480.8" font-family="Times,serif" font-size="14.00">XQXQ</text> |
56 | +<text text-anchor="middle" x="1345" y="-480.8" font-family="Times,serif" font-size="14.00">ZQ</text> |
57 | </a> |
58 | </g> |
59 | <g id="graph101" class="cluster"><title>clusterZorbaProgrammingLanguagesXSLT</title> |
60 | @@ -1895,9 +1895,9 @@ |
61 | </g> |
62 | <!-- 45 --> |
63 | <g id="node178" class="node"><title>45</title> |
64 | -<a xlink:href="../modules_zorba_programming_languages_XQXQ.html" xlink:title="(Zorba-core) module uri=http://www.zorba-xquery.com/modules/xqxq"> |
65 | +<a xlink:href="../modules_zorba_programming_languages_ZQ.html" xlink:title="(Zorba-core) module uri=http://zorba.io/modules/zorba-query"> |
66 | <ellipse fill="white" stroke="white" cx="1345" cy="-447" rx="28.3955" ry="18"/> |
67 | -<text text-anchor="middle" x="1345" y="-443.3" font-family="Times,serif" font-size="14.00" fill="red">xqxq</text> |
68 | +<text text-anchor="middle" x="1345" y="-443.3" font-family="Times,serif" font-size="14.00" fill="red">zorba-query</text> |
69 | </a> |
70 | </g> |
71 | <!-- 51 --> |
72 | |
73 | === modified file 'modules/CMakeLists.txt' |
74 | --- modules/CMakeLists.txt 2013-08-07 23:46:25 +0000 |
75 | +++ modules/CMakeLists.txt 2013-08-14 06:22:56 +0000 |
76 | @@ -16,7 +16,7 @@ |
77 | ADD_SUBDIRECTORY(com) |
78 | ADD_SUBDIRECTORY(org) |
79 | ADD_SUBDIRECTORY(functx) |
80 | -ADD_SUBDIRECTORY(xqxq) |
81 | +ADD_SUBDIRECTORY(zorba-query) |
82 | ADD_SUBDIRECTORY(w3c) |
83 | ADD_SUBDIRECTORY(full-text) |
84 | ADD_SUBDIRECTORY(xml) |
85 | |
86 | === renamed directory 'modules/xqxq' => 'modules/zorba-query' |
87 | === modified file 'modules/zorba-query/CMakeLists.txt' |
88 | --- modules/xqxq/CMakeLists.txt 2013-04-09 14:22:41 +0000 |
89 | +++ modules/zorba-query/CMakeLists.txt 2013-08-14 06:22:56 +0000 |
90 | @@ -12,4 +12,4 @@ |
91 | # See the License for the specific language governing permissions and |
92 | # limitations under the License. |
93 | |
94 | -DECLARE_ZORBA_MODULE (URI "http://www.zorba-xquery.com/modules/xqxq" VERSION 2.0 FILE "xqxq.xq") |
95 | \ No newline at end of file |
96 | +DECLARE_ZORBA_MODULE (URI "http://zorba.io/modules/zorba-query" VERSION 1.0 FILE "zorba-query.xq") |
97 | \ No newline at end of file |
98 | |
99 | === renamed file 'modules/xqxq/xqxq.xq' => 'modules/zorba-query/zorba-query.xq' |
100 | --- modules/xqxq/xqxq.xq 2013-08-09 08:27:30 +0000 |
101 | +++ modules/zorba-query/zorba-query.xq 2013-08-14 06:22:56 +0000 |
102 | @@ -16,242 +16,239 @@ |
103 | :) |
104 | |
105 | (:~ |
106 | - : This module contains functions to compile and evaluate XQuery |
107 | - : programs. Also, it contains function that allow to parameterize |
108 | - : the static or dynamic evaluation phase. |
109 | + : This module contains functions to compile and evaluate queries |
110 | + : written in either JSONiq or XQuery. Also, it contains function that |
111 | + : allow to parameterize the static or dynamic evaluation phase. |
112 | : |
113 | : @author Juan Zacarias |
114 | - : @project Zorba/Programming Languages/XQXQ |
115 | + : @project Zorba/Programming Languages/ZQ |
116 | :) |
117 | -module namespace xqxq = 'http://www.zorba-xquery.com/modules/xqxq'; |
118 | +module namespace zq = 'http://zorba.io/modules/zorba-query'; |
119 | |
120 | declare namespace an = "http://zorba.io/annotations"; |
121 | declare namespace ver = "http://zorba.io/options/versioning"; |
122 | declare namespace op = "http://zorba.io/options/features"; |
123 | declare namespace f = "http://zorba.io/features"; |
124 | |
125 | -declare option ver:module-version "2.0"; |
126 | +declare option ver:module-version "1.0"; |
127 | |
128 | (:~ |
129 | - : The function prepares a given XQuery program for execution. |
130 | - : If the program was successfully compiled, the function returns an |
131 | + : <p>The function prepares a given a query for execution.</p> |
132 | + : <p>If the query was successfully compiled, the function returns an |
133 | : identifier as xs:anyURI. This URI can be passed to other functions |
134 | - : of this module (e.g. to actually evaluate the program). The URI |
135 | - : is opaque and its lilfetime is bound by the lifetime of the XQuery |
136 | - : program that invoked this function. Further reference or uses |
137 | - : of the identifier lead to unexpected results. |
138 | - : |
139 | - : Successfully prepared queries need to be deleted by passing the resulting |
140 | - : identifier to the xqxq:delete-query function of this module. |
141 | - : |
142 | - : @param $main-module-text the XQuery program that should be prepared. |
143 | - : The program needs to be a XQuery main module. |
144 | - : |
145 | - : @return an identifier for the compiled program that can be passed |
146 | + : of this module (e.g. to actually evaluate the query). The URI |
147 | + : is opaque and its lifetime is bound by the lifetime of the query |
148 | + : that invoked this function. Further reference or uses |
149 | + : of the identifier lead to unexpected results.</p> |
150 | + : <p/> |
151 | + : <p>Successfully prepared queries need to be deleted by passing the resulting |
152 | + : identifier to the zq:delete-query function of this module.</p> |
153 | + : |
154 | + : @param $main-module-text the query that should be prepared. |
155 | + : The query needs to be a XQuery or JSONiq main module. |
156 | + : |
157 | + : @return an identifier for the compiled query that can be passed |
158 | : as arguments to other functions of this module. |
159 | : |
160 | : @error any (static or type) error that may be raised during the compilation |
161 | - : of the query. For example, err:XPST0003 if the given XQuery program could |
162 | + : of the query. For example, err:XPST0003 if the given query could |
163 | : not be parsed. |
164 | :) |
165 | -declare %an:sequential function xqxq:prepare-main-module($main-module-text as xs:string) as |
166 | +declare %an:sequential function zq:prepare-main-module($main-module-text as xs:string) as |
167 | xs:anyURI external; |
168 | |
169 | (:~ |
170 | - : The function prepares a given XQuery program for execution. |
171 | - : If the program was successfully compiled, the function returns an |
172 | + : <p>The function prepares a given query for execution.</p> |
173 | + : <p>If the query was successfully compiled, the function returns an |
174 | : identifier as xs:anyURI. This URI can be passed to other functions |
175 | - : of this module (e.g. to actually evaluate the program). The URI |
176 | - : is opaque and its lilfetime is bound by the lifetime of the XQuery |
177 | - : program that invoked this function. Further reference or uses |
178 | - : of the identifier lead to unexpected results. |
179 | - : |
180 | - : Important notes regarding the second and third parameters of the function: |
181 | - : -------------------------------------------------------------------------- |
182 | - : |
183 | - : These parameters allow you to specify a URL resolver and a URI mapper |
184 | + : of this module (e.g. to actually evaluate the query). The URI |
185 | + : is opaque and its lifetime is bound by the lifetime of the query |
186 | + : that invoked this function. Further reference or uses |
187 | + : of the identifier lead to unexpected results.</p> |
188 | + : <p/> |
189 | + : <p>Important notes regarding the second and third parameters of the function:</p> |
190 | + : <p>--------------------------------------------------------------------------</p> |
191 | + : <p/> |
192 | + : <p>These parameters allow you to specify a URL resolver and a URI mapper |
193 | : for Zorba to use when executing this query. See |
194 | - : http://www.zorba-xquery.com/html/documentation/2.7.0/zorba/uriresolvers |
195 | - : |
196 | - : The second parameter is a function item for a URL |
197 | + : <a href="http://www.zorba-xquery.com/html/documentation/2.7.0/zorba/uriresolvers">here</a></p> |
198 | + : <p/> |
199 | + : <ul>The second parameter is a function item for a URL |
200 | : resolver. The URL resolver function must recive 2 parameters: |
201 | - : A $namespace as xs:string that will contain the url to be resolved. |
202 | - : A $entity as xs:string that will contain the type of resolving needed; |
203 | - : this can be 2 values "module" and "schema". |
204 | - : The function must return an empty sequence when the specified $namespace |
205 | - : or $entity are not the ones to be resolved. |
206 | - : |
207 | - : Example: |
208 | - : |
209 | - : declare function mymod:url-resolver($namespace as xs:string, $entity as xs:string) |
210 | + : <li>A $namespace as xs:string that will contain the url to be resolved.</li> |
211 | + : <li>A $entity as xs:string that will contain the type of resolving needed. |
212 | + : This can be one of two values: "module" or "schema".</li> |
213 | + : </ul> |
214 | + : <p>The function must return the empty sequence when the specified $namespace |
215 | + : or $entity are not the ones to be resolved.</p> |
216 | + : <p/> |
217 | + : <p>Example:</p> |
218 | + : <p/> |
219 | + : <code>declare function mymod:url-resolver($namespace as xs:string, $entity as xs:string) as item()? |
220 | : { |
221 | : if($namespace = 'http://test.xq') |
222 | : then "module namespace test = 'http://test'; declare function test:foo(){'foo'};" |
223 | : else () |
224 | - : }; |
225 | - : |
226 | - : The URL resolver function's namespace, name, and parameter naming are |
227 | - : not restricted by XQXQ. |
228 | - : |
229 | - : The URL resolver function's return type is not restricted, it could be a string, a sequence, |
230 | - : a node, etc. All the outputs types are to be serialized as a string. |
231 | - : |
232 | - : The third parameter is a function item for a URI mapper. |
233 | - : The URI mapper function, just like the URL resolver, receives 2 parameters: |
234 | - : A $namespace as xs:string that will contain the URI to be mapped. |
235 | - : A $entity as xs:string that will contain the type of resolving needed; |
236 | - : this can be 2 values "module" and "schema". |
237 | - : The URI mapper must return an empty sequence when the specified $namesapce or $entity |
238 | - : are not to be mapped. Unlike the URL resolver this function must return a sequence of strings. |
239 | - : |
240 | - : Example: |
241 | - : |
242 | - : declare function mymod:uri-mapper($namespace as xs:string, $entity as xs:string) |
243 | + : };</code> |
244 | + : <p/> |
245 | + : <p>The URL resolver function's namespace, name, and parameter naming are |
246 | + : not restricted by ZQ.</p> |
247 | + : <p/> |
248 | + : <p>The URL resolver function's return type is not restricted, it could be a string, a sequence, |
249 | + : a node, etc. All the outputs types are to be serialized as a string.</p> |
250 | + : <p/> |
251 | + : <p>The third parameter is a function item for a URI mapper.</p> |
252 | + : <ul>The URI mapper function, just like the URL resolver, receives 2 parameters: |
253 | + : <li>A $namespace as xs:string that will contain the URI to be mapped.</li> |
254 | + : <li>A $entity as xs:string that will contain the type of resolving needed. |
255 | + : This can be one of two values: "module" or "schema".</li> |
256 | + : </ul> |
257 | + : <p>The URI mapper must return an empty sequence when the specified $namesapce or $entity |
258 | + : are not to be mapped. Unlike the URL resolver this function must return a sequence of strings.</p> |
259 | + : <p/> |
260 | + : <p>Example:</p> |
261 | + : <p/> |
262 | + : <code>declare function mymod:uri-mapper($namespace as xs:string, $entity as xs:string) |
263 | : { |
264 | : if($namespace = 'http://test') |
265 | - : then ("http://www.zorba-xquery.com/test", "http://foo.com/schema/test") |
266 | + : then ("http://zorba.io/test", "http://foo.com/schema/test") |
267 | : else () |
268 | - : }; |
269 | - : |
270 | - : The URI mapper function's namespace, name, and parameter naming are |
271 | - : not restricted by XQXQ. |
272 | - : |
273 | - : In order to pass the above URL resolver and URI mapper to this function, |
274 | - : use the following syntax: |
275 | - : |
276 | - : variable $queryID := xqxq:prepare-main-module("..query text..", |
277 | - : mymod:url-resolver#2, mymod:uri-mapper#2); |
278 | - : |
279 | - : That is, the QName of the function followed by "#2". This is XQuery |
280 | + : };</code> |
281 | + : <p/> |
282 | + : <p>The URI mapper function's namespace, name, and parameter naming are |
283 | + : not restricted by ZQ.</p> |
284 | + : <p/> |
285 | + : <p>In order to pass the above URL resolver and URI mapper to this function, |
286 | + : use the following syntax:</p> |
287 | + : <p/> |
288 | + : <code>variable $queryID := zq:prepare-main-module("..query text..", |
289 | + : mymod:url-resolver#2, mymod:uri-mapper#2);</code> |
290 | + : <p/> |
291 | + : <p>That is, the QName of the function followed by "#2". This is XQuery |
292 | : "higher-order function" syntax, meaning the function with the specified |
293 | : QName which takes two arguments. Since URL resolvers and URI mappers |
294 | - : must take two arguments, both will always be specified with "#2". |
295 | - : |
296 | - : Note that parameters 2 and 3 should be declared as follows: |
297 | - : as function($url as xs:string, $entity as xs:string) as item() |
298 | - : as function($uri as xs:string, $entity as xs:string) as xs:string* |
299 | - : However Zorba's implementation of higher-order functions (HOF) is not |
300 | - : yet complete enough to allow for this. When Zorba's HOF implementation |
301 | - : is complete this function signature will be changed. |
302 | - : |
303 | - : Both the URL resolver and URI mapper functions are optional, meaning you |
304 | - : may pass the empty-sequence () for either. |
305 | - : |
306 | - : Successfully prepared queries need to be deleted by passing the resulting |
307 | - : identifier to the xqxq:delete-query function of this module. |
308 | - : |
309 | - : @param $main-module-text the XQuery program that should be prepared. |
310 | - : The program needs to be a XQuery main module. |
311 | + : must take two arguments, both will always be specified with "#2".</p> |
312 | + : <p/> |
313 | + : <p>Both the URL resolver and URI mapper functions are optional, meaning you |
314 | + : may pass the empty-sequence () for either.</p> |
315 | + : <p/> |
316 | + : <p>Successfully prepared queries need to be deleted by passing the resulting |
317 | + : identifier to the zq:delete-query function of this module.</p> |
318 | + : |
319 | + : @param $main-module-text the query that should be prepared. |
320 | + : The query needs to be a XQuery or JSONiq main module. |
321 | : |
322 | : @param $resolver the URL resolver function. |
323 | : |
324 | : @param $mapper the URI mapper function. |
325 | : |
326 | - : @return an identifier for the compiled program that can be passed |
327 | + : @return an identifier for the compiled query that can be passed |
328 | : as arguments to other functions of this module. |
329 | : |
330 | : @error any (static or type) error that may be raised during the compilation |
331 | - : of the query. For example, err:XPST0003 if the given XQuery program could |
332 | + : of the query. For example, err:XPST0003 if the given query could |
333 | : not be parsed. |
334 | :) |
335 | -declare %an:sequential function xqxq:prepare-main-module($main-module-text as xs:string, $resolver as item()?, $mapper as item()?) as |
336 | - xs:anyURI external; |
337 | +declare %an:sequential function zq:prepare-main-module( |
338 | + $main-module-text as xs:string, |
339 | + $resolver as ( function(xs:string, xs:string) as item()? )?, |
340 | + $mapper as ( function(xs:string, xs:string) as xs:string* )? ) as |
341 | + xs:anyURI external; |
342 | |
343 | (:~ |
344 | - : This function compiles a given XQuery library module. It can be used |
345 | - : to compile-check a module. |
346 | + : <p>This function compiles a given XQuery or JSONiq library module. |
347 | + : It can be used to compile-check a module.</p> |
348 | : |
349 | - : @param $library-module-text the XQuery library module that should |
350 | + : @param $library-module-text the library module that should |
351 | : be prepared. |
352 | : |
353 | - : @return the function is declared as sequential.It returns the |
354 | - : empty-sequence. |
355 | + : @return the empty-sequence. |
356 | : |
357 | : @error any (static or type) error that may be raised during the compilation |
358 | - : of the library module. For example, err:XPST0003 if the given XQuery library |
359 | + : of the library module. For example, err:XPST0003 if the given library |
360 | : module could not be parsed. |
361 | :) |
362 | -declare %an:sequential function xqxq:prepare-library-module($library-module-text as xs:string) as |
363 | +declare %an:sequential function zq:prepare-library-module($library-module-text as xs:string) as |
364 | empty-sequence() external ; |
365 | |
366 | (:~ |
367 | - : The function tests if the context-item is bound for the |
368 | - : execution of the query referred to by the given query identifier. |
369 | + : <p>The function tests if the context-item is bound for the |
370 | + : execution of the query referred to by the given query identifier.</p> |
371 | : |
372 | : @param $query-key the identifier for a compiled query |
373 | : |
374 | : @return true if the context-item is bound, false otherwise. |
375 | : |
376 | - : @error xqxq:NoQueryMatch if no query with the given identifier |
377 | + : @error zq:NO_QUERY_MATCH if no query with the given identifier |
378 | : was prepared. |
379 | :) |
380 | -declare function xqxq:is-bound-context-item($query-key as xs:anyURI) |
381 | +declare function zq:is-bound-context-item($query-key as xs:anyURI) |
382 | as xs:boolean external; |
383 | |
384 | |
385 | (:~ |
386 | - : The function tests if the given variable is bound for the |
387 | - : execution of the query referred to by the given query identifier. |
388 | + : <p>The function tests if the given variable is bound for the |
389 | + : execution of the query referred to by the given query identifier.</p> |
390 | : |
391 | : @param $query-key the identifier for a compiled query |
392 | : @param $var-name the name of the variable |
393 | : |
394 | : @return true if the variable is bound, false otherwise. |
395 | : |
396 | - : @error xqxq:NoQueryMatch if no query with the given identifier |
397 | + : @error zq:NO_QUERY_MATCH if no query with the given identifier |
398 | : was prepared. |
399 | - : @error xqxq:UndeclaredVariable if the given variable is not declared |
400 | + : @error zq:UNDECLARED_VARIABLE if the given variable is not declared |
401 | : in the query. |
402 | :) |
403 | -declare function xqxq:is-bound-variable($query-key as xs:anyURI, $var-name as |
404 | +declare function zq:is-bound-variable($query-key as xs:anyURI, $var-name as |
405 | xs:QName) as xs:boolean external; |
406 | |
407 | (:~ |
408 | - : The function returns the names of the external variables that |
409 | + : <p>The function returns the names of the external variables that |
410 | : are declared in the given query (either in the main module or |
411 | - : in any of the imported library modules). |
412 | + : in any of the imported library modules).</p> |
413 | : |
414 | : @param $query-key the identifier for a compiled query |
415 | : |
416 | : @return the sequence of names of the said external variables. |
417 | : |
418 | - : @error xqxq:NoQueryMatch if no query with the given identifier |
419 | + : @error zq:NO_QUERY_MATCH if no query with the given identifier |
420 | : was prepared. |
421 | :) |
422 | -declare function xqxq:external-variables($query-key as xs:anyURI) as |
423 | +declare function zq:external-variables($query-key as xs:anyURI) as |
424 | xs:QName* external ; |
425 | |
426 | (:~ |
427 | - : The function tests if the query identified by the given key |
428 | - : is an updating query. |
429 | + : <p>The function tests if the query identified by the given key |
430 | + : is an updating query.</p> |
431 | : |
432 | : @param $query-key the identifier for a compiled query |
433 | : |
434 | : @return true if the query is an updating query, false otherwise. |
435 | : |
436 | - : @error xqxq:NoQueryMatch if no query with the given identifier |
437 | + : @error zq:NO_QUERY_MATCH if no query with the given identifier |
438 | : was prepared. |
439 | :) |
440 | -declare function xqxq:is-updating($query-key as xs:anyURI) as |
441 | +declare function zq:is-updating($query-key as xs:anyURI) as |
442 | xs:boolean external; |
443 | |
444 | (:~ |
445 | - : The function tests if the query identified by the given key |
446 | - : is sequential query. |
447 | + : <p>The function tests if the query identified by the given key |
448 | + : is sequential query.</p> |
449 | : |
450 | : @param $query-key the identifier for a compiled query |
451 | : |
452 | : @return true if the query is a sequential, false otherwise. |
453 | : |
454 | - : @error xqxq:NoQueryMatch if no query with the given identifier |
455 | + : @error zq:NO_QUERY_MATCH if no query with the given identifier |
456 | : was prepared. |
457 | :) |
458 | -declare function xqxq:is-sequential($query-key as xs:anyURI) as |
459 | +declare function zq:is-sequential($query-key as xs:anyURI) as |
460 | xs:boolean external; |
461 | |
462 | (:~ |
463 | - : This function binds the context-item of the prepared query |
464 | - : identified by the given key to the $dot argument. |
465 | + : <p>This function binds the context-item of the prepared query |
466 | + : identified by the given key to the $dot argument.</p> |
467 | : |
468 | : @param $query-key the identifier for a compiled query |
469 | : @param $dot the context item to bind |
470 | @@ -259,15 +256,15 @@ |
471 | : @return the function has side effects and returns the empty |
472 | : sequence. |
473 | : |
474 | - : @error xqxq:NoQueryMatch if no query with the given identifier |
475 | + : @error zq:NO_QUERY_MATCH if no query with the given identifier |
476 | : was prepared. |
477 | :) |
478 | -declare %an:sequential function xqxq:bind-context-item($query-key as xs:anyURI, |
479 | +declare %an:sequential function zq:bind-context-item($query-key as xs:anyURI, |
480 | $dot as item()) as empty-sequence() external ; |
481 | |
482 | (:~ |
483 | - : This function binds the variable with name $name of |
484 | - : the prepared query identified by $query-key to the given sequence. |
485 | + : <p>This function binds the variable with name $name of |
486 | + : the prepared query identified by $query-key to the given sequence.</p> |
487 | : |
488 | : @param $query-key the identifier for a compiled query |
489 | : @param $name the name of the external variable to bind |
490 | @@ -277,195 +274,193 @@ |
491 | : @return the function has side effects and returns the empty |
492 | : sequence. |
493 | : |
494 | - : @error xqxq:NoQueryMatch if no query with the given identifier |
495 | + : @error zq:NO_QUERY_MATCH if no query with the given identifier |
496 | : was prepared. |
497 | - : @error xqxq:UndeclaredVariable if the given variable is not declared |
498 | + : @error zq:UNDECLARED_VARIABLE if the given variable is not declared |
499 | : in the query. |
500 | :) |
501 | -declare %an:sequential function xqxq:bind-variable($query-key as xs:anyURI, |
502 | +declare %an:sequential function zq:bind-variable($query-key as xs:anyURI, |
503 | $var as xs:QName, $value as item()*) as empty-sequence() external ; |
504 | |
505 | |
506 | (:~ |
507 | - : Evaluates the given prepared query and returns the result |
508 | + : <p>Evaluates the given prepared query and returns the result |
509 | : of the evaluation. The query must not be sequential or |
510 | - : updating. |
511 | + : updating.</p> |
512 | : |
513 | : @param $query-key the identifier for a compiled query |
514 | : |
515 | : @return the result of evaluating the given query |
516 | : |
517 | - : @error xqxq:NoQueryMatch if no query with the given identifier |
518 | + : @error zq:NO_QUERY_MATCH if no query with the given identifier |
519 | : was prepared. |
520 | : |
521 | - : @error xqxq:QueryIsUpdating if the query is an updating query. |
522 | + : @error zq:QUERY_IS_UPDATING if the query is an updating query. |
523 | : |
524 | - : @error xqxq:QueryIsSequential if the query is sequential. |
525 | + : @error zq:QUERY_IS_SEQUENTIAL if the query is sequential. |
526 | : |
527 | : @error any dynamic error that is raised by evaluating the |
528 | : given query. |
529 | : |
530 | :) |
531 | -declare function xqxq:evaluate($query-key as xs:anyURI) as item()* external; |
532 | +declare function zq:evaluate($query-key as xs:anyURI) as item()* external; |
533 | |
534 | (:~ |
535 | - : Evaluates the given prepared query and applies the updates |
536 | - : computed by this query. The query must be an updating query. |
537 | + : <p>Evaluates the given prepared query and applies the updates |
538 | + : computed by this query. The query must be an updating query.</p> |
539 | : |
540 | : @param $query-key the identifier for a compiled query |
541 | : |
542 | : @return the function has side effects because it applies |
543 | : the updates of the query. It returns the empty sequence. |
544 | : |
545 | - : @error xqxq:NoQueryMatch if no query with the given identifier |
546 | + : @error zq:NO_QUERY_MATCH if no query with the given identifier |
547 | : was prepared. |
548 | : |
549 | - : @error xqxq:QueryNotUpdating if the query is not an updating query. |
550 | + : @error zq:QUERY_NOT_UPDATING if the query is not an updating query. |
551 | : |
552 | - : @error xqxq:QueryIsSequential if the query is sequential. |
553 | + : @error zq:QUERY_IS_SEQUENTIAL if the query is sequential. |
554 | : |
555 | : @error any dynamic error that is raised by evaluating the |
556 | : given query or applying its updates. |
557 | : |
558 | :) |
559 | -declare updating function xqxq:evaluate-updating($query-key as xs:anyURI) external; |
560 | +declare updating function zq:evaluate-updating($query-key as xs:anyURI) external; |
561 | |
562 | (:~ |
563 | - : Evaluates the given prepared query and returns the result |
564 | - : of the evaluation. The query must be sequential. |
565 | + : <p>Evaluates the given prepared query and returns the result |
566 | + : of the evaluation. The query must be sequential.</p> |
567 | : |
568 | : @param $query-key the identifier for a compiled query |
569 | : |
570 | : @return the result of evaluating the query. |
571 | : |
572 | - : @error xqxq:NoQueryMatch if no query with the given identifier |
573 | + : @error zq:NO_QUERY_MATCH if no query with the given identifier |
574 | : was prepared. |
575 | : |
576 | - : @error xqxq:QueryNotSequential if the query is not sequential. |
577 | + : @error zq:QUERY_NOT_SEQUENTIAL if the query is not sequential. |
578 | : |
579 | - : @error xqxq:QueryIsUpdating if the query is an updating query. |
580 | + : @error zq:QUERY_IS_UPDATING if the query is an updating query. |
581 | : |
582 | : @error any dynamic error that is raised by evaluating the |
583 | : given query. |
584 | : |
585 | :) |
586 | -declare %an:sequential function xqxq:evaluate-sequential($query-key as |
587 | +declare %an:sequential function zq:evaluate-sequential($query-key as |
588 | xs:string) as item()* external; |
589 | |
590 | (:~ |
591 | - : Deletes the prepared query associated with the given identifier. |
592 | - : After the query is deleted, the corresponding identifier should |
593 | - : not be used as argument to any of the functions of this module. |
594 | + : <p>Deletes the prepared query associated with the given identifier.</p> |
595 | + : <p>After the query is deleted, the corresponding identifier should |
596 | + : not be used as argument to any of the functions of this module.</p> |
597 | : |
598 | : @param $query-key the identifier for a compiled query |
599 | : |
600 | : @return the function has side effects and returns the empty sequence. |
601 | : |
602 | - : @error xqxq:NoQueryMatch if no query with the given identifier |
603 | + : @error zq:NO_QUERY_MATCH if no query with the given identifier |
604 | : was prepared. |
605 | : |
606 | :) |
607 | -declare %an:sequential function xqxq:delete-query($query-key as xs:anyURI) as |
608 | +declare %an:sequential function zq:delete-query($query-key as xs:anyURI) as |
609 | empty-sequence() external; |
610 | |
611 | (:~ |
612 | - : This function returns the value of a variable that is bound in the |
613 | - : given query. |
614 | + : <p>This function returns the value of a variable that is bound in the |
615 | + : given query.</p> |
616 | : |
617 | : @param $query-key the identifier of a compiled query. |
618 | : @param $var-name the name of the variable whose value should be returned. |
619 | : |
620 | : @return the value bound to the given variable. |
621 | : |
622 | - : @error xqxq:NoQueryMatch if no query with the given identifier |
623 | + : @error zq:NO_QUERY_MATCH if no query with the given identifier |
624 | : was prepared. |
625 | - : @error xqxq:UndeclaredVariable if the given variable is not declared |
626 | + : @error zq:UNDECLARED_VARIABLE if the given variable is not declared |
627 | : in the query. |
628 | - : @error xqxq:UnboundVariable if the given variable doesn't have a value. |
629 | + : @error zq:UNBOUND_VARIABLE if the given variable doesn't have a value. |
630 | :) |
631 | -declare function xqxq:variable-value($query-key as xs:anyURI, $var-name as |
632 | +declare function zq:variable-value($query-key as xs:anyURI, $var-name as |
633 | xs:QName) as item()* external; |
634 | |
635 | (:~ |
636 | - : Returns the compiled query identified by the given query-key |
637 | - : as binary data. |
638 | + : <p>Returns the compiled query identified by the given query-key |
639 | + : as binary data.</p> |
640 | : |
641 | : @param $query-key the identifier of a compiled query. |
642 | : |
643 | : @return the query as xs:base64Binary. |
644 | : |
645 | - : @error xqxq:NoQueryMatch if no query with the given identifier |
646 | + : @error zq:NO_QUERY_MATCH if no query with the given identifier |
647 | : was prepared. |
648 | - : @error xqxq:QueryPlanError if there is an error serializing the query. |
649 | + : @error zq:NO_QUERY_PLAN if there is an error serializing the query. |
650 | :) |
651 | -declare function xqxq:query-plan($query-key as xs:anyURI) |
652 | +declare function zq:query-plan($query-key as xs:anyURI) |
653 | as xs:base64Binary external; |
654 | |
655 | |
656 | (:~ |
657 | - : The function loads a given XQuery program for execution from a |
658 | - : xs:base64Binary query plan, obtained through the xqxq:query-plan function. |
659 | - : If the program was successfully loaded, the function returns an |
660 | + : <p>The function loads a given query for execution from a |
661 | + : xs:base64Binary query plan, obtained through the zq:query-plan function.</p> |
662 | + : <p>If the query was successfully loaded, the function returns an |
663 | : identifier as xs:anyURI. This URI can be passed to other functions |
664 | - : of this module (e.g. to actually evaluate the program). The URI |
665 | - : is opaque and its lifetime is bound by the lifetime of the XQuery |
666 | - : program that invoked this function. Further reference or uses |
667 | - : of the identifier lead to unexpected results. |
668 | - : |
669 | - : Successfully prepared queries need to be deleted by passing the resulting |
670 | - : identifier to the xqxq:delete-query function of this module. |
671 | - : |
672 | - : @param $main-module-text the XQuery program that should be prepared. |
673 | - : The program needs to be a XQuery main module. |
674 | - : |
675 | - : @return an identifier for the compiled program that can be passed |
676 | + : of this module (e.g. to actually evaluate the query). The URI |
677 | + : is opaque and its lifetime is bound by the lifetime of the query |
678 | + : that invoked this function. Further reference or uses |
679 | + : of the identifier lead to unexpected results.</p> |
680 | + : <p/> |
681 | + : <p>Successfully prepared queries need to be deleted by passing the resulting |
682 | + : identifier to the zq:delete-query function of this module.</p> |
683 | + : |
684 | + : @param $plan the binary query plan. |
685 | + : |
686 | + : @return an identifier for the compiled query that can be passed |
687 | : as arguments to other functions of this module. |
688 | : |
689 | : @error any (static or type) error that may be raised during the compilation |
690 | - : of the query. For example, err:XPST0003 if the given XQuery program could |
691 | + : of the query. For example, err:XPST0003 if the given query could |
692 | : not be parsed. |
693 | :) |
694 | -declare function xqxq:load-from-query-plan($plan as xs:base64Binary) |
695 | +declare function zq:load-from-query-plan($plan as xs:base64Binary) |
696 | as xs:anyURI external; |
697 | |
698 | (:~ |
699 | - : The function loads a given XQuery program for execution from a |
700 | - : xs:base64Binary query plan, obtained through the xqxq:query-plan function. |
701 | - : If the program was successfully loaded, the function returns an |
702 | + : <p>The function loads a given query for execution from a |
703 | + : xs:base64Binary query plan, obtained through the zq:query-plan function.</p> |
704 | + : <p>If the query was successfully loaded, the function returns an |
705 | : identifier as xs:anyURI. This URI can be passed to other functions |
706 | - : of this module (e.g. to actually evaluate the program). The URI |
707 | - : is opaque and its lilfetime is bound by the lifetime of the XQuery |
708 | - : program that invoked this function. Further reference or uses |
709 | - : of the identifier lead to unexpected results. |
710 | - : |
711 | - : For important notes regarding the second and third parameters of the |
712 | - : function, review the comments in xqxq:prepare-main-module#3. |
713 | - : |
714 | - : Successfully prepared queries need to be deleted by passing the resulting |
715 | - : identifier to the xqxq:delete-query function of this module. |
716 | - : |
717 | - : @param $main-module-text the XQuery program that should be prepared. |
718 | - : The program needs to be a XQuery main module. |
719 | + : of this module (e.g. to actually evaluate the query). The URI |
720 | + : is opaque and its lilfetime is bound by the lifetime of the query |
721 | + : that invoked this function. Further reference or uses |
722 | + : of the identifier lead to unexpected results.</p> |
723 | + : <p/> |
724 | + : <p>For important notes regarding the second and third parameters of the |
725 | + : function, review the comments in zq:prepare-main-module#3.</p> |
726 | + : <p/> |
727 | + : <p>Successfully prepared queries need to be deleted by passing the resulting |
728 | + : identifier to the zq:delete-query function of this module.</p> |
729 | + : |
730 | + : @param $plan the binary query plan. |
731 | : |
732 | : @param $resolver the URL resolver function. |
733 | : |
734 | : @param $mapper the URI mapper function. |
735 | : |
736 | - : @return an identifier for the compiled program that can be passed |
737 | + : @return an identifier for the compiled query that can be passed |
738 | : as arguments to other functions of this module. |
739 | : |
740 | : @error any (static or type) error that may be raised during the compilation |
741 | - : of the query. For example, err:XPST0003 if the given XQuery program could |
742 | + : of the query. For example, err:XPST0003 if the given query could |
743 | : not be parsed. |
744 | :) |
745 | -declare function xqxq:load-from-query-plan($plan as xs:base64Binary, |
746 | +declare function zq:load-from-query-plan($plan as xs:base64Binary, |
747 | $resolver as item()?, $mapper as item()?) as xs:anyURI external; |
748 | |
749 | (:~ |
750 | - : Internal helper function. Only necessary because of incomplete HOF |
751 | - : support in Zorba. |
752 | + : <p>Internal helper function. Only necessary because of incomplete HOF |
753 | + : support in Zorba.</p> |
754 | :) |
755 | -declare %private function xqxq:hof-invoker($hof as item(), |
756 | +declare %private function zq:hof-invoker($hof as item(), |
757 | $ns as xs:string, $entity as xs:string) as item()* |
758 | { |
759 | $hof($ns, $entity) |
760 | |
761 | === renamed directory 'modules/xqxq/xqxq.xq.src' => 'modules/zorba-query/zorba-query.xq.src' |
762 | === renamed file 'modules/xqxq/xqxq.xq.src/xqxq.cpp' => 'modules/zorba-query/zorba-query.xq.src/zorba-query.cpp' |
763 | --- modules/xqxq/xqxq.xq.src/xqxq.cpp 2013-08-01 11:24:18 +0000 |
764 | +++ modules/zorba-query/zorba-query.xq.src/zorba-query.cpp 2013-08-14 06:22:56 +0000 |
765 | @@ -13,15 +13,15 @@ |
766 | #include <zorba/util/uuid.h> |
767 | #include <vector> |
768 | |
769 | -#include "xqxq.h" |
770 | +#include "zorba-query.h" |
771 | |
772 | -namespace zorba { namespace xqxq { |
773 | +namespace zorba { namespace zorbaquery { |
774 | |
775 | /******************************************************************************* |
776 | |
777 | ********************************************************************************/ |
778 | zorba::ExternalFunction* |
779 | -XQXQModule::getExternalFunction(const zorba::String& localName) |
780 | +ZorbaQueryModule::getExternalFunction(const zorba::String& localName) |
781 | { |
782 | FuncMap_t::iterator lIte = theFunctions.find(localName); |
783 | |
784 | @@ -102,7 +102,7 @@ |
785 | /******************************************************************************* |
786 | |
787 | ********************************************************************************/ |
788 | -void XQXQModule::destroy() |
789 | +void ZorbaQueryModule::destroy() |
790 | { |
791 | delete this; |
792 | } |
793 | @@ -111,7 +111,7 @@ |
794 | /******************************************************************************* |
795 | |
796 | ********************************************************************************/ |
797 | -XQXQModule::~XQXQModule() |
798 | +ZorbaQueryModule::~ZorbaQueryModule() |
799 | { |
800 | for (FuncMap_t::const_iterator lIter = theFunctions.begin(); |
801 | lIter != theFunctions.end(); ++lIter) |
802 | @@ -229,11 +229,11 @@ |
803 | /******************************************************************************* |
804 | |
805 | ********************************************************************************/ |
806 | -void XQXQFunction::throwError(const char *err_localname, const std::string& aErrorMessage) |
807 | +void ZorbaQueryFunction::throwError(const char *err_localname, const std::string& aErrorMessage) |
808 | { |
809 | - String errNS(XQXQ_MODULE_NAMESPACE); |
810 | + String errNS(ZORBA_QUERY_MODULE_NAMESPACE); |
811 | String errName(err_localname); |
812 | - Item errQName = XQXQModule::getItemFactory()->createQName(errNS, errName); |
813 | + Item errQName = ZorbaQueryModule::getItemFactory()->createQName(errNS, errName); |
814 | String errDescription(aErrorMessage); |
815 | throw USER_EXCEPTION(errQName, errDescription); |
816 | } |
817 | @@ -242,7 +242,7 @@ |
818 | /******************************************************************************* |
819 | |
820 | ********************************************************************************/ |
821 | -XQXQFunction::XQXQFunction(const XQXQModule* aModule) |
822 | +ZorbaQueryFunction::ZorbaQueryFunction(const ZorbaQueryModule* aModule) |
823 | : |
824 | theModule(aModule) |
825 | { |
826 | @@ -253,7 +253,7 @@ |
827 | /******************************************************************************* |
828 | |
829 | ********************************************************************************/ |
830 | -XQXQFunction::~XQXQFunction() |
831 | +ZorbaQueryFunction::~ZorbaQueryFunction() |
832 | { |
833 | } |
834 | |
835 | @@ -261,7 +261,7 @@ |
836 | /******************************************************************************* |
837 | |
838 | ********************************************************************************/ |
839 | -String XQXQFunction::getURI() const |
840 | +String ZorbaQueryFunction::getURI() const |
841 | { |
842 | return theModule->getURI(); |
843 | } |
844 | @@ -270,7 +270,7 @@ |
845 | /******************************************************************************* |
846 | |
847 | ********************************************************************************/ |
848 | -String XQXQFunction::getOneStringArgument(const Arguments_t& aArgs, int aPos) const |
849 | +String ZorbaQueryFunction::getOneStringArgument(const Arguments_t& aArgs, int aPos) const |
850 | { |
851 | Item lItem; |
852 | Iterator_t args_iter = aArgs[aPos]->getIterator(); |
853 | @@ -285,7 +285,7 @@ |
854 | /******************************************************************************* |
855 | |
856 | ********************************************************************************/ |
857 | -Item XQXQFunction::getItemArgument(const Arguments_t& aArgs, int aPos) const |
858 | +Item ZorbaQueryFunction::getItemArgument(const Arguments_t& aArgs, int aPos) const |
859 | { |
860 | Item lItem; |
861 | Iterator_t args_iter = aArgs[aPos]->getIterator(); |
862 | @@ -300,7 +300,7 @@ |
863 | /******************************************************************************* |
864 | |
865 | ********************************************************************************/ |
866 | -Iterator_t XQXQFunction::getIterArgument(const Arguments_t& aArgs, int aPos) const |
867 | +Iterator_t ZorbaQueryFunction::getIterArgument(const Arguments_t& aArgs, int aPos) const |
868 | { |
869 | Iterator_t args_iter = aArgs[aPos]->getIterator(); |
870 | return args_iter; |
871 | @@ -310,21 +310,21 @@ |
872 | /******************************************************************************* |
873 | |
874 | ********************************************************************************/ |
875 | -XQuery_t XQXQFunction::getQuery( |
876 | +XQuery_t ZorbaQueryFunction::getQuery( |
877 | const zorba::DynamicContext* aDctx, |
878 | const zorba::String& aIdent) const |
879 | { |
880 | QueryMap* lQueryMap; |
881 | |
882 | if (!(lQueryMap = |
883 | - dynamic_cast<QueryMap*>(aDctx->getExternalFunctionParameter("xqxqQueryMap")))) |
884 | + dynamic_cast<QueryMap*>(aDctx->getExternalFunctionParameter("zqQueryMap")))) |
885 | { |
886 | - throwError("NoQueryMatch", "No query with the given identifier was found"); |
887 | + throwError("NO_QUERY_MATCH", "No query with the given identifier was found"); |
888 | } |
889 | |
890 | XQuery_t lQuery; |
891 | if (!(lQuery = lQueryMap->getQuery(aIdent))) |
892 | - throwError("NoQueryMatch", "No query with the given identifier was found"); |
893 | + throwError("NO_QUERY_MATCH", "No query with the given identifier was found"); |
894 | |
895 | return lQuery; |
896 | } |
897 | @@ -333,7 +333,7 @@ |
898 | /******************************************************************************* |
899 | |
900 | ********************************************************************************/ |
901 | -void XQXQURIMapper::mapURI( |
902 | +void ZorbaQueryURIMapper::mapURI( |
903 | String aUri, |
904 | EntityData const* aEntityData, |
905 | std::vector<String>& oUris) |
906 | @@ -355,15 +355,15 @@ |
907 | //construct the arguments for the url resolver |
908 | std::vector<ItemSequence_t> lArgs; |
909 | ItemSequence_t lSeq0 = new SingletonItemSequence(theFunction); |
910 | - ItemSequence_t lSeq1 = new SingletonItemSequence(XQXQModule::getItemFactory()->createString(aUri)); |
911 | - ItemSequence_t lSeq2 = new SingletonItemSequence(XQXQModule::getItemFactory()->createString(lDataKind)); |
912 | + ItemSequence_t lSeq1 = new SingletonItemSequence(ZorbaQueryModule::getItemFactory()->createString(aUri)); |
913 | + ItemSequence_t lSeq2 = new SingletonItemSequence(ZorbaQueryModule::getItemFactory()->createString(lDataKind)); |
914 | lArgs.push_back(lSeq0); |
915 | lArgs.push_back(lSeq1); |
916 | lArgs.push_back(lSeq2); |
917 | |
918 | //invoke the HOF helper function using the arguments generated |
919 | - Item lHofHelper = XQXQModule::getItemFactory()-> |
920 | - createQName("http://www.zorba-xquery.com/modules/xqxq", "xqxq", "hof-invoker"); |
921 | + Item lHofHelper = ZorbaQueryModule::getItemFactory()-> |
922 | + createQName("http://zorba.io/modules/zorba-query", "zq", "hof-invoker"); |
923 | |
924 | ItemSequence_t lResult = theCtx->invoke(lHofHelper, lArgs); |
925 | |
926 | @@ -384,7 +384,7 @@ |
927 | /******************************************************************************* |
928 | |
929 | ********************************************************************************/ |
930 | -Resource* XQXQURLResolver::resolveURL( |
931 | +Resource* ZorbaQueryURLResolver::resolveURL( |
932 | const String& aUrl, |
933 | EntityData const* aEntityData) |
934 | { |
935 | @@ -405,15 +405,15 @@ |
936 | //construct the arguments for the url resolver |
937 | std::vector<ItemSequence_t> lArgs; |
938 | ItemSequence_t lSeq0 = new SingletonItemSequence(theFunction); |
939 | - ItemSequence_t lSeq1 = new SingletonItemSequence(XQXQModule::getItemFactory()->createString(aUrl)); |
940 | - ItemSequence_t lSeq2 = new SingletonItemSequence(XQXQModule::getItemFactory()->createString(lDataKind)); |
941 | + ItemSequence_t lSeq1 = new SingletonItemSequence(ZorbaQueryModule::getItemFactory()->createString(aUrl)); |
942 | + ItemSequence_t lSeq2 = new SingletonItemSequence(ZorbaQueryModule::getItemFactory()->createString(lDataKind)); |
943 | lArgs.push_back(lSeq0); |
944 | lArgs.push_back(lSeq1); |
945 | lArgs.push_back(lSeq2); |
946 | |
947 | //invoke the HOF helper function using the arguments generated |
948 | - Item lHofHelper = XQXQModule::getItemFactory()-> |
949 | - createQName("http://www.zorba-xquery.com/modules/xqxq", "xqxq", "hof-invoker"); |
950 | + Item lHofHelper = ZorbaQueryModule::getItemFactory()-> |
951 | + createQName("http://zorba.io/modules/zorba-query", "zq", "hof-invoker"); |
952 | |
953 | ItemSequence_t lResult = theCtx->invoke(lHofHelper, lArgs); |
954 | |
955 | @@ -459,10 +459,10 @@ |
956 | StaticContext_t lSctxChild = aSctx->createChildContext(); |
957 | |
958 | QueryMap* lQueryMap; |
959 | - if (!(lQueryMap = dynamic_cast<QueryMap*>(lDynCtx->getExternalFunctionParameter("xqxqQueryMap")))) |
960 | + if (!(lQueryMap = dynamic_cast<QueryMap*>(lDynCtx->getExternalFunctionParameter("zqQueryMap")))) |
961 | { |
962 | lQueryMap = new QueryMap(); |
963 | - lDynCtx->addExternalFunctionParameter("xqxqQueryMap", lQueryMap); |
964 | + lDynCtx->addExternalFunctionParameter("zqQueryMap", lQueryMap); |
965 | } |
966 | |
967 | Zorba* lZorba = Zorba::getInstance(0); |
968 | @@ -473,15 +473,15 @@ |
969 | |
970 | StaticContext_t ltempSctx = lZorba->createStaticContext(); |
971 | |
972 | - std::auto_ptr<XQXQURLResolver> lResolver; |
973 | - std::auto_ptr<XQXQURIMapper> lMapper; |
974 | + std::auto_ptr<ZorbaQueryURLResolver> lResolver; |
975 | + std::auto_ptr<ZorbaQueryURIMapper> lMapper; |
976 | |
977 | if ( aArgs.size() > 2 ) |
978 | { |
979 | Item lMapperFunctionItem = getItemArgument(aArgs, 2); |
980 | if (!lMapperFunctionItem.isNull()) |
981 | { |
982 | - lMapper.reset(new XQXQURIMapper(lMapperFunctionItem, lSctxChild)); |
983 | + lMapper.reset(new ZorbaQueryURIMapper(lMapperFunctionItem, lSctxChild)); |
984 | ltempSctx->registerURIMapper(lMapper.get()); |
985 | } |
986 | } |
987 | @@ -491,7 +491,7 @@ |
988 | Item lResolverFunctionItem = getItemArgument(aArgs, 1); |
989 | if (!lResolverFunctionItem.isNull()) |
990 | { |
991 | - lResolver.reset(new XQXQURLResolver(lResolverFunctionItem, lSctxChild)); |
992 | + lResolver.reset(new ZorbaQueryURLResolver(lResolverFunctionItem, lSctxChild)); |
993 | ltempSctx->registerURLResolver(lResolver.get()); |
994 | } |
995 | } |
996 | @@ -505,12 +505,12 @@ |
997 | { |
998 | lQuery = NULL; |
999 | std::ostringstream err; |
1000 | - err << "The query compiled using xqxq:prepare-main-module raised an error at" |
1001 | + err << "The query compiled using zq:prepare-main-module raised an error at" |
1002 | << " file " << xe.source_uri() << " line " << xe.source_line() |
1003 | << " column " << xe.source_column() << ": " << xe.what(); |
1004 | // << " -- Query string : " << std::endl << lQueryString; |
1005 | |
1006 | - Item errQName = XQXQModule::getItemFactory()->createQName( |
1007 | + Item errQName = ZorbaQueryModule::getItemFactory()->createQName( |
1008 | xe.diagnostic().qname().ns(), |
1009 | xe.diagnostic().qname().localname()); |
1010 | throw USER_EXCEPTION(errQName, err.str()); |
1011 | @@ -519,10 +519,10 @@ |
1012 | { |
1013 | lQuery = NULL; |
1014 | std::ostringstream err; |
1015 | - err << "The query compiled using xqxq:prepare-main-module raised an error: " |
1016 | + err << "The query compiled using zq:prepare-main-module raised an error: " |
1017 | << e.what(); |
1018 | |
1019 | - Item errQName = XQXQModule::getItemFactory()-> |
1020 | + Item errQName = ZorbaQueryModule::getItemFactory()-> |
1021 | createQName(e.diagnostic().qname().ns(), e.diagnostic().qname().localname()); |
1022 | |
1023 | throw USER_EXCEPTION(errQName, err.str()); |
1024 | @@ -538,7 +538,7 @@ |
1025 | |
1026 | lQueryMap->storeQuery(lStrUUID, lQuery, lMapper.release(), lResolver.release()); |
1027 | |
1028 | - return ItemSequence_t(new SingletonItemSequence(XQXQModule::getItemFactory()->createAnyURI(lStrUUID))); |
1029 | + return ItemSequence_t(new SingletonItemSequence(ZorbaQueryModule::getItemFactory()->createAnyURI(lStrUUID))); |
1030 | } |
1031 | |
1032 | |
1033 | @@ -563,11 +563,11 @@ |
1034 | catch (XQueryException& xe) |
1035 | { |
1036 | std::ostringstream err; |
1037 | - err << "The query compiled using xqxq:prepare-library-module raised an error at" |
1038 | + err << "The query compiled using zq:prepare-library-module raised an error at" |
1039 | << " line " << xe.source_line() << " column " << xe.source_column() |
1040 | << ": " << xe.what(); |
1041 | |
1042 | - Item errQName = XQXQModule::getItemFactory()-> |
1043 | + Item errQName = ZorbaQueryModule::getItemFactory()-> |
1044 | createQName(xe.diagnostic().qname().ns(), xe.diagnostic().qname().localname()); |
1045 | |
1046 | throw USER_EXCEPTION(errQName, err.str()); |
1047 | @@ -575,10 +575,10 @@ |
1048 | catch (ZorbaException& e) |
1049 | { |
1050 | std::ostringstream err; |
1051 | - err << "The query compiled using xqxq:prepare-main-query raised an error: " |
1052 | + err << "The query compiled using zq:prepare-main-query raised an error: " |
1053 | << e.what(); |
1054 | |
1055 | - Item errQName = XQXQModule::getItemFactory()-> |
1056 | + Item errQName = ZorbaQueryModule::getItemFactory()-> |
1057 | createQName(e.diagnostic().qname().ns(), e.diagnostic().qname().localname()); |
1058 | |
1059 | throw USER_EXCEPTION(errQName, err.str()); |
1060 | @@ -595,14 +595,14 @@ |
1061 | const zorba::StaticContext* aSctx, |
1062 | const zorba::DynamicContext* aDctx) const |
1063 | { |
1064 | - String lQueryID = XQXQFunction::getOneStringArgument(aArgs, 0); |
1065 | + String lQueryID = ZorbaQueryFunction::getOneStringArgument(aArgs, 0); |
1066 | |
1067 | XQuery_t lQuery = getQuery(aDctx, lQueryID); |
1068 | |
1069 | bool lIsContextItemBound = lQuery->getDynamicContext()->isBoundContextItem(); |
1070 | |
1071 | return ItemSequence_t(new SingletonItemSequence( |
1072 | - XQXQModule::getItemFactory()->createBoolean(lIsContextItemBound))); |
1073 | + ZorbaQueryModule::getItemFactory()->createBoolean(lIsContextItemBound))); |
1074 | } |
1075 | |
1076 | |
1077 | @@ -614,11 +614,11 @@ |
1078 | const zorba::StaticContext* aSctx, |
1079 | const zorba::DynamicContext* aDctx) const |
1080 | { |
1081 | - String lQueryID = XQXQFunction::getOneStringArgument(aArgs, 0); |
1082 | + String lQueryID = ZorbaQueryFunction::getOneStringArgument(aArgs, 0); |
1083 | |
1084 | XQuery_t lQuery = getQuery(aDctx, lQueryID); |
1085 | |
1086 | - Item lVarQName = XQXQFunction::getItemArgument(aArgs, 1); |
1087 | + Item lVarQName = ZorbaQueryFunction::getItemArgument(aArgs, 1); |
1088 | bool lIsBoundVariable = false; |
1089 | |
1090 | try |
1091 | @@ -628,10 +628,10 @@ |
1092 | catch (ZorbaException& ze) |
1093 | { |
1094 | if (ze.diagnostic() == zerr::ZAPI0011_VARIABLE_NOT_DECLARED) |
1095 | - XQXQFunction::throwError("UndeclaredVariable", ze.what()); |
1096 | + ZorbaQueryFunction::throwError("UNDECLARED_VARIABLE", ze.what()); |
1097 | throw; // should not happen |
1098 | } |
1099 | - return ItemSequence_t(new SingletonItemSequence(XQXQModule::getItemFactory()->createBoolean(lIsBoundVariable))); |
1100 | + return ItemSequence_t(new SingletonItemSequence(ZorbaQueryModule::getItemFactory()->createBoolean(lIsBoundVariable))); |
1101 | } |
1102 | |
1103 | |
1104 | @@ -643,7 +643,7 @@ |
1105 | const zorba::StaticContext* aSctx, |
1106 | const zorba::DynamicContext* aDctx) const |
1107 | { |
1108 | - String lQueryID = XQXQFunction::getOneStringArgument(aArgs, 0); |
1109 | + String lQueryID = ZorbaQueryFunction::getOneStringArgument(aArgs, 0); |
1110 | |
1111 | XQuery_t lQuery = getQuery(aDctx, lQueryID); |
1112 | |
1113 | @@ -669,11 +669,11 @@ |
1114 | const zorba::StaticContext* aSctx, |
1115 | const zorba::DynamicContext* aDctx) const |
1116 | { |
1117 | - String lQueryID = XQXQFunction::getOneStringArgument(aArgs, 0); |
1118 | + String lQueryID = ZorbaQueryFunction::getOneStringArgument(aArgs, 0); |
1119 | |
1120 | XQuery_t lQuery = getQuery(aDctx, lQueryID); |
1121 | |
1122 | - return ItemSequence_t(new SingletonItemSequence(XQXQModule::getItemFactory()->createBoolean(lQuery->isUpdating()))); |
1123 | + return ItemSequence_t(new SingletonItemSequence(ZorbaQueryModule::getItemFactory()->createBoolean(lQuery->isUpdating()))); |
1124 | } |
1125 | |
1126 | |
1127 | @@ -685,11 +685,11 @@ |
1128 | const zorba::StaticContext* aSctx, |
1129 | const zorba::DynamicContext* aDctx) const |
1130 | { |
1131 | - String lQueryID = XQXQFunction::getOneStringArgument(aArgs, 0); |
1132 | + String lQueryID = ZorbaQueryFunction::getOneStringArgument(aArgs, 0); |
1133 | |
1134 | XQuery_t lQuery = getQuery(aDctx, lQueryID); |
1135 | |
1136 | - return ItemSequence_t(new SingletonItemSequence(XQXQModule::getItemFactory()->createBoolean(lQuery->isSequential()))); |
1137 | + return ItemSequence_t(new SingletonItemSequence(ZorbaQueryModule::getItemFactory()->createBoolean(lQuery->isSequential()))); |
1138 | } |
1139 | |
1140 | |
1141 | @@ -701,12 +701,12 @@ |
1142 | const zorba::StaticContext* aSctx, |
1143 | const zorba::DynamicContext* aDctx) const |
1144 | { |
1145 | - String lQueryID = XQXQFunction::getOneStringArgument(aArgs,0); |
1146 | + String lQueryID = ZorbaQueryFunction::getOneStringArgument(aArgs,0); |
1147 | |
1148 | XQuery_t lQuery = getQuery(aDctx, lQueryID); |
1149 | |
1150 | // shouldn't raise errors |
1151 | - Item lItemContext = XQXQFunction::getItemArgument(aArgs, 1); |
1152 | + Item lItemContext = ZorbaQueryFunction::getItemArgument(aArgs, 1); |
1153 | lQuery->getDynamicContext()->setContextItem(lItemContext); |
1154 | |
1155 | return ItemSequence_t(new EmptySequence()); |
1156 | @@ -721,7 +721,7 @@ |
1157 | const zorba::StaticContext* aSctx, |
1158 | const zorba::DynamicContext* aDctx) const |
1159 | { |
1160 | - XQXQFunction::throwError("ImplementationError", "This function is not implemented yet"); |
1161 | + ZorbaQueryFunction::throwError("ImplementationError", "This function is not implemented yet"); |
1162 | |
1163 | return ItemSequence_t(new EmptySequence()); |
1164 | } |
1165 | @@ -735,7 +735,7 @@ |
1166 | const zorba::StaticContext* aSctx, |
1167 | const zorba::DynamicContext* aDctx) const |
1168 | { |
1169 | - XQXQFunction::throwError("ImplementationError", "This function is not implemented yet"); |
1170 | + ZorbaQueryFunction::throwError("ImplementationError", "This function is not implemented yet"); |
1171 | |
1172 | return ItemSequence_t(new EmptySequence()); |
1173 | } |
1174 | @@ -749,13 +749,13 @@ |
1175 | const zorba::StaticContext* aSctx, |
1176 | const zorba::DynamicContext* aDctx) const |
1177 | { |
1178 | - String lQueryID = XQXQFunction::getOneStringArgument(aArgs,0); |
1179 | + String lQueryID = ZorbaQueryFunction::getOneStringArgument(aArgs,0); |
1180 | |
1181 | XQuery_t lQuery = getQuery(aDctx, lQueryID); |
1182 | |
1183 | - Item lVarQName = XQXQFunction::getItemArgument(aArgs, 1); |
1184 | + Item lVarQName = ZorbaQueryFunction::getItemArgument(aArgs, 1); |
1185 | |
1186 | - Iterator_t lVarValue = XQXQFunction::getIterArgument(aArgs, 2); |
1187 | + Iterator_t lVarValue = ZorbaQueryFunction::getIterArgument(aArgs, 2); |
1188 | |
1189 | if (!lQuery->getDynamicContext()->setVariable(lVarQName.getNamespace(), |
1190 | lVarQName.getLocalName(), |
1191 | @@ -765,7 +765,7 @@ |
1192 | lMsg << "{" << lVarQName.getNamespace() << "}" << lVarQName.getLocalName() |
1193 | << ": undefined variable"; |
1194 | |
1195 | - throwError("UndeclaredVariable", lMsg.str()); |
1196 | + throwError("UNDECLARED_VARIABLE", lMsg.str()); |
1197 | } |
1198 | |
1199 | return ItemSequence_t(new EmptySequence()); |
1200 | @@ -785,11 +785,11 @@ |
1201 | { |
1202 | std::ostringstream err; |
1203 | err << "The query " << "(" << theQueryID |
1204 | - << ") evaluated using xqxq:evaluate raised an error at" |
1205 | + << ") evaluated using zq:evaluate raised an error at" |
1206 | << " line " << xe.source_line() << " column " |
1207 | << xe.source_column() << ": " << xe.what(); |
1208 | |
1209 | - Item errQName = XQXQModule::getItemFactory()-> |
1210 | + Item errQName = ZorbaQueryModule::getItemFactory()-> |
1211 | createQName(xe.diagnostic().qname().ns(), xe.diagnostic().qname().localname()); |
1212 | |
1213 | throw USER_EXCEPTION(errQName, err.str()); |
1214 | @@ -798,10 +798,10 @@ |
1215 | { |
1216 | std::ostringstream err; |
1217 | err << "The query " << "(" << theQueryID |
1218 | - << ") evaluated using xqxq:evaluate raised an error at" |
1219 | + << ") evaluated using zq:evaluate raised an error at" |
1220 | << e.what(); |
1221 | |
1222 | - Item errQName = XQXQModule::getItemFactory()-> |
1223 | + Item errQName = ZorbaQueryModule::getItemFactory()-> |
1224 | createQName(e.diagnostic().qname().ns(), e.diagnostic().qname().localname()); |
1225 | |
1226 | throw USER_EXCEPTION(errQName, err.str()); |
1227 | @@ -817,18 +817,18 @@ |
1228 | const zorba::StaticContext* aSctx, |
1229 | const zorba::DynamicContext* aDctx) const |
1230 | { |
1231 | - String lQueryID = XQXQFunction::getOneStringArgument(aArgs,0); |
1232 | + String lQueryID = ZorbaQueryFunction::getOneStringArgument(aArgs,0); |
1233 | |
1234 | XQuery_t lQuery = getQuery(aDctx, lQueryID); |
1235 | |
1236 | if (lQuery->isUpdating()) |
1237 | { |
1238 | - throwError("QueryIsUpdating", "Executing Query shouldn't be updating."); |
1239 | + throwError("QUERY_IS_UPDATING", "Executing Query shouldn't be updating."); |
1240 | } |
1241 | |
1242 | if (lQuery->isSequential()) |
1243 | { |
1244 | - throwError("QueryIsSequential", "Executing Query shouldn't be sequential."); |
1245 | + throwError("QUERY_IS_SEQUENTIAL", "Executing Query shouldn't be sequential."); |
1246 | } |
1247 | |
1248 | Iterator_t lIterQuery = lQuery->iterator(); |
1249 | @@ -845,18 +845,18 @@ |
1250 | const zorba::StaticContext* aSctx, |
1251 | const zorba::DynamicContext* aDctx) const |
1252 | { |
1253 | - String lQueryID = XQXQFunction::getOneStringArgument(aArgs,0); |
1254 | + String lQueryID = ZorbaQueryFunction::getOneStringArgument(aArgs,0); |
1255 | |
1256 | XQuery_t lQuery = getQuery(aDctx, lQueryID); |
1257 | |
1258 | if (lQuery->isSequential()) |
1259 | { |
1260 | - throwError("QueryIsSequential", "Executing Query shouldn't be sequential."); |
1261 | + throwError("QUERY_IS_SEQUENTIAL", "Executing Query shouldn't be sequential."); |
1262 | } |
1263 | |
1264 | if(!lQuery->isUpdating()) |
1265 | { |
1266 | - throwError("QueryNotUpdating", "Executing Query should be updating.") ; |
1267 | + throwError("QUERY_NOT_UPDATING", "Executing Query should be updating.") ; |
1268 | } |
1269 | |
1270 | Iterator_t lIterQuery = lQuery->iterator(); |
1271 | @@ -872,18 +872,18 @@ |
1272 | const zorba::StaticContext* aSctx, |
1273 | const zorba::DynamicContext* aDctx) const |
1274 | { |
1275 | - String lQueryID = XQXQFunction::getOneStringArgument(aArgs, 0); |
1276 | + String lQueryID = ZorbaQueryFunction::getOneStringArgument(aArgs, 0); |
1277 | |
1278 | XQuery_t lQuery = getQuery(aDctx, lQueryID); |
1279 | |
1280 | if(lQuery->isUpdating()) |
1281 | { |
1282 | - throwError("QueryIsUpdating", "Executing Query shouldn't be updating."); |
1283 | + throwError("QUERY_IS_UPDATING", "Executing Query shouldn't be updating."); |
1284 | } |
1285 | |
1286 | if(!lQuery->isSequential()) |
1287 | { |
1288 | - throwError("QueryNotSequential", "Executing Query should be sequential."); |
1289 | + throwError("QUERY_NOT_SEQUENTIAL", "Executing Query should be sequential."); |
1290 | } |
1291 | |
1292 | Iterator_t lIterQuery = lQuery->iterator(); |
1293 | @@ -899,17 +899,17 @@ |
1294 | const zorba::StaticContext* aSctx, |
1295 | const zorba::DynamicContext* aDctx) const |
1296 | { |
1297 | - String lQueryID = XQXQFunction::getOneStringArgument(aArgs,0); |
1298 | + String lQueryID = ZorbaQueryFunction::getOneStringArgument(aArgs,0); |
1299 | |
1300 | QueryMap* lQueryMap; |
1301 | - if (!(lQueryMap= dynamic_cast<QueryMap*>(aDctx->getExternalFunctionParameter("xqxqQueryMap")))) |
1302 | + if (!(lQueryMap= dynamic_cast<QueryMap*>(aDctx->getExternalFunctionParameter("zqQueryMap")))) |
1303 | { |
1304 | - throwError("NoQueryMatch", "String identifying query does not exists."); |
1305 | + throwError("NO_QUERY_MATCH", "String identifying query does not exists."); |
1306 | } |
1307 | |
1308 | if (!lQueryMap->deleteQuery(lQueryID)) |
1309 | { |
1310 | - throwError("NoQueryMatch","String identifying query does not exists."); |
1311 | + throwError("NO_QUERY_MATCH","String identifying query does not exists."); |
1312 | } |
1313 | |
1314 | return ItemSequence_t(new EmptySequence()); |
1315 | @@ -924,17 +924,17 @@ |
1316 | const zorba::StaticContext* aSctx, |
1317 | const zorba::DynamicContext* aDctx) const |
1318 | { |
1319 | - String lQueryID = XQXQFunction::getOneStringArgument(aArgs,0); |
1320 | + String lQueryID = ZorbaQueryFunction::getOneStringArgument(aArgs,0); |
1321 | |
1322 | QueryMap* lQueryMap; |
1323 | - if (!(lQueryMap= dynamic_cast<QueryMap*>(aDctx->getExternalFunctionParameter("xqxqQueryMap")))) |
1324 | + if (!(lQueryMap= dynamic_cast<QueryMap*>(aDctx->getExternalFunctionParameter("zqQueryMap")))) |
1325 | { |
1326 | - throwError("NoQueryMatch", "String identifying query does not exists."); |
1327 | + throwError("NO_QUERY_MATCH", "String identifying query does not exists."); |
1328 | } |
1329 | |
1330 | XQuery_t lQuery = getQuery(aDctx, lQueryID); |
1331 | |
1332 | - Item lVarQName = XQXQFunction::getItemArgument(aArgs, 1); |
1333 | + Item lVarQName = ZorbaQueryFunction::getItemArgument(aArgs, 1); |
1334 | bool lIsBoundVariable = false; |
1335 | |
1336 | zorba::DynamicContext* lCtx = lQuery->getDynamicContext(); |
1337 | @@ -947,7 +947,7 @@ |
1338 | catch (ZorbaException& ze) |
1339 | { |
1340 | if (ze.diagnostic() == zerr::ZAPI0011_VARIABLE_NOT_DECLARED) |
1341 | - XQXQFunction::throwError("UndeclaredVariable", ze.what()); |
1342 | + ZorbaQueryFunction::throwError("UNDECLARED_VARIABLE", ze.what()); |
1343 | throw; // should not happen |
1344 | } |
1345 | |
1346 | @@ -955,7 +955,7 @@ |
1347 | { |
1348 | std::ostringstream lMsg; |
1349 | lMsg << lLocal << ": variable not bound"; |
1350 | - XQXQFunction::throwError("UnboundVariable", lMsg.str()); |
1351 | + ZorbaQueryFunction::throwError("UNBOUND_VARIABLE", lMsg.str()); |
1352 | } |
1353 | |
1354 | zorba::Iterator_t lIterator; |
1355 | @@ -981,12 +981,12 @@ |
1356 | const zorba::StaticContext* aSctx, |
1357 | const zorba::DynamicContext* aDctx) const |
1358 | { |
1359 | - String lQueryID = XQXQFunction::getOneStringArgument(aArgs,0); |
1360 | + String lQueryID = ZorbaQueryFunction::getOneStringArgument(aArgs,0); |
1361 | |
1362 | QueryMap* lQueryMap; |
1363 | - if (!(lQueryMap = dynamic_cast<QueryMap*>(aDctx->getExternalFunctionParameter("xqxqQueryMap")))) |
1364 | + if (!(lQueryMap = dynamic_cast<QueryMap*>(aDctx->getExternalFunctionParameter("zqQueryMap")))) |
1365 | { |
1366 | - throwError("NoQueryMatch", "String identifying query does not exists."); |
1367 | + throwError("NO_QUERY_MATCH", "String identifying query does not exists."); |
1368 | } |
1369 | |
1370 | XQuery_t lQuery = getQuery(aDctx, lQueryID); |
1371 | @@ -995,10 +995,10 @@ |
1372 | lExcPlan.reset(new std::stringstream()); |
1373 | if (!lQuery->saveExecutionPlan(*lExcPlan.get())) |
1374 | { |
1375 | - throwError("QueryPlanError", "FAILED getting query execution plan."); |
1376 | + throwError("NO_QUERY_PLAN", "FAILED getting query execution plan."); |
1377 | } |
1378 | |
1379 | - return ItemSequence_t(new SingletonItemSequence(XQXQModule::getItemFactory()->createStreamableBase64Binary(*lExcPlan.release(), &streamReleaser))); |
1380 | + return ItemSequence_t(new SingletonItemSequence(ZorbaQueryModule::getItemFactory()->createStreamableBase64Binary(*lExcPlan.release(), &streamReleaser))); |
1381 | } |
1382 | |
1383 | |
1384 | @@ -1010,24 +1010,24 @@ |
1385 | const zorba::StaticContext* aSctx, |
1386 | const zorba::DynamicContext* aDctx) const |
1387 | { |
1388 | - Item lQueryPlanItem = XQXQFunction::getItemArgument(aArgs,0); |
1389 | + Item lQueryPlanItem = ZorbaQueryFunction::getItemArgument(aArgs,0); |
1390 | std::istream& lQueryPlanStream = lQueryPlanItem.getStream(); |
1391 | |
1392 | DynamicContext* lDynCtx = const_cast<DynamicContext*>(aDctx); |
1393 | StaticContext_t lSctxChild = aSctx->createChildContext(); |
1394 | |
1395 | QueryMap* lQueryMap; |
1396 | - if (!(lQueryMap = dynamic_cast<QueryMap*>(lDynCtx->getExternalFunctionParameter("xqxqQueryMap")))) |
1397 | + if (!(lQueryMap = dynamic_cast<QueryMap*>(lDynCtx->getExternalFunctionParameter("zqQueryMap")))) |
1398 | { |
1399 | lQueryMap = new QueryMap(); |
1400 | - lDynCtx->addExternalFunctionParameter("xqxqQueryMap", lQueryMap); |
1401 | + lDynCtx->addExternalFunctionParameter("zqQueryMap", lQueryMap); |
1402 | } |
1403 | |
1404 | Zorba* lZorba = Zorba::getInstance(0); |
1405 | XQuery_t lQuery; |
1406 | |
1407 | - std::auto_ptr<XQXQURLResolver> lResolver; |
1408 | - std::auto_ptr<XQXQURIMapper> lMapper; |
1409 | + std::auto_ptr<ZorbaQueryURLResolver> lResolver; |
1410 | + std::auto_ptr<ZorbaQueryURIMapper> lMapper; |
1411 | try |
1412 | { |
1413 | lQuery = lZorba->createQuery(); |
1414 | @@ -1038,14 +1038,14 @@ |
1415 | Item lMapperFunctionItem = getItemArgument(aArgs, 2); |
1416 | if (!lMapperFunctionItem.isNull()) |
1417 | { |
1418 | - lMapper.reset(new XQXQURIMapper(lMapperFunctionItem, lSctxChild)); |
1419 | + lMapper.reset(new ZorbaQueryURIMapper(lMapperFunctionItem, lSctxChild)); |
1420 | lPlanSer.add_URIMapper(lMapper.get()); |
1421 | } |
1422 | |
1423 | Item lResolverFunctionItem = getItemArgument(aArgs, 1); |
1424 | if (!lResolverFunctionItem.isNull()) |
1425 | { |
1426 | - lResolver.reset(new XQXQURLResolver(lResolverFunctionItem, lSctxChild)); |
1427 | + lResolver.reset(new ZorbaQueryURLResolver(lResolverFunctionItem, lSctxChild)); |
1428 | lPlanSer.add_URLResolver(lResolver.get()); |
1429 | } |
1430 | |
1431 | @@ -1063,7 +1063,7 @@ |
1432 | err << "The query loaded from the query plan raised an error at" |
1433 | << " file" << xe.source_uri() << " line" << xe.source_line() |
1434 | << " column" << xe.source_column() << ": " << xe.what(); |
1435 | - Item errQName = XQXQModule::getItemFactory()->createQName( |
1436 | + Item errQName = ZorbaQueryModule::getItemFactory()->createQName( |
1437 | xe.diagnostic().qname().ns(), |
1438 | xe.diagnostic().qname().localname()); |
1439 | throw USER_EXCEPTION(errQName, err.str()); |
1440 | @@ -1076,7 +1076,7 @@ |
1441 | err << "The query loaded from the query plan raised an error: failed to load pre-compiled query: document, collection, or module resolver required but not given."; |
1442 | else |
1443 | err << "The query loaded from the query plan raised an error: "<< ze.what(); |
1444 | - Item errQName = XQXQModule::getItemFactory()->createQName( |
1445 | + Item errQName = ZorbaQueryModule::getItemFactory()->createQName( |
1446 | ze.diagnostic().qname().ns(), |
1447 | ze.diagnostic().qname().localname()); |
1448 | throw USER_EXCEPTION(errQName, err.str()); |
1449 | @@ -1091,10 +1091,10 @@ |
1450 | String lStrUUID = lStream.str(); |
1451 | |
1452 | lQueryMap->storeQuery(lStrUUID, lQuery, lMapper.release(), lResolver.release()); |
1453 | - return ItemSequence_t(new SingletonItemSequence(XQXQModule::getItemFactory()->createAnyURI(lStrUUID))); |
1454 | + return ItemSequence_t(new SingletonItemSequence(ZorbaQueryModule::getItemFactory()->createAnyURI(lStrUUID))); |
1455 | } |
1456 | |
1457 | -}/*namespace xqxq*/ }/*namespace zorba*/ |
1458 | +}/*namespace zorbaquery*/ }/*namespace zorba*/ |
1459 | |
1460 | #ifdef WIN32 |
1461 | # define DLL_EXPORT __declspec(dllexport) |
1462 | @@ -1103,5 +1103,5 @@ |
1463 | #endif |
1464 | |
1465 | extern "C" DLL_EXPORT zorba::ExternalModule* createModule() { |
1466 | - return new zorba::xqxq::XQXQModule(); |
1467 | + return new zorba::zorbaquery::ZorbaQueryModule(); |
1468 | } |
1469 | |
1470 | === renamed file 'modules/xqxq/xqxq.xq.src/xqxq.h' => 'modules/zorba-query/zorba-query.xq.src/zorba-query.h' |
1471 | --- modules/xqxq/xqxq.xq.src/xqxq.h 2013-04-15 12:07:41 +0000 |
1472 | +++ modules/zorba-query/zorba-query.xq.src/zorba-query.h 2013-08-14 06:22:56 +0000 |
1473 | @@ -1,5 +1,5 @@ |
1474 | -#ifndef __COM_ZORBA_WWW_MODULES_XQXQ_H__ |
1475 | -#define __COM_ZORBA_WWW_MODULES_XQXQ_H__ |
1476 | +#ifndef __COM_ZORBA_WWW_MODULES_ZORBA_QUERY_H__ |
1477 | +#define __COM_ZORBA_WWW_MODULES_ZORBA_QUERY_H__ |
1478 | |
1479 | #include <map> |
1480 | |
1481 | @@ -9,15 +9,15 @@ |
1482 | #include <zorba/dynamic_context.h> |
1483 | #include <zorba/serialization_callback.h> |
1484 | |
1485 | -#define XQXQ_MODULE_NAMESPACE "http://www.zorba-xquery.com/modules/xqxq" |
1486 | +#define ZORBA_QUERY_MODULE_NAMESPACE "http://zorba.io/modules/zorba-query" |
1487 | |
1488 | -namespace zorba { namespace xqxq { |
1489 | +namespace zorba { namespace zorbaquery { |
1490 | |
1491 | |
1492 | /******************************************************************************* |
1493 | |
1494 | ********************************************************************************/ |
1495 | -class XQXQModule : public ExternalModule |
1496 | +class ZorbaQueryModule : public ExternalModule |
1497 | { |
1498 | protected: |
1499 | class ltstr |
1500 | @@ -36,9 +36,9 @@ |
1501 | |
1502 | public: |
1503 | |
1504 | - virtual ~XQXQModule(); |
1505 | + virtual ~ZorbaQueryModule(); |
1506 | |
1507 | - virtual zorba::String getURI() const {return XQXQ_MODULE_NAMESPACE;} |
1508 | + virtual zorba::String getURI() const {return ZORBA_QUERY_MODULE_NAMESPACE;} |
1509 | |
1510 | virtual zorba::ExternalFunction* getExternalFunction(const String& localName); |
1511 | |
1512 | @@ -54,14 +54,14 @@ |
1513 | /******************************************************************************* |
1514 | |
1515 | ********************************************************************************/ |
1516 | -class XQXQURLResolver : public URLResolver |
1517 | +class ZorbaQueryURLResolver : public URLResolver |
1518 | { |
1519 | protected: |
1520 | Item theFunction; |
1521 | StaticContext_t theCtx; |
1522 | |
1523 | public: |
1524 | - XQXQURLResolver(Item& aFunction, StaticContext_t& aSctx) |
1525 | + ZorbaQueryURLResolver(Item& aFunction, StaticContext_t& aSctx) |
1526 | : |
1527 | URLResolver(), |
1528 | theFunction(aFunction), |
1529 | @@ -69,20 +69,20 @@ |
1530 | { |
1531 | } |
1532 | |
1533 | - virtual ~XQXQURLResolver() { } |
1534 | + virtual ~ZorbaQueryURLResolver() { } |
1535 | |
1536 | virtual Resource* resolveURL(const String& url, EntityData const* entityData); |
1537 | }; |
1538 | |
1539 | |
1540 | -class XQXQURIMapper : public URIMapper |
1541 | +class ZorbaQueryURIMapper : public URIMapper |
1542 | { |
1543 | protected: |
1544 | Item theFunction; |
1545 | StaticContext_t theCtx; |
1546 | |
1547 | public: |
1548 | - XQXQURIMapper(Item& aFunction, StaticContext_t& aSctx) |
1549 | + ZorbaQueryURIMapper(Item& aFunction, StaticContext_t& aSctx) |
1550 | : |
1551 | URIMapper(), |
1552 | theFunction(aFunction), |
1553 | @@ -90,7 +90,7 @@ |
1554 | { |
1555 | } |
1556 | |
1557 | - virtual ~XQXQURIMapper(){ } |
1558 | + virtual ~ZorbaQueryURIMapper(){ } |
1559 | |
1560 | virtual void mapURI( |
1561 | const zorba::String aUri, |
1562 | @@ -146,10 +146,10 @@ |
1563 | /******************************************************************************* |
1564 | |
1565 | ********************************************************************************/ |
1566 | -class XQXQFunction : public ContextualExternalFunction |
1567 | +class ZorbaQueryFunction : public ContextualExternalFunction |
1568 | { |
1569 | protected: |
1570 | - const XQXQModule * theModule; |
1571 | + const ZorbaQueryModule * theModule; |
1572 | |
1573 | protected: |
1574 | static void throwError(const char*, const std::string&); |
1575 | @@ -166,9 +166,9 @@ |
1576 | const zorba::String& aIdent) const; |
1577 | |
1578 | public: |
1579 | - XQXQFunction(const XQXQModule* module); |
1580 | + ZorbaQueryFunction(const ZorbaQueryModule* module); |
1581 | |
1582 | - virtual ~XQXQFunction(); |
1583 | + virtual ~ZorbaQueryFunction(); |
1584 | |
1585 | virtual String getURI() const; |
1586 | }; |
1587 | @@ -177,10 +177,10 @@ |
1588 | /******************************************************************************* |
1589 | |
1590 | ********************************************************************************/ |
1591 | -class PrepareMainModuleFunction : public XQXQFunction |
1592 | +class PrepareMainModuleFunction : public ZorbaQueryFunction |
1593 | { |
1594 | public: |
1595 | - PrepareMainModuleFunction(const XQXQModule* aModule) : XQXQFunction(aModule) {} |
1596 | + PrepareMainModuleFunction(const ZorbaQueryModule* aModule) : ZorbaQueryFunction(aModule) {} |
1597 | |
1598 | virtual ~PrepareMainModuleFunction(){ } |
1599 | |
1600 | @@ -197,10 +197,10 @@ |
1601 | /******************************************************************************* |
1602 | |
1603 | ********************************************************************************/ |
1604 | -class PrepareLibraryModuleFunction : public XQXQFunction |
1605 | +class PrepareLibraryModuleFunction : public ZorbaQueryFunction |
1606 | { |
1607 | public: |
1608 | - PrepareLibraryModuleFunction(const XQXQModule* aModule) : XQXQFunction(aModule) {} |
1609 | + PrepareLibraryModuleFunction(const ZorbaQueryModule* aModule) : ZorbaQueryFunction(aModule) {} |
1610 | |
1611 | virtual ~PrepareLibraryModuleFunction(){} |
1612 | |
1613 | @@ -217,10 +217,10 @@ |
1614 | /******************************************************************************* |
1615 | |
1616 | ********************************************************************************/ |
1617 | -class IsBoundContextItemFunction : public XQXQFunction |
1618 | +class IsBoundContextItemFunction : public ZorbaQueryFunction |
1619 | { |
1620 | public: |
1621 | - IsBoundContextItemFunction(const XQXQModule* aModule) : XQXQFunction(aModule) {} |
1622 | + IsBoundContextItemFunction(const ZorbaQueryModule* aModule) : ZorbaQueryFunction(aModule) {} |
1623 | |
1624 | virtual ~IsBoundContextItemFunction(){} |
1625 | |
1626 | @@ -237,10 +237,10 @@ |
1627 | /******************************************************************************* |
1628 | |
1629 | ********************************************************************************/ |
1630 | -class IsBoundVariableFunction : public XQXQFunction |
1631 | +class IsBoundVariableFunction : public ZorbaQueryFunction |
1632 | { |
1633 | public: |
1634 | - IsBoundVariableFunction(const XQXQModule* aModule) : XQXQFunction(aModule) {} |
1635 | + IsBoundVariableFunction(const ZorbaQueryModule* aModule) : ZorbaQueryFunction(aModule) {} |
1636 | |
1637 | virtual ~IsBoundVariableFunction(){} |
1638 | |
1639 | @@ -257,10 +257,10 @@ |
1640 | /******************************************************************************* |
1641 | |
1642 | ********************************************************************************/ |
1643 | -class GetExternalVariablesFunction : public XQXQFunction |
1644 | +class GetExternalVariablesFunction : public ZorbaQueryFunction |
1645 | { |
1646 | public: |
1647 | - GetExternalVariablesFunction(const XQXQModule* aModule) : XQXQFunction(aModule) {} |
1648 | + GetExternalVariablesFunction(const ZorbaQueryModule* aModule) : ZorbaQueryFunction(aModule) {} |
1649 | |
1650 | virtual ~GetExternalVariablesFunction() {} |
1651 | |
1652 | @@ -277,10 +277,10 @@ |
1653 | /******************************************************************************* |
1654 | |
1655 | ********************************************************************************/ |
1656 | -class IsUpdatingFunction : public XQXQFunction |
1657 | +class IsUpdatingFunction : public ZorbaQueryFunction |
1658 | { |
1659 | public: |
1660 | - IsUpdatingFunction(const XQXQModule* aModule) : XQXQFunction(aModule) {} |
1661 | + IsUpdatingFunction(const ZorbaQueryModule* aModule) : ZorbaQueryFunction(aModule) {} |
1662 | |
1663 | virtual ~IsUpdatingFunction() {} |
1664 | |
1665 | @@ -297,10 +297,10 @@ |
1666 | /******************************************************************************* |
1667 | |
1668 | ********************************************************************************/ |
1669 | -class IsSequentialFunction : public XQXQFunction |
1670 | +class IsSequentialFunction : public ZorbaQueryFunction |
1671 | { |
1672 | public: |
1673 | - IsSequentialFunction(const XQXQModule* aModule) : XQXQFunction(aModule) {} |
1674 | + IsSequentialFunction(const ZorbaQueryModule* aModule) : ZorbaQueryFunction(aModule) {} |
1675 | |
1676 | virtual ~IsSequentialFunction() {} |
1677 | |
1678 | @@ -317,10 +317,10 @@ |
1679 | /******************************************************************************* |
1680 | |
1681 | ********************************************************************************/ |
1682 | -class BindContextItemFunction : public XQXQFunction |
1683 | +class BindContextItemFunction : public ZorbaQueryFunction |
1684 | { |
1685 | public: |
1686 | - BindContextItemFunction(const XQXQModule* aModule) : XQXQFunction(aModule) {} |
1687 | + BindContextItemFunction(const ZorbaQueryModule* aModule) : ZorbaQueryFunction(aModule) {} |
1688 | |
1689 | virtual ~BindContextItemFunction() {} |
1690 | |
1691 | @@ -337,10 +337,10 @@ |
1692 | /******************************************************************************* |
1693 | |
1694 | ********************************************************************************/ |
1695 | -class BindContextPositionFunction : public XQXQFunction |
1696 | +class BindContextPositionFunction : public ZorbaQueryFunction |
1697 | { |
1698 | public: |
1699 | - BindContextPositionFunction(const XQXQModule* aModule) : XQXQFunction(aModule) {} |
1700 | + BindContextPositionFunction(const ZorbaQueryModule* aModule) : ZorbaQueryFunction(aModule) {} |
1701 | |
1702 | virtual ~BindContextPositionFunction() {} |
1703 | |
1704 | @@ -357,10 +357,10 @@ |
1705 | /******************************************************************************* |
1706 | |
1707 | ********************************************************************************/ |
1708 | -class BindContextSizeFunction : public XQXQFunction |
1709 | +class BindContextSizeFunction : public ZorbaQueryFunction |
1710 | { |
1711 | public: |
1712 | - BindContextSizeFunction(const XQXQModule* aModule) : XQXQFunction(aModule) {} |
1713 | + BindContextSizeFunction(const ZorbaQueryModule* aModule) : ZorbaQueryFunction(aModule) {} |
1714 | |
1715 | virtual ~BindContextSizeFunction() {} |
1716 | |
1717 | @@ -377,10 +377,10 @@ |
1718 | /******************************************************************************* |
1719 | |
1720 | ********************************************************************************/ |
1721 | -class BindVariableFunction : public XQXQFunction |
1722 | +class BindVariableFunction : public ZorbaQueryFunction |
1723 | { |
1724 | public: |
1725 | - BindVariableFunction(const XQXQModule* aModule) : XQXQFunction(aModule) {} |
1726 | + BindVariableFunction(const ZorbaQueryModule* aModule) : ZorbaQueryFunction(aModule) {} |
1727 | |
1728 | virtual ~BindVariableFunction() {} |
1729 | |
1730 | @@ -448,10 +448,10 @@ |
1731 | /******************************************************************************* |
1732 | |
1733 | ********************************************************************************/ |
1734 | -class EvaluateFunction : public XQXQFunction |
1735 | +class EvaluateFunction : public ZorbaQueryFunction |
1736 | { |
1737 | public: |
1738 | - EvaluateFunction(const XQXQModule* aModule) : XQXQFunction(aModule) {} |
1739 | + EvaluateFunction(const ZorbaQueryModule* aModule) : ZorbaQueryFunction(aModule) {} |
1740 | |
1741 | virtual ~EvaluateFunction() {} |
1742 | |
1743 | @@ -468,10 +468,10 @@ |
1744 | /******************************************************************************* |
1745 | |
1746 | ********************************************************************************/ |
1747 | -class EvaluateUpdatingFunction : public XQXQFunction |
1748 | +class EvaluateUpdatingFunction : public ZorbaQueryFunction |
1749 | { |
1750 | public: |
1751 | - EvaluateUpdatingFunction(const XQXQModule* aModule) : XQXQFunction(aModule) {} |
1752 | + EvaluateUpdatingFunction(const ZorbaQueryModule* aModule) : ZorbaQueryFunction(aModule) {} |
1753 | |
1754 | virtual ~EvaluateUpdatingFunction() {} |
1755 | |
1756 | @@ -488,10 +488,10 @@ |
1757 | /******************************************************************************* |
1758 | |
1759 | ********************************************************************************/ |
1760 | -class EvaluateSequentialFunction : public XQXQFunction |
1761 | +class EvaluateSequentialFunction : public ZorbaQueryFunction |
1762 | { |
1763 | public: |
1764 | - EvaluateSequentialFunction(const XQXQModule* aModule) : XQXQFunction(aModule) {} |
1765 | + EvaluateSequentialFunction(const ZorbaQueryModule* aModule) : ZorbaQueryFunction(aModule) {} |
1766 | |
1767 | virtual ~EvaluateSequentialFunction() {} |
1768 | |
1769 | @@ -508,17 +508,17 @@ |
1770 | } |
1771 | |
1772 | protected: |
1773 | - const XQXQModule* theModule; |
1774 | + const ZorbaQueryModule* theModule; |
1775 | }; |
1776 | |
1777 | |
1778 | /******************************************************************************* |
1779 | |
1780 | ********************************************************************************/ |
1781 | -class DeleteQueryFunction : public XQXQFunction |
1782 | +class DeleteQueryFunction : public ZorbaQueryFunction |
1783 | { |
1784 | public: |
1785 | - DeleteQueryFunction(const XQXQModule* aModule) : XQXQFunction(aModule) {} |
1786 | + DeleteQueryFunction(const ZorbaQueryModule* aModule) : ZorbaQueryFunction(aModule) {} |
1787 | |
1788 | virtual ~DeleteQueryFunction() {} |
1789 | |
1790 | @@ -531,7 +531,7 @@ |
1791 | const zorba::DynamicContext*) const; |
1792 | }; |
1793 | |
1794 | - class VariableValueFunction : public XQXQFunction{ |
1795 | + class VariableValueFunction : public ZorbaQueryFunction{ |
1796 | protected: |
1797 | class ValueItemSequence : public ItemSequence |
1798 | { |
1799 | @@ -551,7 +551,7 @@ |
1800 | |
1801 | }; |
1802 | public: |
1803 | - VariableValueFunction(const XQXQModule* aModule) : XQXQFunction(aModule) {} |
1804 | + VariableValueFunction(const ZorbaQueryModule* aModule) : ZorbaQueryFunction(aModule) {} |
1805 | |
1806 | virtual ~VariableValueFunction() {} |
1807 | |
1808 | @@ -567,10 +567,10 @@ |
1809 | /******************************************************************************* |
1810 | |
1811 | ********************************************************************************/ |
1812 | -class QueryPlanFunction : public XQXQFunction |
1813 | +class QueryPlanFunction : public ZorbaQueryFunction |
1814 | { |
1815 | public: |
1816 | - QueryPlanFunction(const XQXQModule* aModule) : XQXQFunction(aModule) {} |
1817 | + QueryPlanFunction(const ZorbaQueryModule* aModule) : ZorbaQueryFunction(aModule) {} |
1818 | |
1819 | virtual ~QueryPlanFunction() {} |
1820 | |
1821 | @@ -587,17 +587,17 @@ |
1822 | } |
1823 | |
1824 | protected: |
1825 | - const XQXQModule* theModule; |
1826 | + const ZorbaQueryModule* theModule; |
1827 | }; |
1828 | |
1829 | |
1830 | /******************************************************************************* |
1831 | |
1832 | ********************************************************************************/ |
1833 | -class LoadFromQueryPlanFunction : public XQXQFunction |
1834 | +class LoadFromQueryPlanFunction : public ZorbaQueryFunction |
1835 | { |
1836 | public: |
1837 | - LoadFromQueryPlanFunction(const XQXQModule* aModule) : XQXQFunction(aModule) {} |
1838 | + LoadFromQueryPlanFunction(const ZorbaQueryModule* aModule) : ZorbaQueryFunction(aModule) {} |
1839 | |
1840 | virtual ~LoadFromQueryPlanFunction() {} |
1841 | |
1842 | @@ -614,7 +614,7 @@ |
1843 | } |
1844 | |
1845 | protected: |
1846 | - const XQXQModule* theModule; |
1847 | + const ZorbaQueryModule* theModule; |
1848 | |
1849 | class QueryPlanSerializationCallback : public zorba::SerializationCallback |
1850 | { |
1851 | @@ -645,7 +645,7 @@ |
1852 | getURLResolver(size_t i) const { return theUrlResolvers.size() < i? NULL : theUrlResolvers[i]; } |
1853 | }; |
1854 | }; |
1855 | -}/*xqxq namespace*/}/*zorba namespace*/ |
1856 | - |
1857 | - |
1858 | -#endif //_COM_ZORBA_WWW_MODULES_XQXQ_H_ |
1859 | +}/*zorbaquery namespace*/}/*zorba namespace*/ |
1860 | + |
1861 | + |
1862 | +#endif //_COM_ZORBA_WWW_MODULES_ZORBA_QUERY_H_ |
1863 | |
1864 | === modified file 'test/fots_driver/cli.xq' |
1865 | --- test/fots_driver/cli.xq 2013-05-20 17:56:33 +0000 |
1866 | +++ test/fots_driver/cli.xq 2013-08-14 06:22:56 +0000 |
1867 | @@ -157,14 +157,14 @@ |
1868 | |
1869 | (:~ |
1870 | : Enable or disable verbose output. When this is set to true the exact query |
1871 | - : that is run by XQXQ is also written down into a query_*.xq file. |
1872 | + : that is run by ZQ is also written down into a query_*.xq file. |
1873 | :) |
1874 | declare variable $verbose as xs:string external := "false"; |
1875 | |
1876 | |
1877 | (:~ |
1878 | : Enable or disable plan serializer usage. When this is set to true the query |
1879 | - : plan is saved then loaded and executed by XQXQ. |
1880 | + : plan is saved then loaded and executed by ZQ. |
1881 | :) |
1882 | declare variable $usePlanSerializer as xs:string external := "false"; |
1883 | |
1884 | |
1885 | === modified file 'test/fots_driver/environment.xq' |
1886 | --- test/fots_driver/environment.xq 2013-08-12 19:12:06 +0000 |
1887 | +++ test/fots_driver/environment.xq 2013-08-14 06:22:56 +0000 |
1888 | @@ -22,8 +22,8 @@ |
1889 | module namespace env = |
1890 | "http://www.zorba-xquery.com/fots-driver/environment"; |
1891 | |
1892 | -import module namespace xqxq = |
1893 | - "http://www.zorba-xquery.com/modules/xqxq"; |
1894 | +import module namespace zq = |
1895 | + "http://zorba.io/modules/zorba-query"; |
1896 | |
1897 | import module namespace util = |
1898 | "http://www.zorba-xquery.com/fots-driver/util" at "util.xq"; |
1899 | @@ -335,15 +335,15 @@ |
1900 | : If a test-case query TQ references a source doc via the context item, this |
1901 | : function creates and returns the xquery code for computing a value for the |
1902 | : context item and binding this value inside TQ. The result of this function |
1903 | - : is added to the query FQ that will be evaluated via XQXQ by the fots test |
1904 | - : driver. The function assumes that TQ will appear as a nested XQXQ query |
1905 | - : within FQ, and that $queryID is the FQ variable storing the XQXQ query id |
1906 | + : is added to the query FQ that will be evaluated via ZQ by the fots test |
1907 | + : driver. The function assumes that TQ will appear as a nested ZQ query |
1908 | + : within FQ, and that $queryID is the FQ variable storing the ZQ query id |
1909 | : of TQ. |
1910 | : |
1911 | : If the source doc needs to be validated, the code created by this function |
1912 | : looks like this: |
1913 | : |
1914 | - : variable $contextItemQuery := xqxq:prepare-main-module |
1915 | + : variable $contextItemQuery := zq:prepare-main-module |
1916 | : ( |
1917 | : ' |
1918 | : import schema some-prefix = "some-URI"; |
1919 | @@ -353,16 +353,16 @@ |
1920 | : (), mapper:uri-mapper#2 |
1921 | : ); |
1922 | : |
1923 | - : variable $contextItem := xqxq:evaluate($contextItemQuery); |
1924 | + : variable $contextItem := zq:evaluate($contextItemQuery); |
1925 | : |
1926 | - : xqxq:bind-context-item($queryID, $contextItem); |
1927 | + : zq:bind-context-item($queryID, $contextItem); |
1928 | : |
1929 | : If no validation is required, the code created by this function looks like |
1930 | : this: |
1931 | : |
1932 | : variable $contextItem := doc("some-xml-file"); |
1933 | : |
1934 | - : xqxq:bind-context-item($queryID, $contextItem); |
1935 | + : zq:bind-context-item($queryID, $contextItem); |
1936 | : |
1937 | : @param $env The environment (local or non-local) that applies to the current |
1938 | : test case. |
1939 | @@ -385,14 +385,14 @@ |
1940 | ( |
1941 | env:compute-context-item($env, $envBaseURI, $needsDTDValidation), |
1942 | "", |
1943 | - 'xqxq:bind-context-item($queryID, $contextItem);' |
1944 | + 'zq:bind-context-item($queryID, $contextItem);' |
1945 | ) |
1946 | , |
1947 | "
" |
1948 | ) |
1949 | else if(exists($env/fots:context-item/@select)) |
1950 | then |
1951 | - concat('xqxq:bind-context-item($queryID,', |
1952 | + concat('zq:bind-context-item($queryID,', |
1953 | $env/fots:context-item/@select, |
1954 | ');') |
1955 | else |
1956 | @@ -423,7 +423,7 @@ |
1957 | string-join( |
1958 | ( |
1959 | "
", |
1960 | - "variable $contextItemQuery := xqxq:prepare-main-module", |
1961 | + "variable $contextItemQuery := zq:prepare-main-module", |
1962 | "(", |
1963 | "'", |
1964 | if ($needsSchemaValidation) then env:get-schema-import($env) else (), |
1965 | @@ -436,7 +436,7 @@ |
1966 | "(), mapper:uri-mapper#2", |
1967 | ");", |
1968 | "", |
1969 | - "variable $contextItem := xqxq:evaluate($contextItemQuery);" |
1970 | + "variable $contextItem := zq:evaluate($contextItemQuery);" |
1971 | ) |
1972 | , |
1973 | "
") |
1974 | @@ -471,17 +471,17 @@ |
1975 | |
1976 | (:~ |
1977 | : Creates the xquery code for assigning values to the external variables of |
1978 | - : a nested XQXQ query. The nested XQXQ query is a test-case query TQ, and the |
1979 | + : a nested zorba-query query. The nested ZQ query is a test-case query TQ, and the |
1980 | : result of this function is added to the query FQ that will be evaluated via |
1981 | - : XQXQ by the fots test driver. The function assumes that TQ will appear as a |
1982 | - : nested XQXQ query within FQ, and that $queryID is the FQ variable storing |
1983 | - : the XQXQ query id of TQ. |
1984 | + : ZQ by the fots test driver. The function assumes that TQ will appear as a |
1985 | + : nested ZQ query within FQ, and that $queryID is the FQ variable storing |
1986 | + : the ZQ query id of TQ. |
1987 | : |
1988 | : @param $env The environment (local or non-local) that applies to the current |
1989 | : test case |
1990 | : @param $envBaseURI The absolute pathname of the directory containing the |
1991 | : file that defines the environment. |
1992 | - : @return the strings for variable binding in XQXQ. |
1993 | + : @return the strings for variable binding in ZQ. |
1994 | :) |
1995 | declare function env:set-variables( |
1996 | $env as element(fots:environment)?, |
1997 | @@ -497,7 +497,7 @@ |
1998 | ( |
1999 | for $src in $env/fots:source[starts-with(@role, "$")] |
2000 | return |
2001 | - concat('xqxq:bind-variable($queryID, xs:QName("', |
2002 | + concat('zq:bind-variable($queryID, xs:QName("', |
2003 | substring-after($src/@role, "$"), |
2004 | '"), ', |
2005 | 'doc("', |
2006 | @@ -515,7 +515,7 @@ |
2007 | let $varName := $param/@name |
2008 | where (exists($select) and exists($param[@declared eq "true"])) |
2009 | return |
2010 | - concat('xqxq:bind-variable( $queryID, xs:QName("', |
2011 | + concat('zq:bind-variable( $queryID, xs:QName("', |
2012 | $param/@name, |
2013 | '"), ', |
2014 | $varValue, |
2015 | @@ -528,13 +528,13 @@ |
2016 | |
2017 | |
2018 | (:~ |
2019 | - : Returns the XQXQ URL resolver declaration. |
2020 | + : Returns the ZQ URL resolver declaration. |
2021 | : |
2022 | : @param $case the test case. |
2023 | : @param $env the environment. |
2024 | : @param $envBaseURI URI of the environment. |
2025 | : @param $testSetBaseURI URI to the test set that defines the test case. |
2026 | - : @return the XQXQ URL resolver declaration. |
2027 | + : @return the ZQ URL resolver declaration. |
2028 | :) |
2029 | declare function env:resolver( |
2030 | $case as element(fots:test-case), |
2031 | @@ -625,12 +625,12 @@ |
2032 | |
2033 | |
2034 | (:~ |
2035 | - : Returns the XQXQ URL mapper declaration. |
2036 | + : Returns the ZQ URL mapper declaration. |
2037 | : @param $case the test case. |
2038 | : @param $env the environment. |
2039 | : @param $envBaseURI URI of the environment. |
2040 | : @param $testSetBaseURI URI to the test set that defines the test case. |
2041 | - : @return the XQXQ URL mapper declaration. |
2042 | + : @return the ZQ URL mapper declaration. |
2043 | :) |
2044 | declare function env:mapper( |
2045 | $case as element(fots:test-case), |
2046 | |
2047 | === modified file 'test/fots_driver/evaluate.xq' |
2048 | --- test/fots_driver/evaluate.xq 2013-08-09 08:27:30 +0000 |
2049 | +++ test/fots_driver/evaluate.xq 2013-08-14 06:22:56 +0000 |
2050 | @@ -25,8 +25,8 @@ |
2051 | import schema namespace output = |
2052 | "http://www.w3.org/2010/xslt-xquery-serialization"; |
2053 | |
2054 | -import module namespace xqxq = |
2055 | - "http://www.zorba-xquery.com/modules/xqxq"; |
2056 | +import module namespace zq = |
2057 | + "http://zorba.io/modules/zorba-query"; |
2058 | |
2059 | import module namespace schema = |
2060 | "http://www.zorba-xquery.com/modules/schema"; |
2061 | @@ -296,13 +296,13 @@ |
2062 | "declare variable $result external; ", |
2063 | xs:string($expResult)); |
2064 | |
2065 | - variable $queryKey := xqxq:prepare-main-module($queryText); |
2066 | + variable $queryKey := zq:prepare-main-module($queryText); |
2067 | |
2068 | - variable $queryKeyResult := xqxq:bind-variable($queryKey, |
2069 | + variable $queryKeyResult := zq:bind-variable($queryKey, |
2070 | xs:QName('result'), |
2071 | $result); |
2072 | |
2073 | - variable $queryResult := xqxq:evaluate($queryKey); |
2074 | + variable $queryResult := zq:evaluate($queryKey); |
2075 | |
2076 | if ($queryResult) |
2077 | then () |
2078 | @@ -346,11 +346,11 @@ |
2079 | "declare variable $x external;", |
2080 | "let $y := (",string(data($expResult)),") return ", |
2081 | "every $i in 1 to max((count($x),count($y))) satisfies deep-equal($x[$i],$y[$i])"); |
2082 | - variable $queryKey := xqxq:prepare-main-module($queryText), |
2083 | - $queryKeyResult := xqxq:bind-variable($queryKey, |
2084 | + variable $queryKey := zq:prepare-main-module($queryText), |
2085 | + $queryKeyResult := zq:bind-variable($queryKey, |
2086 | xs:QName('x'), |
2087 | $result), |
2088 | - $queryResult := xqxq:evaluate($queryKey); |
2089 | + $queryResult := zq:evaluate($queryKey); |
2090 | if ($queryResult) |
2091 | then () |
2092 | else "'assert-deep-eq' returned: actual result is not deep-equal to expected result." |
2093 | @@ -404,12 +404,12 @@ |
2094 | then concat("'",$expResult,"'") |
2095 | else $expResult, |
2096 | ")")); |
2097 | - variable $queryKey := xqxq:prepare-main-module($queryText); |
2098 | + variable $queryKey := zq:prepare-main-module($queryText); |
2099 | |
2100 | - xqxq:bind-variable($queryKey, |
2101 | + zq:bind-variable($queryKey, |
2102 | xs:QName('x'), |
2103 | $result); |
2104 | - variable $queryResult := xqxq:evaluate($queryKey); |
2105 | + variable $queryResult := zq:evaluate($queryKey); |
2106 | if ($queryResult) |
2107 | then () |
2108 | else "'assert-eq' returned: result doesn't match expected result." |
2109 | @@ -463,11 +463,11 @@ |
2110 | "let $y := (",string(data($expResult)),") return ", |
2111 | "deep-equal(local:order-string-values($x), local:order-string-values($y)) or |
2112 | deep-equal(reverse($x), $y)"); |
2113 | - variable $queryKey := xqxq:prepare-main-module($queryText), |
2114 | - $queryKeyResult := xqxq:bind-variable($queryKey, |
2115 | + variable $queryKey := zq:prepare-main-module($queryText), |
2116 | + $queryKeyResult := zq:bind-variable($queryKey, |
2117 | xs:QName('x'), |
2118 | $result), |
2119 | - $queryResult := xqxq:evaluate($queryKey); |
2120 | + $queryResult := zq:evaluate($queryKey); |
2121 | if ($queryResult) |
2122 | then () |
2123 | else "'assert-permutation' returned: result isn't a permutation of expected result." |
2124 | @@ -609,11 +609,11 @@ |
2125 | { |
2126 | variable $queryText := concat( "declare variable $x external; $x instance of ", |
2127 | data($expResult)); |
2128 | - variable $queryKey := xqxq:prepare-main-module($queryText), |
2129 | - $queryKeyResult := xqxq:bind-variable($queryKey, |
2130 | + variable $queryKey := zq:prepare-main-module($queryText), |
2131 | + $queryKeyResult := zq:bind-variable($queryKey, |
2132 | xs:QName('x'), |
2133 | $result), |
2134 | - $queryResult := xqxq:evaluate($queryKey); |
2135 | + $queryResult := zq:evaluate($queryKey); |
2136 | if ($queryResult) |
2137 | then () |
2138 | else concat("'assert-type' returned: result doesn't have type '", |
2139 | |
2140 | === modified file 'test/fots_driver/execute.xq' |
2141 | --- test/fots_driver/execute.xq 2013-08-09 08:27:30 +0000 |
2142 | +++ test/fots_driver/execute.xq 2013-08-14 06:22:56 +0000 |
2143 | @@ -22,8 +22,8 @@ |
2144 | module namespace execute = |
2145 | "http://www.zorba-xquery.com/fots-driver/execute"; |
2146 | |
2147 | -import module namespace xqxq = |
2148 | - "http://www.zorba-xquery.com/modules/xqxq#2.0"; |
2149 | +import module namespace zq = |
2150 | + "http://zorba.io/modules/zorba-query#2.0"; |
2151 | |
2152 | import module namespace eval = |
2153 | "http://www.zorba-xquery.com/fots-driver/evaluate" at "evaluate.xq"; |
2154 | @@ -43,17 +43,17 @@ |
2155 | declare option op:disable "f:trace"; |
2156 | |
2157 | (:~ |
2158 | - : XQXQ invoke. |
2159 | - : @param $xqxqQueryText the query that will be run. |
2160 | + : ZQ invoke. |
2161 | + : @param $zqQueryText the query that will be run. |
2162 | : @param $case the test case. |
2163 | : @param $verbose if set to TRUE it will also output the actual result. |
2164 | : @param $testSetBaseURI the URI of the directory that contains the file of the |
2165 | associated test set. |
2166 | : @param $usePlanSerializer if true the plan serializer is used. |
2167 | - : @return the result of running the query with XQXQ. |
2168 | + : @return the result of running the query with ZQ. |
2169 | :) |
2170 | -declare %ann:sequential function execute:xqxq-invoke( |
2171 | - $xqxqQueryText as xs:string, |
2172 | +declare %ann:sequential function execute:zq-invoke( |
2173 | + $zqQueryText as xs:string, |
2174 | $case as element(fots:test-case), |
2175 | $verbose as xs:boolean?, |
2176 | $testSetBaseURI as xs:anyURI, |
2177 | @@ -64,22 +64,22 @@ |
2178 | { |
2179 | if($usePlanSerializer) then |
2180 | { |
2181 | - variable $queryKey := xqxq:prepare-main-module($xqxqQueryText); |
2182 | - variable $queryPlan := xqxq:query-plan($queryKey); |
2183 | - variable $queryPlanKey := xqxq:load-from-query-plan($queryPlan); |
2184 | - variable $queryResult := xqxq:evaluate-sequential($queryPlanKey); |
2185 | + variable $queryKey := zq:prepare-main-module($zqQueryText); |
2186 | + variable $queryPlan := zq:query-plan($queryKey); |
2187 | + variable $queryPlanKey := zq:load-from-query-plan($queryPlan); |
2188 | + variable $queryResult := zq:evaluate-sequential($queryPlanKey); |
2189 | |
2190 | - xqxq:delete-query($queryPlanKey); |
2191 | - xqxq:delete-query($queryKey); |
2192 | + zq:delete-query($queryPlanKey); |
2193 | + zq:delete-query($queryKey); |
2194 | |
2195 | eval:result($queryResult, $case/fots:result/*, $testSetBaseURI) |
2196 | } |
2197 | else |
2198 | { |
2199 | - variable $queryKey := xqxq:prepare-main-module($xqxqQueryText); |
2200 | - variable $queryResult := xqxq:evaluate-sequential($queryKey); |
2201 | + variable $queryKey := zq:prepare-main-module($zqQueryText); |
2202 | + variable $queryResult := zq:evaluate-sequential($queryKey); |
2203 | |
2204 | - xqxq:delete-query($queryKey); |
2205 | + zq:delete-query($queryKey); |
2206 | |
2207 | eval:result($queryResult, $case/fots:result/*, $testSetBaseURI) |
2208 | } |
2209 | |
2210 | === modified file 'test/fots_driver/fots-driver.xq' |
2211 | --- test/fots_driver/fots-driver.xq 2013-08-12 19:12:06 +0000 |
2212 | +++ test/fots_driver/fots-driver.xq 2013-08-14 06:22:56 +0000 |
2213 | @@ -886,7 +886,7 @@ |
2214 | "
" |
2215 | ); |
2216 | |
2217 | - variable $xqxqQuery := driver:create-XQXQ-query($query, |
2218 | + variable $zqQuery := driver:create-ZQ-query($query, |
2219 | $case, |
2220 | $env, |
2221 | $envBaseURI, |
2222 | @@ -896,12 +896,12 @@ |
2223 | (:if $verbose then print the query to a file:) |
2224 | if ($verbose and |
2225 | ($cliMode eq "run-test-case")) |
2226 | - then util:write-query-to-file($xqxqQuery, $queryName); |
2227 | + then util:write-query-to-file($zqQuery, $queryName); |
2228 | else (); |
2229 | |
2230 | variable $startDateTime := datetime:current-dateTime(); |
2231 | |
2232 | - variable $result := execute:xqxq-invoke($xqxqQuery, |
2233 | + variable $result := execute:zq-invoke($zqQuery, |
2234 | $case, |
2235 | $verbose, |
2236 | $testSetURI, |
2237 | @@ -914,7 +914,7 @@ |
2238 | if ($checkPass) then |
2239 | feedback:pass($case, |
2240 | $result, |
2241 | - $xqxqQuery, |
2242 | + $zqQuery, |
2243 | $env, |
2244 | $duration, |
2245 | $verbose, |
2246 | @@ -927,7 +927,7 @@ |
2247 | else |
2248 | feedback:fail($case, |
2249 | $result, |
2250 | - $xqxqQuery, |
2251 | + $zqQuery, |
2252 | $testSetName, |
2253 | $env, |
2254 | $duration, |
2255 | @@ -956,9 +956,9 @@ |
2256 | |
2257 | |
2258 | (:~ |
2259 | - : Creates the text for the complete query FQ that will be evaluated via XQXQ |
2260 | + : Creates the text for the complete query FQ that will be evaluated via ZQ |
2261 | : by the fots test driver. The actual test-case query TQ will be evaluated as |
2262 | - : a nested XQXQ query within FQ. FQ may contain additional nested XQXQ queries, |
2263 | + : a nested ZQ query within FQ. FQ may contain additional nested zorba-query queries, |
2264 | : for example to compute values for external variables declared in TQ. |
2265 | : |
2266 | : @param $queryText the text for the test-case query TQ. It is content of |
2267 | @@ -972,7 +972,7 @@ |
2268 | : These may be defined at test-set level and/or test-case level. |
2269 | : @return the query that will be evaluated. |
2270 | :) |
2271 | -declare %private function driver:create-XQXQ-query( |
2272 | +declare %private function driver:create-ZQ-query( |
2273 | $queryText as xs:string, |
2274 | $case as element(fots:test-case), |
2275 | $env as element(fots:environment)?, |
2276 | @@ -995,7 +995,7 @@ |
2277 | ( |
2278 | ( |
2279 | "", |
2280 | - "import module namespace xqxq = 'http://www.zorba-xquery.com/modules/xqxq';", |
2281 | + "import module namespace zq = 'http://zorba.io/modules/zorba-query';", |
2282 | |
2283 | if ($needsDTDValidation) then |
2284 | ("import module namespace zorba-xml = 'http://zorba.io/modules/xml';", |
2285 | @@ -1003,11 +1003,11 @@ |
2286 | else (), |
2287 | |
2288 | if (exists($resolver)) |
2289 | - then "declare namespace resolver = 'http://www.zorba-xquery.com/modules/xqxq/url-resolver';" |
2290 | + then "declare namespace resolver = 'http://zorba.io/modules/zorba-query/url-resolver';" |
2291 | else (), |
2292 | |
2293 | if (exists($mapper)) |
2294 | - then "declare namespace mapper = 'http://www.zorba-xquery.com/modules/xqxq/uri-mapper';" |
2295 | + then "declare namespace mapper = 'http://zorba.io/modules/zorba-query/uri-mapper';" |
2296 | else (), |
2297 | |
2298 | "", |
2299 | @@ -1037,7 +1037,7 @@ |
2300 | let $escAposQueryText := replace($queryText,"'","''") |
2301 | let $escAmpQueryText := replace($escAposQueryText, '&', '&amp;') |
2302 | return concat( |
2303 | - "variable $queryID := xqxq:prepare-main-module
(", |
2304 | + "variable $queryID := zq:prepare-main-module
(", |
2305 | "
", |
2306 | "'", |
2307 | "
", |
2308 | @@ -1058,9 +1058,9 @@ |
2309 | env:set-variables($env, $envBaseURI), |
2310 | env:set-variables($case/fots:environment, $testSetURI), |
2311 | |
2312 | - "xqxq:evaluate($queryID),", |
2313 | + "zq:evaluate($queryID),", |
2314 | "", |
2315 | - "xqxq:delete-query($queryID)", |
2316 | + "zq:delete-query($queryID)", |
2317 | " " |
2318 | ), |
2319 | "
" |
2320 | |
2321 | === renamed directory 'test/rbkt/ExpQueryResults/zorba/xqxq' => 'test/rbkt/ExpQueryResults/zorba/zorba-query' |
2322 | === renamed directory 'test/rbkt/Queries/zorba/xqxq' => 'test/rbkt/Queries/zorba/zorba-query' |
2323 | === modified file 'test/rbkt/Queries/zorba/zorba-query/bind-context-item.xq' |
2324 | --- test/rbkt/Queries/zorba/xqxq/bind-context-item.xq 2012-10-25 00:07:03 +0000 |
2325 | +++ test/rbkt/Queries/zorba/zorba-query/bind-context-item.xq 2013-08-14 06:22:56 +0000 |
2326 | @@ -1,6 +1,6 @@ |
2327 | -import module namespace xqxq = 'http://www.zorba-xquery.com/modules/xqxq'; |
2328 | +import module namespace zq = 'http://zorba.io/modules/zorba-query'; |
2329 | |
2330 | -variable $query-key := xqxq:prepare-main-module("insert node <child>Content</child> into /parent"); |
2331 | +variable $query-key := zq:prepare-main-module("insert node <child>Content</child> into /parent"); |
2332 | variable $xml := doc("context-item.xml"); |
2333 | -xqxq:bind-context-item($query-key, $xml); |
2334 | -xqxq:is-bound-context-item($query-key) |
2335 | +zq:bind-context-item($query-key, $xml); |
2336 | +zq:is-bound-context-item($query-key) |
2337 | |
2338 | === modified file 'test/rbkt/Queries/zorba/zorba-query/bind-variable.xq' |
2339 | --- test/rbkt/Queries/zorba/xqxq/bind-variable.xq 2012-10-25 00:07:03 +0000 |
2340 | +++ test/rbkt/Queries/zorba/zorba-query/bind-variable.xq 2013-08-14 06:22:56 +0000 |
2341 | @@ -1,4 +1,4 @@ |
2342 | -import module namespace xqxq = 'http://www.zorba-xquery.com/modules/xqxq'; |
2343 | -variable $query-key := xqxq:prepare-main-module('declare variable $a external; $a'); |
2344 | -xqxq:bind-variable($query-key,xs:QName('a'),"foo"); |
2345 | -xqxq:is-bound-variable($query-key, xs:QName('a')) |
2346 | \ No newline at end of file |
2347 | +import module namespace zq = 'http://zorba.io/modules/zorba-query'; |
2348 | +variable $query-key := zq:prepare-main-module('declare variable $a external; $a'); |
2349 | +zq:bind-variable($query-key,xs:QName('a'),"foo"); |
2350 | +zq:is-bound-variable($query-key, xs:QName('a')) |
2351 | \ No newline at end of file |
2352 | |
2353 | === modified file 'test/rbkt/Queries/zorba/zorba-query/delete.spec' |
2354 | --- test/rbkt/Queries/zorba/xqxq/delete.spec 2012-10-25 00:07:03 +0000 |
2355 | +++ test/rbkt/Queries/zorba/zorba-query/delete.spec 2013-08-14 06:22:56 +0000 |
2356 | @@ -1,1 +1,1 @@ |
2357 | -Error: http://www.zorba-xquery.com/modules/xqxq:NoQueryMatch |
2358 | \ No newline at end of file |
2359 | +Error: http://zorba.io/modules/zorba-query:NO_QUERY_MATCH |
2360 | \ No newline at end of file |
2361 | |
2362 | === modified file 'test/rbkt/Queries/zorba/zorba-query/delete.xq' |
2363 | --- test/rbkt/Queries/zorba/xqxq/delete.xq 2012-10-25 00:07:03 +0000 |
2364 | +++ test/rbkt/Queries/zorba/zorba-query/delete.xq 2013-08-14 06:22:56 +0000 |
2365 | @@ -1,5 +1,5 @@ |
2366 | -import module namespace xqxq = 'http://www.zorba-xquery.com/modules/xqxq'; |
2367 | +import module namespace zq = 'http://zorba.io/modules/zorba-query'; |
2368 | |
2369 | -variable $query-key := xqxq:prepare-main-module("1+1"); |
2370 | -xqxq:delete-query($query-key); |
2371 | -xqxq:evaluate($query-key) |
2372 | +variable $query-key := zq:prepare-main-module("1+1"); |
2373 | +zq:delete-query($query-key); |
2374 | +zq:evaluate($query-key) |
2375 | |
2376 | === modified file 'test/rbkt/Queries/zorba/zorba-query/error-in-query.xq' |
2377 | --- test/rbkt/Queries/zorba/xqxq/error-in-query.xq 2013-08-09 08:27:30 +0000 |
2378 | +++ test/rbkt/Queries/zorba/zorba-query/error-in-query.xq 2013-08-14 06:22:56 +0000 |
2379 | @@ -1,4 +1,4 @@ |
2380 | -import module namespace xqxq = 'http://www.zorba-xquery.com/modules/xqxq'; |
2381 | +import module namespace zq = 'http://zorba.io/modules/zorba-query'; |
2382 | |
2383 | declare namespace op = 'http://zorba.io/options/features'; |
2384 | declare namespace f = 'http://zorba.io/features'; |
2385 | @@ -12,9 +12,9 @@ |
2386 | default return () |
2387 | }; |
2388 | |
2389 | -variable $queryID := xqxq:prepare-main-module( |
2390 | +variable $queryID := zq:prepare-main-module( |
2391 | "declare namespace foo='http://test'; |
2392 | declare namespace foo='http://test'; |
2393 | 1", |
2394 | local:url-resolver#2, ()); |
2395 | -xqxq:evaluate($queryID) |
2396 | +zq:evaluate($queryID) |
2397 | |
2398 | === modified file 'test/rbkt/Queries/zorba/zorba-query/evaluate-sequential.xq' |
2399 | --- test/rbkt/Queries/zorba/xqxq/evaluate-sequential.xq 2013-08-09 08:27:30 +0000 |
2400 | +++ test/rbkt/Queries/zorba/zorba-query/evaluate-sequential.xq 2013-08-14 06:22:56 +0000 |
2401 | @@ -1,6 +1,6 @@ |
2402 | -import module namespace xqxq = 'http://www.zorba-xquery.com/modules/xqxq'; |
2403 | +import module namespace zq = 'http://zorba.io/modules/zorba-query'; |
2404 | |
2405 | -variable $query-key := xqxq:prepare-main-module(' |
2406 | +variable $query-key := zq:prepare-main-module(' |
2407 | import module namespace ddl = "http://www.zorba-xquery.com/modules/store/dynamic/collections/ddl"; |
2408 | declare namespace an = "http://zorba.io/annotations"; |
2409 | declare %an:sequential function local:foo() { |
2410 | @@ -12,6 +12,6 @@ |
2411 | local:foo() |
2412 | '); |
2413 | variable $xml := doc("context-item.xml"); |
2414 | -xqxq:bind-context-item($query-key, $xml); |
2415 | -xqxq:evaluate-sequential($query-key) |
2416 | +zq:bind-context-item($query-key, $xml); |
2417 | +zq:evaluate-sequential($query-key) |
2418 | |
2419 | |
2420 | === modified file 'test/rbkt/Queries/zorba/zorba-query/evaluate-sequential2.spec' |
2421 | --- test/rbkt/Queries/zorba/xqxq/evaluate-sequential2.spec 2012-10-25 00:07:03 +0000 |
2422 | +++ test/rbkt/Queries/zorba/zorba-query/evaluate-sequential2.spec 2013-08-14 06:22:56 +0000 |
2423 | @@ -1,1 +1,1 @@ |
2424 | -Error: http://www.zorba-xquery.com/modules/xqxq:QueryIsUpdating |
2425 | \ No newline at end of file |
2426 | +Error: http://zorba.io/modules/zorba-query:QUERY_IS_UPDATING |
2427 | \ No newline at end of file |
2428 | |
2429 | === modified file 'test/rbkt/Queries/zorba/zorba-query/evaluate-sequential2.xq' |
2430 | --- test/rbkt/Queries/zorba/xqxq/evaluate-sequential2.xq 2012-10-25 00:07:03 +0000 |
2431 | +++ test/rbkt/Queries/zorba/zorba-query/evaluate-sequential2.xq 2013-08-14 06:22:56 +0000 |
2432 | @@ -1,6 +1,6 @@ |
2433 | -import module namespace xqxq = 'http://www.zorba-xquery.com/modules/xqxq'; |
2434 | +import module namespace zq = 'http://zorba.io/modules/zorba-query'; |
2435 | |
2436 | -variable $query-key := xqxq:prepare-main-module("insert node <child>Content</child> into /parent"); |
2437 | +variable $query-key := zq:prepare-main-module("insert node <child>Content</child> into /parent"); |
2438 | variable $xml := doc("context-item.xml"); |
2439 | -xqxq:bind-context-item($query-key, $xml); |
2440 | -xqxq:evaluate-sequential($query-key) |
2441 | \ No newline at end of file |
2442 | +zq:bind-context-item($query-key, $xml); |
2443 | +zq:evaluate-sequential($query-key) |
2444 | \ No newline at end of file |
2445 | |
2446 | === modified file 'test/rbkt/Queries/zorba/zorba-query/evaluate-updating.xq' |
2447 | --- test/rbkt/Queries/zorba/xqxq/evaluate-updating.xq 2012-10-25 00:07:03 +0000 |
2448 | +++ test/rbkt/Queries/zorba/zorba-query/evaluate-updating.xq 2013-08-14 06:22:56 +0000 |
2449 | @@ -1,7 +1,7 @@ |
2450 | -import module namespace xqxq = 'http://www.zorba-xquery.com/modules/xqxq'; |
2451 | +import module namespace zq = 'http://zorba.io/modules/zorba-query'; |
2452 | |
2453 | -variable $query-key := xqxq:prepare-main-module("insert node <child>Content</child> into /parent"); |
2454 | +variable $query-key := zq:prepare-main-module("insert node <child>Content</child> into /parent"); |
2455 | variable $xml := doc("context-item.xml"); |
2456 | -xqxq:bind-context-item($query-key, $xml); |
2457 | -xqxq:evaluate-updating($query-key); |
2458 | +zq:bind-context-item($query-key, $xml); |
2459 | +zq:evaluate-updating($query-key); |
2460 | $xml |
2461 | \ No newline at end of file |
2462 | |
2463 | === modified file 'test/rbkt/Queries/zorba/zorba-query/evaluate-updating2.spec' |
2464 | --- test/rbkt/Queries/zorba/xqxq/evaluate-updating2.spec 2012-10-25 00:07:03 +0000 |
2465 | +++ test/rbkt/Queries/zorba/zorba-query/evaluate-updating2.spec 2013-08-14 06:22:56 +0000 |
2466 | @@ -1,1 +1,1 @@ |
2467 | -Error: http://www.zorba-xquery.com/modules/xqxq:QueryIsSequential |
2468 | \ No newline at end of file |
2469 | +Error: http://zorba.io/modules/zorba-query:QUERY_IS_SEQUENTIAL |
2470 | \ No newline at end of file |
2471 | |
2472 | === modified file 'test/rbkt/Queries/zorba/zorba-query/evaluate-updating2.xq' |
2473 | --- test/rbkt/Queries/zorba/xqxq/evaluate-updating2.xq 2013-08-09 08:27:30 +0000 |
2474 | +++ test/rbkt/Queries/zorba/zorba-query/evaluate-updating2.xq 2013-08-14 06:22:56 +0000 |
2475 | @@ -1,6 +1,6 @@ |
2476 | -import module namespace xqxq = 'http://www.zorba-xquery.com/modules/xqxq'; |
2477 | +import module namespace zq = 'http://zorba.io/modules/zorba-query'; |
2478 | |
2479 | -variable $query-key := xqxq:prepare-main-module(' |
2480 | +variable $query-key := zq:prepare-main-module(' |
2481 | import module namespace ddl = "http://www.zorba-xquery.com/modules/store/dynamic/collections/ddl"; |
2482 | declare namespace an = "http://zorba.io/annotations"; |
2483 | declare %an:sequential function local:foo() { |
2484 | @@ -11,5 +11,5 @@ |
2485 | |
2486 | local:foo() |
2487 | '); |
2488 | -xqxq:evaluate-updating($query-key); |
2489 | +zq:evaluate-updating($query-key); |
2490 | |
2491 | |
2492 | === modified file 'test/rbkt/Queries/zorba/zorba-query/evaluate.xq' |
2493 | --- test/rbkt/Queries/zorba/xqxq/evaluate.xq 2012-10-25 00:07:03 +0000 |
2494 | +++ test/rbkt/Queries/zorba/zorba-query/evaluate.xq 2013-08-14 06:22:56 +0000 |
2495 | @@ -1,5 +1,5 @@ |
2496 | -import module namespace xqxq = 'http://www.zorba-xquery.com/modules/xqxq'; |
2497 | +import module namespace zq = 'http://zorba.io/modules/zorba-query'; |
2498 | |
2499 | -variable $query-key := xqxq:prepare-main-module("1+1"); |
2500 | -variable $a := xqxq:evaluate($query-key); |
2501 | +variable $query-key := zq:prepare-main-module("1+1"); |
2502 | +variable $a := zq:evaluate($query-key); |
2503 | $a |
2504 | |
2505 | === modified file 'test/rbkt/Queries/zorba/zorba-query/evaluate2.xq' |
2506 | --- test/rbkt/Queries/zorba/xqxq/evaluate2.xq 2012-10-25 00:07:03 +0000 |
2507 | +++ test/rbkt/Queries/zorba/zorba-query/evaluate2.xq 2013-08-14 06:22:56 +0000 |
2508 | @@ -1,6 +1,6 @@ |
2509 | -import module namespace xqxq = 'http://www.zorba-xquery.com/modules/xqxq'; |
2510 | +import module namespace zq = 'http://zorba.io/modules/zorba-query'; |
2511 | |
2512 | -variable $query-key := xqxq:prepare-main-module("declare variable $a external; $a+1"); |
2513 | -xqxq:bind-variable($query-key, xs:QName("a"), 1); |
2514 | -variable $b := xqxq:evaluate($query-key); |
2515 | +variable $query-key := zq:prepare-main-module("declare variable $a external; $a+1"); |
2516 | +zq:bind-variable($query-key, xs:QName("a"), 1); |
2517 | +variable $b := zq:evaluate($query-key); |
2518 | $b |
2519 | |
2520 | === modified file 'test/rbkt/Queries/zorba/zorba-query/evaluate3.spec' |
2521 | --- test/rbkt/Queries/zorba/xqxq/evaluate3.spec 2012-10-25 00:07:03 +0000 |
2522 | +++ test/rbkt/Queries/zorba/zorba-query/evaluate3.spec 2013-08-14 06:22:56 +0000 |
2523 | @@ -1,1 +1,1 @@ |
2524 | -Error: http://www.zorba-xquery.com/modules/xqxq:QueryIsSequential |
2525 | \ No newline at end of file |
2526 | +Error: http://zorba.io/modules/zorba-query:QUERY_IS_SEQUENTIAL |
2527 | \ No newline at end of file |
2528 | |
2529 | === modified file 'test/rbkt/Queries/zorba/zorba-query/evaluate3.xq' |
2530 | --- test/rbkt/Queries/zorba/xqxq/evaluate3.xq 2013-08-09 08:27:30 +0000 |
2531 | +++ test/rbkt/Queries/zorba/zorba-query/evaluate3.xq 2013-08-14 06:22:56 +0000 |
2532 | @@ -1,6 +1,6 @@ |
2533 | -import module namespace xqxq = 'http://www.zorba-xquery.com/modules/xqxq'; |
2534 | +import module namespace zq = 'http://zorba.io/modules/zorba-query'; |
2535 | |
2536 | -variable $query-key := xqxq:prepare-main-module(' |
2537 | +variable $query-key := zq:prepare-main-module(' |
2538 | import module namespace ddl = "http://www.zorba-xquery.com/modules/store/dynamic/collections/ddl"; |
2539 | declare namespace an = "http://zorba.io/annotations"; |
2540 | declare %an:sequential function local:foo() { |
2541 | @@ -11,5 +11,5 @@ |
2542 | |
2543 | local:foo() |
2544 | '); |
2545 | -variable $a := xqxq:evaluate($query-key); |
2546 | +variable $a := zq:evaluate($query-key); |
2547 | $a |
2548 | |
2549 | === modified file 'test/rbkt/Queries/zorba/zorba-query/external-module.xq' |
2550 | --- test/rbkt/Queries/zorba/xqxq/external-module.xq 2013-07-17 09:01:57 +0000 |
2551 | +++ test/rbkt/Queries/zorba/zorba-query/external-module.xq 2013-08-14 06:22:56 +0000 |
2552 | @@ -1,8 +1,8 @@ |
2553 | -import module namespace xqxq = 'http://www.zorba-xquery.com/modules/xqxq'; |
2554 | +import module namespace zq = 'http://zorba.io/modules/zorba-query'; |
2555 | |
2556 | -variable $query-key := xqxq:prepare-main-module(' |
2557 | +variable $query-key := zq:prepare-main-module(' |
2558 | import module namespace r = "http://zorba.io/modules/random"; |
2559 | |
2560 | count((for $i in 1 to 10 return r:random(10), r:random())) eq 101 |
2561 | '); |
2562 | -xqxq:evaluate($query-key) |
2563 | \ No newline at end of file |
2564 | +zq:evaluate($query-key) |
2565 | \ No newline at end of file |
2566 | |
2567 | === modified file 'test/rbkt/Queries/zorba/zorba-query/get-external-variables.xq' |
2568 | --- test/rbkt/Queries/zorba/xqxq/get-external-variables.xq 2012-10-25 00:07:03 +0000 |
2569 | +++ test/rbkt/Queries/zorba/zorba-query/get-external-variables.xq 2013-08-14 06:22:56 +0000 |
2570 | @@ -1,4 +1,4 @@ |
2571 | -import module namespace xqxq = 'http://www.zorba-xquery.com/modules/xqxq'; |
2572 | -variable $query-key2 := xqxq:prepare-main-module('declare variable $c external; $c'); |
2573 | -variable $query-key := xqxq:prepare-main-module('declare variable $a external;declare variable $d := "hi"; $a'); |
2574 | -xqxq:external-variables($query-key) |
2575 | \ No newline at end of file |
2576 | +import module namespace zq = 'http://zorba.io/modules/zorba-query'; |
2577 | +variable $query-key2 := zq:prepare-main-module('declare variable $c external; $c'); |
2578 | +variable $query-key := zq:prepare-main-module('declare variable $a external;declare variable $d := "hi"; $a'); |
2579 | +zq:external-variables($query-key) |
2580 | \ No newline at end of file |
2581 | |
2582 | === modified file 'test/rbkt/Queries/zorba/zorba-query/is-bound-context-item.xq' |
2583 | --- test/rbkt/Queries/zorba/xqxq/is-bound-context-item.xq 2012-10-25 00:07:03 +0000 |
2584 | +++ test/rbkt/Queries/zorba/zorba-query/is-bound-context-item.xq 2013-08-14 06:22:56 +0000 |
2585 | @@ -1,4 +1,4 @@ |
2586 | -import module namespace xqxq = 'http://www.zorba-xquery.com/modules/xqxq'; |
2587 | +import module namespace zq = 'http://zorba.io/modules/zorba-query'; |
2588 | |
2589 | -variable $query-key := xqxq:prepare-main-module("insert node <child/> into /parent"); |
2590 | -xqxq:is-bound-context-item($query-key) |
2591 | +variable $query-key := zq:prepare-main-module("insert node <child/> into /parent"); |
2592 | +zq:is-bound-context-item($query-key) |
2593 | |
2594 | === modified file 'test/rbkt/Queries/zorba/zorba-query/is-bound-variable.xq' |
2595 | --- test/rbkt/Queries/zorba/xqxq/is-bound-variable.xq 2013-02-15 06:11:20 +0000 |
2596 | +++ test/rbkt/Queries/zorba/zorba-query/is-bound-variable.xq 2013-08-14 06:22:56 +0000 |
2597 | @@ -1,11 +1,11 @@ |
2598 | -import module namespace xqxq = 'http://www.zorba-xquery.com/modules/xqxq'; |
2599 | -variable $query-key := xqxq:prepare-main-module(' |
2600 | +import module namespace zq = 'http://zorba.io/modules/zorba-query'; |
2601 | +variable $query-key := zq:prepare-main-module(' |
2602 | declare variable $a external; |
2603 | declare variable $b external := 2; |
2604 | declare variable $c external; |
2605 | $a'); |
2606 | -xqxq:bind-variable($query-key, xs:QName('a'), "foo"); |
2607 | -xqxq:is-bound-variable($query-key, xs:QName('a')), |
2608 | -xqxq:is-bound-variable($query-key, xs:QName('b')), |
2609 | -xqxq:is-bound-variable($query-key, xs:QName('c')), |
2610 | -xqxq:variable-value($query-key, xs:QName('a')) |
2611 | +zq:bind-variable($query-key, xs:QName('a'), "foo"); |
2612 | +zq:is-bound-variable($query-key, xs:QName('a')), |
2613 | +zq:is-bound-variable($query-key, xs:QName('b')), |
2614 | +zq:is-bound-variable($query-key, xs:QName('c')), |
2615 | +zq:variable-value($query-key, xs:QName('a')) |
2616 | |
2617 | === modified file 'test/rbkt/Queries/zorba/zorba-query/is-bound-variable2.spec' |
2618 | --- test/rbkt/Queries/zorba/xqxq/is-bound-variable2.spec 2012-10-25 00:07:03 +0000 |
2619 | +++ test/rbkt/Queries/zorba/zorba-query/is-bound-variable2.spec 2013-08-14 06:22:56 +0000 |
2620 | @@ -1,1 +1,1 @@ |
2621 | -Error: http://www.zorba-xquery.com/modules/xqxq:UndeclaredVariable |
2622 | \ No newline at end of file |
2623 | +Error: http://zorba.io/modules/zorba-query:UNDECLARED_VARIABLE |
2624 | \ No newline at end of file |
2625 | |
2626 | === modified file 'test/rbkt/Queries/zorba/zorba-query/is-bound-variable2.xq' |
2627 | --- test/rbkt/Queries/zorba/xqxq/is-bound-variable2.xq 2012-10-25 00:07:03 +0000 |
2628 | +++ test/rbkt/Queries/zorba/zorba-query/is-bound-variable2.xq 2013-08-14 06:22:56 +0000 |
2629 | @@ -1,7 +1,7 @@ |
2630 | -import module namespace xqxq = 'http://www.zorba-xquery.com/modules/xqxq'; |
2631 | -variable $query-key := xqxq:prepare-main-module(' |
2632 | +import module namespace zq = 'http://zorba.io/modules/zorba-query'; |
2633 | +variable $query-key := zq:prepare-main-module(' |
2634 | declare variable $a external; |
2635 | declare variable $b external := 2; |
2636 | declare variable $c external; |
2637 | $a'); |
2638 | -xqxq:is-bound-variable($query-key, xs:QName('x')) |
2639 | \ No newline at end of file |
2640 | +zq:is-bound-variable($query-key, xs:QName('x')) |
2641 | \ No newline at end of file |
2642 | |
2643 | === modified file 'test/rbkt/Queries/zorba/zorba-query/is-sequential.xq' |
2644 | --- test/rbkt/Queries/zorba/xqxq/is-sequential.xq 2013-08-09 08:27:30 +0000 |
2645 | +++ test/rbkt/Queries/zorba/zorba-query/is-sequential.xq 2013-08-14 06:22:56 +0000 |
2646 | @@ -1,6 +1,6 @@ |
2647 | -import module namespace xqxq = 'http://www.zorba-xquery.com/modules/xqxq'; |
2648 | +import module namespace zq = 'http://zorba.io/modules/zorba-query'; |
2649 | |
2650 | -variable $query-key1 := xqxq:prepare-main-module(' |
2651 | +variable $query-key1 := zq:prepare-main-module(' |
2652 | import module namespace ddl = "http://www.zorba-xquery.com/modules/store/dynamic/collections/ddl"; |
2653 | declare namespace an = "http://zorba.io/annotations"; |
2654 | declare %an:sequential function local:foo() { |
2655 | @@ -11,8 +11,8 @@ |
2656 | |
2657 | local:foo() |
2658 | '); |
2659 | -variable $query-key2 := xqxq:prepare-main-module("insert node <child/> into /parent"); |
2660 | -variable $is-sequential := xqxq:is-sequential($query-key1); |
2661 | -variable $is-not-sequential := xqxq:is-sequential($query-key2); |
2662 | +variable $query-key2 := zq:prepare-main-module("insert node <child/> into /parent"); |
2663 | +variable $is-sequential := zq:is-sequential($query-key1); |
2664 | +variable $is-not-sequential := zq:is-sequential($query-key2); |
2665 | $is-sequential, $is-not-sequential |
2666 | |
2667 | |
2668 | === modified file 'test/rbkt/Queries/zorba/zorba-query/is-updating.xq' |
2669 | --- test/rbkt/Queries/zorba/xqxq/is-updating.xq 2013-08-09 08:27:30 +0000 |
2670 | +++ test/rbkt/Queries/zorba/zorba-query/is-updating.xq 2013-08-14 06:22:56 +0000 |
2671 | @@ -1,6 +1,6 @@ |
2672 | -import module namespace xqxq = 'http://www.zorba-xquery.com/modules/xqxq'; |
2673 | +import module namespace zq = 'http://zorba.io/modules/zorba-query'; |
2674 | |
2675 | -variable $query-key1 := xqxq:prepare-main-module(' |
2676 | +variable $query-key1 := zq:prepare-main-module(' |
2677 | import module namespace ddl = "http://www.zorba-xquery.com/modules/store/dynamic/collections/ddl"; |
2678 | declare namespace an = "http://zorba.io/annotations"; |
2679 | declare %an:sequential function local:foo() { |
2680 | @@ -11,10 +11,10 @@ |
2681 | |
2682 | local:foo() |
2683 | '); |
2684 | -variable $query-key2 := xqxq:prepare-main-module("insert node <child/> into /parent"); |
2685 | -variable $is-updating := xqxq:is-updating($query-key2); |
2686 | -variable $is-not-updating := xqxq:is-updating($query-key1); |
2687 | -xqxq:delete-query($query-key1); |
2688 | -xqxq:delete-query($query-key2); |
2689 | +variable $query-key2 := zq:prepare-main-module("insert node <child/> into /parent"); |
2690 | +variable $is-updating := zq:is-updating($query-key2); |
2691 | +variable $is-not-updating := zq:is-updating($query-key1); |
2692 | +zq:delete-query($query-key1); |
2693 | +zq:delete-query($query-key2); |
2694 | $is-updating, $is-not-updating |
2695 | |
2696 | |
2697 | === modified file 'test/rbkt/Queries/zorba/zorba-query/multiple-queries.xq' |
2698 | --- test/rbkt/Queries/zorba/xqxq/multiple-queries.xq 2012-10-25 00:07:03 +0000 |
2699 | +++ test/rbkt/Queries/zorba/zorba-query/multiple-queries.xq 2013-08-14 06:22:56 +0000 |
2700 | @@ -1,9 +1,9 @@ |
2701 | -import module namespace xqxq = 'http://www.zorba-xquery.com/modules/xqxq'; |
2702 | +import module namespace zq = 'http://zorba.io/modules/zorba-query'; |
2703 | |
2704 | -variable $query-key1 := xqxq:prepare-main-module("1+1"); |
2705 | -variable $query-key2 := xqxq:prepare-main-module("1+2"); |
2706 | -variable $a := xqxq:evaluate($query-key1); |
2707 | -variable $b := xqxq:evaluate($query-key2); |
2708 | -xqxq:delete-query($query-key1); |
2709 | -xqxq:delete-query($query-key2); |
2710 | +variable $query-key1 := zq:prepare-main-module("1+1"); |
2711 | +variable $query-key2 := zq:prepare-main-module("1+2"); |
2712 | +variable $a := zq:evaluate($query-key1); |
2713 | +variable $b := zq:evaluate($query-key2); |
2714 | +zq:delete-query($query-key1); |
2715 | +zq:delete-query($query-key2); |
2716 | $a, $b |
2717 | |
2718 | === modified file 'test/rbkt/Queries/zorba/zorba-query/prepare-library-module.xq' |
2719 | --- test/rbkt/Queries/zorba/xqxq/prepare-library-module.xq 2012-10-25 00:07:03 +0000 |
2720 | +++ test/rbkt/Queries/zorba/zorba-query/prepare-library-module.xq 2013-08-14 06:22:56 +0000 |
2721 | @@ -1,3 +1,3 @@ |
2722 | -import module namespace xqxq = 'http://www.zorba-xquery.com/modules/xqxq'; |
2723 | +import module namespace zq = 'http://zorba.io/modules/zorba-query'; |
2724 | |
2725 | -xqxq:prepare-library-module('module namespace foo = "foo:bar"; declare function foo:bar() { 1 }') |
2726 | +zq:prepare-library-module('module namespace foo = "foo:bar"; declare function foo:bar() { 1 }') |
2727 | |
2728 | === modified file 'test/rbkt/Queries/zorba/zorba-query/query-plan.xq' |
2729 | --- test/rbkt/Queries/zorba/xqxq/query-plan.xq 2013-03-22 23:09:40 +0000 |
2730 | +++ test/rbkt/Queries/zorba/zorba-query/query-plan.xq 2013-08-14 06:22:56 +0000 |
2731 | @@ -1,6 +1,6 @@ |
2732 | -import module namespace xqxq = 'http://www.zorba-xquery.com/modules/xqxq'; |
2733 | +import module namespace zq = 'http://zorba.io/modules/zorba-query'; |
2734 | |
2735 | -variable $queryID := xqxq:prepare-main-module("1+1"); |
2736 | -variable $query-plan := xqxq:query-plan($queryID); |
2737 | -variable $queryID2 := xqxq:load-from-query-plan($query-plan); |
2738 | -xqxq:evaluate ($queryID2) |
2739 | +variable $queryID := zq:prepare-main-module("1+1"); |
2740 | +variable $query-plan := zq:query-plan($queryID); |
2741 | +variable $queryID2 := zq:load-from-query-plan($query-plan); |
2742 | +zq:evaluate ($queryID2) |
2743 | |
2744 | === modified file 'test/rbkt/Queries/zorba/zorba-query/query-plan2.xq' |
2745 | --- test/rbkt/Queries/zorba/xqxq/query-plan2.xq 2013-08-09 08:27:30 +0000 |
2746 | +++ test/rbkt/Queries/zorba/zorba-query/query-plan2.xq 2013-08-14 06:22:56 +0000 |
2747 | @@ -1,6 +1,6 @@ |
2748 | -import module namespace xqxq = 'http://www.zorba-xquery.com/modules/xqxq'; |
2749 | +import module namespace zq = 'http://zorba.io/modules/zorba-query'; |
2750 | |
2751 | -declare namespace resolver = 'http://www.zorba-xquery.com/modules/xqxq/url-resolver'; |
2752 | +declare namespace resolver = 'http://zorba.io/modules/zorba-query/url-resolver'; |
2753 | declare namespace op = "http://zorba.io/options/features"; |
2754 | declare namespace f = "http://zorba.io/features"; |
2755 | |
2756 | @@ -10,11 +10,11 @@ |
2757 | else () |
2758 | }; |
2759 | |
2760 | -variable $queryID := xqxq:prepare-main-module( |
2761 | +variable $queryID := zq:prepare-main-module( |
2762 | "import module namespace test = 'http://test'; test:foo()", |
2763 | resolver:url-resolver#2, ()); |
2764 | |
2765 | |
2766 | -variable $query-plan := xqxq:query-plan($queryID); |
2767 | -variable $queryID2 := xqxq:load-from-query-plan($query-plan, resolver:url-resolver#2, ()); |
2768 | -xqxq:evaluate ($queryID2) |
2769 | +variable $query-plan := zq:query-plan($queryID); |
2770 | +variable $queryID2 := zq:load-from-query-plan($query-plan, resolver:url-resolver#2, ()); |
2771 | +zq:evaluate ($queryID2) |
2772 | |
2773 | === modified file 'test/rbkt/Queries/zorba/zorba-query/query-plan3.xq' |
2774 | --- test/rbkt/Queries/zorba/xqxq/query-plan3.xq 2013-08-09 08:27:30 +0000 |
2775 | +++ test/rbkt/Queries/zorba/zorba-query/query-plan3.xq 2013-08-14 06:22:56 +0000 |
2776 | @@ -1,7 +1,7 @@ |
2777 | -import module namespace xqxq = 'http://www.zorba-xquery.com/modules/xqxq'; |
2778 | +import module namespace zq = 'http://zorba.io/modules/zorba-query'; |
2779 | |
2780 | -declare namespace resolver = 'http://www.zorba-xquery.com/modules/xqxq/url-resolver'; |
2781 | -declare namespace mapper = 'http://www.zorba-xquery.com/modules/xqxq/uri-mapper'; |
2782 | +declare namespace resolver = 'http://zorba.io/modules/zorba-query/url-resolver'; |
2783 | +declare namespace mapper = 'http://zorba.io/modules/zorba-query/uri-mapper'; |
2784 | declare namespace op = "http://zorba.io/options/features"; |
2785 | declare namespace f = "http://zorba.io/features"; |
2786 | |
2787 | @@ -18,11 +18,11 @@ |
2788 | else () |
2789 | }; |
2790 | |
2791 | -variable $queryID := xqxq:prepare-main-module |
2792 | +variable $queryID := zq:prepare-main-module |
2793 | ( |
2794 | "import module namespace test = 'http://test'; test:foo()", |
2795 | resolver:url-resolver#2, mapper:uri-mapper#2 |
2796 | ); |
2797 | -variable $query-plan := xqxq:query-plan($queryID); |
2798 | -variable $queryID2 := xqxq:load-from-query-plan($query-plan, resolver:url-resolver#2, mapper:uri-mapper#2); |
2799 | -xqxq:evaluate ($queryID2) |
2800 | +variable $query-plan := zq:query-plan($queryID); |
2801 | +variable $queryID2 := zq:load-from-query-plan($query-plan, resolver:url-resolver#2, mapper:uri-mapper#2); |
2802 | +zq:evaluate ($queryID2) |
2803 | |
2804 | === modified file 'test/rbkt/Queries/zorba/zorba-query/query-plan4.xq' |
2805 | --- test/rbkt/Queries/zorba/xqxq/query-plan4.xq 2013-08-09 08:27:30 +0000 |
2806 | +++ test/rbkt/Queries/zorba/zorba-query/query-plan4.xq 2013-08-14 06:22:56 +0000 |
2807 | @@ -1,7 +1,7 @@ |
2808 | -import module namespace xqxq = 'http://www.zorba-xquery.com/modules/xqxq'; |
2809 | +import module namespace zq = 'http://zorba.io/modules/zorba-query'; |
2810 | |
2811 | -declare namespace resolver = 'http://www.zorba-xquery.com/modules/xqxq/url-resolver'; |
2812 | -declare namespace mapper = 'http://www.zorba-xquery.com/modules/xqxq/uri-mapper'; |
2813 | +declare namespace resolver = 'http://zorba.io/modules/zorba-query/url-resolver'; |
2814 | +declare namespace mapper = 'http://zorba.io/modules/zorba-query/uri-mapper'; |
2815 | declare namespace op = "http://zorba.io/options/features"; |
2816 | declare namespace f = "http://zorba.io/features"; |
2817 | |
2818 | @@ -18,11 +18,11 @@ |
2819 | else () |
2820 | }; |
2821 | |
2822 | -variable $queryID := xqxq:prepare-main-module |
2823 | +variable $queryID := zq:prepare-main-module |
2824 | ( |
2825 | "import module namespace test = 'http://test'; test:foo()", |
2826 | resolver:url-resolver#2, mapper:uri-mapper#2 |
2827 | ); |
2828 | -variable $query-plan := xqxq:query-plan($queryID); |
2829 | -variable $queryID2 := xqxq:load-from-query-plan($query-plan); |
2830 | -xqxq:evaluate ($queryID2) |
2831 | +variable $query-plan := zq:query-plan($queryID); |
2832 | +variable $queryID2 := zq:load-from-query-plan($query-plan); |
2833 | +zq:evaluate ($queryID2) |
2834 | |
2835 | === modified file 'test/rbkt/Queries/zorba/zorba-query/uri-mapper.xq' |
2836 | --- test/rbkt/Queries/zorba/xqxq/uri-mapper.xq 2013-08-09 08:27:30 +0000 |
2837 | +++ test/rbkt/Queries/zorba/zorba-query/uri-mapper.xq 2013-08-14 06:22:56 +0000 |
2838 | @@ -1,7 +1,7 @@ |
2839 | -import module namespace xqxq = 'http://www.zorba-xquery.com/modules/xqxq'; |
2840 | +import module namespace zq = 'http://zorba.io/modules/zorba-query'; |
2841 | |
2842 | -declare namespace resolver = 'http://www.zorba-xquery.com/modules/xqxq/url-resolver'; |
2843 | -declare namespace mapper = 'http://www.zorba-xquery.com/modules/xqxq/uri-mapper'; |
2844 | +declare namespace resolver = 'http://zorba.io/modules/zorba-query/url-resolver'; |
2845 | +declare namespace mapper = 'http://zorba.io/modules/zorba-query/uri-mapper'; |
2846 | declare namespace op = "http://zorba.io/options/features"; |
2847 | declare namespace f = "http://zorba.io/features"; |
2848 | |
2849 | @@ -18,9 +18,9 @@ |
2850 | else () |
2851 | }; |
2852 | |
2853 | -variable $queryID := xqxq:prepare-main-module |
2854 | +variable $queryID := zq:prepare-main-module |
2855 | ( |
2856 | "import module namespace test = 'http://test'; test:foo()", |
2857 | resolver:url-resolver#2, mapper:uri-mapper#2 |
2858 | ); |
2859 | -xqxq:evaluate($queryID) |
2860 | +zq:evaluate($queryID) |
2861 | |
2862 | === modified file 'test/rbkt/Queries/zorba/zorba-query/uri-mapper2.xq' |
2863 | --- test/rbkt/Queries/zorba/xqxq/uri-mapper2.xq 2013-08-09 08:27:30 +0000 |
2864 | +++ test/rbkt/Queries/zorba/zorba-query/uri-mapper2.xq 2013-08-14 06:22:56 +0000 |
2865 | @@ -1,7 +1,7 @@ |
2866 | -import module namespace xqxq = 'http://www.zorba-xquery.com/modules/xqxq'; |
2867 | +import module namespace zq = 'http://zorba.io/modules/zorba-query'; |
2868 | |
2869 | -declare namespace resolver = 'http://www.zorba-xquery.com/modules/xqxq/url-resolver'; |
2870 | -declare namespace mapper = 'http://www.zorba-xquery.com/modules/xqxq/uri-mapper'; |
2871 | +declare namespace resolver = 'http://zorba.io/modules/zorba-query/url-resolver'; |
2872 | +declare namespace mapper = 'http://zorba.io/modules/zorba-query/uri-mapper'; |
2873 | declare namespace op = "http://zorba.io/options/features"; |
2874 | declare namespace f = "http://zorba.io/features"; |
2875 | |
2876 | @@ -12,10 +12,10 @@ |
2877 | else () |
2878 | }; |
2879 | |
2880 | -variable $queryID := xqxq:prepare-main-module |
2881 | +variable $queryID := zq:prepare-main-module |
2882 | ( |
2883 | "import schema namespace test = 'http://test'; validate{<test:test><test:subtest>a</test:subtest><test:subtest2>a</test:subtest2></test:test>}", |
2884 | (), |
2885 | mapper:uri-mapper#2 |
2886 | ); |
2887 | -xqxq:evaluate($queryID) |
2888 | +zq:evaluate($queryID) |
2889 | |
2890 | === modified file 'test/rbkt/Queries/zorba/zorba-query/url-module-resolver.xq' |
2891 | --- test/rbkt/Queries/zorba/xqxq/url-module-resolver.xq 2013-08-09 08:27:30 +0000 |
2892 | +++ test/rbkt/Queries/zorba/zorba-query/url-module-resolver.xq 2013-08-14 06:22:56 +0000 |
2893 | @@ -1,6 +1,6 @@ |
2894 | -import module namespace xqxq = 'http://www.zorba-xquery.com/modules/xqxq'; |
2895 | +import module namespace zq = 'http://zorba.io/modules/zorba-query'; |
2896 | |
2897 | -declare namespace resolver = 'http://www.zorba-xquery.com/modules/xqxq/url-resolver'; |
2898 | +declare namespace resolver = 'http://zorba.io/modules/zorba-query/url-resolver'; |
2899 | declare namespace op = "http://zorba.io/options/features"; |
2900 | declare namespace f = "http://zorba.io/features"; |
2901 | |
2902 | @@ -10,7 +10,7 @@ |
2903 | else () |
2904 | }; |
2905 | |
2906 | -variable $queryID := xqxq:prepare-main-module( |
2907 | +variable $queryID := zq:prepare-main-module( |
2908 | "import module namespace test = 'http://test'; test:foo()", |
2909 | resolver:url-resolver#2, ()); |
2910 | -xqxq:evaluate($queryID) |
2911 | +zq:evaluate($queryID) |
2912 | |
2913 | === modified file 'test/rbkt/Queries/zorba/zorba-query/url-schema-resolver.xq' |
2914 | --- test/rbkt/Queries/zorba/xqxq/url-schema-resolver.xq 2013-08-09 08:27:30 +0000 |
2915 | +++ test/rbkt/Queries/zorba/zorba-query/url-schema-resolver.xq 2013-08-14 06:22:56 +0000 |
2916 | @@ -1,6 +1,6 @@ |
2917 | -import module namespace xqxq = 'http://www.zorba-xquery.com/modules/xqxq'; |
2918 | +import module namespace zq = 'http://zorba.io/modules/zorba-query'; |
2919 | |
2920 | -declare namespace resolver = 'http://www.zorba-xquery.com/modules/xqxq/url-resolver'; |
2921 | +declare namespace resolver = 'http://zorba.io/modules/zorba-query/url-resolver'; |
2922 | |
2923 | declare namespace op = "http://zorba.io/options/features"; |
2924 | declare namespace f = "http://zorba.io/features"; |
2925 | @@ -13,7 +13,7 @@ |
2926 | () |
2927 | }; |
2928 | |
2929 | -variable $queryID := xqxq:prepare-main-module( |
2930 | +variable $queryID := zq:prepare-main-module( |
2931 | "import schema namespace test = 'http://test'; validate {<test:test><test:subtest>a</test:subtest><test:subtest2>a</test:subtest2></test:test>}", |
2932 | resolver:url-resolver#2, ()); |
2933 | -xqxq:evaluate($queryID) |
2934 | +zq:evaluate($queryID) |
2935 | |
2936 | === modified file 'test/rbkt/Queries/zorba/zorba-query/url-schema-resolver2.xq' |
2937 | --- test/rbkt/Queries/zorba/xqxq/url-schema-resolver2.xq 2013-08-09 08:27:30 +0000 |
2938 | +++ test/rbkt/Queries/zorba/zorba-query/url-schema-resolver2.xq 2013-08-14 06:22:56 +0000 |
2939 | @@ -1,28 +1,28 @@ |
2940 | -import module namespace xqxq = 'http://www.zorba-xquery.com/modules/xqxq'; |
2941 | +import module namespace zq = 'http://zorba.io/modules/zorba-query'; |
2942 | |
2943 | import module namespace ddl = |
2944 | "http://www.zorba-xquery.com/modules/store/dynamic/collections/w3c/ddl"; |
2945 | import module namespace dml = |
2946 | "http://www.zorba-xquery.com/modules/store/dynamic/collections/w3c/dml"; |
2947 | |
2948 | -declare namespace resolver = 'http://www.zorba-xquery.com/modules/xqxq/url-resolver'; |
2949 | +declare namespace resolver = 'http://zorba.io/modules/zorba-query/url-resolver'; |
2950 | declare namespace op = "http://zorba.io/options/features"; |
2951 | declare namespace f = "http://zorba.io/features"; |
2952 | |
2953 | declare function resolver:url-resolver($namespace as xs:string, $entity as xs:string) { |
2954 | if ($entity = 'schema') |
2955 | then |
2956 | - dml:collection("http://www.zorba-xquery.com/modules/xqxq")//xs:schema[@targetNamespace=$namespace] |
2957 | + dml:collection("http://zorba.io/modules/zorba-query")//xs:schema[@targetNamespace=$namespace] |
2958 | else |
2959 | () |
2960 | }; |
2961 | |
2962 | -declare variable $coll := "http://www.zorba-xquery.com/modules/xqxq"; |
2963 | +declare variable $coll := "http://zorba.io/modules/zorba-query"; |
2964 | declare variable $schema := doc("test.xsd"); |
2965 | ddl:create($coll); |
2966 | |
2967 | dml:apply-insert-nodes-first($coll, $schema); |
2968 | -variable $query-key := xqxq:prepare-main-module( |
2969 | +variable $query-key := zq:prepare-main-module( |
2970 | "import schema namespace test = 'http://test'; validate {<test:test><test:subtest>a</test:subtest><test:subtest2>a</test:subtest2></test:test>}", |
2971 | resolver:url-resolver#2, ()); |
2972 | -xqxq:evaluate($query-key) |
2973 | +zq:evaluate($query-key) |
2974 | |
2975 | === modified file 'test/rbkt/Queries/zorba/zorba-query/url-schema-resolver3.xq' |
2976 | --- test/rbkt/Queries/zorba/xqxq/url-schema-resolver3.xq 2013-08-09 08:27:30 +0000 |
2977 | +++ test/rbkt/Queries/zorba/zorba-query/url-schema-resolver3.xq 2013-08-14 06:22:56 +0000 |
2978 | @@ -1,6 +1,6 @@ |
2979 | -import module namespace xqxq = 'http://www.zorba-xquery.com/modules/xqxq'; |
2980 | +import module namespace zq = 'http://zorba.io/modules/zorba-query'; |
2981 | |
2982 | -declare namespace resolver = 'http://www.zorba-xquery.com/modules/xqxq/url-resolver'; |
2983 | +declare namespace resolver = 'http://zorba.io/modules/zorba-query/url-resolver'; |
2984 | |
2985 | declare namespace op = "http://zorba.io/options/features"; |
2986 | declare namespace f = "http://zorba.io/features"; |
2987 | @@ -13,16 +13,16 @@ |
2988 | () |
2989 | }; |
2990 | |
2991 | -variable $contextQueryID := xqxq:prepare-main-module( |
2992 | +variable $contextQueryID := zq:prepare-main-module( |
2993 | "import schema namespace test = 'http://test'; |
2994 | declare variable $cwd as xs:anyURI external; |
2995 | validate { doc(resolve-uri('test.xml', $cwd)) }", |
2996 | resolver:url-resolver#2, ()); |
2997 | -xqxq:bind-variable($contextQueryID, fn:QName("", "cwd"), resolve-uri(".")); |
2998 | -variable $contextItem := xqxq:evaluate($contextQueryID); |
2999 | +zq:bind-variable($contextQueryID, fn:QName("", "cwd"), resolve-uri(".")); |
3000 | +variable $contextItem := zq:evaluate($contextQueryID); |
3001 | |
3002 | -variable $queryID := xqxq:prepare-main-module( |
3003 | +variable $queryID := zq:prepare-main-module( |
3004 | "import schema namespace test = 'http://test'; //*:test", |
3005 | resolver:url-resolver#2, ()); |
3006 | -xqxq:bind-context-item($queryID, $contextItem); |
3007 | -xqxq:evaluate($queryID) |
3008 | +zq:bind-context-item($queryID, $contextItem); |
3009 | +zq:evaluate($queryID) |
Validation queue starting for the following merge proposals: /code.launchpad .net/~zorba- coders/ zorba/update3. 0_zorba- query-module/ +merge/ 179756
https:/
Progress dashboard at http:// jenkins. lambda. nu/view/ ValidationQueue