← Back to team overview

zorba-coders team mailing list archive

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

 

Markos Zaharioudakis has proposed merging lp:~zorba-coders/zorba/markos-scratch into lp:zorba.

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


Requested reviews:
  Markos Zaharioudakis (markos-za)

For more details, see:
https://code.launchpad.net/~zorba-coders/zorba/markos-scratch/+merge/170572

1. Check that namespace uri used in default namespace declaration is a valid one
2. fixed error messages for XQST0070 and XQST0036
-- 
https://code.launchpad.net/~zorba-coders/zorba/markos-scratch/+merge/170572
Your team Zorba Coders is subscribed to branch lp:zorba.
=== modified file 'ChangeLog'
--- ChangeLog	2013-06-19 22:18:54 +0000
+++ ChangeLog	2013-06-20 09:54:39 +0000
@@ -32,6 +32,7 @@
   * Fixed bug #1103115 (Timezone units as hours are wrong)
   * Fixed bug #1188280 (casting xs:id to xs:ncname)
   * Fixed bug in casting to xs:NCName
+  * Check that namespace uri used in default namespace declaration is a valid one
   * Fixed bug in error conditions for computed PI constructor
   * Fixed implementation of fn:deep-equal according to latest W3C spec.
   * Must apply document ordering on the domain expression of a FOR clause, if

=== modified file 'src/compiler/translator/translator.cpp'
--- src/compiler/translator/translator.cpp	2013-06-19 19:27:26 +0000
+++ src/compiler/translator/translator.cpp	2013-06-20 09:54:39 +0000
@@ -178,15 +178,7 @@
 /*******************************************************************************
 
 ********************************************************************************/
