Merge lp:~zorba-coders/zorba/markos-scratch into lp:zorba

Proposed by Markos Zaharioudakis on 2013-06-20
Status: Merged
Approved by: Markos Zaharioudakis on 2013-06-20
Approved revision: 11159
Merged at revision: 11531
Proposed branch: lp:~zorba-coders/zorba/markos-scratch
Merge into: lp:zorba
Diff against target: 1045 lines (+233/-176)
9 files modified
ChangeLog (+1/-0)
src/compiler/translator/translator.cpp (+117/-125)
src/diagnostics/diagnostic_en.xml (+69/-19)
src/diagnostics/pregenerated/dict_en.cpp (+21/-9)
src/diagnostics/pregenerated/dict_zed_keys.h (+16/-4)
src/diagnostics/util_macros.h (+0/-5)
src/runtime/core/constructors.cpp (+1/-1)
src/store/naive/nsbindings.cpp (+8/-11)
test/fots/CMakeLists.txt (+0/-2)
To merge this branch: bzr merge lp:~zorba-coders/zorba/markos-scratch
Reviewer Review Type Date Requested Status
Markos Zaharioudakis Approve on 2013-06-20
Review via email: mp+170572@code.launchpad.net

Commit Message

1. Check that namespace uri used in default namespace declaration is a valid one
2. fixed error messages for XQST0070 and XQST0036

Description of the Change

1. Check that namespace uri used in default namespace declaration is a valid one
2. fixed error messages for XQST0070 and XQST0036

To post a comment you must log in.
review: Approve
Zorba Build Bot (zorba-buildbot) wrote :

The attempt to merge lp:~zorba-coders/zorba/markos-scratch into lp:zorba failed. Below is the output from the failed tests.

CMake Error at /home/ceej/zo/testing/zorbatest/tester/TarmacLander.cmake:281 (message):
  Validation queue job markos-scratch-2013-06-20T10-02-14.106Z is finished.
  The final status was:

  4 tests did not succeed - changes not commited.

Error in read script: /home/ceej/zo/testing/zorbatest/tester/TarmacLander.cmake

Zorba Build Bot (zorba-buildbot) wrote :

Validation queue job markos-scratch-2013-06-20T11-36-56.639Z is finished. The final status was:

