← Back to team overview

zorba-coders team mailing list archive

[Merge] lp:~zorba-coders/zorba/bug867156-importsegfaults into lp:zorba

 

Cezar Andrei has proposed merging lp:~zorba-coders/zorba/bug867156-importsegfaults into lp:zorba.

Requested reviews:
  Cezar Andrei (cezar-andrei)
  Chris Hillery (ceejatec)
Related bugs:
  Bug #867156 in Zorba: "Import schema segfaults"
  https://bugs.launchpad.net/zorba/+bug/867156

For more details, see:
https://code.launchpad.net/~zorba-coders/zorba/bug867156-importsegfaults/+merge/103169

According to Xerces-C++ team( http://issues.apache.org/jira/browse/XERCESC-1980 ) XMLSchema.xsd i.e. schema4schema should be avoided to be imported. This fix avoids importing this schema file.
-- 
https://code.launchpad.net/~zorba-coders/zorba/bug867156-importsegfaults/+merge/103169
Your team Zorba Coders is subscribed to branch lp:zorba.
=== modified file 'src/compiler/translator/translator.cpp'
--- src/compiler/translator/translator.cpp	2012-04-23 10:46:38 +0000
+++ src/compiler/translator/translator.cpp	2012-04-23 20:45:24 +0000
@@ -105,7 +105,7 @@
 
 
 #define NODE_SORT_OPT
-
+#define XS_URI "http://www.w3.org/2001/XMLSchema";
 
 namespace zorba
 {
@@ -2011,6 +2011,13 @@
       theSctx->bind_ns(pfx, targetNS, loc, err::XQST0033);
   }
 
+  zstring xsdTNS = zstring(XS_URI);
+  if ( xsdTNS.compare(targetNS)==0 )
+  {
+    // Xerces doesn't like importing XMLSchema.xsd schema4schema, so we skip it
+    return no_state;
+  }
+
   store::Item_t targetNSItem = NULL;
   zstring tmp = targetNS;
   ITEM_FACTORY->createAnyURI(targetNSItem, tmp);


Follow ups