← 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:
Fixed bug #1188304

Requested reviews:
  Markos Zaharioudakis (markos-za)

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

Fixed bug #1188304
-- 
https://code.launchpad.net/~zorba-coders/zorba/markos-scratch/+merge/170288
Your team Zorba Coders is subscribed to branch lp:zorba.
=== modified file 'src/compiler/translator/translator.cpp'
--- src/compiler/translator/translator.cpp	2013-06-18 11:51:57 +0000
+++ src/compiler/translator/translator.cpp	2013-06-19 10:00:50 +0000
@@ -403,7 +403,7 @@
   theImportedModules :
   --------------------
   A set containing the target namespace uris of the modules directly imported
-  by this  module. Used to check that the same module is not imported twice by
+  by this module. Used to check that the same module is not imported twice by
   this module.
 
   theModuleNamespace :
@@ -3378,6 +3378,12 @@
   std::vector<zstring> compURIs;
   if (atlist == NULL || atlist->size() == 0)
   {
+    if (theSctx->xquery_version() >= StaticContextConsts::xquery_version_3_0 &&
+        targetNS == theModuleNamespace)
+    {
+      return;
+    }
+
     // Note the use of versioned_uri() here, so that the namespace with any
     // version fragment will be passed through to the mappers.
     theSctx->get_component_uris(modVer.versioned_uri(),

=== modified file 'src/store/naive/loader_fast.cpp'
--- src/store/naive/loader_fast.cpp	2013-04-08 22:59:58 +0000
+++ src/store/naive/loader_fast.cpp	2013-06-19 10:00:50 +0000
@@ -147,31 +147,36 @@
   } // if
 
   XmlLoader *const loader = static_cast<XmlLoader*>( ctx );
-  switch ( error->level )
+
+  xmlErrorLevel errorLevel = error->level;
+
+  if (error->code == XML_WAR_NS_URI)
+  {
+    errorLevel = XML_ERR_WARNING;
+  }
+
+  switch (errorLevel)
   {
     case XML_ERR_ERROR:
-    case XML_ERR_FATAL: {
-      XQueryException *const xe = NEW_XQUERY_EXCEPTION(
-        zerr::ZSTR0021_LOADER_PARSING_ERROR,
-        ERROR_PARAMS(
-          error->file, error->line, error->int2 /* column */,
-          libxml_dict_key_4, error_str1_5, error_str2_6, error_str3_7,
-          error_int1_8, error_message_9
-        )
-      );
+    case XML_ERR_FATAL:
+    {
+      XQueryException *const xe =
+      NEW_XQUERY_EXCEPTION(zerr::ZSTR0021_LOADER_PARSING_ERROR,
+      ERROR_PARAMS(error->file, error->line, error->int2 /* column */,
+                   libxml_dict_key_4, error_str1_5, error_str2_6, error_str3_7,
+                   error_int1_8, error_message_9));
+
       xe->set_data( error->file, error->line, error->int2 /* column */ );
       loader->theXQueryDiagnostics->add_error( xe );
       break;
     }
-    case XML_ERR_WARNING: {
-      XQueryWarning *const xw = NEW_XQUERY_WARNING(
-        zwarn::ZWST0007_LOADER_PARSING_WARNING,
-        WARN_PARAMS(
-          error->file, error->line, error->int2 /* column */,
-          libxml_dict_key_4, error_str1_5, error_str2_6, error_str3_7,
-          error_int1_8, error_message_9
-        )
-      );
+    case XML_ERR_WARNING:
+    {
+      XQueryWarning *const xw =
+      NEW_XQUERY_WARNING(zwarn::ZWST0007_LOADER_PARSING_WARNING,
+      WARN_PARAMS(error->file, error->line, error->int2 /* column */,
+                  libxml_dict_key_4, error_str1_5, error_str2_6, error_str3_7,
+                  error_int1_8, error_message_9));
       xw->set_data( error->file, error->line, error->int2 /* column */ );
       loader->theXQueryDiagnostics->add_warning( xw );
       break;

=== modified file 'test/rbkt/ExpQueryResults/zorba/jsoniq/keys_05.xml.res'
--- test/rbkt/ExpQueryResults/zorba/jsoniq/keys_05.xml.res	2013-06-18 18:55:33 +0000
+++ test/rbkt/ExpQueryResults/zorba/jsoniq/keys_05.xml.res	2013-06-19 10:00:50 +0000
@@ -1,1 +1,1 @@
-foo1 foo2
+foo1 foo2 foo1 foo2

=== modified file 'test/rbkt/Queries/zorba/jsoniq/keys_05.xq'
--- test/rbkt/Queries/zorba/jsoniq/keys_05.xq	2013-06-18 18:55:33 +0000
+++ test/rbkt/Queries/zorba/jsoniq/keys_05.xq	2013-06-19 10:00:50 +0000
@@ -1,3 +1,5 @@
+
+for $j in (1, 2)
 let $a :=
   for $i in 1 to 10
   return { if ($i mod 2 eq 0) then "foo2" else "foo1" : "bar" || $i }


Follow ups