-#define ZANN_CONTAINS( ann ) theAnnotations->contains(AnnotationInternal::ann)
-
-
-/*******************************************************************************
-  Check/set certain bool data members of TranslatorImpl: raise error if true
-  already otherwise set to true.
-********************************************************************************/
-#define CHK_SINGLE_DECL( state, err ) \
-do { if (state) throw XQUERY_EXCEPTION(err); state = true; } while (0)
+#define ZANN_CONTAINS(ann) theAnnotations->contains(AnnotationInternal::ann)
 
 
 /*******************************************************************************
@@ -2204,19 +2196,22 @@
 #ifndef ZORBA_NO_XMLSCHEMA
 
   if (! theImportedSchemas.insert(targetNS.str()).second)
-    throw XQUERY_EXCEPTION(err::XQST0058, ERROR_LOC(loc));
+    RAISE_ERROR(err::XQST0058, loc, ERROR_PARAMS(targetNS));
 
   if (prefix != NULL)
   {
     if (!prefix->get_default_bit() && targetNS.empty())
     {
-      throw XQUERY_EXCEPTION( err::XQST0057, ERROR_LOC(loc));
+      RAISE_ERROR_NO_PARAMS(err::XQST0057, loc);
     }
 
     zstring pfx = prefix->get_prefix();
 
     if (pfx == "xml" || pfx == "xmlns")
-      RAISE_ERROR(err::XQST0070, loc, ERROR_PARAMS(pfx, ZED(NoRebindPrefix)));
+    {
+      RAISE_ERROR(err::XQST0070, loc,
+      ERROR_PARAMS(ZED(XQST0070_ReservedPrefixInImport_2), pfx));
+    }
 
     if (prefix->get_default_bit())
       theSctx->set_default_elem_type_ns(targetNS, true, loc);
@@ -2226,7 +2221,7 @@
   }
 
   zstring xsdTNS = zstring(XML_SCHEMA_NS);
-  if ( xsdTNS.compare(targetNS)==0 )
+  if (xsdTNS.compare(targetNS) == 0)
   {
     // Xerces doesn't like importing XMLSchema.xsd schema4schema, so we skip it
     // see Xerces-C++ bug: https://issues.apache.org/jira/browse/XERCESC-1980
@@ -2301,7 +2296,7 @@
   return no_state;
 
 #else
-  throw XQUERY_EXCEPTION(err::XQST0009, ERROR_LOC(loc));
+  RAISE_ERROR_NO_PARAMS(err::XQST0009, loc);
 #endif
 }
 
@@ -2358,7 +2353,7 @@
   return no_state;
 
 #else
-  throw XQUERY_EXCEPTION(err::XQST0009, ERROR_LOC(aLoc));
+  RAISE_ERROR_NO_PARAMS(err::XQST0009, aLoc);
 #endif
 }
 
@@ -2801,7 +2796,7 @@
   theModuleNamespace = v.get_target_namespace();
 
   if (theModuleNamespace.empty())
-    throw XQUERY_EXCEPTION(err::XQST0088, ERROR_LOC(loc));
+    RAISE_ERROR_NO_PARAMS(err::XQST0088, loc);
 
   if (static_context::is_reserved_module(theModuleNamespace))
   {
@@ -2812,7 +2807,7 @@
   if (theModulePrefix == "xml" || theModulePrefix == "xmlns")
   {
     RAISE_ERROR(err::XQST0070, loc,
-    ERROR_PARAMS(theModulePrefix, ZED(NoRebindPrefix)));
+    ERROR_PARAMS(ZED(XQST0070_ReservedPrefixInModule_2), theModulePrefix));
   }
 
   theSctx->bind_ns(theModulePrefix, theModuleNamespace, loc);
@@ -2998,7 +2993,12 @@
 void* begin_visit(const BoundarySpaceDecl& v)
 {
   TRACE_VISIT();
-  CHK_SINGLE_DECL (hadBSpaceDecl, err::XQST0068);
+
+  if (hadBSpaceDecl)
+    RAISE_ERROR_NO_PARAMS(err::XQST0068, loc);
+
+  hadBSpaceDecl = true;
+
   theSctx->set_boundary_space_mode(v.get_boundary_space_mode());
   return NULL;
 }
@@ -3015,7 +3015,12 @@
 void* begin_visit(const OrderingModeDecl& v)
 {
   TRACE_VISIT();
-  CHK_SINGLE_DECL(hadOrdModeDecl, err::XQST0065);
+
+  if (hadOrdModeDecl)
+    RAISE_ERROR_NO_PARAMS(err::XQST0065, loc);
+
+  hadOrdModeDecl = true;
+
   theSctx->set_ordering_mode(v.get_mode());
   return NULL;
 }
@@ -3035,7 +3040,10 @@
 {
   TRACE_VISIT();
 
-  CHK_SINGLE_DECL(hadEmptyOrdDecl, err::XQST0069);
+  if (hadEmptyOrdDecl)
+    RAISE_ERROR_NO_PARAMS(err::XQST0069, loc);
+
+  hadEmptyOrdDecl = true;
 
   theSctx->set_empty_order_mode(v.get_mode());
   return no_state;
@@ -3056,7 +3064,12 @@
 void* begin_visit(const CopyNamespacesDecl& v)
 {
   TRACE_VISIT();
-  CHK_SINGLE_DECL(hadCopyNSDecl, err::XQST0055);
+
+  if (hadCopyNSDecl)
+    RAISE_ERROR_NO_PARAMS(err::XQST0055, loc);
+
+  hadCopyNSDecl = true;
+
   return no_state;
 }
 
@@ -3090,7 +3103,7 @@
   }
 
   theSctx->add_decimal_format(
-    new DecimalFormat( v.is_default, qnameItem, v.param_list, loc ), loc
+    new DecimalFormat(v.is_default, qnameItem, v.param_list, loc), loc
   );
 
   return no_state;
@@ -3126,7 +3139,10 @@
 {
   TRACE_VISIT();
 
-  CHK_SINGLE_DECL(hadBUriDecl, err::XQST0032);
+  if (hadBUriDecl)
+    RAISE_ERROR_NO_PARAMS(err::XQST0032, loc);
+
+  hadBUriDecl = true;
 
   zstring uri(v.get_base_uri());
   try
@@ -3135,8 +3151,8 @@
   }
   catch (ZorbaException& e)
   {
-    e.set_diagnostic( err::XQST0046 );
-    set_source( e, loc );
+    e.set_diagnostic(err::XQST0046);
+    set_source(e, loc);
     throw;
   }
   return NULL;
@@ -3157,7 +3173,11 @@
 {
   TRACE_VISIT();
 
-  CHK_SINGLE_DECL(hadConstrDecl, err::XQST0067);
+  if (hadConstrDecl)
+    RAISE_ERROR_NO_PARAMS(err::XQST0067, loc);
+
+  hadConstrDecl = true;
+
   theSctx->set_construction_mode(v.get_mode());
   return NULL;
 }
@@ -3175,7 +3195,11 @@
 {
   TRACE_VISIT();
 
-  CHK_SINGLE_DECL (hadBUriDecl, err::XUST0003);
+  if (hadRevalDecl)
+    RAISE_ERROR_NO_PARAMS(err::XUST0003, loc);
+
+  hadRevalDecl = true;
+
   theSctx->set_validation_mode(v.get_mode());
   return no_state;
 }
@@ -3198,19 +3222,13 @@
 
   if (pre == "xml" || pre == "xmlns")
   {
-    throw XQUERY_EXCEPTION(
-      err::XQST0070,
-      ERROR_PARAMS( pre, ZED( NoRebindPrefix ) ),
-      ERROR_LOC( loc )
-    );
+    RAISE_ERROR(err::XQST0070, loc,
+    ERROR_PARAMS(ZED(XQST0070_ReservedPrefixInDecl_2), pre));
   }
   else if (uri == XML_NS || uri == XMLNS_NS)
   {
-    throw XQUERY_EXCEPTION(
-      err::XQST0070,
-      ERROR_PARAMS( uri, ZED( NoBindURI ) ),
-      ERROR_LOC( loc )
-    );
+    RAISE_ERROR(err::XQST0070, loc,
+    ERROR_PARAMS(ZED(XQST0070_ReservedURI_23), pre, uri));
   }
 
   theSctx->bind_ns(pre, uri, loc);
@@ -3232,13 +3250,21 @@
 {
   TRACE_VISIT();
 
+  zstring uri = v.get_default_namespace();
+
+  if (uri == XML_NS || uri == XMLNS_NS)
+  {
+    RAISE_ERROR(err::XQST0070, loc,
+    ERROR_PARAMS(ZED(XQST0070_ReservedURI_23), "", uri));
+  }
+
   switch (v.get_mode())
   {
   case ParseConstants::ns_element_default:
-    theSctx->set_default_elem_type_ns(v.get_default_namespace(), true, loc);
+    theSctx->set_default_elem_type_ns(uri, true, loc);
     break;
   case ParseConstants::ns_function_default:
-    theSctx->set_default_function_ns(v.get_default_namespace(), true, loc);
+    theSctx->set_default_function_ns(uri, true, loc);
     break;
   }
   return NULL;
@@ -3553,7 +3579,7 @@
       importedNS = mod_ast->get_decl()->get_target_namespace().str();
 
       if (importedNS.empty())
-        throw XQUERY_EXCEPTION(err::XQST0088, ERROR_LOC(loc));
+        RAISE_ERROR_NO_PARAMS(err::XQST0088, loc);
 
       if (importedNS != targetNS)
       {
@@ -3644,16 +3670,16 @@
   }
 
   // The namespace prefix specified in a module import must not be xml or xmlns
-  // [err:XQST0070]
-  if (!pfx.empty() && (pfx == "xml" || pfx == "xmlns"))
+  if (pfx == "xml" || pfx == "xmlns")
   {
-    RAISE_ERROR(err::XQST0070, loc, ERROR_PARAMS(pfx, ZED(NoRebindPrefix)));
+    RAISE_ERROR(err::XQST0070, loc,
+    ERROR_PARAMS(ZED(XQST0070_ReservedPrefixInImport_2), pfx));
   }
 
   // The first URILiteral in a module import must be of nonzero length
   // [err:XQST0088]
   if (targetNS.empty())
-    throw XQUERY_EXCEPTION(err::XQST0088, ERROR_LOC(loc));
+    RAISE_ERROR_NO_PARAMS(err::XQST0088, loc);
 
   // It is a static error [err:XQST0047] if more than one module import in a
   // Prolog specifies the same target namespace. Note: by checking this here,
@@ -5498,20 +5524,14 @@
 
   if ( !theSctx->is_feature_set(feature::ddl) )
   {
-    throw XQUERY_EXCEPTION(
-      zerr::ZXQP0050_FEATURE_NOT_AVAILABLE,
-      ERROR_PARAMS( "data-definition (ddl)" ),
-      ERROR_LOC( v.get_location() )
-    );
+    RAISE_ERROR(zerr::ZXQP0050_FEATURE_NOT_AVAILABLE, v.get_location(),
+    ERROR_PARAMS("data-definition (ddl)"));
   }
 
   if (!inLibraryModule())
   {
-    throw XQUERY_EXCEPTION(
-      zerr::ZDST0044_IC_DECL_IN_MAIN_MODULE,
-      ERROR_PARAMS( v.getName()->get_qname() ),
-      ERROR_LOC( loc )
-    );
+    RAISE_ERROR(zerr::ZDST0044_IC_DECL_IN_MAIN_MODULE, loc,
+    ERROR_PARAMS(v.getName()->get_qname()));
   }
 
   push_scope();
@@ -6171,11 +6191,8 @@
 
   if (qnameItem->getNamespace() != theModuleNamespace)
   {
-    throw XQUERY_EXCEPTION(
-      zerr::ZDST0048_IC_DECL_IN_FOREIGN_MODULE,
-      ERROR_PARAMS( qname->get_qname() ),
-      ERROR_LOC( loc )
-    );
+    RAISE_ERROR(zerr::ZDST0048_IC_DECL_IN_FOREIGN_MODULE, loc,
+    ERROR_PARAMS(qname->get_qname()));
   }
 
   ValueIC_t vic;
@@ -7032,7 +7049,7 @@
   expr* domainExpr = pop_nodestack();
 
   if (domainExpr->is_updating())
-    throw XQUERY_EXCEPTION(err::XUST0001, ERROR_LOC(loc));
+    RAISE_ERROR_NO_PARAMS(err::XUST0001, loc);
 
   // it's important to insert the debugger before the scope is pushed.
   // Otherwise, the variable in question would already be in scope for
@@ -7136,7 +7153,7 @@
     xqtref_t type)
 {
   if (domainExpr->is_updating())
-    throw XQUERY_EXCEPTION(err::XUST0001, ERROR_LOC(loc));
+    RAISE_ERROR_NO_PARAMS(err::XUST0001, loc);
 
   // it's important to insert the debugger before the scope is pushed.
   // Otherwise, the variable in question would already be in scope for
@@ -7773,7 +7790,7 @@
     expr* orderExpr = pop_nodestack();
 
     if (orderExpr->is_updating())
-      throw XQUERY_EXCEPTION(err::XUST0001, ERROR_LOC(loc));
+       RAISE_ERROR_NO_PARAMS(err::XUST0001, loc);
 
     orderExpr = wrap_in_atomization(orderExpr);
 
@@ -7896,7 +7913,7 @@
   expr* whereExpr = pop_nodestack();
 
   if (whereExpr->is_updating())
-    throw XQUERY_EXCEPTION(err::XUST0001, ERROR_LOC(loc));
+     RAISE_ERROR_NO_PARAMS(err::XUST0001, loc);
 
   whereExpr = wrap_in_bev(whereExpr);
 
@@ -9547,7 +9564,7 @@
 
   if (v.get_expr() == NULL)
   {
-    throw XQUERY_EXCEPTION( err::XQST0079, ERROR_LOC(loc) );
+     RAISE_ERROR_NO_PARAMS(err::XQST0079, loc);
   }
 
   return no_state;
@@ -11309,17 +11326,15 @@
         if (theModuleNamespace.empty())
         {
           RAISE_ERROR(err::XPTY0004, loc,
-          ERROR_PARAMS(ZED(BadType_23o),
+          ERROR_PARAMS(ZED(XPTY0004_NoVarTypeInMainModule_23),
                        *declaredType,
-                       ZED(NoTypeInMainModule_4),
                        ve->get_name()->getStringValue()));
         }
         else
         {
           RAISE_ERROR(err::XPTY0004, loc,
-          ERROR_PARAMS(ZED(BadType_23o),
+          ERROR_PARAMS(ZED(XPTY0004_NoVarTypeInModule_234),
                        *declaredType,
-                       ZED(NoTypeInModule_45),
                        ve->get_name()->getStringValue(),
                        theModuleNamespace));
         }
@@ -11329,17 +11344,15 @@
         if (theModuleNamespace.empty())
         {
           RAISE_ERROR(err::XQST0036, loc,
-          ERROR_PARAMS(ZED(BadType_23o),
+          ERROR_PARAMS(ZED(XQST0036_NoVarTypeInMainModule_23),
                        *declaredType,
-                       ZED(NoTypeInMainModule_4),
                        ve->get_name()->getStringValue()));
         }
         else
         {
           RAISE_ERROR(err::XQST0036, loc,
-          ERROR_PARAMS(ZED(BadType_23o),
+          ERROR_PARAMS(ZED(XQST0036_NoVarTypeInModule_234),
                        *declaredType,
-                       ZED(NoTypeInModule_45),
                        ve->get_name()->getStringValue(),
                        theModuleNamespace));
         }
@@ -11566,17 +11579,15 @@
       if (theModuleNamespace.empty())
       {
         RAISE_ERROR(err::XQST0036, loc,
-        ERROR_PARAMS(ZED(BadType_23o),
+        ERROR_PARAMS(ZED(XQST0036_NoRetTypeInMainModule_23),
                      *retType,
-                     ZED(NoTypeInMainModule_4),
                      f->getName()->getStringValue()));
       }
       else
       {
         RAISE_ERROR(err::XQST0036, loc,
-        ERROR_PARAMS(ZED(BadType_23o),
+        ERROR_PARAMS(ZED(XQST0036_NoRetTypeInModule_234),
                      *retType,
-                     ZED(NoTypeInModule_45),
                      f->getName()->getStringValue(),
                      theModuleNamespace));
       }
@@ -11594,17 +11605,15 @@
         if (theModuleNamespace.empty())
         {
           RAISE_ERROR(err::XQST0036, loc,
-          ERROR_PARAMS(ZED(BadType_23o),
+          ERROR_PARAMS(ZED(XQST0036_NoParamTypeInMainModule_23),
                        *type,
-                       ZED(NoTypeInMainModule_4),
                        f->getName()->getStringValue()));
         }
         else
         {
           RAISE_ERROR(err::XQST0036, loc,
-          ERROR_PARAMS(ZED(BadType_23o),
+          ERROR_PARAMS(ZED(XQST0036_NoParamTypeInModule_234),
                        *retType,
-                       ZED(NoTypeInModule_45),
                        f->getName()->getStringValue(),
                        theModuleNamespace));
         }
@@ -13467,9 +13476,10 @@
     {
       prefix = qname->get_localname();
 
-      if (ZSTREQ(prefix, "xmlns"))
-        RAISE_ERROR(err::XQST0070, loc,
-        ERROR_PARAMS(prefix, ZED(NoRebindPrefix)));
+      if (prefix == "xmlns")
+      {
+        RAISE_ERROR(err::XQST0070, loc, ERROR_PARAMS(ZED(XQST0070_xmlnsInAttrDecl)));
+      }
     }
 
     const_expr* constValueExpr = dynamic_cast<const_expr*>(valueExpr);
@@ -13499,10 +13509,11 @@
               foExpr2->get_func()->getKind() == FunctionConsts::OP_ENCLOSED_1 &&
               (qname->get_qname() == "xmlns" || qname->get_prefix() == "xmlns"))
           {
-            throw XQUERY_EXCEPTION(err::XQST0022, ERROR_LOC(loc));
+             RAISE_ERROR_NO_PARAMS(err::XQST0022, loc);
           }
         }
       }
+
       have_uri = true;
     }
 
@@ -13511,13 +13522,14 @@
       if ((ZSTREQ(prefix, "xml") && !ZSTREQ(uri, XML_NS)))
       {
         RAISE_ERROR(err::XQST0070, loc,
-        ERROR_PARAMS(prefix, ZED(NoRebindPrefix)));
+        ERROR_PARAMS(ZED(XQST0070_ReservedPrefix_23), prefix, uri));
       }
 
       if ((ZSTREQ(uri, XML_NS) && !ZSTREQ(prefix, "xml")) ||
            ZSTREQ(uri, XMLNS_NS))
       {
-        RAISE_ERROR(err::XQST0070, loc, ERROR_PARAMS(uri, ZED(NoBindURI)));
+        RAISE_ERROR(err::XQST0070, loc,
+        ERROR_PARAMS(ZED(XQST0070_ReservedURI_23), prefix, uri));
       }
 
       URI parsedUri(uri);
@@ -13533,7 +13545,7 @@
       if (ZSTREQ(prefix, "xml"))
       {
         RAISE_ERROR(err::XQST0070, loc,
-        ERROR_PARAMS(prefix, ZED(NoRebindPrefix)));
+        ERROR_PARAMS(ZED(XQST0070_ReservedPrefix_23), prefix, ""));
       }
 
       // unbind the prefix
@@ -13546,7 +13558,7 @@
     }
     else
     {
-      throw XQUERY_EXCEPTION(err::XQST0022, ERROR_LOC(loc));
+       RAISE_ERROR_NO_PARAMS(err::XQST0022, loc);
     }
   }
   // Plain direct attribute
@@ -14929,17 +14941,17 @@
     // whose PITarget is equal to fn:normalize-space(N). If fn:normalize-space(N)
     // is not in the lexical space of NCName, a type error is raised [err:XPTY0004]
 
-    zstring lNormalizedTarget;
-    ascii::normalize_space(target, &lNormalizedTarget);
+    zstring normalizedTarget;
+    ascii::normalize_space(target, &normalizedTarget);
 
-    if (!GenericCast::castableToNCName(lNormalizedTarget))
+    if (!GenericCast::castableToNCName(normalizedTarget))
     {
       RAISE_ERROR(err::XPTY0004, loc,
-      ERROR_PARAMS(ZED(BadType_23o), lNormalizedTarget, ZED(NoCastTo_45o), "NCName"));
+      ERROR_PARAMS(ZED(XPTY0004_ValueNoCastTo_23), normalizedTarget, "xs:NCName"));
     }
 
     // bugfix (see above); pass normalized string instead of original target
-    GENV_ITEMFACTORY->createQName(qname, NULL, NULL, lNormalizedTarget.c_str());
+    GENV_ITEMFACTORY->createQName(qname, NULL, NULL, normalizedTarget.c_str());
   }
 
   if (axisExpr != NULL)
@@ -15472,7 +15484,7 @@
   expr* sourceExpr = pop_nodestack();
 
   if (sourceExpr->is_updating())
-    throw XQUERY_EXCEPTION(err::XUST0001, ERROR_LOC(loc));
+     RAISE_ERROR_NO_PARAMS(err::XUST0001, loc);
 
   push_scope();
 
@@ -15592,9 +15604,7 @@
   ftmatch_options *const mo = dynamic_cast<ftmatch_options*>( top_ftstack() );
   ZORBA_ASSERT( mo );
   if ( mo->get_case_option() )
-    throw XQUERY_EXCEPTION(
-      err::FTST0019, ERROR_PARAMS( "case" ), ERROR_LOC( loc )
-    );
+    RAISE_ERROR(err::FTST0019, loc, ERROR_PARAMS("case"));
   mo->set_case_option( new ftcase_option( loc, v.get_mode() ) );
 #endif /* ZORBA_NO_FULL_TEXT */
 }