All tests succeeded!

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'ChangeLog'
2--- ChangeLog 2013-06-19 22:18:54 +0000
3+++ ChangeLog 2013-06-20 10:12:27 +0000
4@@ -32,6 +32,7 @@
5 * Fixed bug #1103115 (Timezone units as hours are wrong)
6 * Fixed bug #1188280 (casting xs:id to xs:ncname)
7 * Fixed bug in casting to xs:NCName
8+ * Check that namespace uri used in default namespace declaration is a valid one
9 * Fixed bug in error conditions for computed PI constructor
10 * Fixed implementation of fn:deep-equal according to latest W3C spec.
11 * Must apply document ordering on the domain expression of a FOR clause, if
12
13=== modified file 'src/compiler/translator/translator.cpp'
14--- src/compiler/translator/translator.cpp 2013-06-19 19:27:26 +0000
15+++ src/compiler/translator/translator.cpp 2013-06-20 10:12:27 +0000
16@@ -178,15 +178,7 @@
17 /*******************************************************************************
18
19 ********************************************************************************/
20-#define ZANN_CONTAINS( ann ) theAnnotations->contains(AnnotationInternal::ann)
21-
22-
23-/*******************************************************************************
24- Check/set certain bool data members of TranslatorImpl: raise error if true
25- already otherwise set to true.
26-********************************************************************************/
27-#define CHK_SINGLE_DECL( state, err ) \
28-do { if (state) throw XQUERY_EXCEPTION(err); state = true; } while (0)
29+#define ZANN_CONTAINS(ann) theAnnotations->contains(AnnotationInternal::ann)
30
31
32 /*******************************************************************************
33@@ -2204,19 +2196,22 @@
34 #ifndef ZORBA_NO_XMLSCHEMA
35
36 if (! theImportedSchemas.insert(targetNS.str()).second)
37- throw XQUERY_EXCEPTION(err::XQST0058, ERROR_LOC(loc));
38+ RAISE_ERROR(err::XQST0058, loc, ERROR_PARAMS(targetNS));
39
40 if (prefix != NULL)
41 {
42 if (!prefix->get_default_bit() && targetNS.empty())
43 {
44- throw XQUERY_EXCEPTION( err::XQST0057, ERROR_LOC(loc));
45+ RAISE_ERROR_NO_PARAMS(err::XQST0057, loc);
46 }
47
48 zstring pfx = prefix->get_prefix();
49
50 if (pfx == "xml" || pfx == "xmlns")
51- RAISE_ERROR(err::XQST0070, loc, ERROR_PARAMS(pfx, ZED(NoRebindPrefix)));
52+ {
53+ RAISE_ERROR(err::XQST0070, loc,
54+ ERROR_PARAMS(ZED(XQST0070_ReservedPrefixInImport_2), pfx));
55+ }
56
57 if (prefix->get_default_bit())
58 theSctx->set_default_elem_type_ns(targetNS, true, loc);
59@@ -2226,7 +2221,7 @@
60 }
61
62 zstring xsdTNS = zstring(XML_SCHEMA_NS);
63- if ( xsdTNS.compare(targetNS)==0 )
64+ if (xsdTNS.compare(targetNS) == 0)
65 {
66 // Xerces doesn't like importing XMLSchema.xsd schema4schema, so we skip it
67 // see Xerces-C++ bug: https://issues.apache.org/jira/browse/XERCESC-1980
68@@ -2301,7 +2296,7 @@
69 return no_state;
70
71 #else
72- throw XQUERY_EXCEPTION(err::XQST0009, ERROR_LOC(loc));
73+ RAISE_ERROR_NO_PARAMS(err::XQST0009, loc);
74 #endif
75 }
76
77@@ -2358,7 +2353,7 @@
78 return no_state;
79
80 #else
81- throw XQUERY_EXCEPTION(err::XQST0009, ERROR_LOC(aLoc));
82+ RAISE_ERROR_NO_PARAMS(err::XQST0009, aLoc);
83 #endif
84 }
85
86@@ -2801,7 +2796,7 @@
87 theModuleNamespace = v.get_target_namespace();
88
89 if (theModuleNamespace.empty())
90- throw XQUERY_EXCEPTION(err::XQST0088, ERROR_LOC(loc));
91+ RAISE_ERROR_NO_PARAMS(err::XQST0088, loc);
92
93 if (static_context::is_reserved_module(theModuleNamespace))
94 {
95@@ -2812,7 +2807,7 @@
96 if (theModulePrefix == "xml" || theModulePrefix == "xmlns")
97 {
98 RAISE_ERROR(err::XQST0070, loc,
99- ERROR_PARAMS(theModulePrefix, ZED(NoRebindPrefix)));
100+ ERROR_PARAMS(ZED(XQST0070_ReservedPrefixInModule_2), theModulePrefix));
101 }
102
103 theSctx->bind_ns(theModulePrefix, theModuleNamespace, loc);
104@@ -2998,7 +2993,12 @@
105 void* begin_visit(const BoundarySpaceDecl& v)
106 {
107 TRACE_VISIT();
108- CHK_SINGLE_DECL (hadBSpaceDecl, err::XQST0068);
109+
110+ if (hadBSpaceDecl)
111+ RAISE_ERROR_NO_PARAMS(err::XQST0068, loc);
112+
113+ hadBSpaceDecl = true;
114+
115 theSctx->set_boundary_space_mode(v.get_boundary_space_mode());
116 return NULL;
117 }
118@@ -3015,7 +3015,12 @@
119 void* begin_visit(const OrderingModeDecl& v)
120 {
121 TRACE_VISIT();
122- CHK_SINGLE_DECL(hadOrdModeDecl, err::XQST0065);
123+
124+ if (hadOrdModeDecl)
125+ RAISE_ERROR_NO_PARAMS(err::XQST0065, loc);
126+
127+ hadOrdModeDecl = true;
128+
129 theSctx->set_ordering_mode(v.get_mode());
130 return NULL;
131 }
132@@ -3035,7 +3040,10 @@
133 {
134 TRACE_VISIT();
135
136- CHK_SINGLE_DECL(hadEmptyOrdDecl, err::XQST0069);
137+ if (hadEmptyOrdDecl)
138+ RAISE_ERROR_NO_PARAMS(err::XQST0069, loc);
139+
140+ hadEmptyOrdDecl = true;
141
142 theSctx->set_empty_order_mode(v.get_mode());
143 return no_state;
144@@ -3056,7 +3064,12 @@
145 void* begin_visit(const CopyNamespacesDecl& v)
146 {
147 TRACE_VISIT();
148- CHK_SINGLE_DECL(hadCopyNSDecl, err::XQST0055);
149+
150+ if (hadCopyNSDecl)
151+ RAISE_ERROR_NO_PARAMS(err::XQST0055, loc);
152+
153+ hadCopyNSDecl = true;
154+
155 return no_state;
156 }
157
158@@ -3090,7 +3103,7 @@
159 }
160
161 theSctx->add_decimal_format(
162- new DecimalFormat( v.is_default, qnameItem, v.param_list, loc ), loc
163+ new DecimalFormat(v.is_default, qnameItem, v.param_list, loc), loc
164 );
165
166 return no_state;
167@@ -3126,7 +3139,10 @@
168 {
169 TRACE_VISIT();
170
171- CHK_SINGLE_DECL(hadBUriDecl, err::XQST0032);
172+ if (hadBUriDecl)
173+ RAISE_ERROR_NO_PARAMS(err::XQST0032, loc);
174+
175+ hadBUriDecl = true;
176
177 zstring uri(v.get_base_uri());
178 try
179@@ -3135,8 +3151,8 @@
180 }
181 catch (ZorbaException& e)
182 {
183- e.set_diagnostic( err::XQST0046 );
184- set_source( e, loc );
185+ e.set_diagnostic(err::XQST0046);
186+ set_source(e, loc);
187 throw;
188 }
189 return NULL;
190@@ -3157,7 +3173,11 @@
191 {
192 TRACE_VISIT();
193
194- CHK_SINGLE_DECL(hadConstrDecl, err::XQST0067);
195+ if (hadConstrDecl)
196+ RAISE_ERROR_NO_PARAMS(err::XQST0067, loc);
197+
198+ hadConstrDecl = true;
199+
200 theSctx->set_construction_mode(v.get_mode());
201 return NULL;
202 }
203@@ -3175,7 +3195,11 @@
204 {
205 TRACE_VISIT();
206
207- CHK_SINGLE_DECL (hadBUriDecl, err::XUST0003);
208+ if (hadRevalDecl)
209+ RAISE_ERROR_NO_PARAMS(err::XUST0003, loc);
210+
211+ hadRevalDecl = true;
212+
213 theSctx->set_validation_mode(v.get_mode());
214 return no_state;
215 }
216@@ -3198,19 +3222,13 @@
217
218 if (pre == "xml" || pre == "xmlns")
219 {
220- throw XQUERY_EXCEPTION(
221- err::XQST0070,
222- ERROR_PARAMS( pre, ZED( NoRebindPrefix ) ),
223- ERROR_LOC( loc )
224- );
225+ RAISE_ERROR(err::XQST0070, loc,
226+ ERROR_PARAMS(ZED(XQST0070_ReservedPrefixInDecl_2), pre));
227 }
228 else if (uri == XML_NS || uri == XMLNS_NS)
229 {
230- throw XQUERY_EXCEPTION(
231- err::XQST0070,
232- ERROR_PARAMS( uri, ZED( NoBindURI ) ),
233- ERROR_LOC( loc )
234- );
235+ RAISE_ERROR(err::XQST0070, loc,
236+ ERROR_PARAMS(ZED(XQST0070_ReservedURI_23), pre, uri));
237 }
238
239 theSctx->bind_ns(pre, uri, loc);
240@@ -3232,13 +3250,21 @@
241 {
242 TRACE_VISIT();
243
244+ zstring uri = v.get_default_namespace();
245+
246+ if (uri == XML_NS || uri == XMLNS_NS)
247+ {
248+ RAISE_ERROR(err::XQST0070, loc,
249+ ERROR_PARAMS(ZED(XQST0070_ReservedURI_23), "", uri));
250+ }
251+
252 switch (v.get_mode())
253 {
254 case ParseConstants::ns_element_default:
255- theSctx->set_default_elem_type_ns(v.get_default_namespace(), true, loc);
256+ theSctx->set_default_elem_type_ns(uri, true, loc);
257 break;
258 case ParseConstants::ns_function_default:
259- theSctx->set_default_function_ns(v.get_default_namespace(), true, loc);
260+ theSctx->set_default_function_ns(uri, true, loc);
261 break;
262 }
263 return NULL;
264@@ -3553,7 +3579,7 @@
265 importedNS = mod_ast->get_decl()->get_target_namespace().str();
266
267 if (importedNS.empty())
268- throw XQUERY_EXCEPTION(err::XQST0088, ERROR_LOC(loc));
269+ RAISE_ERROR_NO_PARAMS(err::XQST0088, loc);
270
271 if (importedNS != targetNS)
272 {
273@@ -3644,16 +3670,16 @@
274 }
275
276 // The namespace prefix specified in a module import must not be xml or xmlns
277- // [err:XQST0070]
278- if (!pfx.empty() && (pfx == "xml" || pfx == "xmlns"))
279+ if (pfx == "xml" || pfx == "xmlns")
280 {
281- RAISE_ERROR(err::XQST0070, loc, ERROR_PARAMS(pfx, ZED(NoRebindPrefix)));
282+ RAISE_ERROR(err::XQST0070, loc,
283+ ERROR_PARAMS(ZED(XQST0070_ReservedPrefixInImport_2), pfx));
284 }
285
286 // The first URILiteral in a module import must be of nonzero length
287 // [err:XQST0088]
288 if (targetNS.empty())
289- throw XQUERY_EXCEPTION(err::XQST0088, ERROR_LOC(loc));
290+ RAISE_ERROR_NO_PARAMS(err::XQST0088, loc);
291
292 // It is a static error [err:XQST0047] if more than one module import in a
293 // Prolog specifies the same target namespace. Note: by checking this here,
294@@ -5498,20 +5524,14 @@
295
296 if ( !theSctx->is_feature_set(feature::ddl) )
297 {
298- throw XQUERY_EXCEPTION(
299- zerr::ZXQP0050_FEATURE_NOT_AVAILABLE,
300- ERROR_PARAMS( "data-definition (ddl)" ),
301- ERROR_LOC( v.get_location() )
302- );
303+ RAISE_ERROR(zerr::ZXQP0050_FEATURE_NOT_AVAILABLE, v.get_location(),
304+ ERROR_PARAMS("data-definition (ddl)"));
305 }
306
307 if (!inLibraryModule())
308 {
309- throw XQUERY_EXCEPTION(
310- zerr::ZDST0044_IC_DECL_IN_MAIN_MODULE,
311- ERROR_PARAMS( v.getName()->get_qname() ),
312- ERROR_LOC( loc )
313- );
314+ RAISE_ERROR(zerr::ZDST0044_IC_DECL_IN_MAIN_MODULE, loc,
315+ ERROR_PARAMS(v.getName()->get_qname()));
316 }
317
318 push_scope();
319@@ -6171,11 +6191,8 @@
320
321 if (qnameItem->getNamespace() != theModuleNamespace)
322 {
323- throw XQUERY_EXCEPTION(
324- zerr::ZDST0048_IC_DECL_IN_FOREIGN_MODULE,
325- ERROR_PARAMS( qname->get_qname() ),
326- ERROR_LOC( loc )
327- );
328+ RAISE_ERROR(zerr::ZDST0048_IC_DECL_IN_FOREIGN_MODULE, loc,
329+ ERROR_PARAMS(qname->get_qname()));
330 }
331
332 ValueIC_t vic;
333@@ -7032,7 +7049,7 @@
334 expr* domainExpr = pop_nodestack();
335
336 if (domainExpr->is_updating())
337- throw XQUERY_EXCEPTION(err::XUST0001, ERROR_LOC(loc));
338+ RAISE_ERROR_NO_PARAMS(err::XUST0001, loc);
339
340 // it's important to insert the debugger before the scope is pushed.
341 // Otherwise, the variable in question would already be in scope for
342@@ -7136,7 +7153,7 @@
343 xqtref_t type)
344 {
345 if (domainExpr->is_updating())
346- throw XQUERY_EXCEPTION(err::XUST0001, ERROR_LOC(loc));
347+ RAISE_ERROR_NO_PARAMS(err::XUST0001, loc);
348
349 // it's important to insert the debugger before the scope is pushed.
350 // Otherwise, the variable in question would already be in scope for
351@@ -7773,7 +7790,7 @@
352 expr* orderExpr = pop_nodestack();
353
354 if (orderExpr->is_updating())
355- throw XQUERY_EXCEPTION(err::XUST0001, ERROR_LOC(loc));
356+ RAISE_ERROR_NO_PARAMS(err::XUST0001, loc);
357
358 orderExpr = wrap_in_atomization(orderExpr);
359
360@@ -7896,7 +7913,7 @@
361 expr* whereExpr = pop_nodestack();
362
363 if (whereExpr->is_updating())
364- throw XQUERY_EXCEPTION(err::XUST0001, ERROR_LOC(loc));
365+ RAISE_ERROR_NO_PARAMS(err::XUST0001, loc);
366
367 whereExpr = wrap_in_bev(whereExpr);
368
369@@ -9547,7 +9564,7 @@
370
371 if (v.get_expr() == NULL)
372 {
373- throw XQUERY_EXCEPTION( err::XQST0079, ERROR_LOC(loc) );
374+ RAISE_ERROR_NO_PARAMS(err::XQST0079, loc);
375 }
376
377 return no_state;
378@@ -11309,17 +11326,15 @@
379 if (theModuleNamespace.empty())
380 {
381 RAISE_ERROR(err::XPTY0004, loc,
382- ERROR_PARAMS(ZED(BadType_23o),
383+ ERROR_PARAMS(ZED(XPTY0004_NoVarTypeInMainModule_23),
384 *declaredType,
385- ZED(NoTypeInMainModule_4),
386 ve->get_name()->getStringValue()));
387 }
388 else
389 {
390 RAISE_ERROR(err::XPTY0004, loc,
391- ERROR_PARAMS(ZED(BadType_23o),
392+ ERROR_PARAMS(ZED(XPTY0004_NoVarTypeInModule_234),
393 *declaredType,
394- ZED(NoTypeInModule_45),
395 ve->get_name()->getStringValue(),
396 theModuleNamespace));
397 }
398@@ -11329,17 +11344,15 @@
399 if (theModuleNamespace.empty())
400 {
401 RAISE_ERROR(err::XQST0036, loc,
402- ERROR_PARAMS(ZED(BadType_23o),
403+ ERROR_PARAMS(ZED(XQST0036_NoVarTypeInMainModule_23),
404 *declaredType,
405- ZED(NoTypeInMainModule_4),
406 ve->get_name()->getStringValue()));
407 }
408 else
409 {
410 RAISE_ERROR(err::XQST0036, loc,
411- ERROR_PARAMS(ZED(BadType_23o),
412+ ERROR_PARAMS(ZED(XQST0036_NoVarTypeInModule_234),
413 *declaredType,
414- ZED(NoTypeInModule_45),
415 ve->get_name()->getStringValue(),
416 theModuleNamespace));
417 }
418@@ -11566,17 +11579,15 @@
419 if (theModuleNamespace.empty())
420 {
421 RAISE_ERROR(err::XQST0036, loc,
422- ERROR_PARAMS(ZED(BadType_23o),
423+ ERROR_PARAMS(ZED(XQST0036_NoRetTypeInMainModule_23),
424 *retType,
425- ZED(NoTypeInMainModule_4),
426 f->getName()->getStringValue()));
427 }
428 else
429 {
430 RAISE_ERROR(err::XQST0036, loc,
431- ERROR_PARAMS(ZED(BadType_23o),
432+ ERROR_PARAMS(ZED(XQST0036_NoRetTypeInModule_234),
433 *retType,
434- ZED(NoTypeInModule_45),
435 f->getName()->getStringValue(),
436 theModuleNamespace));
437 }
438@@ -11594,17 +11605,15 @@
439 if (theModuleNamespace.empty())
440 {
441 RAISE_ERROR(err::XQST0036, loc,
442- ERROR_PARAMS(ZED(BadType_23o),
443+ ERROR_PARAMS(ZED(XQST0036_NoParamTypeInMainModule_23),
444 *type,
445- ZED(NoTypeInMainModule_4),
446 f->getName()->getStringValue()));
447 }
448 else
449 {
450 RAISE_ERROR(err::XQST0036, loc,
451- ERROR_PARAMS(ZED(BadType_23o),
452+ ERROR_PARAMS(ZED(XQST0036_NoParamTypeInModule_234),
453 *retType,
454- ZED(NoTypeInModule_45),
455 f->getName()->getStringValue(),
456 theModuleNamespace));
457 }
458@@ -13467,9 +13476,10 @@
459 {
460 prefix = qname->get_localname();
461
462- if (ZSTREQ(prefix, "xmlns"))
463- RAISE_ERROR(err::XQST0070, loc,
464- ERROR_PARAMS(prefix, ZED(NoRebindPrefix)));
465+ if (prefix == "xmlns")
466+ {
467+ RAISE_ERROR(err::XQST0070, loc, ERROR_PARAMS(ZED(XQST0070_xmlnsInAttrDecl)));
468+ }
469 }
470
471 const_expr* constValueExpr = dynamic_cast<const_expr*>(valueExpr);
472@@ -13499,10 +13509,11 @@
473 foExpr2->get_func()->getKind() == FunctionConsts::OP_ENCLOSED_1 &&
474 (qname->get_qname() == "xmlns" || qname->get_prefix() == "xmlns"))
475 {
476- throw XQUERY_EXCEPTION(err::XQST0022, ERROR_LOC(loc));
477+ RAISE_ERROR_NO_PARAMS(err::XQST0022, loc);
478 }
479 }
480 }
481+
482 have_uri = true;
483 }
484
485@@ -13511,13 +13522,14 @@
486 if ((ZSTREQ(prefix, "xml") && !ZSTREQ(uri, XML_NS)))
487 {
488 RAISE_ERROR(err::XQST0070, loc,
489- ERROR_PARAMS(prefix, ZED(NoRebindPrefix)));
490+ ERROR_PARAMS(ZED(XQST0070_ReservedPrefix_23), prefix, uri));
491 }
492
493 if ((ZSTREQ(uri, XML_NS) && !ZSTREQ(prefix, "xml")) ||
494 ZSTREQ(uri, XMLNS_NS))
495 {
496- RAISE_ERROR(err::XQST0070, loc, ERROR_PARAMS(uri, ZED(NoBindURI)));
497+ RAISE_ERROR(err::XQST0070, loc,
498+ ERROR_PARAMS(ZED(XQST0070_ReservedURI_23), prefix, uri));
499 }
500
501 URI parsedUri(uri);
502@@ -13533,7 +13545,7 @@
503 if (ZSTREQ(prefix, "xml"))
504 {
505 RAISE_ERROR(err::XQST0070, loc,
506- ERROR_PARAMS(prefix, ZED(NoRebindPrefix)));
507+ ERROR_PARAMS(ZED(XQST0070_ReservedPrefix_23), prefix, ""));
508 }
509
510 // unbind the prefix
511@@ -13546,7 +13558,7 @@
512 }
513 else
514 {
515- throw XQUERY_EXCEPTION(err::XQST0022, ERROR_LOC(loc));
516+ RAISE_ERROR_NO_PARAMS(err::XQST0022, loc);
517 }
518 }
519 // Plain direct attribute
520@@ -14929,17 +14941,17 @@
521 // whose PITarget is equal to fn:normalize-space(N). If fn:normalize-space(N)
522 // is not in the lexical space of NCName, a type error is raised [err:XPTY0004]
523
524- zstring lNormalizedTarget;
525- ascii::normalize_space(target, &lNormalizedTarget);
526+ zstring normalizedTarget;
527+ ascii::normalize_space(target, &normalizedTarget);
528
529- if (!GenericCast::castableToNCName(lNormalizedTarget))
530+ if (!GenericCast::castableToNCName(normalizedTarget))
531 {
532 RAISE_ERROR(err::XPTY0004, loc,
533- ERROR_PARAMS(ZED(BadType_23o), lNormalizedTarget, ZED(NoCastTo_45o), "NCName"));
534+ ERROR_PARAMS(ZED(XPTY0004_ValueNoCastTo_23), normalizedTarget, "xs:NCName"));
535 }
536
537 // bugfix (see above); pass normalized string instead of original target
538- GENV_ITEMFACTORY->createQName(qname, NULL, NULL, lNormalizedTarget.c_str());
539+ GENV_ITEMFACTORY->createQName(qname, NULL, NULL, normalizedTarget.c_str());
540 }
541
542 if (axisExpr != NULL)
543@@ -15472,7 +15484,7 @@
544 expr* sourceExpr = pop_nodestack();
545
546 if (sourceExpr->is_updating())
547- throw XQUERY_EXCEPTION(err::XUST0001, ERROR_LOC(loc));
548+ RAISE_ERROR_NO_PARAMS(err::XUST0001, loc);
549
550 push_scope();
551
552@@ -15592,9 +15604,7 @@
553 ftmatch_options *const mo = dynamic_cast<ftmatch_options*>( top_ftstack() );
554 ZORBA_ASSERT( mo );
555 if ( mo->get_case_option() )
556- throw XQUERY_EXCEPTION(
557- err::FTST0019, ERROR_PARAMS( "case" ), ERROR_LOC( loc )
558- );
559+ RAISE_ERROR(err::FTST0019, loc, ERROR_PARAMS("case"));
560 mo->set_case_option( new ftcase_option( loc, v.get_mode() ) );
561 #endif /* ZORBA_NO_FULL_TEXT */
562 }
563@@ -15604,9 +15614,7 @@
564 {
565 TRACE_VISIT ();
566 #ifdef ZORBA_NO_FULL_TEXT
567- throw XQUERY_EXCEPTION(
568- err::XPST0003, ERROR_PARAMS( ZED( FullTextNotEnabled ) ), ERROR_LOC( loc )
569- );
570+ RAISE_ERROR(err::XPST0003, loc, ERROR_PARAMS(ZED(FullTextNotEnabled)));
571 #endif /* ZORBA_NO_FULL_TEXT */
572 return no_state;
573 }
574@@ -15656,9 +15664,7 @@
575 ftmatch_options *const mo = dynamic_cast<ftmatch_options*>( top_ftstack() );
576 ZORBA_ASSERT( mo );
577 if ( mo->get_diacritics_option() )
578- throw XQUERY_EXCEPTION(
579- err::FTST0019, ERROR_PARAMS( "diacriticics" ), ERROR_LOC( loc )
580- );
581+ RAISE_ERROR(err::FTST0019, loc, ERROR_PARAMS("diacriticics"));
582 mo->set_diacritics_option( new ftdiacritics_option( loc, v.get_mode() ) );
583 #endif /* ZORBA_NO_FULL_TEXT */
584 }
585@@ -15711,7 +15717,7 @@
586 if ( s )
587 pop_ftstack();
588 else
589- throw XQUERY_EXCEPTION( err::XQST0079, ERROR_LOC( loc ) );
590+ RAISE_ERROR_NO_PARAMS(err::XQST0079, loc);
591 push_ftstack( new ftextension_selection( loc, v.get_pragma_list(), s ) );
592 #endif /* ZORBA_NO_FULL_TEXT */
593 }
594@@ -15745,9 +15751,7 @@
595 ftmatch_options *const mo = dynamic_cast<ftmatch_options*>( top_ftstack() );
596 ZORBA_ASSERT( mo );
597 if ( mo->get_language_option() )
598- throw XQUERY_EXCEPTION(
599- err::FTST0019, ERROR_PARAMS( "language" ), ERROR_LOC( loc )
600- );
601+ RAISE_ERROR(err::FTST0019, loc, ERROR_PARAMS("language"));
602 mo->set_language_option( new ftlanguage_option( loc, v.get_language() ) );
603 #endif /* ZORBA_NO_FULL_TEXT */
604 }
605@@ -15936,9 +15940,7 @@
606
607 void *begin_visit (const FTScoreVar& v) {
608 TRACE_VISIT ();
609- throw XQUERY_EXCEPTION(
610- zerr::ZXQP0004_NOT_IMPLEMENTED, ERROR_PARAMS( "score" ), ERROR_LOC( loc )
611- );
612+ RAISE_ERROR(zerr::ZXQP0004_NOT_IMPLEMENTED, loc, ERROR_PARAMS("score"));
613 }
614
615 void end_visit (const FTScoreVar& v, void* /*visit_state*/) {
616@@ -15984,9 +15986,7 @@
617 ftmatch_options *const mo = dynamic_cast<ftmatch_options*>( top_ftstack() );
618 ZORBA_ASSERT( mo );
619 if ( mo->get_stem_option() )
620- throw XQUERY_EXCEPTION(
621- err::FTST0019, ERROR_PARAMS( "stem" ), ERROR_LOC( loc )
622- );
623+ RAISE_ERROR(err::FTST0019, loc, ERROR_PARAMS("stem"));
624 mo->set_stem_option( new ftstem_option( loc, v.get_mode() ) );
625 #endif /* ZORBA_NO_FULL_TEXT */
626 }
627@@ -16049,9 +16049,7 @@
628 ftmatch_options *const mo = dynamic_cast<ftmatch_options*>( top_ftstack() );
629 ZORBA_ASSERT( mo );
630 if ( mo->get_stop_word_option() )
631- throw XQUERY_EXCEPTION(
632- err::FTST0019, ERROR_PARAMS( "stop words" ), ERROR_LOC( loc )
633- );
634+ RAISE_ERROR(err::FTST0019, loc, ERROR_PARAMS("stop words"));
635 ftstop_word_option *const sw =
636 new ftstop_word_option( loc, stop_words, v.get_mode() );
637 mo->set_stop_word_option( sw );
638@@ -16073,9 +16071,7 @@
639 theSctx->resolve_uri( uri, internal::EntityData::THESAURUS, error_msg )
640 );
641 if ( !rsrc.get() )
642- throw XQUERY_EXCEPTION(
643- err::FTST0018, ERROR_PARAMS( uri ), ERROR_LOC( loc )
644- );
645+ RAISE_ERROR(err::FTST0018, loc, ERROR_PARAMS( uri ));
646
647 ftrange *levels;
648 if ( v.get_levels() ) {
649@@ -16115,9 +16111,7 @@
650 ftmatch_options *const mo = dynamic_cast<ftmatch_options*>( top_ftstack() );
651 ZORBA_ASSERT( mo );
652 if ( mo->get_thesaurus_option() )
653- throw XQUERY_EXCEPTION(
654- err::FTST0019, ERROR_PARAMS( "thesaurus" ), ERROR_LOC( loc )
655- );
656+ RAISE_ERROR(err::FTST0019, loc, ERROR_PARAMS( "thesaurus" ));
657 ftthesaurus_option *const t =
658 new ftthesaurus_option( loc, default_tid, list, v.no_thesaurus() );
659 mo->set_thesaurus_option( t );
660@@ -16188,9 +16182,7 @@
661 ftmatch_options *const mo = dynamic_cast<ftmatch_options*>( top_ftstack() );
662 ZORBA_ASSERT( mo );
663 if ( mo->get_wild_card_option() )
664- throw XQUERY_EXCEPTION(
665- err::FTST0019, ERROR_PARAMS( "wildcards" ), ERROR_LOC( loc )
666- );
667+ RAISE_ERROR(err::FTST0019, loc, ERROR_PARAMS( "wildcards" ));
668 mo->set_wild_card_option( new ftwild_card_option( loc, v.get_mode() ) );
669 #endif /* ZORBA_NO_FULL_TEXT */
670 }
671
672=== modified file 'src/diagnostics/diagnostic_en.xml'
673--- src/diagnostics/diagnostic_en.xml 2013-06-19 20:05:45 +0000
674+++ src/diagnostics/diagnostic_en.xml 2013-06-20 10:12:27 +0000
675@@ -304,8 +304,20 @@
676 <value>atomization of grouping variable produces more than one item</value>
677 </entry>
678
679- <entry key="PiTarget_3">
680- <value>$3: type of processing instruction target is not xs:NCName, or xs:string, or xs:untypedAtomic</value>
681+ <entry key="NoVarTypeInMainModule_23">
682+ <value>"$2": type of variable "$3" is not among the in-scope types of the main module</value>
683+ </entry>
684+
685+ <entry key="NoVarTypeInModule_234">
686+ <value>"$2": type of variable "$3" is not among the in-scope types of module "$4"</value>
687+ </entry>
688+
689+ <entry key="ValueNoCastTo_23">
690+ <value>$2: value can not be cast to type $3</value>
691+ </entry>
692+
693+ <entry key="PiTarget_2">
694+ <value>$2: type of processing instruction target is not xs:NCName, or xs:string, or xs:untypedAtomic</value>
695 </entry>
696 </diagnostic>
697
698@@ -485,6 +497,31 @@
699 referenced in the importing module.
700 </comment>
701 <value>$1</value>
702+
703+ <entry key="NoVarTypeInMainModule_23">
704+ <value>"$2": type of variable "$3" is not among the in-scope types of the main module</value>
705+ </entry>
706+
707+ <entry key="NoVarTypeInModule_234">
708+ <value>"$2": type of variable "$3" is not among the in-scope types of module "$4"</value>
709+ </entry>
710+
711+ <entry key="NoRetTypeInMainModule_23">
712+ <value>"$2": return type of function "$3" is not among the in-scope types of the main module</value>
713+ </entry>
714+
715+ <entry key="NoRetTypeInModule_234">
716+ <value>"$2": return type of function "$3" is not among the in-scope types of module "$4"</value>
717+ </entry>
718+
719+ <entry key="NoParamTypeInMainModule_23">
720+ <value>"$2": parameter type of function "$3" is not among the in-scope types of the main module</value>
721+ </entry>
722+
723+ <entry key="NoParamTypeInModule_234">
724+ <value>"$2": parameter type of function "$3" is not among the in-scope types of module "$4"</value>
725+ </entry>
726+
727 </diagnostic>
728
729 <diagnostic code="XQST0038">
730@@ -588,7 +625,7 @@
731 It is a static error if a schema import binds a namespace prefix but
732 does not specify a target namespace other than a zero-length string.
733 </comment>
734- <value>empty target namespace</value>
735+ <value>schema import with empty target namespace</value>
736 </diagnostic>
737
738 <diagnostic code="XQST0058">
739@@ -596,7 +633,7 @@
740 It is a static error if multiple schema imports specify the same target
741 namespace.
742 </comment>
743- <value>"$1": duplicate target namespace</value>
744+ <value>duplicate import of schema with target namespace $1</value>
745 </diagnostic>
746
747 <diagnostic code="XQST0059">
748@@ -627,7 +664,7 @@
749 A static error is raised if a Prolog contains more than one ordering mode
750 declaration.
751 </comment>
752- <value>multiple ordering mode declaraions</value>
753+ <value>multiple ordering mode declarations</value>
754 </diagnostic>
755
756 <diagnostic code="XQST0066">
757@@ -676,7 +713,32 @@
758 - A prefix other than \c xmlns is bound to the namespace URI
759 <code>http://www.w3.org/2000/xmlns/</code>.
760 </comment>
761- <value>"$1": $2</value>
762+ <value>$1</value>
763+
764+ <entry key="ReservedPrefixInDecl_2">
765+ <value>"$2": reserved prefix can not appear in namespace declaration</value>
766+ </entry>
767+
768+ <entry key="ReservedPrefixInModule_2">
769+ <value>"$2": reserved prefix can not appear in module declaration</value>
770+ </entry>
771+
772+ <entry key="ReservedPrefixInImport_2">
773+ <value>"$2": reserved prefix can not appear in schema or module import</value>
774+ </entry>
775+
776+ <entry key="xmlnsInAttrDecl">
777+ <value>"xmlns" prefix can not be bound in namespace declaration attribute</value>
778+ </entry>
779+
780+ <entry key="ReservedPrefix_23">
781+ <value>"$2": can not rebind reserved prefix to namespace URI "$3"</value>
782+ </entry>
783+
784+ <entry key="ReservedURI_23">
785+ <value>"$2": can not bind prefix to reserved namespace URI "$3"</value>
786+ </entry>
787+
788 </diagnostic>
789
790 <diagnostic code="XQST0071">
791@@ -727,7 +789,7 @@
792 It is a static error if the literal that specifies the target namespace
793 in a module import or a module declaration is of zero length.
794 </comment>
795- <value>empty target namespace literal</value>
796+ <value>empty target namespace in module import or module declaration</value>
797 </diagnostic>
798
799 <diagnostic code="XQST0089">
800@@ -3904,10 +3966,6 @@
801 <value>could not parse function arity (maybe it's too large)</value>
802 </entry>
803
804- <entry key="NoRebindPrefix">
805- <value>can not rebind predefined prefix</value>
806- </entry>
807-
808 <entry key="NoRegisteredSerializationCallback_2">
809 <value>external module "$2" not available using registered SerializationCallback</value>
810 </entry>
811@@ -3976,14 +4034,6 @@
812 <value>"\\$3": multi-character and category escapes not permitted in character range</value>
813 </entry>
814
815- <entry key="NoTypeInMainModule_4">
816- <value>type of variable "$4" is not among the in-scope types of the main module</value>
817- </entry>
818-
819- <entry key="NoTypeInModule_45">
820- <value>type of variable "$4" is not among the in-scope types module "$5"</value>
821- </entry>
822-
823 <entry key="NoURIAuthority">
824 <value>no authority</value>
825 </entry>
826
827=== modified file 'src/diagnostics/pregenerated/dict_en.cpp'
828--- src/diagnostics/pregenerated/dict_en.cpp 2013-06-19 20:05:45 +0000
829+++ src/diagnostics/pregenerated/dict_en.cpp 2013-06-20 10:12:27 +0000
830@@ -190,22 +190,22 @@
831 { "XQST0052", "\"$1\": not defined as simple type" },
832 { "XQST0054", "${\"1\": }variable must not depend on itself" },
833 { "XQST0055", "multiple copy-namespaces declarations" },
834- { "XQST0057", "empty target namespace" },
835- { "XQST0058", "\"$1\": duplicate target namespace" },
836+ { "XQST0057", "schema import with empty target namespace" },
837+ { "XQST0058", "duplicate import of schema with target namespace $1" },
838 { "XQST0059", "$1" },
839 { "XQST0060", "\"$1\": function name has a null namespace URI" },
840- { "XQST0065", "multiple ordering mode declaraions" },
841+ { "XQST0065", "multiple ordering mode declarations" },
842 { "XQST0066", "multiple element/type/function namespace declarations" },
843 { "XQST0067", "multiple construction declarations" },
844 { "XQST0068", "multiple boundary-space declarations" },
845 { "XQST0069", "multiple empty order declarations" },
846- { "XQST0070", "\"$1\": $2" },
847+ { "XQST0070", "$1" },
848 { "XQST0071", "\"$1\": duplicate namespace declaration attribute" },
849 { "XQST0076", "\"$1\": unknown collation" },
850 { "XQST0079", "unknown pragma or empty expression" },
851 { "XQST0085", "namespace URI is empty" },
852 { "XQST0087", "\"$1\": invalid encoding" },
853- { "XQST0088", "empty target namespace literal" },
854+ { "XQST0088", "empty target namespace in module import or module declaration" },
855 { "XQST0089", "\"$1\": duplicate variable name" },
856 { "XQST0090", "\"$1\": invalid character reference in XML $2" },
857 { "XQST0093", "\"$1\": module must not depend on itself" },
858@@ -687,7 +687,6 @@
859 { "~NoModuleURIResolver", "no module URI resolver could be retrieved using SerializationCallback" },
860 { "~NoMultiKeyNodeValues_2", "node with more than one key value found during probe on index \"$2\"" },
861 { "~NoParseFnArity", "could not parse function arity (maybe it's too large)" },
862- { "~NoRebindPrefix", "can not rebind predefined prefix" },
863 { "~NoRegisteredSerializationCallback_2", "external module \"$2\" not available using registered SerializationCallback" },
864 { "~NoResolveRelativeURI", "could not resolve relative URI" },
865 { "~NoSeqAsArithOp", "sequence of more than one item can not be operand for arithmetic operation" },
866@@ -703,8 +702,6 @@
867 { "~NoSourceURI", "no URI" },
868 { "~NoStrictCompareWithType_4", "can not compare for strict inequality to type \"$4\"" },
869 { "~NoTreatAs_4", "can not treat as \"$4\"" },
870- { "~NoTypeInMainModule_4", "type of variable \"$4\" is not among the in-scope types of the main module" },
871- { "~NoTypeInModule_45", "type of variable \"$4\" is not among the in-scope types module \"$5\"" },
872 { "~NoURIAuthority", "no authority" },
873 { "~NoURIInStore", "URI for document not found in store" },
874 { "~NoURIScheme", "no URI scheme" },
875@@ -922,7 +919,10 @@
876 { "~XPTY0004_NoReturnTypePromote_234", "$2 can not be promoted to return type $3 of function $4()" },
877 { "~XPTY0004_NoTreatAs_23", "$2 can not be treated as type $3" },
878 { "~XPTY0004_NoTypePromote_23", "$2 can not be promoted to type $3" },
879- { "~XPTY0004_PiTarget_3", "$3: type of processing instruction target is not xs:NCName, or xs:string, or xs:untypedAtomic" },
880+ { "~XPTY0004_NoVarTypeInMainModule_23", "\"$2\": type of variable \"$3\" is not among the in-scope types of the main module" },
881+ { "~XPTY0004_NoVarTypeInModule_234", "\"$2\": type of variable \"$3\" is not among the in-scope types of module \"$4\"" },
882+ { "~XPTY0004_PiTarget_2", "$2: type of processing instruction target is not xs:NCName, or xs:string, or xs:untypedAtomic" },
883+ { "~XPTY0004_ValueNoCastTo_23", "$2: value can not be cast to type $3" },
884 { "~XPTY0117_NodeCast", "Cannot cast node to xs:QName" },
885 { "~XPTY0117_NotationParam_23", "$2 can not be promoted to parameter type xs:NOTATION of function $3()" },
886 { "~XQDY0027_InvalidValue", "\"$2\": invalid value for type${: 3}${: 4}" },
887@@ -933,9 +933,21 @@
888 { "~XQDY0074_NameSapceConstructor", "$2: cannot cast prefix to xs:NCName" },
889 { "~XQDY0074_NoEmptyLocalname", "can not convert empty local name to xs:QName" },
890 { "~XQDY0074_NotCastToQName", "$2: can not convert to xs:QName" },
891+ { "~XQST0036_NoParamTypeInMainModule_23", "\"$2\": parameter type of function \"$3\" is not among the in-scope types of the main module" },
892+ { "~XQST0036_NoParamTypeInModule_234", "\"$2\": parameter type of function \"$3\" is not among the in-scope types of module \"$4\"" },
893+ { "~XQST0036_NoRetTypeInMainModule_23", "\"$2\": return type of function \"$3\" is not among the in-scope types of the main module" },
894+ { "~XQST0036_NoRetTypeInModule_234", "\"$2\": return type of function \"$3\" is not among the in-scope types of module \"$4\"" },
895+ { "~XQST0036_NoVarTypeInMainModule_23", "\"$2\": type of variable \"$3\" is not among the in-scope types of the main module" },
896+ { "~XQST0036_NoVarTypeInModule_234", "\"$2\": type of variable \"$3\" is not among the in-scope types of module \"$4\"" },
897 { "~XQST0046_BadHexDigit_3", "'$3': invalid hexedecimal digit" },
898 { "~XQST0059_SpecificationMessage", "\"$2\": target namespace not found for schema/module${ \"3\"}${: 4}" },
899 { "~XQST0059_XercesMessage", "$2,$3: error in schema${ with System ID \"4\"}${ with Public ID \"5\"}${: 6}" },
900+ { "~XQST0070_ReservedPrefixInDecl_2", "\"$2\": reserved prefix can not appear in namespace declaration" },
901+ { "~XQST0070_ReservedPrefixInImport_2", "\"$2\": reserved prefix can not appear in schema or module import" },
902+ { "~XQST0070_ReservedPrefixInModule_2", "\"$2\": reserved prefix can not appear in module declaration" },
903+ { "~XQST0070_ReservedPrefix_23", "\"$2\": can not rebind reserved prefix to namespace URI \"$3\"" },
904+ { "~XQST0070_ReservedURI_23", "\"$2\": can not bind prefix to reserved namespace URI \"$3\"" },
905+ { "~XQST0070_xmlnsInAttrDecl", "\"xmlns\" prefix can not be bound in namespace declaration attribute" },
906 { "~XQST0097_MustBeChar", "must be a single character" },
907 { "~XQST0097_MustBeZeroDigit", "must be a digit (Unicode category Nd) and represent zero" },
908 { "~XQST0106_Conflicting", "$2: conflicting annotations in declaration" },
909
910=== modified file 'src/diagnostics/pregenerated/dict_zed_keys.h'
911--- src/diagnostics/pregenerated/dict_zed_keys.h 2013-06-19 20:05:45 +0000
912+++ src/diagnostics/pregenerated/dict_zed_keys.h 2013-06-20 10:12:27 +0000
913@@ -48,12 +48,27 @@
914 #define ZED_XPTY0004_NoTreatAs_23 "~XPTY0004_NoTreatAs_23"
915 #define ZED_XPTY0004_JSONIQ_SELECTOR "~XPTY0004_JSONIQ_SELECTOR"
916 #define ZED_XPTY0004_MultiValuedGroupingKey "~XPTY0004_MultiValuedGroupingKey"
917-#define ZED_XPTY0004_PiTarget_3 "~XPTY0004_PiTarget_3"
918+#define ZED_XPTY0004_NoVarTypeInMainModule_23 "~XPTY0004_NoVarTypeInMainModule_23"
919+#define ZED_XPTY0004_NoVarTypeInModule_234 "~XPTY0004_NoVarTypeInModule_234"
920+#define ZED_XPTY0004_ValueNoCastTo_23 "~XPTY0004_ValueNoCastTo_23"
921+#define ZED_XPTY0004_PiTarget_2 "~XPTY0004_PiTarget_2"
922 #define ZED_XPTY0117_NodeCast "~XPTY0117_NodeCast"
923 #define ZED_XPTY0117_NotationParam_23 "~XPTY0117_NotationParam_23"
924+#define ZED_XQST0036_NoVarTypeInMainModule_23 "~XQST0036_NoVarTypeInMainModule_23"
925+#define ZED_XQST0036_NoVarTypeInModule_234 "~XQST0036_NoVarTypeInModule_234"
926+#define ZED_XQST0036_NoRetTypeInMainModule_23 "~XQST0036_NoRetTypeInMainModule_23"
927+#define ZED_XQST0036_NoRetTypeInModule_234 "~XQST0036_NoRetTypeInModule_234"
928+#define ZED_XQST0036_NoParamTypeInMainModule_23 "~XQST0036_NoParamTypeInMainModule_23"
929+#define ZED_XQST0036_NoParamTypeInModule_234 "~XQST0036_NoParamTypeInModule_234"
930 #define ZED_XQST0046_BadHexDigit_3 "~XQST0046_BadHexDigit_3"
931 #define ZED_XQST0059_SpecificationMessage "~XQST0059_SpecificationMessage"
932 #define ZED_XQST0059_XercesMessage "~XQST0059_XercesMessage"
933+#define ZED_XQST0070_ReservedPrefixInDecl_2 "~XQST0070_ReservedPrefixInDecl_2"
934+#define ZED_XQST0070_ReservedPrefixInModule_2 "~XQST0070_ReservedPrefixInModule_2"
935+#define ZED_XQST0070_ReservedPrefixInImport_2 "~XQST0070_ReservedPrefixInImport_2"
936+#define ZED_XQST0070_xmlnsInAttrDecl "~XQST0070_xmlnsInAttrDecl"
937+#define ZED_XQST0070_ReservedPrefix_23 "~XQST0070_ReservedPrefix_23"
938+#define ZED_XQST0070_ReservedURI_23 "~XQST0070_ReservedURI_23"
939 #define ZED_XQST0097_MustBeChar "~XQST0097_MustBeChar"
940 #define ZED_XQST0097_MustBeZeroDigit "~XQST0097_MustBeZeroDigit"
941 #define ZED_XQST0106_Duplicate "~XQST0106_Duplicate"
942@@ -281,7 +296,6 @@
943 #define ZED_NoModuleURIResolver "~NoModuleURIResolver"
944 #define ZED_NoMultiKeyNodeValues_2 "~NoMultiKeyNodeValues_2"
945 #define ZED_NoParseFnArity "~NoParseFnArity"
946-#define ZED_NoRebindPrefix "~NoRebindPrefix"
947 #define ZED_NoRegisteredSerializationCallback_2 "~NoRegisteredSerializationCallback_2"
948 #define ZED_NoResolveRelativeURI "~NoResolveRelativeURI"
949 #define ZED_NoSeqAsArithOp "~NoSeqAsArithOp"
950@@ -299,8 +313,6 @@
951 #define ZED_NoSourceURI "~NoSourceURI"
952 #define ZED_NoTreatAs_4 "~NoTreatAs_4"
953 #define ZED_NotSingleCharEsc_3 "~NotSingleCharEsc_3"
954-#define ZED_NoTypeInMainModule_4 "~NoTypeInMainModule_4"
955-#define ZED_NoTypeInModule_45 "~NoTypeInModule_45"
956 #define ZED_NoURIAuthority "~NoURIAuthority"
957 #define ZED_NoURIInStore "~NoURIInStore"
958 #define ZED_NoURIScheme "~NoURIScheme"
959
960=== modified file 'src/diagnostics/util_macros.h'
961--- src/diagnostics/util_macros.h 2013-02-07 17:24:36 +0000
962+++ src/diagnostics/util_macros.h 2013-06-20 10:12:27 +0000
963@@ -19,11 +19,6 @@
964 params, \
965 ERROR_LOC(loc))
966
967-#define RAISE_ERROR_VAR(errcode, loc, params) \
968- throw XQUERY_EXCEPTION_VAR(errcode, \
969- params, \
970- ERROR_LOC(loc))
971-
972
973 #define RAISE_ERROR_NO_LOC(errcode, params) \
974 throw XQUERY_EXCEPTION(errcode, \
975
976=== modified file 'src/runtime/core/constructors.cpp'
977--- src/runtime/core/constructors.cpp 2013-06-19 19:27:26 +0000
978+++ src/runtime/core/constructors.cpp 2013-06-20 10:12:27 +0000
979@@ -884,7 +884,7 @@
980 TypeManager* tm = theSctx->get_typemanager();
981 xqtref_t type = tm->create_value_type(targetItem);
982 RAISE_ERROR(err::XPTY0004, loc,
983- ERROR_PARAMS(ZED(XPTY0004_PiTarget_3), type->toSchemaString()));
984+ ERROR_PARAMS(ZED(XPTY0004_PiTarget_2), type->toSchemaString()));
985 }
986
987 if (targetType != store::XS_NCNAME)
988
989=== modified file 'src/store/naive/nsbindings.cpp'
990--- src/store/naive/nsbindings.cpp 2013-02-26 04:12:43 +0000
991+++ src/store/naive/nsbindings.cpp 2013-06-20 10:12:27 +0000
992@@ -21,6 +21,7 @@
993
994 #include "diagnostics/xquery_diagnostics.h"
995 #include "diagnostics/dict.h"
996+#include "diagnostics/util_macros.h"
997
998 #include "zorbamisc/ns_consts.h"
999
1000@@ -117,25 +118,21 @@
1001 void NsBindingsContext::check_ns_binding(const zstring& prefix, const zstring& uri)
1002 {
1003 if (ZSTREQ(prefix, "xmlns"))
1004- throw XQUERY_EXCEPTION(
1005- err::XQST0070,
1006- ERROR_PARAMS( prefix, ZED( NoRebindPrefix ) )
1007- );
1008+ {
1009+ RAISE_ERROR_NO_LOC(err::XQST0070, ERROR_PARAMS(ZED(XQST0070_xmlnsInAttrDecl)));
1010+ }
1011
1012 if ((ZSTREQ(prefix, "xml") && !ZSTREQ(uri, XML_NS)))
1013 {
1014- throw XQUERY_EXCEPTION(
1015- err::XQST0070,
1016- ERROR_PARAMS( prefix, ZED( NoRebindPrefix ) )
1017- );
1018+ RAISE_ERROR_NO_LOC(err::XQST0070,
1019+ ERROR_PARAMS(ZED(XQST0070_ReservedPrefix_23), prefix, uri));
1020 }
1021
1022 if ((ZSTREQ(uri, XML_NS) && !ZSTREQ(prefix, "xml")) ||
1023 ZSTREQ(uri, XMLNS_NS))
1024 {
1025- throw XQUERY_EXCEPTION(
1026- err::XQST0070, ERROR_PARAMS( uri, ZED( NoBindURI ) )
1027- );
1028+ RAISE_ERROR_NO_LOC(err::XQST0070,
1029+ ERROR_PARAMS(ZED(XQST0070_ReservedURI_23), prefix, uri));
1030 }
1031
1032 }
1033
1034=== modified file 'test/fots/CMakeLists.txt'
1035--- test/fots/CMakeLists.txt 2013-06-19 17:19:18 +0000
1036+++ test/fots/CMakeLists.txt 2013-06-20 10:12:27 +0000
1037@@ -231,8 +231,6 @@
1038 EXPECTED_FOTS_FAILURE (prod-CastExpr.schema CastAs-ListType-31 1110217)
1039 EXPECTED_FOTS_FAILURE (prod-CompDocConstructor K2-ConDocNode-2 1188302)
1040 EXPECTED_FOTS_FAILURE (prod-CompNamespaceConstructor nscons-042 1188285)
1041-EXPECTED_FOTS_FAILURE (prod-DefaultNamespaceDecl defaultnamespacedeclerr-6 1188283)
1042-EXPECTED_FOTS_FAILURE (prod-DefaultNamespaceDecl defaultnamespacedeclerr-8 1188283)
1043 EXPECTED_FOTS_FAILURE (prod-DirElemContent Constr-cont-charref-2 1130998)
1044 EXPECTED_FOTS_FAILURE (prod-FunctionCall FunctionCall-007 1114221)
1045 EXPECTED_FOTS_FAILURE (prod-FunctionCall FunctionCall-008 1114221)

Subscribers

People subscribed via source and target branches