@@ -15604,9 +15614,7 @@
 {
   TRACE_VISIT ();
 #ifdef ZORBA_NO_FULL_TEXT
-  throw XQUERY_EXCEPTION(
-    err::XPST0003, ERROR_PARAMS( ZED( FullTextNotEnabled ) ), ERROR_LOC( loc )
-  );
+  RAISE_ERROR(err::XPST0003, loc, ERROR_PARAMS(ZED(FullTextNotEnabled)));
 #endif /* ZORBA_NO_FULL_TEXT */
   return no_state;
 }
@@ -15656,9 +15664,7 @@
   ftmatch_options *const mo = dynamic_cast<ftmatch_options*>( top_ftstack() );
   ZORBA_ASSERT( mo );
   if ( mo->get_diacritics_option() )
-    throw XQUERY_EXCEPTION(
-      err::FTST0019, ERROR_PARAMS( "diacriticics" ), ERROR_LOC( loc )
-    );
+    RAISE_ERROR(err::FTST0019, loc, ERROR_PARAMS("diacriticics"));
   mo->set_diacritics_option( new ftdiacritics_option( loc, v.get_mode() ) );
 #endif /* ZORBA_NO_FULL_TEXT */
 }
@@ -15711,7 +15717,7 @@
   if ( s )
     pop_ftstack();
   else
-    throw XQUERY_EXCEPTION( err::XQST0079, ERROR_LOC( loc ) );
+    RAISE_ERROR_NO_PARAMS(err::XQST0079, loc);
   push_ftstack( new ftextension_selection( loc, v.get_pragma_list(), s ) );
 #endif /* ZORBA_NO_FULL_TEXT */
 }
@@ -15745,9 +15751,7 @@
   ftmatch_options *const mo = dynamic_cast<ftmatch_options*>( top_ftstack() );
   ZORBA_ASSERT( mo );
   if ( mo->get_language_option() )
-    throw XQUERY_EXCEPTION(
-      err::FTST0019, ERROR_PARAMS( "language" ), ERROR_LOC( loc )
-    );
+    RAISE_ERROR(err::FTST0019, loc, ERROR_PARAMS("language"));
   mo->set_language_option( new ftlanguage_option( loc, v.get_language() ) );
 #endif /* ZORBA_NO_FULL_TEXT */
 }
@@ -15936,9 +15940,7 @@
 
 void *begin_visit (const FTScoreVar& v) {
   TRACE_VISIT ();
-  throw XQUERY_EXCEPTION(
-    zerr::ZXQP0004_NOT_IMPLEMENTED, ERROR_PARAMS( "score" ), ERROR_LOC( loc )
-  );
+  RAISE_ERROR(zerr::ZXQP0004_NOT_IMPLEMENTED, loc, ERROR_PARAMS("score"));
 }
 
 void end_visit (const FTScoreVar& v, void* /*visit_state*/) {
@@ -15984,9 +15986,7 @@
   ftmatch_options *const mo = dynamic_cast<ftmatch_options*>( top_ftstack() );
   ZORBA_ASSERT( mo );
   if ( mo->get_stem_option() )
-    throw XQUERY_EXCEPTION(
-      err::FTST0019, ERROR_PARAMS( "stem" ), ERROR_LOC( loc )
-    );
+    RAISE_ERROR(err::FTST0019, loc, ERROR_PARAMS("stem"));
   mo->set_stem_option( new ftstem_option( loc, v.get_mode() ) );
 #endif /* ZORBA_NO_FULL_TEXT */
 }
@@ -16049,9 +16049,7 @@
   ftmatch_options *const mo = dynamic_cast<ftmatch_options*>( top_ftstack() );
   ZORBA_ASSERT( mo );
   if ( mo->get_stop_word_option() )
-    throw XQUERY_EXCEPTION(
-      err::FTST0019, ERROR_PARAMS( "stop words" ), ERROR_LOC( loc )
-    );
+    RAISE_ERROR(err::FTST0019, loc, ERROR_PARAMS("stop words"));
   ftstop_word_option *const sw =
     new ftstop_word_option( loc, stop_words, v.get_mode() );
   mo->set_stop_word_option( sw );
@@ -16073,9 +16071,7 @@
     theSctx->resolve_uri( uri, internal::EntityData::THESAURUS, error_msg )
   );
   if ( !rsrc.get() )
-    throw XQUERY_EXCEPTION(
-      err::FTST0018, ERROR_PARAMS( uri ), ERROR_LOC( loc )
-    );
+    RAISE_ERROR(err::FTST0018, loc, ERROR_PARAMS( uri ));
 
   ftrange *levels;
   if ( v.get_levels() ) {
@@ -16115,9 +16111,7 @@
   ftmatch_options *const mo = dynamic_cast<ftmatch_options*>( top_ftstack() );
   ZORBA_ASSERT( mo );
   if ( mo->get_thesaurus_option() )
-    throw XQUERY_EXCEPTION(
-      err::FTST0019, ERROR_PARAMS( "thesaurus" ), ERROR_LOC( loc )
-    );
+    RAISE_ERROR(err::FTST0019, loc, ERROR_PARAMS( "thesaurus" ));
   ftthesaurus_option *const t =
     new ftthesaurus_option( loc, default_tid, list, v.no_thesaurus() );
   mo->set_thesaurus_option( t );
@@ -16188,9 +16182,7 @@
   ftmatch_options *const mo = dynamic_cast<ftmatch_options*>( top_ftstack() );
   ZORBA_ASSERT( mo );
   if ( mo->get_wild_card_option() )
-    throw XQUERY_EXCEPTION(
-      err::FTST0019, ERROR_PARAMS( "wildcards" ), ERROR_LOC( loc )
-    );
+    RAISE_ERROR(err::FTST0019, loc, ERROR_PARAMS( "wildcards" ));
   mo->set_wild_card_option( new ftwild_card_option( loc, v.get_mode() ) );
 #endif /* ZORBA_NO_FULL_TEXT */
 }

=== modified file 'src/diagnostics/diagnostic_en.xml'
--- src/diagnostics/diagnostic_en.xml	2013-06-19 20:05:45 +0000
+++ src/diagnostics/diagnostic_en.xml	2013-06-20 09:54:39 +0000
@@ -304,8 +304,20 @@
         <value>atomization of grouping variable produces more than one item</value>
       </entry>
 
-      <entry key="PiTarget_3">
-        <value>$3: type of processing instruction target is not xs:NCName, or xs:string, or xs:untypedAtomic</value>
+      <entry key="NoVarTypeInMainModule_23">
+        <value>"$2": type of variable "$3" is not among the in-scope types of the main module</value>
+      </entry>
+
+      <entry key="NoVarTypeInModule_234">
+        <value>"$2": type of variable "$3" is not among the in-scope types of module "$4"</value>
+      </entry>
+
+      <entry key="ValueNoCastTo_23">
+        <value>$2: value can not be cast to type $3</value>
+      </entry>
+
+      <entry key="PiTarget_2">
+        <value>$2: type of processing instruction target is not xs:NCName, or xs:string, or xs:untypedAtomic</value>
       </entry>
     </diagnostic>
 
@@ -485,6 +497,31 @@
             referenced in the importing module.
       </comment>
       <value>$1</value>
+
+      <entry key="NoVarTypeInMainModule_23">
+        <value>"$2": type of variable "$3" is not among the in-scope types of the main module</value>
+      </entry>
+
+      <entry key="NoVarTypeInModule_234">
+        <value>"$2": type of variable "$3" is not among the in-scope types of module "$4"</value>
+      </entry>
+
+      <entry key="NoRetTypeInMainModule_23">
+        <value>"$2": return type of function "$3" is not among the in-scope types of the main module</value>
+      </entry>
+
+      <entry key="NoRetTypeInModule_234">
+        <value>"$2": return type of function "$3" is not among the in-scope types of module "$4"</value>
+      </entry>
+
+      <entry key="NoParamTypeInMainModule_23">
+        <value>"$2": parameter type of function "$3" is not among the in-scope types of the main module</value>
+      </entry>
+
+      <entry key="NoParamTypeInModule_234">
+        <value>"$2": parameter type of function "$3" is not among the in-scope types of module "$4"</value>
+      </entry>
+
     </diagnostic>
 
     <diagnostic code="XQST0038">
@@ -588,7 +625,7 @@
         It is a static error if a schema import binds a namespace prefix but
         does not specify a target namespace other than a zero-length string.
       </comment>
-      <value>empty target namespace</value>
+      <value>schema import with empty target namespace</value>
     </diagnostic>
 
     <diagnostic code="XQST0058">
@@ -596,7 +633,7 @@
         It is a static error if multiple schema imports specify the same target
         namespace.
       </comment>
-      <value>"$1": duplicate target namespace</value>
+      <value>duplicate import of schema with target namespace $1</value>
     </diagnostic>
 
     <diagnostic code="XQST0059">
@@ -627,7 +664,7 @@
        A static error is raised if a Prolog contains more than one ordering mode
        declaration.
       </comment>
-      <value>multiple ordering mode declaraions</value>
+      <value>multiple ordering mode declarations</value>
     </diagnostic>
 
     <diagnostic code="XQST0066">
@@ -676,7 +713,32 @@
        - A prefix other than \c xmlns is bound to the namespace URI
          <code>http://www.w3.org/2000/xmlns/</code>.
       </comment>
-      <value>"$1": $2</value>
+      <value>$1</value>
+
+      <entry key="ReservedPrefixInDecl_2">
+        <value>"$2": reserved prefix can not appear in namespace declaration</value>
+      </entry>
+
+      <entry key="ReservedPrefixInModule_2">
+        <value>"$2": reserved prefix can not appear in module declaration</value>
+      </entry>
+
+      <entry key="ReservedPrefixInImport_2">
+        <value>"$2": reserved prefix can not appear in schema or module import</value>
+      </entry>
+
+      <entry key="xmlnsInAttrDecl">
+        <value>"xmlns" prefix can not be bound in namespace declaration attribute</value>
+      </entry>
+
+      <entry key="ReservedPrefix_23">
+        <value>"$2": can not rebind reserved prefix to namespace URI "$3"</value>
+      </entry>
+
+      <entry key="ReservedURI_23">
+        <value>"$2": can not bind prefix to reserved namespace URI "$3"</value>
+      </entry>
+
     </diagnostic>
 
     <diagnostic code="XQST0071">
@@ -727,7 +789,7 @@
        It is a static error if the literal that specifies the target namespace
        in a module import or a module declaration is of zero length.
       </comment>
-      <value>empty target namespace literal</value>
+      <value>empty target namespace in module import or module declaration</value>
     </diagnostic>
 
     <diagnostic code="XQST0089">
@@ -3904,10 +3966,6 @@
       <value>could not parse function arity (maybe it's too large)</value>
     </entry>
 
-    <entry key="NoRebindPrefix">
-      <value>can not rebind predefined prefix</value>
-    </entry>
-
     <entry key="NoRegisteredSerializationCallback_2">
       <value>external module "$2" not available using registered SerializationCallback</value>
     </entry>
@@ -3976,14 +4034,6 @@
       <value>"\\$3": multi-character and category escapes not permitted in character range</value>
     </entry>
 
-    <entry key="NoTypeInMainModule_4">
-      <value>type of variable "$4" is not among the in-scope types of the main module</value>
-    </entry>
-
-    <entry key="NoTypeInModule_45">
-      <value>type of variable "$4" is not among the in-scope types module "$5"</value>
-    </entry>
-
     <entry key="NoURIAuthority">
       <value>no authority</value>
     </entry>

=== modified file 'src/diagnostics/pregenerated/dict_en.cpp'
--- src/diagnostics/pregenerated/dict_en.cpp	2013-06-19 20:05:45 +0000
+++ src/diagnostics/pregenerated/dict_en.cpp	2013-06-20 09:54:39 +0000
@@ -190,22 +190,22 @@
   { "XQST0052", "\"$1\": not defined as simple type" },
   { "XQST0054", "${\"1\": }variable must not depend on itself" },
   { "XQST0055", "multiple copy-namespaces declarations" },
-  { "XQST0057", "empty target namespace" },
-  { "XQST0058", "\"$1\": duplicate target namespace" },
+  { "XQST0057", "schema import with empty target namespace" },
+  { "XQST0058", "duplicate import of schema with target namespace $1" },
   { "XQST0059", "$1" },
   { "XQST0060", "\"$1\": function name has a null namespace URI" },
-  { "XQST0065", "multiple ordering mode declaraions" },
+  { "XQST0065", "multiple ordering mode declarations" },
   { "XQST0066", "multiple element/type/function namespace declarations" },
   { "XQST0067", "multiple construction declarations" },
   { "XQST0068", "multiple boundary-space declarations" },
   { "XQST0069", "multiple empty order declarations" },
-  { "XQST0070", "\"$1\": $2" },
+  { "XQST0070", "$1" },
   { "XQST0071", "\"$1\": duplicate namespace declaration attribute" },
   { "XQST0076", "\"$1\": unknown collation" },
   { "XQST0079", "unknown pragma or empty expression" },
   { "XQST0085", "namespace URI is empty" },
   { "XQST0087", "\"$1\": invalid encoding" },
-  { "XQST0088", "empty target namespace literal" },
+  { "XQST0088", "empty target namespace in module import or module declaration" },
   { "XQST0089", "\"$1\": duplicate variable name" },
   { "XQST0090", "\"$1\": invalid character reference in XML $2" },
   { "XQST0093", "\"$1\": module must not depend on itself" },
@@ -687,7 +687,6 @@
   { "~NoModuleURIResolver", "no module URI resolver could be retrieved using SerializationCallback" },
   { "~NoMultiKeyNodeValues_2", "node with more than one key value found during probe on index \"$2\"" },
   { "~NoParseFnArity", "could not parse function arity (maybe it's too large)" },
-  { "~NoRebindPrefix", "can not rebind predefined prefix" },
   { "~NoRegisteredSerializationCallback_2", "external module \"$2\" not available using registered SerializationCallback" },
   { "~NoResolveRelativeURI", "could not resolve relative URI" },
   { "~NoSeqAsArithOp", "sequence of more than one item can not be operand for arithmetic operation" },
@@ -703,8 +702,6 @@
   { "~NoSourceURI", "no URI" },
   { "~NoStrictCompareWithType_4", "can not compare for strict inequality to type \"$4\"" },
   { "~NoTreatAs_4", "can not treat as \"$4\"" },
-  { "~NoTypeInMainModule_4", "type of variable \"$4\" is not among the in-scope types of the main module" },
-  { "~NoTypeInModule_45", "type of variable \"$4\" is not among the in-scope types module \"$5\"" },
   { "~NoURIAuthority", "no authority" },
   { "~NoURIInStore", "URI for document not found in store" },
   { "~NoURIScheme", "no URI scheme" },
@@ -922,7 +919,10 @@
   { "~XPTY0004_NoReturnTypePromote_234", "$2 can not be promoted to return type $3 of function $4()" },
   { "~XPTY0004_NoTreatAs_23", "$2 can not be treated as type $3" },
   { "~XPTY0004_NoTypePromote_23", "$2 can not be promoted to type $3" },
-  { "~XPTY0004_PiTarget_3", "$3: type of processing instruction target is not xs:NCName, or xs:string, or xs:untypedAtomic" },
+  { "~XPTY0004_NoVarTypeInMainModule_23", "\"$2\": type of variable \"$3\" is not among the in-scope types of the main module" },
+  { "~XPTY0004_NoVarTypeInModule_234", "\"$2\": type of variable \"$3\" is not among the in-scope types of module \"$4\"" },
+  { "~XPTY0004_PiTarget_2", "$2: type of processing instruction target is not xs:NCName, or xs:string, or xs:untypedAtomic" },
+  { "~XPTY0004_ValueNoCastTo_23", "$2: value can not be cast to type $3" },
   { "~XPTY0117_NodeCast", "Cannot cast node to xs:QName" },
   { "~XPTY0117_NotationParam_23", "$2 can not be promoted to parameter type xs:NOTATION of function $3()" },
   { "~XQDY0027_InvalidValue", "\"$2\": invalid value for type${: 3}${: 4}" },
@@ -933,9 +933,21 @@
   { "~XQDY0074_NameSapceConstructor", "$2: cannot cast prefix to xs:NCName" },
   { "~XQDY0074_NoEmptyLocalname", "can not convert empty local name to xs:QName" },
   { "~XQDY0074_NotCastToQName", "$2: can not convert to xs:QName" },
+  { "~XQST0036_NoParamTypeInMainModule_23", "\"$2\": parameter type of function \"$3\" is not among the in-scope types of the main module" },
+  { "~XQST0036_NoParamTypeInModule_234", "\"$2\": parameter type of function \"$3\" is not among the in-scope types of module \"$4\"" },
+  { "~XQST0036_NoRetTypeInMainModule_23", "\"$2\": return type of function \"$3\" is not among the in-scope types of the main module" },
+  { "~XQST0036_NoRetTypeInModule_234", "\"$2\": return type of function \"$3\" is not among the in-scope types of module \"$4\"" },
+  { "~XQST0036_NoVarTypeInMainModule_23", "\"$2\": type of variable \"$3\" is not among the in-scope types of the main module" },
+  { "~XQST0036_NoVarTypeInModule_234", "\"$2\": type of variable \"$3\" is not among the in-scope types of module \"$4\"" },
   { "~XQST0046_BadHexDigit_3", "'$3': invalid hexedecimal digit" },
   { "~XQST0059_SpecificationMessage", "\"$2\": target namespace not found for schema/module${ \"3\"}${: 4}" },
   { "~XQST0059_XercesMessage", "$2,$3: error in schema${ with System ID \"4\"}${ with Public ID \"5\"}${: 6}" },
+  { "~XQST0070_ReservedPrefixInDecl_2", "\"$2\": reserved prefix can not appear in namespace declaration" },
+  { "~XQST0070_ReservedPrefixInImport_2", "\"$2\": reserved prefix can not appear in schema or module import" },
+  { "~XQST0070_ReservedPrefixInModule_2", "\"$2\": reserved prefix can not appear in module declaration" },
+  { "~XQST0070_ReservedPrefix_23", "\"$2\": can not rebind reserved prefix to namespace URI \"$3\"" },
+  { "~XQST0070_ReservedURI_23", "\"$2\": can not bind prefix to reserved namespace URI \"$3\"" },
+  { "~XQST0070_xmlnsInAttrDecl", "\"xmlns\" prefix can not be bound in namespace declaration attribute" },
   { "~XQST0097_MustBeChar", "must be a single character" },
   { "~XQST0097_MustBeZeroDigit", "must be a digit (Unicode category Nd) and represent zero" },
   { "~XQST0106_Conflicting", "$2: conflicting annotations in declaration" },

=== modified file 'src/diagnostics/pregenerated/dict_zed_keys.h'
--- src/diagnostics/pregenerated/dict_zed_keys.h	2013-06-19 20:05:45 +0000
+++ src/diagnostics/pregenerated/dict_zed_keys.h	2013-06-20 09:54:39 +0000
@@ -48,12 +48,27 @@
 #define ZED_XPTY0004_NoTreatAs_23 "~XPTY0004_NoTreatAs_23"
 #define ZED_XPTY0004_JSONIQ_SELECTOR "~XPTY0004_JSONIQ_SELECTOR"
 #define ZED_XPTY0004_MultiValuedGroupingKey "~XPTY0004_MultiValuedGroupingKey"
-#define ZED_XPTY0004_PiTarget_3 "~XPTY0004_PiTarget_3"
+#define ZED_XPTY0004_NoVarTypeInMainModule_23 "~XPTY0004_NoVarTypeInMainModule_23"
+#define ZED_XPTY0004_NoVarTypeInModule_234 "~XPTY0004_NoVarTypeInModule_234"
+#define ZED_XPTY0004_ValueNoCastTo_23 "~XPTY0004_ValueNoCastTo_23"
+#define ZED_XPTY0004_PiTarget_2 "~XPTY0004_PiTarget_2"
 #define ZED_XPTY0117_NodeCast "~XPTY0117_NodeCast"
 #define ZED_XPTY0117_NotationParam_23 "~XPTY0117_NotationParam_23"
+#define ZED_XQST0036_NoVarTypeInMainModule_23 "~XQST0036_NoVarTypeInMainModule_23"
+#define ZED_XQST0036_NoVarTypeInModule_234 "~XQST0036_NoVarTypeInModule_234"
+#define ZED_XQST0036_NoRetTypeInMainModule_23 "~XQST0036_NoRetTypeInMainModule_23"
+#define ZED_XQST0036_NoRetTypeInModule_234 "~XQST0036_NoRetTypeInModule_234"
+#define ZED_XQST0036_NoParamTypeInMainModule_23 "~XQST0036_NoParamTypeInMainModule_23"
+#define ZED_XQST0036_NoParamTypeInModule_234 "~XQST0036_NoParamTypeInModule_234"
 #define ZED_XQST0046_BadHexDigit_3 "~XQST0046_BadHexDigit_3"
 #define ZED_XQST0059_SpecificationMessage "~XQST0059_SpecificationMessage"
 #define ZED_XQST0059_XercesMessage "~XQST0059_XercesMessage"
+#define ZED_XQST0070_ReservedPrefixInDecl_2 "~XQST0070_ReservedPrefixInDecl_2"
+#define ZED_XQST0070_ReservedPrefixInModule_2 "~XQST0070_ReservedPrefixInModule_2"
+#define ZED_XQST0070_ReservedPrefixInImport_2 "~XQST0070_ReservedPrefixInImport_2"
+#define ZED_XQST0070_xmlnsInAttrDecl "~XQST0070_xmlnsInAttrDecl"
+#define ZED_XQST0070_ReservedPrefix_23 "~XQST0070_ReservedPrefix_23"
+#define ZED_XQST0070_ReservedURI_23 "~XQST0070_ReservedURI_23"
 #define ZED_XQST0097_MustBeChar "~XQST0097_MustBeChar"
 #define ZED_XQST0097_MustBeZeroDigit "~XQST0097_MustBeZeroDigit"
 #define ZED_XQST0106_Duplicate "~XQST0106_Duplicate"
@@ -281,7 +296,6 @@
 #define ZED_NoModuleURIResolver "~NoModuleURIResolver"
 #define ZED_NoMultiKeyNodeValues_2 "~NoMultiKeyNodeValues_2"
 #define ZED_NoParseFnArity "~NoParseFnArity"
-#define ZED_NoRebindPrefix "~NoRebindPrefix"
 #define ZED_NoRegisteredSerializationCallback_2 "~NoRegisteredSerializationCallback_2"
 #define ZED_NoResolveRelativeURI "~NoResolveRelativeURI"
 #define ZED_NoSeqAsArithOp "~NoSeqAsArithOp"
@@ -299,8 +313,6 @@
 #define ZED_NoSourceURI "~NoSourceURI"
 #define ZED_NoTreatAs_4 "~NoTreatAs_4"
 #define ZED_NotSingleCharEsc_3 "~NotSingleCharEsc_3"
-#define ZED_NoTypeInMainModule_4 "~NoTypeInMainModule_4"
-#define ZED_NoTypeInModule_45 "~NoTypeInModule_45"
 #define ZED_NoURIAuthority "~NoURIAuthority"
 #define ZED_NoURIInStore "~NoURIInStore"
 #define ZED_NoURIScheme "~NoURIScheme"

=== modified file 'src/diagnostics/util_macros.h'
--- src/diagnostics/util_macros.h	2013-02-07 17:24:36 +0000
+++ src/diagnostics/util_macros.h	2013-06-20 09:54:39 +0000
@@ -19,11 +19,6 @@
                          params,                              \
                          ERROR_LOC(loc))
 
-#define RAISE_ERROR_VAR(errcode, loc, params)                 \
-  throw XQUERY_EXCEPTION_VAR(errcode,                         \
-                             params,                          \
-                             ERROR_LOC(loc))
-
 
 #define RAISE_ERROR_NO_LOC(errcode, params)                   \
   throw XQUERY_EXCEPTION(errcode,                             \

=== modified file 'src/runtime/core/constructors.cpp'
--- src/runtime/core/constructors.cpp	2013-06-19 19:27:26 +0000
+++ src/runtime/core/constructors.cpp	2013-06-20 09:54:39 +0000
@@ -884,7 +884,7 @@
     TypeManager* tm = theSctx->get_typemanager();
     xqtref_t type = tm->create_value_type(targetItem);
     RAISE_ERROR(err::XPTY0004, loc,
-    ERROR_PARAMS(ZED(XPTY0004_PiTarget_3), type->toSchemaString()));
+    ERROR_PARAMS(ZED(XPTY0004_PiTarget_2), type->toSchemaString()));
   }
 
   if (targetType != store::XS_NCNAME)

=== modified file 'src/store/naive/nsbindings.cpp'
--- src/store/naive/nsbindings.cpp	2013-02-26 04:12:43 +0000
+++ src/store/naive/nsbindings.cpp	2013-06-20 09:54:39 +0000
@@ -21,6 +21,7 @@
 
 #include "diagnostics/xquery_diagnostics.h"
 #include "diagnostics/dict.h"
+#include "diagnostics/util_macros.h"
 
 #include "zorbamisc/ns_consts.h"
 
@@ -117,25 +118,21 @@
 void NsBindingsContext::check_ns_binding(const zstring& prefix, const zstring& uri)
 {
   if (ZSTREQ(prefix, "xmlns"))
-    throw XQUERY_EXCEPTION(
-      err::XQST0070,
-      ERROR_PARAMS( prefix, ZED( NoRebindPrefix ) )
-    );
+  {
+    RAISE_ERROR_NO_LOC(err::XQST0070, ERROR_PARAMS(ZED(XQST0070_xmlnsInAttrDecl)));
+  }
 
   if ((ZSTREQ(prefix, "xml") && !ZSTREQ(uri, XML_NS)))
   {
-    throw XQUERY_EXCEPTION(
-      err::XQST0070,
-      ERROR_PARAMS( prefix, ZED( NoRebindPrefix ) )
-    );
+    RAISE_ERROR_NO_LOC(err::XQST0070,
+    ERROR_PARAMS(ZED(XQST0070_ReservedPrefix_23), prefix, uri));
   }
 
   if ((ZSTREQ(uri, XML_NS) && !ZSTREQ(prefix, "xml")) ||
        ZSTREQ(uri, XMLNS_NS))
   {
-    throw XQUERY_EXCEPTION(
-      err::XQST0070, ERROR_PARAMS( uri, ZED( NoBindURI ) )
-    );
+    RAISE_ERROR_NO_LOC(err::XQST0070,
+    ERROR_PARAMS(ZED(XQST0070_ReservedURI_23), prefix, uri));
   }
 
 }


Follow ups