← Back to team overview

zorba-coders team mailing list archive

[Merge] lp:~zorba-coders/zorba/module-schema-tools into lp:zorba

 

Cezar Andrei has proposed merging lp:~zorba-coders/zorba/module-schema-tools into lp:zorba.

Requested reviews:
  Cezar Andrei (cezar-andrei)
  Matthias Brantner (matthias-brantner)
  Chris Hillery (ceejatec)
Related bugs:
  Bug #931816 in Zorba: "New way of classpath and JVM Singleton handling"
  https://bugs.launchpad.net/zorba/+bug/931816
  Bug #933490 in Zorba: "Error ItemFactoryImpl::createBase64Binary with istream"
  https://bugs.launchpad.net/zorba/+bug/933490

For more details, see:
https://code.launchpad.net/~zorba-coders/zorba/module-schema-tools/+merge/101639

Add java classpath to zorbacmd and to Zorba API.
Fix dynamic libraries loading.
Tested it works on Windows with both xsl-fo and xmlbeans modules. All tests are passing.

Fixed ExternalModule integration, fixed comment and indentation of previously property generated files: src/system/zorba_properties.h and bin/zorbacmdproperties_base.h.

Removed swig IStream class and references.

Added util-jvm module which implements the link to the jvm.
-- 
https://code.launchpad.net/~zorba-coders/zorba/module-schema-tools/+merge/101639
Your team Zorba Coders is subscribed to branch lp:zorba.
=== modified file 'NOTICE.txt'
--- NOTICE.txt	2012-03-28 05:19:57 +0000
+++ NOTICE.txt	2012-04-11 19:41:20 +0000
@@ -459,6 +459,24 @@
           suitability of this software for any purpose. It is provided "as is"
           without express or implied warranty.
     
+----------------------------------------------------
+
+src/util/win32/dirent.h
+
+Copyright: 2006 Toni Ronkko
+
+
+      Permission is hereby granted, free of charge, to any person obtaining
+      a copy of this software and associated documentation files (the
+      ``Software''), to deal in the Software without restriction, including
+      without limitation the rights to use, copy, modify, merge, publish,
+      distribute, sublicense, and/or sell copies of the Software, and to
+      permit persons to whom the Software is furnished to do so, subject to
+      the following conditions:
+
+      The above copyright notice and this permission notice shall be included
+      in all copies or substantial portions of the Software.
+    
 
 External libraries used by this project:
 ----------------------------------------------------

=== modified file 'NOTICE.xml'
--- NOTICE.xml	2012-03-28 05:19:57 +0000
+++ NOTICE.xml	2012-04-11 19:41:20 +0000
@@ -423,6 +423,22 @@
           without express or implied warranty.
     </foreign-notice>
   </foreign-files>
+  <foreign-files>
+    <file>src/util/win32/dirent.h</file>
+    <copyright>2006 Toni Ronkko</copyright>
+    <foreign-notice>
+      Permission is hereby granted, free of charge, to any person obtaining
+      a copy of this software and associated documentation files (the
+      ``Software''), to deal in the Software without restriction, including
+      without limitation the rights to use, copy, modify, merge, publish,
+      distribute, sublicense, and/or sell copies of the Software, and to
+      permit persons to whom the Software is furnished to do so, subject to
+      the following conditions:
+
+      The above copyright notice and this permission notice shall be included
+      in all copies or substantial portions of the Software.
+    </foreign-notice>
+  </foreign-files>
 
   <external-lib mandatory="true">
     <name>LIBXML2</name>

=== modified file 'bin/path_util.cpp'
--- bin/path_util.cpp	2012-03-28 05:19:57 +0000
+++ bin/path_util.cpp	2012-04-11 19:41:20 +0000
@@ -49,7 +49,7 @@
 }
 
 
-static void
+void
 tokenizePath(
   const std::string&    aPathStr,
   std::vector<String>&  aResult)
@@ -66,6 +66,23 @@
   }
 }
 
+
+String
+concatenatePaths( const std::vector<String>& aPathList)
+{
+  String delimiter(filesystem_path::get_path_separator());
+
+  String lResult;
+  for (std::vector<String>::const_iterator lIter = aPathList.begin();
+       lIter != aPathList.end(); ++lIter)
+  {
+    lResult += delimiter + *lIter;
+  }
+
+  return lResult;
+}
+
+
 void
 setPathsOnContext(
   const ZorbaCMDProperties& aProperties,
@@ -101,8 +118,8 @@
     // Compute and set lib path
     aProperties.getLibPath(lPathStr);
     tokenizePath(lPathStr, lPath);
+    lPath.push_back(lCWD.get_path());
     lEnvStr = getPathFromEnvironment("ZORBA_LIB_PATH");
-    lPath.push_back(lCWD.get_path());
     tokenizePath(lEnvStr, lPath);
     aStaticCtx->setLibPath(lPath);
   }

=== modified file 'bin/path_util.h'
--- bin/path_util.h	2012-03-28 05:19:57 +0000
+++ bin/path_util.h	2012-04-11 19:41:20 +0000
@@ -32,6 +32,12 @@
     setPathsOnContext(const ZorbaCMDProperties& aProperties,
                       zorba::StaticContext_t& aStaticCtx);
 
+    void
+    tokenizePath(const std::string& aPathStr, std::vector<String>&  aResult);
+
+
+    String
+    concatenatePaths( const std::vector<String>& aPathList);
 
   }
 } /* namespace zorba */

=== modified file 'bin/zorbacmd.cpp'
--- bin/zorbacmd.cpp	2012-03-28 05:19:57 +0000
+++ bin/zorbacmd.cpp	2012-04-11 19:41:20 +0000
@@ -787,6 +787,14 @@
     return 3;
   }
 
+  // Add command line --classpath option in front of config/env CLASSPATH
+  Properties* globalProperties = Properties::instance();
+  std::string cmdJvmClassPath;
+  lProperties.getJVMClassPath(cmdJvmClassPath);
+  std::string configJvmClassPath;
+  globalProperties->getJVMClassPath(configJvmClassPath);
+  globalProperties->setJVMClassPath(cmdJvmClassPath +
+      filesystem_path::get_path_separator() + configJvmClassPath);
 
   // Start the engine
 

=== modified file 'bin/zorbacmdproperties.cpp'
--- bin/zorbacmdproperties.cpp	2012-03-28 05:19:57 +0000
+++ bin/zorbacmdproperties.cpp	2012-04-11 19:41:20 +0000
@@ -181,6 +181,11 @@
   aPath = theLibPath;
 }
 
+void ZorbaCMDProperties::getJVMClassPath(std::string& aPath) const
+{
+  aPath = theClasspath;
+}
+
 std::vector<std::pair<std::string,std::string> > ZorbaCMDProperties::getSerializerParameters() const
 {
   std::vector<std::pair<std::string,std::string> > lResult;

=== modified file 'bin/zorbacmdproperties.h'
--- bin/zorbacmdproperties.h	2012-03-28 05:19:57 +0000
+++ bin/zorbacmdproperties.h	2012-04-11 19:41:20 +0000
@@ -92,6 +92,9 @@
   void
   getLibPath(std::string&) const;
 
+  void
+  getJVMClassPath(std::string&) const;
+
   bool isDebug(){ return theDebug; }
 
   bool hasNoLogo(){ return theNoLogo; }

=== modified file 'bin/zorbacmdproperties.txt'
--- bin/zorbacmdproperties.txt	2012-03-28 05:19:57 +0000
+++ bin/zorbacmdproperties.txt	2012-04-11 19:41:20 +0000
@@ -31,6 +31,7 @@
 ("uri-path", po::value<std::string>(), "URI path (list of directories) added to the built-in URI resolver, i.e. where to find modules/schemas to import.")
 ("lib-path", po::value<std::string>(), "Library path (list of directories) where Zorba will look for dynamic libraries (e.g., module external function implementations.")
 ("module-path", po::value<std::string>(), "Path (list of directories) to add to both the URI and Library paths.")
+("classpath", po::value<std::string>(), "JVM classpath to be used by modules using Java implementations")
 ("option", po::value<std::vector<std::string> >(), "Set an XQuery option in the static context. The QName of the option is passed as a string in the notation by James Clark (i.e. {namespace}localname). For example, --option {http://www.zorba-xquery.com}option=value";).
 ("trailing-nl", "Output a trailing newline after the result of the query.")
 ("stop-words", po::value<std::vector<std::string> >(), "Mapping specifying a stop-words URI to another.")

=== modified file 'bin/zorbacmdproperties_base.h'
--- bin/zorbacmdproperties_base.h	2012-03-28 05:19:57 +0000
+++ bin/zorbacmdproperties_base.h	2012-04-11 19:41:20 +0000
@@ -15,13 +15,6 @@
  */
 /* vim:set et sw=2 ts=2: */
 
-// ******************************************
-// *                                        *
-// * THIS IS A GENERATED FILE. DO NOT EDIT! *
-// * SEE .txt FILE WITH SAME NAME           *
-// *                                        *
-// ******************************************
-
 #include <string>
 #include <sstream>
 #include <zorba/config.h>
@@ -30,13 +23,29 @@
 
 #ifndef ZORBACMD_ZORBACMDPROPERTIESBASE
 #define ZORBACMD_ZORBACMDPROPERTIESBASE
-namespace zorbacmd { 
-class ZorbaCMDPropertiesBase : public ::zorba::PropertiesBase {
+namespace zorbacmd
+{
+
+class ZorbaCMDPropertiesBase : public ::zorba::PropertiesBase
+{
 protected:
-  const char **get_all_options () const {
-    static const char *result [] = { "--timing", "--output-file", "--serialization-parameter", "--serialize-html", "--serialize-text", "--indent", "--print-query", "--print-errors-as-xml", "--byte-order-mark", "--omit-xml-declaration", "--base-uri", "--boundary-space", "--default-collation", "--construction-mode", "--ordering-mode", "--multiple", "--query", "--as-files", "--external-variable", "--context-item", "--optimization-level", "--lib-module", "--parse-only", "--compile-only", "--no-serializer", "--debug", "--debug-host", "--debug-port", "--no-logo", "--timeout", "--uri-path", "--lib-path", "--module-path", "--option", "--trailing-nl", "--stop-words", "--thesaurus", "--compile-plan", "--execute-plan", NULL };
+  const char **get_all_options () const
+  {
+    static const char *result [] = {
+      "--timing", "--output-file", "--serialization-parameter",
+      "--serialize-html", "--serialize-text", "--indent", "--print-query",
+      "--print-errors-as-xml", "--byte-order-mark", "--omit-xml-declaration",
+      "--base-uri", "--boundary-space", "--default-collation",
+      "--construction-mode", "--ordering-mode", "--multiple", "--query",
+      "--as-files", "--external-variable", "--context-item",
+      "--optimization-level", "--lib-module", "--parse-only", "--compile-only",
+      "--no-serializer", "--debug", "--debug-host", "--debug-port", "--no-logo",
+      "--timeout", "--uri-path", "--lib-path", "--module-path", "--classpath",
+      "--option", "--trailing-nl", "--stop-words", "--thesaurus",
+      "--compile-plan", "--execute-plan", NULL };
     return result;
   }
+
   bool theTiming;
   std::string theOutputFile;
   std::vector<std::string> theSerializationParameter;
@@ -70,6 +79,7 @@
   std::string theUriPath;
   std::string theLibPath;
   std::string theModulePath;
+  std::string theClasspath;
   std::vector<std::string> theOption;
   bool theTrailingNl;
   std::vector<std::string> theStopWords;
@@ -136,6 +146,7 @@
   const std::string &uriPath () const { return theUriPath; }
   const std::string &libPath () const { return theLibPath; }
   const std::string &modulePath () const { return theModulePath; }
+  const std::string &classpath () const { return theClasspath; }
   const std::vector<std::string> &option () const { return theOption; }
   const bool &trailingNl () const { return theTrailingNl; }
   const std::vector<std::string> &stopWords () const { return theStopWords; }
@@ -158,12 +169,16 @@
       else if (strcmp (*argv, "--output-file") == 0 || strncmp (*argv, "-o", 2) == 0) {
         int d = 2;
         if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; }
-        if (*argv == NULL) { result = "No value given for --output-file option"; break; }        init_val (*argv, theOutputFile, d);
+        if (*argv == NULL) { result = "No value given for --output-file option"; break; }
+
+        init_val (*argv, theOutputFile, d);
       }
       else if (strcmp (*argv, "--serialization-parameter") == 0 || strncmp (*argv, "-z", 2) == 0) {
         int d = 2;
         if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; }
-        if (*argv == NULL) { result = "No value given for --serialization-parameter option"; break; }        init_val (*argv, theSerializationParameter, d);
+        if (*argv == NULL) { result = "No value given for --serialization-parameter option"; break; }
+
+        init_val (*argv, theSerializationParameter, d);
       }
       else if (strcmp (*argv, "--serialize-html") == 0) {
         theSerializeHtml = true;
@@ -189,37 +204,51 @@
       else if (strcmp (*argv, "--base-uri") == 0) {
         int d = 2;
         if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; }
-        if (*argv == NULL) { result = "No value given for --base-uri option"; break; }        init_val (*argv, theBaseUri, d);
+        if (*argv == NULL) { result = "No value given for --base-uri option"; break; }
+
+        init_val (*argv, theBaseUri, d);
       }
       else if (strcmp (*argv, "--boundary-space") == 0) {
         int d = 2;
         if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; }
-        if (*argv == NULL) { result = "No value given for --boundary-space option"; break; }        init_val (*argv, theBoundarySpace, d);
+        if (*argv == NULL) { result = "No value given for --boundary-space option"; break; }
+
+        init_val (*argv, theBoundarySpace, d);
       }
       else if (strcmp (*argv, "--default-collation") == 0) {
         int d = 2;
         if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; }
-        if (*argv == NULL) { result = "No value given for --default-collation option"; break; }        init_val (*argv, theDefaultCollation, d);
+        if (*argv == NULL) { result = "No value given for --default-collation option"; break; }
+
+        init_val (*argv, theDefaultCollation, d);
       }
       else if (strcmp (*argv, "--construction-mode") == 0) {
         int d = 2;
         if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; }
-        if (*argv == NULL) { result = "No value given for --construction-mode option"; break; }        init_val (*argv, theConstructionMode, d);
+        if (*argv == NULL) { result = "No value given for --construction-mode option"; break; }
+
+        init_val (*argv, theConstructionMode, d);
       }
       else if (strcmp (*argv, "--ordering-mode") == 0) {
         int d = 2;
         if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; }
-        if (*argv == NULL) { result = "No value given for --ordering-mode option"; break; }        init_val (*argv, theOrderingMode, d);
+        if (*argv == NULL) { result = "No value given for --ordering-mode option"; break; }
+
+        init_val (*argv, theOrderingMode, d);
       }
       else if (strcmp (*argv, "--multiple") == 0 || strncmp (*argv, "-m", 2) == 0) {
         int d = 2;
         if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; }
-        if (*argv == NULL) { result = "No value given for --multiple option"; break; }        init_val (*argv, theMultiple, d);
+        if (*argv == NULL) { result = "No value given for --multiple option"; break; }
+
+        init_val (*argv, theMultiple, d);
       }
       else if (strcmp (*argv, "--query") == 0 || strncmp (*argv, "-q", 2) == 0) {
         int d = 2;
         if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; }
-        if (*argv == NULL) { result = "No value given for --query option"; break; }        init_val (*argv, theQueriesOrFiles, d);
+        if (*argv == NULL) { result = "No value given for --query option"; break; }
+
+        init_val (*argv, theQueriesOrFiles, d);
       }
       else if (strcmp (*argv, "--as-files") == 0 || strncmp (*argv, "-f", 2) == 0) {
         theAsFiles = true;
@@ -227,17 +256,23 @@
       else if (strcmp (*argv, "--external-variable") == 0 || strncmp (*argv, "-e", 2) == 0) {
         int d = 2;
         if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; }
-        if (*argv == NULL) { result = "No value given for --external-variable option"; break; }        init_val (*argv, theExternalVariable, d);
+        if (*argv == NULL) { result = "No value given for --external-variable option"; break; }
+
+        init_val (*argv, theExternalVariable, d);
       }
       else if (strcmp (*argv, "--context-item") == 0) {
         int d = 2;
         if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; }
-        if (*argv == NULL) { result = "No value given for --context-item option"; break; }        init_val (*argv, theContextItem, d);
+        if (*argv == NULL) { result = "No value given for --context-item option"; break; }
+
+        init_val (*argv, theContextItem, d);
       }
       else if (strcmp (*argv, "--optimization-level") == 0) {
         int d = 2;
         if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; }
-        if (*argv == NULL) { result = "No value given for --optimization-level option"; break; }        init_val (*argv, theOptimizationLevel, d);
+        if (*argv == NULL) { result = "No value given for --optimization-level option"; break; }
+
+        init_val (*argv, theOptimizationLevel, d);
       }
       else if (strcmp (*argv, "--lib-module") == 0 || strncmp (*argv, "-l", 2) == 0) {
         theLibModule = true;
@@ -257,12 +292,16 @@
       else if (strcmp (*argv, "--debug-host") == 0 || strncmp (*argv, "-h", 2) == 0) {
         int d = 2;
         if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; }
-        if (*argv == NULL) { result = "No value given for --debug-host option"; break; }        init_val (*argv, theDebugHost, d);
+        if (*argv == NULL) { result = "No value given for --debug-host option"; break; }
+
+        init_val (*argv, theDebugHost, d);
       }
       else if (strcmp (*argv, "--debug-port") == 0 || strncmp (*argv, "-p", 2) == 0) {
         int d = 2;
         if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; }
-        if (*argv == NULL) { result = "No value given for --debug-port option"; break; }        init_val (*argv, theDebugPort, d);
+        if (*argv == NULL) { result = "No value given for --debug-port option"; break; }
+
+        init_val (*argv, theDebugPort, d);
       }
       else if (strcmp (*argv, "--no-logo") == 0) {
         theNoLogo = true;
@@ -270,27 +309,44 @@
       else if (strcmp (*argv, "--timeout") == 0) {
         int d = 2;
         if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; }
-        if (*argv == NULL) { result = "No value given for --timeout option"; break; }        init_val (*argv, theTimeout, d);
+        if (*argv == NULL) { result = "No value given for --timeout option"; break; }
+
+        init_val (*argv, theTimeout, d);
       }
       else if (strcmp (*argv, "--uri-path") == 0) {
         int d = 2;
         if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; }
-        if (*argv == NULL) { result = "No value given for --uri-path option"; break; }        init_val (*argv, theUriPath, d);
+        if (*argv == NULL) { result = "No value given for --uri-path option"; break; }
+
+        init_val (*argv, theUriPath, d);
       }
       else if (strcmp (*argv, "--lib-path") == 0) {
         int d = 2;
         if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; }
-        if (*argv == NULL) { result = "No value given for --lib-path option"; break; }        init_val (*argv, theLibPath, d);
+        if (*argv == NULL) { result = "No value given for --lib-path option"; break; }
+
+        init_val (*argv, theLibPath, d);
       }
       else if (strcmp (*argv, "--module-path") == 0) {
         int d = 2;
         if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; }
-        if (*argv == NULL) { result = "No value given for --module-path option"; break; }        init_val (*argv, theModulePath, d);
+        if (*argv == NULL) { result = "No value given for --module-path option"; break; }
+
+        init_val (*argv, theModulePath, d);
+      }
+      else if (strcmp (*argv, "--classpath") == 0) {
+        int d = 2;
+        if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; }
+        if (*argv == NULL) { result = "No value given for --classpath option"; break; }
+
+        init_val (*argv, theClasspath, d);
       }
       else if (strcmp (*argv, "--option") == 0) {
         int d = 2;
         if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; }
-        if (*argv == NULL) { result = "No value given for --option option"; break; }        init_val (*argv, theOption, d);
+        if (*argv == NULL) { result = "No value given for --option option"; break; }
+
+        init_val (*argv, theOption, d);
       }
       else if (strcmp (*argv, "--trailing-nl") == 0) {
         theTrailingNl = true;
@@ -298,12 +354,16 @@
       else if (strcmp (*argv, "--stop-words") == 0) {
         int d = 2;
         if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; }
-        if (*argv == NULL) { result = "No value given for --stop-words option"; break; }        init_val (*argv, theStopWords, d);
+        if (*argv == NULL) { result = "No value given for --stop-words option"; break; }
+
+        init_val (*argv, theStopWords, d);
       }
       else if (strcmp (*argv, "--thesaurus") == 0) {
         int d = 2;
         if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; }
-        if (*argv == NULL) { result = "No value given for --thesaurus option"; break; }        init_val (*argv, theThesaurus, d);
+        if (*argv == NULL) { result = "No value given for --thesaurus option"; break; }
+
+        init_val (*argv, theThesaurus, d);
       }
       else if (strcmp (*argv, "--compile-plan") == 0 || strncmp (*argv, "-c", 2) == 0) {
         theCompilePlan = true;
@@ -327,46 +387,47 @@
 
   const char *get_help_msg () const {
     return
-"--timing, -t\nPrint timing information. In case of multiple queries the timing information is provided per each query. Both wallclock time and user time (which excludes I/O, network delays and other kernel waits) are shown.\n\n"
-"--output-file, -o\nWrite the result to the given file.\n\n"
-"--serialization-parameter, -z\nSet serialization parameter in the form of a parameter=value pair (see http://www.w3.org/TR/xslt-xquery-serialization/#serparam, e.g.: -z method=xhtml -z doctype-system=DTD/xhtml1-strict.dtd -z indent=yes).\n\n"
-"--serialize-html\nSerialize the result as HTML.\n\n"
-"--serialize-text\nSerialize the result as Text.\n\n"
-"--indent, -i\nIndent output.\n\n"
-"--print-query\nPrint the queries.\n\n"
-"--print-errors-as-xml, -x\nPrint the errors as XML.\n\n"
-"--byte-order-mark\nSet the byte-order-mark for the serializer.\n\n"
-"--omit-xml-declaration, -r\nOmit the XML declaration from the result.\n\n"
-"--base-uri\nSet the base URI property of the static context.\n\n"
-"--boundary-space\nSet the boundary-space policy ('strip' or 'preserve') in the static context.\n\n"
-"--default-collation\nAdd the given collation and set the value of the default collation in the static context to the given collation.\n\n"
-"--construction-mode\nSet the construction mode ('strip' or 'preserve') in the static context.\n\n"
-"--ordering-mode\nSet the ordering mode ('ordered' or 'unordered') in the static context.\n\n"
-"--multiple, -m\nExecute the given queries multiple times.\n\n"
-"--query, -q\nQuery test or file URI (file://...)\n\n"
-"--as-files, -f\nTreat all -q arguments as file paths instead of URIs or inline queries.\n\n"
-"--external-variable, -e\nProvide the value for a variable given a file (name=file) or a value (name:=value)\n\n"
-"--context-item\nSet the context item to the XML document in a given file.\n\n"
-"--optimization-level\nOptimization level for the query compiler (O0, O1 or O2 - default: O1)\n\n"
-"--lib-module, -l\nQuery compiler option to treat the query as a library module. If this is set --compile-only option is also set to true.\n\n"
-"--parse-only\nStop after parsing the query.\n\n"
-"--compile-only\nOnly compile (don't execute)\n\n"
-"--no-serializer\nDo not serialize (discard) result.\n\n"
-"--debug, -d\nLaunch the Zorba debugger server and connect to a DBGP-enabled debugger client.\n\n"
-"--debug-host, -h\nThe host where the DBGP-enabled debugger client listens for connections. Defaults to: 127.0.0.1\n\n"
-"--debug-port, -p\nThe port on which the DBGP-enabled debugger client listens for connections. Defaults to: 28028\n\n"
-"--no-logo\nPrint no logo when starting.\n\n"
-"--timeout\nSpecify a timeout in seconds. After the specified time, the execution of the query will be aborted.\n\n"
-"--uri-path\nURI path (list of directories) added to the built-in URI resolver, i.e. where to find modules/schemas to import.\n\n"
-"--lib-path\nLibrary path (list of directories) where Zorba will look for dynamic libraries (e.g., module external function implementations.\n\n"
-"--module-path\nPath (list of directories) to add to both the URI and Library paths.\n\n"
-"--option\nSet an XQuery option in the static context. The QName of the option is passed as a string in the notation by James Clark (i.e. {namespace}localname). For example, --option {http://www.zorba-xquery.com}option=value\n\n";
-"--trailing-nl\nOutput a trailing newline after the result of the query.\n\n"
-"--stop-words\nMapping specifying a stop-words URI to another.\n\n"
-"--thesaurus\nMapping specifying a thesaurus URI to another.\n\n"
-"--compile-plan, -c\nOutput the query plan as binary.\n\n"
-"--execute-plan\nTake a query plan as binary and execute it. Binary query plans can be generated using the --compile-plan option.\n\n"
-;
+        "--timing, -t\nPrint timing information. In case of multiple queries the timing information is provided per each query. Both wallclock time and user time (which excludes I/O, network delays and other kernel waits) are shown.\n\n"
+        "--output-file, -o\nWrite the result to the given file.\n\n"
+        "--serialization-parameter, -z\nSet serialization parameter in the form of a parameter=value pair (see http://www.w3.org/TR/xslt-xquery-serialization/#serparam, e.g.: -z method=xhtml -z doctype-system=DTD/xhtml1-strict.dtd -z indent=yes).\n\n"
+        "--serialize-html\nSerialize the result as HTML.\n\n"
+        "--serialize-text\nSerialize the result as Text.\n\n"
+        "--indent, -i\nIndent output.\n\n"
+        "--print-query\nPrint the queries.\n\n"
+        "--print-errors-as-xml, -x\nPrint the errors as XML.\n\n"
+        "--byte-order-mark\nSet the byte-order-mark for the serializer.\n\n"
+        "--omit-xml-declaration, -r\nOmit the XML declaration from the result.\n\n"
+        "--base-uri\nSet the base URI property of the static context.\n\n"
+        "--boundary-space\nSet the boundary-space policy ('strip' or 'preserve') in the static context.\n\n"
+        "--default-collation\nAdd the given collation and set the value of the default collation in the static context to the given collation.\n\n"
+        "--construction-mode\nSet the construction mode ('strip' or 'preserve') in the static context.\n\n"
+        "--ordering-mode\nSet the ordering mode ('ordered' or 'unordered') in the static context.\n\n"
+        "--multiple, -m\nExecute the given queries multiple times.\n\n"
+        "--query, -q\nQuery test or file URI (file://...)\n\n"
+        "--as-files, -f\nTreat all -q arguments as file paths instead of URIs or inline queries.\n\n"
+        "--external-variable, -e\nProvide the value for a variable given a file (name=file) or a value (name:=value)\n\n"
+        "--context-item\nSet the context item to the XML document in a given file.\n\n"
+        "--optimization-level\nOptimization level for the query compiler (O0, O1 or O2 - default: O1)\n\n"
+        "--lib-module, -l\nQuery compiler option to treat the query as a library module. If this is set --compile-only option is also set to true.\n\n"
+        "--parse-only\nStop after parsing the query.\n\n"
+        "--compile-only\nOnly compile (don't execute)\n\n"
+        "--no-serializer\nDo not serialize (discard) result.\n\n"
+        "--debug, -d\nLaunch the Zorba debugger server and connect to a DBGP-enabled debugger client.\n\n"
+        "--debug-host, -h\nThe host where the DBGP-enabled debugger client listens for connections. Defaults to: 127.0.0.1\n\n"
+        "--debug-port, -p\nThe port on which the DBGP-enabled debugger client listens for connections. Defaults to: 28028\n\n"
+        "--no-logo\nPrint no logo when starting.\n\n"
+        "--timeout\nSpecify a timeout in seconds. After the specified time, the execution of the query will be aborted.\n\n"
+        "--uri-path\nURI path (list of directories) added to the built-in URI resolver, i.e. where to find modules/schemas to import.\n\n"
+        "--lib-path\nLibrary path (list of directories) where Zorba will look for dynamic libraries (e.g., module external function implementations.\n\n"
+        "--module-path\nPath (list of directories) to add to both the URI and Library paths.\n\n"
+        "--classpath\nJVM classpath to be used by modules using Java implementations\n\n"
+        "--option\nSet an XQuery option in the static context. The QName of the option is passed as a string in the notation by James Clark (i.e. {namespace}localname). For example, --option {http://www.zorba-xquery.com}option=value\n\n";
+        "--trailing-nl\nOutput a trailing newline after the result of the query.\n\n"
+        "--stop-words\nMapping specifying a stop-words URI to another.\n\n"
+        "--thesaurus\nMapping specifying a thesaurus URI to another.\n\n"
+        "--compile-plan, -c\nOutput the query plan as binary.\n\n"
+        "--execute-plan\nTake a query plan as binary and execute it. Binary query plans can be generated using the --compile-plan option.\n\n"
+        ;
   }
 
   static const ZorbaCMDPropertiesBase *instance () {

=== modified file 'cmake_modules/ZorbaModule.cmake'
--- cmake_modules/ZorbaModule.cmake	2012-03-28 05:19:57 +0000
+++ cmake_modules/ZorbaModule.cmake	2012-04-11 19:41:20 +0000
@@ -140,7 +140,6 @@
   ENDIF (NOT IS_ABSOLUTE "${MODULE_FILE}")
   GET_FILENAME_COMPONENT (module_name "${MODULE_FILE}" NAME)
 
-
   MANGLE_URI (${MODULE_URI} ".xq" module_path module_filename)
 
   # Compute a CMake-symbol-safe version of the target URI, for storing
@@ -267,6 +266,13 @@
       SET (module_filewe "${module_filewe}_${MODULE_VERSION}")
     ENDIF (MODULE_VERSION)
 
+    # Choose output base directory
+    IF (${MODULE_TEST_ONLY} EQUAL 1)
+      SET (_output_basedir "${CMAKE_BINARY_DIR}/TEST_LIB_PATH")
+    ELSE (${MODULE_TEST_ONLY} EQUAL 1)
+      SET (_output_basedir "${CMAKE_BINARY_DIR}/LIB_PATH")
+    ENDIF (${MODULE_TEST_ONLY} EQUAL 1)
+
     # It seems like it would be nice to set the VERSION and/or
     # SOVERSION target properties here. However: On Windows, it
     # doesn't seem to do anything (the .rc file configured above
@@ -278,12 +284,20 @@
     # FOLDER is to group IDE projects into folders.
     SET_TARGET_PROPERTIES (${module_lib_target} PROPERTIES
       OUTPUT_NAME "${module_filewe}${SUFFIX}"
-      ${target_type}_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/${module_name}.src"
+      ${target_type}_OUTPUT_DIRECTORY "${_output_basedir}/${module_path}"
       FOLDER "Modules"
     )
     TARGET_LINK_LIBRARIES(${module_lib_target}
       zorba_${ZORBA_STORE_NAME} ${MODULE_LINK_LIBRARIES})
 
+    # While we're at it, remember this library for the auto-generated
+    # module Config.cmake file. Need to use the LIB_PATH location
+    # since that's what will be dlopen()'d by Zorba at runtime. QQQ
+    # and what about the installed version?
+    GET_TARGET_PROPERTY (_lib_location "${module_lib_target}" LOCATION)
+    SET_PROPERTY (GLOBAL APPEND PROPERTY "${PROJECT_NAME}_LIBRARIES"
+      "${_lib_location}")
+
     # Install the library, if it's not a TEST_ONLY module
     IF (NOT MODULE_TEST_ONLY)
       IF(NOT ${PROJECT_NAME} STREQUAL "zorba")
@@ -314,17 +328,9 @@
   ENDIF (MODULE_VERSION)
   FOREACH (version_infix "" ${version_infixes})
     ADD_COPY_RULE ("URI" "${SOURCE_FILE}" "${module_path}/${module_filename}"
-      "${version_infix}" "" "${MODULE_TEST_ONLY}")
+      "${version_infix}" "" 1 "${MODULE_TEST_ONLY}")
   ENDFOREACH (version_infix)
 
-  # Also copy the dynamic library from the location it was built.
-  IF (module_lib_target)
-    GET_TARGET_PROPERTY (lib_location "${module_lib_target}" LOCATION)
-    GET_FILENAME_COMPONENT (lib_filename "${lib_location}" NAME)
-    ADD_COPY_RULE ("LIB" "${lib_location}" "${module_path}/${lib_filename}"
-      "" "${module_lib_target}" "${MODULE_TEST_ONLY}")
-  ENDIF (module_lib_target)
-
   # Last but not least, whip up a test case that ensures the module
   # can at least be compiled. Don't bother for test-only modules
   # (presumably they're there to be tested!).
@@ -375,7 +381,7 @@
   ENDIF (NOT SCHEMA_TEST_ONLY)
 
   ADD_COPY_RULE ("URI" "${SOURCE_FILE}" "${schema_path}/${schema_filename}"
-    "" "" "${SCHEMA_TEST_ONLY}")
+    "" "" 1 "${SCHEMA_TEST_ONLY}")
 
 ENDMACRO (DECLARE_ZORBA_SCHEMA)
 
@@ -407,25 +413,74 @@
   MANGLE_URI (${URI_FILE_URI} "" uri_file_path uri_file_filename)
 
   ADD_COPY_RULE ("URI" "${SOURCE_FILE}" "${uri_file_path}/${uri_file_filename}"
-    "" "" "${URI_FILE_TEST_ONLY}")
+    "" "" 1 "${URI_FILE_TEST_ONLY}")
 
 ENDMACRO (DECLARE_ZORBA_URI_FILE)
 
+
+# Inform Zorba of a .jar file that should be made available on the CLASSPATH
+# of the JVM, should the JVM be started. QQQ more doc needed
+#
+# Args: FILE - path to file(s) (must be absolute)
+#       TARGET - (optional) a CMake target that must be executed in order
+#              for FILEs to be generated
+#       EXTERNAL - (optional) FILE specifies a path that should be added
+#              to CLASSPATH as-is
+#       TEST_ONLY - (optional) Jar file is for testcases only and should not
+#              be installed
+#
+# Must supply at least one value to FILE or TARGET.
+MACRO (DECLARE_ZORBA_JAR)
+  PARSE_ARGUMENTS (JAR "FILE;TARGET" "TARGET" "TEST_ONLY;EXTERNAL" ${ARGN})
+  IF (NOT JAR_FILE)
+    MESSAGE (FATAL_ERROR "'FILE' argument is required for DECLARE_ZORBA_JAR")
+  ENDIF (NOT JAR_FILE)
+
+  # Initialize classpath file and set up copy rule (once per project)
+  SET (_CP_FILE "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-classpath.txt")
+  GET_PROPERTY (_known_project GLOBAL PROPERTY "${PROJECT_NAME}-jars")
+  IF (NOT _known_project)
+    FILE (REMOVE "${_CP_FILE}")
+    SET_PROPERTY (GLOBAL PROPERTY "${PROJECT_NAME}-jars" 1)
+    ADD_COPY_RULE ("LIB" "${_CP_FILE}" "jars/${PROJECT_NAME}-classpath.txt"
+      "" "" 1 "${JAR_TEST_ONLY}")
+  ENDIF (NOT _known_project)
+
+  # Iterate over all supplied jar files
+  FOREACH (_jar_file ${JAR_FILE})
+
+    IF (JAR_EXTERNAL)
+      # Put absolute path into classpath file
+      FILE (APPEND "${_CP_FILE}" "${_jar_file}\n")
+    ELSE (JAR_EXTERNAL)
+      # Copy jar to jars/ directory and add relative path to classpath file
+      GET_FILENAME_COMPONENT (_output_filename "${_jar_file}" NAME)
+      ADD_COPY_RULE ("LIB" "${_jar_file}" "jars/${_output_filename}" "" 
+	"${JAR_TARGET}" 1 "${JAR_TEST_ONLY}")
+      FILE (APPEND "${_CP_FILE}" "${_output_filename}\n")
+    ENDIF (JAR_EXTERNAL)
+
+  ENDFOREACH (_jar_file)
+ENDMACRO (DECLARE_ZORBA_JAR)
+
+
 # Utility macro for setting up a build rule to copy a file to a
-# particular (possibly versioned) file in a shared directory if such a file has
-# not already been output.
+# particular (possibly versioned) file in a shared directory if such a
+# file has not already been output.
+#
 # FILE_TYPE: Either "URI" or "LIB"; will be used to determine which shared
-#    directory to place output in (URI_PATH or LIB_PATH). Also, "URI" files
-#    will have an INSTALL() directive to put them in the install image.
+#    directory to place output in (URI_PATH or LIB_PATH).
 # INPUT_FILE: Absolute path to file to copy.
 # OUTPUT_FILE: Relative path to output file (relative to URI_PATH).
 # VERSION_ARG: Version; may be "" for non-versioned files.
 # DEPEND_TARGET: A CMake target name upon which the copy rule should depend;
 #    may be "".
+# INSTALL: If 1, an INSTALL() directive will be executed to put the
+#    file into the install image.
 # TEST_ONLY: If 1, file is for testcases only; will be copied into
-#    TEST_URI_PATH/TEST_LIB_PATH and will not be installed
+#    TEST_URI_PATH/TEST_LIB_PATH and will not be installed.
 MACRO (ADD_COPY_RULE FILE_TYPE INPUT_FILE OUTPUT_FILE VERSION_ARG
-       DEPEND_TARGET TEST_ONLY)
+       DEPEND_TARGET INSTALL TEST_ONLY)
   # Choose output base directory
   IF (${TEST_ONLY} EQUAL 1)
     SET (_output_basedir "${CMAKE_BINARY_DIR}/TEST_${FILE_TYPE}_PATH")
@@ -470,13 +525,13 @@
     SET_PROPERTY (GLOBAL APPEND PROPERTY ZORBA_URI_FILES
       "${INPUT_FILE}" "${_output_file}" "${DEPEND_TARGET}" "${_is_core}")
 
-    # Also set up an INSTALL rule (unless TEST_ONLY or LIB).
-    IF ( (NOT "${FILE_TYPE}" STREQUAL "LIB") AND (NOT ${TEST_ONLY} EQUAL 1) )
+    # Also set up an INSTALL rule (unless TEST_ONLY).
+    IF ( (${INSTALL} EQUAL 1) AND (NOT ${TEST_ONLY} EQUAL 1) )
         
       IF(NOT _is_core)
         STRING(REPLACE "-" "_"  component_name ${PROJECT_NAME})   
         INSTALL (FILES "${INPUT_FILE}"
-          DESTINATION "${ZORBA_NONCORE_URI_DIR}/${_output_path}"
+          DESTINATION "${ZORBA_NONCORE_${FILE_TYPE}_DIR}/${_output_path}"
           RENAME "${_output_filename}"
           COMPONENT "${component_name}")
           
@@ -496,11 +551,11 @@
             
       ELSE(NOT _is_core)
         INSTALL (FILES "${INPUT_FILE}"
-          DESTINATION "${ZORBA_CORE_URI_DIR}/${_output_path}"
+          DESTINATION "${ZORBA_CORE_${FILE_TYPE}_DIR}/${_output_path}"
           RENAME "${_output_filename}")
       ENDIF(NOT _is_core)
           
-    ENDIF ( (NOT "${FILE_TYPE}" STREQUAL "LIB") AND (NOT ${TEST_ONLY} EQUAL 1) )
+    ENDIF ( (${INSTALL} EQUAL 1) AND (NOT ${TEST_ONLY} EQUAL 1) )
   ENDIF (file_found EQUAL -1)
 ENDMACRO (ADD_COPY_RULE)
 
@@ -535,6 +590,8 @@
 # files to their corresponding output directories, with appropriate
 # dependencies. This macro will only have any effect when called by
 # the top-level project in a build.
+# Also, this function automatically generates a CMake projectConfig.cmake
+# file for the project, based on config/ExternalModuleConfig.cmake.in.
 MACRO (DONE_DECLARING_ZORBA_URIS)
   IF (PROJECT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
     # Close out the zorba modules and schemas manifests
@@ -553,9 +610,10 @@
       LIST (GET copy_rules 2 _depend_target)
       LIST (GET copy_rules 3 _is_core)
       LIST (REMOVE_AT copy_rules 0 1 2 3)
-      SET (_depends "${_input_file}")
       IF (_depend_target)
-        LIST (APPEND _depends "${_depend_target}")
+        SET (_depends "${_depend_target}")
+      ELSE (_depend_target) 
+	SET (_depends "${_input_file}")
       ENDIF (_depend_target)
       ADD_CUSTOM_COMMAND (OUTPUT "${_output_file}"
         COMMAND "${CMAKE_COMMAND}" -E copy
@@ -591,6 +649,18 @@
     #add 'xqdoc' and 'xqdoc-xml' targets
     ADD_XQDOC_TARGETS()
   ENDIF (PROJECT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
+
+  # Now, do things that should be done at the end of *any* project, not
+  # just the top-level project.
+
+  # Generate project's projectConfig.cmake file.
+  # QQQ need to create an installable version of this too, once we know
+  # how installing a module package should work.
+  GET_PROPERTY (ZORBA_PROJECT_LIBRARIES
+    GLOBAL PROPERTY "${PROJECT_NAME}_LIBRARIES")
+  CONFIGURE_FILE("${Zorba_EXTERNALMODULECONFIG_FILE}"
+    "${PROJECT_BINARY_DIR}/${PROJECT_NAME}Config.cmake" @ONLY)
+
 ENDMACRO (DONE_DECLARING_ZORBA_URIS)
 
 # Initialize expected failures and zorba modules output files when
@@ -648,14 +718,11 @@
   FOREACH(TESTFILE ${TESTFILES})
     SET(TESTNAME "${PROJECT_NAME}/${TESTFILE}")
 
-    IF(WIN32)
-      SET(PATH_SEP ",")
-    ELSE(WIN32)
-      SET(PATH_SEP ":")
-    ENDIF(WIN32)
+    # DEPENDENCY_MODULE_PATH will always start with an appropriate
+    # path separator
     ADD_TEST(${TESTNAME} "${Zorba_TESTDRIVER}"
       "--rbkt-src" "${TEST_DIR}"
-      "--module-path" "${CMAKE_BINARY_DIR}/URI_PATH/${PATH_SEP}${SECONDARY_MODULE_PATHS}"
+      "--module-path" "${CMAKE_BINARY_DIR}/URI_PATH/${DEPENDENCY_MODULE_PATH}"
       "${TESTFILE}")
 
     MATH(EXPR TESTCOUNTER ${TESTCOUNTER}+1)
@@ -667,18 +734,6 @@
   MESSAGE(STATUS "Added ${TESTCOUNTER} tests in ${TEST_DIR}")
 ENDMACRO (ADD_TEST_DIRECTORY)
 
-# Macro to install a basic CMake config file for a module. Provide a
-# source and binary directory. Result will be installed in binary
-# directory. This is a macro because it is called from two different
-# places: ZorbaUse.cmake, and Zorba's modules/CMakeLists.txt.
-MACRO(CREATE_MODULE_CONFIG name src_dir bin_dir)
-  # Set variables referenced in ExternalModuleConfig.cmake.in
-  SET(MODULE_SOURCE_DIR ${src_dir})
-  SET(MODULE_BINARY_DIR ${bin_dir})
-  CONFIGURE_FILE("${Zorba_EXTERNALMODULECONFIG_FILE}"
-    "${MODULE_BINARY_DIR}/${name}Config.cmake" @ONLY)
-ENDMACRO(CREATE_MODULE_CONFIG)
-
 # This macro easies the process of adding test for store dependent
 # executables. It has the same naming convection for the target as the
 # macro that is used to generated store dependent executables (thus,

=== modified file 'config/ExternalModuleConfig.cmake.in'
--- config/ExternalModuleConfig.cmake.in	2012-03-28 05:19:57 +0000
+++ config/ExternalModuleConfig.cmake.in	2012-04-11 19:41:20 +0000
@@ -12,12 +12,29 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-IF(WIN32)
-  SET(PATH_SEP ",")
-ELSE(WIN32)
-  SET(PATH_SEP ":")
-ENDIF(WIN32)
-
-# QQQ When all the module versioning and external-module work is
-# complete, this should contain ONLY MODULE_BINARY_DIR/modules.
-SET(SECONDARY_MODULE_PATHS "${SECONDARY_MODULE_PATHS}${PATH_SEP}@MODULE_SOURCE_DIR@/src/${PATH_SEP}@MODULE_BINARY_DIR@/src/${PATH_SEP}@MODULE_BINARY_DIR@/modules/")
+IF (WIN32)
+  SET (PATH_SEP ",")
+ELSE (WIN32)
+  SET (PATH_SEP ":")
+ENDIF (WIN32)
+
+# Probably should have separate URI and LIB paths here someday; will
+# require testdriver to accept --uri-path and --lib-path args
+# Note that this path is meaningless if the module is installed; see
+# bug 966999.
+SET (DEPENDENCY_MODULE_PATH 
+  "${DEPENDENCY_MODULE_PATH}${PATH_SEP}@PROJECT_BINARY_DIR@/URI_PATH/${PATH_SEP}${DEPENDENCY_LIB_PATH}${PATH_SEP}@PROJECT_BINARY_DIR@/LIB_PATH/")
+
+# Dynamic libraries created by this project to link against
+SET (@PROJECT_NAME@_LIBRARIES @ZORBA_PROJECT_LIBRARIES@)
+
+# Include directories exported by this project
+SET (@PROJECT_NAME@_INCLUDE_DIRS @ZORBA_PROJECT_INCLUDE_DIRS@)
+
+# Offer a "use file" to the user of this module. For most module
+# packages, this is unnecessary. However it can be utilized by
+# advanced packages which wish to, for example, export a C++ header
+# file to dependent packages. As above, note that this currently is
+# non-functional if this module package is installed; this will only
+# work from a project build directory.
+SET (@PROJECT_NAME@_USE_FILE "@ZORBA_PROJECT_USE_FILE@")

=== modified file 'config/ZorbaUse.cmake'
--- config/ZorbaUse.cmake	2012-03-28 05:19:57 +0000
+++ config/ZorbaUse.cmake	2012-04-11 19:41:20 +0000
@@ -31,7 +31,3 @@
   # Load Zorba module support macros.
   INCLUDE("${Zorba_CMAKE_MODULES_DIR}/Windows/ProxyFindModule.cmake")
 ENDIF(WIN32)
-
-# Generate project's projectConfig.cmake file.
-CREATE_MODULE_CONFIG(${PROJECT_NAME} "${PROJECT_SOURCE_DIR}"
-  "${PROJECT_BINARY_DIR}")

=== modified file 'include/zorba/properties_base.h'
--- include/zorba/properties_base.h	2012-03-28 05:19:57 +0000
+++ include/zorba/properties_base.h	2012-04-11 19:41:20 +0000
@@ -101,8 +101,44 @@
     std::vector<std::string>& val,
     unsigned delta);
 
+/**
+ * \brief This class provides access to global properties.
+ *
+ * This class provides access to global properties set for Zorba in environment
+ * and configuration file.
+ * It is available using Zorba.getProperties() method.
+ * \see { Zorba::getProperties() }
+ */
+class ZORBA_DLL_PUBLIC PropertiesGlobal : public PropertiesBase
+{
+public:
+  virtual ~PropertiesGlobal() {}
+
+  /**
+   * \brief Get global JVM classpath property.
+   *
+   * Before the JVM is started this will return the classpath set by
+   * command line option, the CLASSPATH environment variable and in Zorba
+   * config file.
+   *
+   * After the JVM is started this will contain in addition the paths to jars
+   * used by modules that make use of the JVM.
+   */
+  virtual void getJVMClassPath(std::string & jvmClasspath) {}
+
+  /**
+   * \brief Set global JVM classpath property.
+   *
+   * This method should be used to set additional JVM classpath for modules
+   * that make use of JVM. This will overide the classpath set by CLASSPATH
+   * environment variable or Zorba config file.
+   *
+   * Once the JVM is started this method doesn't have any effect.
+   */
+  virtual void setJVMClassPath(const std::string & jvmClasspath) {}
+};
+
 }
-
 #endif  // ZORBA_PROPERTIES_BASE_H
 /*
  * Local variables:

=== modified file 'include/zorba/util/file.h'
--- include/zorba/util/file.h	2012-03-28 05:19:57 +0000
+++ include/zorba/util/file.h	2012-04-11 19:41:20 +0000
@@ -24,6 +24,7 @@
 #include <cstdio>
 #include <string>
 #include <time.h>
+#include <vector>
 
 #include <zorba/config.h>
 #include <zorba/file.h>
@@ -84,6 +85,7 @@
   void mkdir();
   void deep_mkdir();
   void rmdir(bool ignore = true);
+  void lsdir(std::vector<std::string> &list);
 #ifndef _WIN32_WCE
   void chdir();
 #endif

=== modified file 'include/zorba/zorba.h'
--- include/zorba/zorba.h	2012-03-28 05:19:57 +0000
+++ include/zorba/zorba.h	2012-04-11 19:41:20 +0000
@@ -34,14 +34,18 @@
 #include <zorba/xquery.h>
 #include <zorba/zorba_string.h>
 #include <zorba/iterator.h>
+#include <zorba/properties_base.h>
 
 namespace zorba {
 
 /**
  * The Zorba class is the single point of access to the %Zorba engine.
  * There exists one instance of the Zorba class per process.
- * It can be used to (1) create and compile queries, (2) create static contexts,
- * (3) provides access to the XmlDataManager, and (4) provides access to the ItemFactory.
+ * It can be used to (1) create and compile queries,
+ * (2) create static contexts,
+ * (3) provides access to the XmlDataManager,
+ * (4) provides access to the ItemFactory, and
+ * (5) provides access to the PropertiesGlobal.
  */
 class ZORBA_DLL_PUBLIC Zorba
 {
@@ -301,7 +305,7 @@
   virtual StaticContext_t
   createStaticContext(DiagnosticHandler* aDiagnosticHandler = 0) = 0;
 
-  /** \brief Gets the singelton instance of the ItemFactory.
+  /** \brief Gets the singleton instance of the ItemFactory.
    *
    * @return ItemFactory the singleton instance of the ItemFactory.
    */
@@ -310,18 +314,24 @@
 
   /** \brief Gets the singleton instance of the XmlDataManager object.
    *
-   * @return XmlDataManager the singelton instance of the XmlDataManager.
+   * @return XmlDataManager the singleton instance of the XmlDataManager.
    */
   virtual XmlDataManager*
   getXmlDataManager() = 0;
 
   /** \brief Gets the singleton instance of Zorba's audit provider object.
    *
-   * @return audit::Provider the singelton instance of Zorba's audit provider.
+   * @return audit::Provider the singeleton instance of Zorba's audit provider.
    */
   virtual audit::Provider*
   getAuditProvider() = 0;
 
+  /** \brief Gets the singleton instance of Zorba's properties object.
+   *
+   * @return zorba::Properties the singleton instance of Zorba's properties object.
+   */
+  virtual PropertiesGlobal* getPropertiesGlobal() = 0;
+
 }; /* class Zorba */
 
 

=== modified file 'modules/CMakeLists.txt'
--- modules/CMakeLists.txt	2012-03-28 05:19:57 +0000
+++ modules/CMakeLists.txt	2012-04-11 19:41:20 +0000
@@ -21,13 +21,19 @@
 # named "zorba_modules" as a sibling to the main Zorba source
 # directory.
 
-# First, configure the moduleConfig.cmake file for each module
-# project. We must do this "manually" before doing any
-# ADD_SUBDIRECTORY()s, so that all the config files are built and
-# ready for other modules' FIND_PACKAGE() calls. We also add all
-# module build dirs to CMAKE_PREFIX_PATH for the same reason.
-SET (project_regex "[Pp][Rr][Oo][Jj][Ee][Cc][Tt]")
-FILE (GLOB modules_dir_items RELATIVE "${ZORBA_MODULES_DIR}" "${ZORBA_MODULES_DIR}/[a-zA-Z0-9]*")
+# This is complicated and more than a little hacky. We need to add all
+# the module subdirectories, but some may depend on others so we can't
+# simply add them alphabetically. Here we determine their project
+# names and dependencies by manually reading their CMakeLists.txt
+# files (as text files). We form a directed graph (which isn't easy in
+# CMake) then produce a topological sort to load the modules in
+# order. Note that this will not work if there are cyclical
+# dependencies between modules; if we ever need that ability, this
+# will get more complicated.
+
+FILE (GLOB modules_dir_items
+  RELATIVE "${ZORBA_MODULES_DIR}"
+  "${ZORBA_MODULES_DIR}/[a-zA-Z0-9]*")
 
 # Filter out non-directories
 SET (module_dirs)
@@ -37,19 +43,27 @@
   ENDIF (IS_DIRECTORY "${ZORBA_MODULES_DIR}/${module_dir}")
 ENDFOREACH (module_dir)
 
+# First, form a simple list of all known module projects in the
+# variable "module_projects". Also, for each project, set a variable
+# named eg. "zorba-email-module_DIR" with the path to that project's
+# directory, relative to ZORBA_MODULES_DIR.
+SET (project_regex "[Pp][Rr][Oo][Jj][Ee][Cc][Tt] *\\( *([^ )]*)")
+SET (module_projects)
 FOREACH (module_dir ${module_dirs})
-  # This is really kind of hacky, but I don't know a better solution without
-  # introducing some sort of inter-module dependency tracking and requiring
-  # consistent directory naming for external modules. What we do here is
-  # read the module's CMakeLists.txt (as a text file), searching for the
-  # PROJECT() declaration, so we can extract the name of the CMake project.
   SET (module_project)
-  SET (cmakelists)
-  FILE (STRINGS "${ZORBA_MODULES_DIR}/${module_dir}/CMakeLists.txt" cmakelists
-    REGEX ${project_regex})
+  SET (cmakelists_file "${ZORBA_MODULES_DIR}/${module_dir}/CMakeLists.txt")
+  FILE (STRINGS "${cmakelists_file}" cmakelists REGEX "${project_regex}")
   FOREACH (line ${cmakelists})
-    IF (line MATCHES "${project_regex} *\\(([^)]*)\\)")
-      SET (module_project ${CMAKE_MATCH_1})
+
+    IF (line MATCHES "${project_regex}")
+      IF (NOT "${module_project}" STREQUAL "")
+	MESSAGE (FATAL_ERROR
+	  "${cmakelists_file} contains duplicate PROJECT() statements - "
+	  "cannot parse!")
+      ENDIF (NOT "${module_project}" STREQUAL "")
+      SET (module_project "${CMAKE_MATCH_1}")
+      LIST (APPEND module_projects "${module_project}")
+      SET ("${module_project}_DIR" "${module_dir}")
 
       # Print the found module name
       SET (status "Found module project ${module_project}")
@@ -63,8 +77,7 @@
       MESSAGE (STATUS "${status}")
       MESSAGE (STATUS "${border}")
 
-      BREAK ()
-    ENDIF (line MATCHES "${project_regex} *\\(([^)]*)\\)")
+    ENDIF (line MATCHES "${project_regex}")
   ENDFOREACH (line)
 
   IF (NOT module_project)
@@ -72,14 +85,77 @@
       "does not contain a recognizable CMake project.")
   ENDIF (NOT module_project)
 
-  SET (module_builddir "${CMAKE_BINARY_DIR}/zorba_modules/${module_project}")
-  FILE (MAKE_DIRECTORY "${module_builddir}")
-  CREATE_MODULE_CONFIG (${module_project} "${ZORBA_MODULES_DIR}/${module_dir}"
-    "${module_builddir}")
-  LIST (APPEND CMAKE_PREFIX_PATH "${module_builddir}")
-  #SET (ZORBA_EXTERNAL_MODULES_SRCS ${ZORBA_EXTERNAL_MODULES_SRCS} ${ZORBA_MODULES_DIR}/${module_dir}/src)
-ENDFOREACH (module_dir)
-#SET (ZORBA_EXTERNAL_MODULES_SRCS ${ZORBA_EXTERNAL_MODULES_SRCS} PARENT_SCOPE)
+ENDFOREACH (module_dir)
+
+# Next, form the DAG. This comprises one list containing only those
+# module projects that some other module project depends on
+# (dep_module_projects), and a series of CMake variables named
+# eg. "zorba-email-module_DEPS" containing the module projects that
+# the named project depends on. Doing this unfortunately requires us
+# to read through all CMakeLists.txt files again.
+SET (find_package_regex
+  "[Ff][Ii][Nn][Dd]_[Pp][Aa][Cc][Kk][Aa][Gg][Ee] *\\( *([^ )]*)")
+SET (dep_module_projects)
+FOREACH (module_dir ${module_dirs})
+  SET (module_project)
+  SET (cmakelists_file "${ZORBA_MODULES_DIR}/${module_dir}/CMakeLists.txt")
+  FILE (STRINGS "${cmakelists_file}" cmakelists
+    REGEX "${project_regex}|${find_package_regex}")
+  FOREACH (line ${cmakelists})
+    IF (line MATCHES "${project_regex}")
+      # Don't have to do error checking here; was done in last pass.
+      SET (module_project "${CMAKE_MATCH_1}")
+    ELSEIF (line MATCHES "${find_package_regex}")
+      SET (dependee ${CMAKE_MATCH_1})
+      # Ensure this dependency is a known module project, and not some
+      # other dependency like "Zorba" - don't want those in the DAG.
+      LIST (FIND module_projects "${dependee}" is_known)
+      IF (is_known GREATER -1)
+	message (STATUS "${module_project} depends on ${dependee}")
+	# Save the dependency in a variable based on the current project
+	LIST (APPEND "${module_project}_DEPS" ${dependee})
+	# Also add this dependee to dep_module_projects
+	LIST (APPEND dep_module_projects ${dependee})
+      ENDIF (is_known GREATER -1)
+    ENDIF (line MATCHES "${project_regex}")
+  ENDFOREACH (line)
+
+ENDFOREACH (module_dir)
+
+
+# Now, transform the DAG into a dependency-ordered list. See
+# http://en.wikipedia.org/wiki/Topological_sorting .
+SET (no_deps)
+SET (visited)
+SET (ordered_modules)
+MACRO (VISIT mod_name)
+  LIST (FIND visited "${mod_name}" is_visited)
+  IF (is_visited EQUAL -1)
+    # Haven't seen this module before; iterate through modules that depend on it
+    LIST (APPEND visited "${mod_name}")
+    FOREACH (depender ${${mod_name}_DEPS})
+      VISIT ("${depender}")
+    ENDFOREACH (depender)
+    # Now that all modules that depend on it have been added, add this one
+    LIST (APPEND ordered_modules "${mod_name}")
+  ELSE (is_visited EQUAL -1)
+  ENDIF (is_visited EQUAL -1)
+ENDMACRO (VISIT)
+# Annoying - LIST(REMOVE_DUPLICATES) dies if the list is empty.
+LIST (LENGTH dep_module_projects num_deps)
+IF (num_deps GREATER 0)
+  LIST (REMOVE_DUPLICATES dep_module_projects)
+ENDIF (num_deps GREATER 0)
+FOREACH (module_project ${module_projects})
+  # Only initially visit those modules projects that do NOT have any
+  # module projects depending on them; that is, only visit those module
+  # projects that are NOT in dep_module_projects.
+  LIST (FIND dep_module_projects "${module_project}" is_dep)
+  IF (is_dep EQUAL -1)
+    VISIT (${module_project})
+  ENDIF (is_dep EQUAL -1)
+
+ENDFOREACH (module_project)
 
 # Each of these projects will also want to be able to
 # FIND_PACKAGE(Zorba), so add our own build dir to the CMake module
@@ -89,9 +165,16 @@
 # Now, iterate through all the module projects again and actually add
 # them to this Zorba project. Create a binary directory for them
 # inside our own.
-FOREACH (module_dir ${module_dirs})
+FOREACH (module_project ${ordered_modules})
+  # Create the module binary directory and add it to CMAKE_PREFIX_PATH
+  # so other modules can find it. Then, add the module project
+  # directory.
+  SET (module_dir "${${module_project}_DIR}")
+  SET (module_builddir "${CMAKE_BINARY_DIR}/zorba_modules/${module_project}")
+  FILE (MAKE_DIRECTORY "${module_builddir}")
+  LIST (APPEND CMAKE_PREFIX_PATH "${module_builddir}")
   ADD_SUBDIRECTORY("${ZORBA_MODULES_DIR}/${module_dir}"
-    "${CMAKE_BINARY_DIR}/zorba_modules/zorba_${module_dir}_module")
-ENDFOREACH (module_dir)
+    "${CMAKE_BINARY_DIR}/zorba_modules/${module_project}")
+ENDFOREACH (module_project)
 
 MESSAGE(STATUS "End modules")

=== modified file 'modules/ExternalModules.conf'
--- modules/ExternalModules.conf	2012-03-28 05:19:57 +0000
+++ modules/ExternalModules.conf	2012-04-11 19:41:20 +0000
@@ -40,3 +40,5 @@
 system          bzr  lp:zorba/system-module            zorba-2.2 
 xqxq            bzr  lp:zorba/xqxq-module              zorba-2.2 
 email           bzr  lp:zorba/email-module             zorba-2.2 
+util-jvm        bzr  lp:zorba/util-jvm-module
+schema-tools    bzr  lp:zorba/schema-tools-module

=== modified file 'src/api/staticcontextimpl.h'
--- src/api/staticcontextimpl.h	2012-03-28 05:19:57 +0000
+++ src/api/staticcontextimpl.h	2012-04-11 19:41:20 +0000
@@ -281,6 +281,7 @@
   virtual void
   getFullLibPath(std::vector<String>& aLibPath) const;
 
+
 protected:
   String
   createInvokeQuery(const Function_t&, size_t aArity) const;

=== modified file 'src/api/zorbaimpl.cpp'
--- src/api/zorbaimpl.cpp	2012-03-28 05:19:57 +0000
+++ src/api/zorbaimpl.cpp	2012-04-11 19:41:20 +0000
@@ -35,6 +35,7 @@
 #include "diagnostics/xquery_diagnostics.h"
 
 #include "system/globalenv.h"
+#include "system/properties.h"
 
 #include "context/static_context.h"
 
@@ -269,6 +270,15 @@
 }
 
 
+/*******************************************************************************
+
+********************************************************************************/
+PropertiesGlobal* ZorbaImpl::getPropertiesGlobal()
+{
+  return Properties::instance();
+}
+
+
 void ZorbaImpl::notifyError( DiagnosticHandler *eh, ZorbaException const &ze ) {
   eh->error( ze );
 }

=== modified file 'src/api/zorbaimpl.h'
--- src/api/zorbaimpl.h	2012-03-28 05:19:57 +0000
+++ src/api/zorbaimpl.h	2012-04-11 19:41:20 +0000
@@ -134,6 +134,8 @@
 
   audit::Provider* getAuditProvider();
 
+  PropertiesGlobal* getPropertiesGlobal();
+
 protected:
   ZorbaImpl();
 

=== modified file 'src/context/dynamic_loader.cpp'
--- src/context/dynamic_loader.cpp	2012-03-28 05:19:57 +0000
+++ src/context/dynamic_loader.cpp	2012-04-11 19:41:20 +0000
@@ -132,8 +132,15 @@
 ExternalModule*
 DynamicLoader::loadModule(const zstring& aFile) const
 {
-  // function pointer to create a module
-  ExternalModule* (*createModule)() = NULL;
+  handle_t handle;
+  std::map<const zstring, handle_t>::const_iterator lIter;
+
+  lIter = theLibraries.find(aFile);
+  if (lIter != theLibraries.end())
+  {
+    handle = lIter->second;
+    return createModule(handle, aFile);
+  }
 
 #ifdef WIN32
   WCHAR wpath_str[1024];
@@ -146,43 +153,51 @@
                       0, aFile.c_str(), -1,
                       wpath_str, sizeof(wpath_str)/sizeof(WCHAR));
   }
-  HMODULE handle = LoadLibraryW(wpath_str);
+
+  handle = LoadLibraryW(wpath_str);
   if (!handle)
     throw ZORBA_EXCEPTION(
       zerr::ZOSE0005_DLL_LOAD_FAILED,
       ERROR_PARAMS( aFile, os_error::get_err_string() )
     );
-
+#else
+  handle = dlopen(aFile.c_str(), RTLD_NOW);
+  if (!handle)
+    throw ZORBA_EXCEPTION(
+      zerr::ZOSE0005_DLL_LOAD_FAILED, ERROR_PARAMS( aFile, zstring(dlerror()) )
+    );
+#endif
+
+  theLibraries[aFile] = handle;
+  return createModule(handle, aFile);
+}
+
+
+ExternalModule*
+DynamicLoader::createModule(handle_t handle, const zstring& aFile) const
+{
+  // function pointer to create a module
+  ExternalModule* (*createModuleFunction)() = NULL;
+
+#ifdef WIN32
   createModule = (ExternalModule* (*)())GetProcAddress(handle, "createModule");
-  if (createModule == NULL)
+  if (createModuleFunction == NULL)
     throw ZORBA_EXCEPTION(
       zerr::ZAPI0015_CREATEMODULE_NOT_FOUND,
       ERROR_PARAMS( aFile, os_error::get_err_string() )
     );
-
 #else
-  void* handle = dlopen(aFile.c_str(), RTLD_NOW);
-  if (!handle)
-    throw ZORBA_EXCEPTION(
-      zerr::ZOSE0005_DLL_LOAD_FAILED, ERROR_PARAMS( aFile, zstring(dlerror()) )
-    );
-
-  createModule = (ExternalModule* (*)()) dlsym(handle, "createModule");
-  if (createModule == NULL)
+  createModuleFunction = (ExternalModule* (*)()) dlsym(handle, "createModule");
+  if (createModuleFunction == NULL)
   {
     dlclose(handle);
     throw ZORBA_EXCEPTION(
-      zerr::ZAPI0015_CREATEMODULE_NOT_FOUND,
-      ERROR_PARAMS( aFile, dlerror() )
-    );
+          zerr::ZAPI0015_CREATEMODULE_NOT_FOUND,
+          ERROR_PARAMS( aFile, dlerror() )
+          );
   }
 #endif
-  if (theLibraries.find(handle) == theLibraries.end())
-  {
-    theLibraries.insert(handle);
-  }
-
-  return createModule();
+  return createModuleFunction();
 }
 
 
@@ -193,13 +208,13 @@
 
 DynamicLoader::~DynamicLoader()
 {
-  for (LibrarySet_t::const_iterator lIter = theLibraries.begin();
+  for (LibraryMap_t::const_iterator lIter = theLibraries.begin();
        lIter != theLibraries.end(); ++lIter)
   {
 #ifdef WIN32
-    FreeLibrary(*lIter);
+    FreeLibrary(lIter->second);
 #else
-    dlclose(*lIter);
+    dlclose(lIter->second);
 #endif
   }
 }

=== modified file 'src/context/dynamic_loader.h'
--- src/context/dynamic_loader.h	2012-03-28 05:19:57 +0000
+++ src/context/dynamic_loader.h	2012-04-11 19:41:20 +0000
@@ -18,7 +18,7 @@
 #define ZORBA_DYNAMIC_LOADER_H
 
 #include "common/common.h"
-#include <set>
+#include <map>
 #include "common/shared_types.h"
 
 namespace zorba {
@@ -40,15 +40,20 @@
 
   ~DynamicLoader();
 
-  ExternalModule* loadModule(const zstring& aFile) const;
 
 #ifdef WIN32
-  typedef std::set<HMODULE> LibrarySet_t;
+  typedef HMODULE handle_t;
 #else
-  typedef std::set<void*> LibrarySet_t;
+  typedef void *  handle_t;
 #endif
 
-  mutable LibrarySet_t theLibraries;
+  ExternalModule* loadModule(const zstring& aFile) const;
+  ExternalModule* createModule(handle_t handle, const zstring& aFile) const;
+
+
+  typedef std::map<const zstring, handle_t> LibraryMap_t;
+
+  mutable LibraryMap_t theLibraries;
 };
 
 } /* namespace zorba */

=== modified file 'src/context/static_context.cpp'
--- src/context/static_context.cpp	2012-04-10 20:59:34 +0000
+++ src/context/static_context.cpp	2012-04-11 19:41:20 +0000
@@ -1696,6 +1696,43 @@
 }
 
 
+////////////////////////////////////////////////////////////////////////////////
+//                                                                            //
+//  JVM Classpath                                                             //
+//                                                                            //
+////////////////////////////////////////////////////////////////////////////////
+
+/*******************************************************************************
+
+********************************************************************************/
+void static_context::set_jvm_class_path(const std::vector<zstring>& path)
+{
+  theJVMClassPath = path;
+}
+
+
+/*******************************************************************************
+
+********************************************************************************/
+void static_context::get_jvm_class_path(std::vector<zstring>& path) const
+{
+  path.insert(path.end(), theJVMClassPath.begin(), theJVMClassPath.end());
+}
+
+/*******************************************************************************
+
+********************************************************************************/
+void static_context::get_full_jvm_class_path(std::vector<zstring>& path) const
+{
+  if (theParent != NULL)
+  {
+    theParent->get_full_jvm_class_path(path);
+  }
+
+  get_jvm_class_path(path);
+}
+
+
 /////////////////////////////////////////////////////////////////////////////////
 //                                                                             //
 //  Validating Items                                                           //

=== modified file 'src/context/static_context.h'
--- src/context/static_context.h	2012-04-10 20:59:34 +0000
+++ src/context/static_context.h	2012-04-11 19:41:20 +0000
@@ -512,6 +512,8 @@
 
   ExternalModuleMap                     * theExternalModulesMap;
 
+  checked_vector<zstring>                 theJVMClassPath;
+
   rchandle<TypeManager>                   theTypeManager;
 
   NamespaceBindings                     * theNamespaceBindings;
@@ -715,6 +717,15 @@
   void get_full_lib_path(std::vector<zstring>& oLibPath) const;
 
   //
+  // JVM classpath
+  //
+  void set_jvm_class_path(const std::vector<zstring>& aClassPath);
+
+  void get_jvm_class_path(std::vector<zstring>& oClassPath) const;
+
+  void get_full_jvm_class_path(std::vector<zstring>& path) const;
+
+	//
   // Validating Items
   //
   bool validate(

=== modified file 'src/precompiled/stdafx.h'
--- src/precompiled/stdafx.h	2012-03-28 05:19:57 +0000
+++ src/precompiled/stdafx.h	2012-04-11 19:41:20 +0000
@@ -80,7 +80,7 @@
 // #include "compiler/expression/ft_expr.h"
 // #include "compiler/expression/ftnode.h"
 // #include "compiler/parser/query_loc.h"
-  #include "util/cxx_util.h"
+// #include "util/cxx_util.h"
 // #include "util/indent.h"
 // #include "util/stl_util.h"
 // #include "diagnostics/xquery_diagnostics.h"
@@ -166,7 +166,7 @@
 // #include "compiler/api/compiler_api.h"
 // #include "compiler/api/compiler_api_impl.h"
 // #include "system/globalenv.h"
-// #include "system/properties.h"
+#include "system/properties.h"
 // #include "system/zorba_properties.h"
 // #include "context/decimal_format.h"
 // #include "context/default_uri_mappers.h"
@@ -182,7 +182,7 @@
 // #include "context/stemmer_wrappers.h"
 // #include "context/uri_resolver.h"
 // #include "context/uri_resolver_wrapper.h"
-#include "diagnostics/assert.h"
+// //#include "diagnostics/assert.h"
 // #include "diagnostics/diagnostic.h"
 // #include "diagnostics/dict.h"
 // #include "diagnostics/dict_impl.h"
@@ -370,8 +370,7 @@
  #include "zorba/diagnostic_handler.h"
  #include "zorba/xquery_warning.h"
  #include "runtime/full_text/ftcontains_visitor.h"
- #include "store/naive/naive_ft_token_iterator.h"
- #include "store/api/ft_token_iterator.h"
- #include "store/naive/ft_token_store.h"
+ #include "store/naive/node_items.h"
+
 #endif
 /* vim:set et sw=2 ts=2: */

=== modified file 'src/system/properties.h'
--- src/system/properties.h	2012-03-28 05:19:57 +0000
+++ src/system/properties.h	2012-04-11 19:41:20 +0000
@@ -67,6 +67,27 @@
 
   std::ostream& debug_out() { return *debug_stream; }
 
+  /**
+    * Before the JVM is started this will return the classpath set by
+    * command line option, the CLASSPATH environment variable and in Zorba
+    * config file.
+    *
+    * After the JVM is started this will contain in addition the paths to jars
+    * used by modules that make use of the JVM.
+    */
+  void getJVMClassPath(std::string & jvmClasspath)
+  { jvmClasspath = theCLASSPATH ; }
+
+  /**
+    * This method should be used to set additional JVM classpath for modules
+    * that make use of JVM. This will overide the classpath set by CLASSPATH
+    * environment variable or Zorba config file.
+    *
+    * Once the JVM is started this method doesn't have any effect.
+    */
+  void setJVMClassPath(const std::string & jvmClasspath)
+  { theCLASSPATH = jvmClasspath; }
+
  protected:
   /**
    * Gets the Operation System folder where the properties of the current 

=== modified file 'src/system/zorba_properties.h'
--- src/system/zorba_properties.h	2012-03-28 05:19:57 +0000
+++ src/system/zorba_properties.h	2012-04-11 19:41:20 +0000
@@ -26,13 +26,25 @@
 namespace zorba 
 { 
 
-class ZORBA_DLL_PUBLIC ZorbaProperties : public ::zorba::PropertiesBase 
+class ZORBA_DLL_PUBLIC ZorbaProperties : public ::zorba::PropertiesGlobal 
 {
 protected:
   const char** get_all_options() const 
   {
-    static const char* result [] = 
-      { "--trace-parsing", "--trace-scanning", "--use-serializer", "--optimizer", "--result-file", "--debug-file", "--abort", "--query", "--print-query", "--print-time", "--print-ast", "--print-xqdoc", "--print-translated", "--print-normalized", "--print-optimized", "--print-iterator-tree", "--print-item-flow", "--print-static-types", "--dump-lib", "--stable-iterator-ids", "--no-tree-ids", "--print-intermediate-opt", "--print-locations", "--force-gflwor", "--reorder-globals", "--specialize-num", "--specialize-cmp", "--inline-udf", "--loop-hoisting", "--infer-joins", "--no-copy-optim", "--serialize-only-query", "--trace-translator", "--trace-codegen", "--trace-fulltext", "--debug", "--compile-only", "--tz", "--external-var", "--serializer-param", "--iter-plan-test", "--dot-plan-file", "--max-udf-call-depth", NULL };
+    static const char* result [] = {
+      "--trace-parsing", "--trace-scanning", "--use-serializer", "--optimizer",
+      "--result-file", "--debug-file", "--abort", "--query", "--print-query",
+      "--print-time", "--print-ast", "--print-xqdoc", "--print-translated",
+      "--print-normalized", "--print-optimized", "--print-iterator-tree",
+      "--print-item-flow", "--print-static-types", "--dump-lib",
+      "--stable-iterator-ids", "--no-tree-ids", "--print-intermediate-opt",
+      "--print-locations", "--force-gflwor", "--reorder-globals",
+      "--specialize-num", "--specialize-cmp", "--inline-udf", "--loop-hoisting",
+      "--infer-joins", "--no-copy-optim", "--serialize-only-query",
+      "--trace-translator", "--trace-codegen", "--trace-fulltext", "--debug",
+      "--compile-only", "--tz", "--external-var", "--serializer-param",
+      "--iter-plan-test", "--dot-plan-file", "--max-udf-call-depth",
+      "--CLASSPATH", NULL };
 
     return result;
   }
@@ -80,6 +92,7 @@
   bool theIterPlanTest;
   std::string theDotPlanFile;
   uint32_t theMaxUdfCallDepth;
+  std::string theCLASSPATH;
 
   void initialize() 
   {
@@ -165,6 +178,7 @@
   const bool &iterPlanTest () const { return theIterPlanTest; }
   const std::string &dotPlanFile () const { return theDotPlanFile; }
   const uint32_t &maxUdfCallDepth () const { return theMaxUdfCallDepth; }
+  const std::string &CLASSPATH () const { return theCLASSPATH; }
 
   std::string load_argv (int argc, const char **argv) 
   {
@@ -200,7 +214,9 @@
       else if (strcmp (*argv, "--debug-file") == 0) {
         int d = 2;
         if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; }
-        if (*argv == NULL) { result = "No value given for --debug-file option"; break; }        init_val (*argv, theDebugFile, d);
+        if (*argv == NULL) { result = "No value given for --debug-file option"; break; }
+
+        init_val (*argv, theDebugFile, d);
       }
       else if (strcmp (*argv, "--abort") == 0) {
         theAbort = true;
@@ -208,7 +224,9 @@
       else if (strcmp (*argv, "--query") == 0 || strncmp (*argv, "-e", 2) == 0) {
         int d = 2;
         if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; }
-        if (*argv == NULL) { result = "No value given for --query option"; break; }        init_val (*argv, theQuery, d);
+        if (*argv == NULL) { result = "No value given for --query option"; break; }
+
+        init_val (*argv, theQuery, d);
       }
       else if (strcmp (*argv, "--print-query") == 0 || strncmp (*argv, "-q", 2) == 0) {
         thePrintQuery = true;
@@ -240,7 +258,9 @@
       else if (strcmp (*argv, "--print-static-types") == 0) {
         int d = 2;
         if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; }
-        if (*argv == NULL) { result = "No value given for --print-static-types option"; break; }        init_val (*argv, thePrintStaticTypes, d);
+        if (*argv == NULL) { result = "No value given for --print-static-types option"; break; }
+
+        init_val (*argv, thePrintStaticTypes, d);
       }
       else if (strcmp (*argv, "--dump-lib") == 0) {
         theDumpLib = true;
@@ -263,32 +283,44 @@
       else if (strcmp (*argv, "--reorder-globals") == 0) {
         int d = 2;
         if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; }
-        if (*argv == NULL) { result = "No value given for --reorder-globals option"; break; }        init_val (*argv, theReorderGlobals, d);
+        if (*argv == NULL) { result = "No value given for --reorder-globals option"; break; }
+
+        init_val (*argv, theReorderGlobals, d);
       }
       else if (strcmp (*argv, "--specialize-num") == 0) {
         int d = 2;
         if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; }
-        if (*argv == NULL) { result = "No value given for --specialize-num option"; break; }        init_val (*argv, theSpecializeNum, d);
+        if (*argv == NULL) { result = "No value given for --specialize-num option"; break; }
+
+        init_val (*argv, theSpecializeNum, d);
       }
       else if (strcmp (*argv, "--specialize-cmp") == 0) {
         int d = 2;
         if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; }
-        if (*argv == NULL) { result = "No value given for --specialize-cmp option"; break; }        init_val (*argv, theSpecializeCmp, d);
+        if (*argv == NULL) { result = "No value given for --specialize-cmp option"; break; }
+
+        init_val (*argv, theSpecializeCmp, d);
       }
       else if (strcmp (*argv, "--inline-udf") == 0) {
         int d = 2;
         if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; }
-        if (*argv == NULL) { result = "No value given for --inline-udf option"; break; }        init_val (*argv, theInlineUdf, d);
+        if (*argv == NULL) { result = "No value given for --inline-udf option"; break; }
+
+        init_val (*argv, theInlineUdf, d);
       }
       else if (strcmp (*argv, "--loop-hoisting") == 0) {
         int d = 2;
         if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; }
-        if (*argv == NULL) { result = "No value given for --loop-hoisting option"; break; }        init_val (*argv, theLoopHoisting, d);
+        if (*argv == NULL) { result = "No value given for --loop-hoisting option"; break; }
+
+        init_val (*argv, theLoopHoisting, d);
       }
       else if (strcmp (*argv, "--infer-joins") == 0) {
         int d = 2;
         if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; }
-        if (*argv == NULL) { result = "No value given for --infer-joins option"; break; }        init_val (*argv, theInferJoins, d);
+        if (*argv == NULL) { result = "No value given for --infer-joins option"; break; }
+
+        init_val (*argv, theInferJoins, d);
       }
       else if (strcmp (*argv, "--no-copy-optim") == 0)
       {
@@ -325,17 +357,23 @@
       else if (strcmp (*argv, "--tz") == 0) {
         int d = 2;
         if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; }
-        if (*argv == NULL) { result = "No value given for --tz option"; break; }        init_val (*argv, theTz, d);
+        if (*argv == NULL) { result = "No value given for --tz option"; break; }
+
+        init_val (*argv, theTz, d);
       }
       else if (strcmp (*argv, "--external-var") == 0 || strncmp (*argv, "-x", 2) == 0) {
         int d = 2;
         if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; }
-        if (*argv == NULL) { result = "No value given for --external-var option"; break; }        init_val (*argv, theExternalVar, d);
+        if (*argv == NULL) { result = "No value given for --external-var option"; break; }
+
+        init_val (*argv, theExternalVar, d);
       }
       else if (strcmp (*argv, "--serializer-param") == 0 || strncmp (*argv, "-z", 2) == 0) {
         int d = 2;
         if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; }
-        if (*argv == NULL) { result = "No value given for --serializer-param option"; break; }        init_val (*argv, theSerializerParam, d);
+        if (*argv == NULL) { result = "No value given for --serializer-param option"; break; }
+
+        init_val (*argv, theSerializerParam, d);
       }
       else if (strcmp (*argv, "--iter-plan-test") == 0) {
         theIterPlanTest = true;
@@ -343,12 +381,23 @@
       else if (strcmp (*argv, "--dot-plan-file") == 0) {
         int d = 2;
         if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; }
-        if (*argv == NULL) { result = "No value given for --dot-plan-file option"; break; }        init_val (*argv, theDotPlanFile, d);
+        if (*argv == NULL) { result = "No value given for --dot-plan-file option"; break; }
+
+        init_val (*argv, theDotPlanFile, d);
       }
       else if (strcmp (*argv, "--max-udf-call-depth") == 0) {
         int d = 2;
         if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; }
-        if (*argv == NULL) { result = "No value given for --max-udf-call-depth option"; break; }        init_val (*argv, theMaxUdfCallDepth, d);
+        if (*argv == NULL) { result = "No value given for --max-udf-call-depth option"; break; }
+
+        init_val (*argv, theMaxUdfCallDepth, d);
+      }
+      else if (strcmp (*argv, "--CLASSPATH") == 0) {
+        int d = 2;
+        if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; }
+        if (*argv == NULL) { result = "No value given for --CLASSPATH option"; break; }
+
+        init_val (*argv, theCLASSPATH, d);
       }
       else if (strcmp (*argv, "--") == 0) {
         copy_args (++argv);
@@ -413,6 +462,7 @@
 "--iter-plan-test\nrun as iterator plan test\n\n"
 "--dot-plan-file\ngenerate the dot iterator plan\n\n"
 "--max-udf-call-depth\nmaximum stack depth of udf function calls\n\n"
+"--CLASSPATH\nJVM classpath to be used by modules using Java implementations\n\n"
 ;
   }
 

=== modified file 'src/system/zorba_properties.txt'
--- src/system/zorba_properties.txt	2012-03-28 05:19:57 +0000
+++ src/system/zorba_properties.txt	2012-04-11 19:41:20 +0000
@@ -43,3 +43,4 @@
       ("iter-plan-test", "run as iterator plan test")
       ("dot-plan-file", po::value<std::string>(), "generate the dot iterator plan")
       ("max-udf-call-depth", po::value<uint32_t>()->default_value(1024), "maximum stack depth of udf function calls")
+      ("CLASSPATH", po::value<std::string>(), "JVM classpath to be used by modules using Java implementations")
\ No newline at end of file

=== modified file 'src/util/file.cpp'
--- src/util/file.cpp	2012-03-28 05:19:57 +0000
+++ src/util/file.cpp	2012-04-11 19:41:20 +0000
@@ -277,6 +277,18 @@
 #endif
 }
 
+void file::lsdir(std::vector<std::string> &list) {
+#ifdef ZORBA_WITH_FILE_ACCESS
+  try {
+    fs::lsdir( c_str(), list );
+    set_filetype( type_directory );
+  }
+  catch ( fs::exception const &e ) {
+    throw ZORBA_IO_EXCEPTION( e.function(), e.path() );
+  }
+#endif
+}
+
 void file::deep_mkdir() {
 #ifdef ZORBA_WITH_FILE_ACCESS
   vector<file> files;

=== modified file 'src/util/fs_util.cpp'
--- src/util/fs_util.cpp	2012-03-28 05:19:57 +0000
+++ src/util/fs_util.cpp	2012-04-11 19:41:20 +0000
@@ -277,6 +277,30 @@
 #endif
 }
 
+void lsdir( char const *path, std::vector<std::string> &list )
+{
+  DIR *dir;
+  struct dirent *ent;
+
+  dir = opendir (path);
+  if (dir != NULL)
+  {
+    /* print all the files and directories within directory */
+    while ((ent = readdir (dir)) != NULL)
+    {
+      //printf ("%s\n", ent->d_name);
+      std::string item(ent->d_name);
+      list.push_back(item);
+    }
+    closedir (dir);
+  }
+  else
+  {
+    /* could not open directory */
+    throw fs::exception( "lsdir()", path );
+  }
+}
+
 bool remove( char const *path ) {
 #ifndef WIN32
   return ::remove( path ) == 0;

=== modified file 'src/util/fs_util.h'
--- src/util/fs_util.h	2012-03-28 05:19:57 +0000
+++ src/util/fs_util.h	2012-04-11 19:41:20 +0000
@@ -17,6 +17,14 @@
 #ifndef ZORBA_FS_UTIL_H
 #define ZORBA_FS_UTIL_H
 
+#include <vector>
+
+#ifdef WIN32
+# include "win32/dirent.h"
+#else
+# include <dirent.h>                 /* for implementing lsdir */
+#endif /* WIN32 */
+
 #include <zorba/config.h>
 
 #include <stdexcept>
@@ -144,6 +152,26 @@
   mkdir( path.c_str() );
 }
 
+/**
+ * List files in dir
+ *
+ * @param path The full path of the directory to list.
+ * @throws fs::exception if the list fails.
+ */
+void lsdir( char const *path, std::vector<std::string> & list );
+
+/**
+ * List files in dir
+ *
+ * @tparam PathStringType The \a path string type.
+ * @param path The full path of the directory to list.
+ * @throws fs::exception if the list fails.
+ */
+template<class PathStringType> inline
+void lsdir( PathStringType const &path, std::vector<std::string> & list ) {
+  lsdir( path.c_str(), list );
+}
+
 #endif /* ZORBA_WITH_FILE_ACCESS */
 
 ////////// File creation //////////////////////////////////////////////////////

=== added file 'src/util/win32/dirent.h'
--- src/util/win32/dirent.h	1970-01-01 00:00:00 +0000
+++ src/util/win32/dirent.h	2012-04-11 19:41:20 +0000
@@ -0,0 +1,372 @@
+/*****************************************************************************
+ * dirent.h - dirent API for Microsoft Visual Studio
+ *
+ * Copyright (C) 2006 Toni Ronkko
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * ``Software''), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL TONI RONKKO BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * Mar 15, 2011, Toni Ronkko
+ * Defined FILE_ATTRIBUTE_DEVICE for MSVC 6.0.
+ *
+ * Aug 11, 2010, Toni Ronkko
+ * Added d_type and d_namlen fields to dirent structure.  The former is
+ * especially useful for determining whether directory entry represents a
+ * file or a directory.  For more information, see
+ * http://www.delorie.com/gnu/docs/glibc/libc_270.html
+ *
+ * Aug 11, 2010, Toni Ronkko
+ * Improved conformance to the standards.  For example, errno is now set
+ * properly on failure and assert() is never used.  Thanks to Peter Brockam
+ * for suggestions.
+ *
+ * Aug 11, 2010, Toni Ronkko
+ * Fixed a bug in rewinddir(): when using relative directory names, change
+ * of working directory no longer causes rewinddir() to fail.
+ *
+ * Dec 15, 2009, John Cunningham
+ * Added rewinddir member function
+ *
+ * Jan 18, 2008, Toni Ronkko
+ * Using FindFirstFileA and WIN32_FIND_DATAA to avoid converting string
+ * between multi-byte and unicode representations.  This makes the
+ * code simpler and also allows the code to be compiled under MingW.  Thanks
+ * to Azriel Fasten for the suggestion.
+ *
+ * Mar 4, 2007, Toni Ronkko
+ * Bug fix: due to the strncpy_s() function this file only compiled in
+ * Visual Studio 2005.  Using the new string functions only when the
+ * compiler version allows.
+ *
+ * Nov  2, 2006, Toni Ronkko
+ * Major update: removed support for Watcom C, MS-DOS and Turbo C to
+ * simplify the file, updated the code to compile cleanly on Visual
+ * Studio 2005 with both unicode and multi-byte character strings,
+ * removed rewinddir() as it had a bug.
+ *
+ * Aug 20, 2006, Toni Ronkko
+ * Removed all remarks about MSVC 1.0, which is antiqued now.  Simplified
+ * comments by removing SGML tags.
+ *
+ * May 14 2002, Toni Ronkko
+ * Embedded the function definitions directly to the header so that no
+ * source modules need to be included in the Visual Studio project.  Removed
+ * all the dependencies to other projects so that this very header can be
+ * used independently.
+ *
+ * May 28 1998, Toni Ronkko
+ * First version.
+ *****************************************************************************/
+#ifndef DIRENT_H
+#define DIRENT_H
+
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+#include <string.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <errno.h>
+
+/* Entries missing from MSVC 6.0 */
+#if !defined(FILE_ATTRIBUTE_DEVICE)
+# define FILE_ATTRIBUTE_DEVICE 0x40
+#endif
+
+/* File type and permission flags for stat() */
+#if defined(_MSC_VER)  &&  !defined(S_IREAD)
+# define S_IFMT   _S_IFMT                      /* file type mask */
+# define S_IFDIR  _S_IFDIR                     /* directory */
+# define S_IFCHR  _S_IFCHR                     /* character device */
+# define S_IFFIFO _S_IFFIFO                    /* pipe */
+# define S_IFREG  _S_IFREG                     /* regular file */
+# define S_IREAD  _S_IREAD                     /* read permission */
+# define S_IWRITE _S_IWRITE                    /* write permission */
+# define S_IEXEC  _S_IEXEC                     /* execute permission */
+#endif
+#define S_IFBLK   0                            /* block device */
+#define S_IFLNK   0                            /* link */
+#define S_IFSOCK  0                            /* socket */
+
+#if defined(_MSC_VER)
+# define S_IRUSR  S_IREAD                      /* read, user */
+# define S_IWUSR  S_IWRITE                     /* write, user */
+# define S_IXUSR  0                            /* execute, user */
+# define S_IRGRP  0                            /* read, group */
+# define S_IWGRP  0                            /* write, group */
+# define S_IXGRP  0                            /* execute, group */
+# define S_IROTH  0                            /* read, others */
+# define S_IWOTH  0                            /* write, others */
+# define S_IXOTH  0                            /* execute, others */
+#endif
+
+/* Indicates that d_type field is available in dirent structure */
+#define _DIRENT_HAVE_D_TYPE
+
+/* File type flags for d_type */
+#define DT_UNKNOWN  0
+#define DT_REG      S_IFREG
+#define DT_DIR      S_IFDIR
+#define DT_FIFO     S_IFFIFO
+#define DT_SOCK     S_IFSOCK
+#define DT_CHR      S_IFCHR
+#define DT_BLK      S_IFBLK
+
+/* Macros for converting between st_mode and d_type */
+#define IFTODT(mode) ((mode) & S_IFMT)
+#define DTTOIF(type) (type)
+
+/*
+ * File type macros.  Note that block devices, sockets and links cannot be
+ * distinguished on Windows and the macros S_ISBLK, S_ISSOCK and S_ISLNK are
+ * only defined for compatibility.  These macros should always return false
+ * on Windows.
+ */
+#define	S_ISFIFO(mode) (((mode) & S_IFMT) == S_IFFIFO)
+#define	S_ISDIR(mode)  (((mode) & S_IFMT) == S_IFDIR)
+#define	S_ISREG(mode)  (((mode) & S_IFMT) == S_IFREG)
+#define	S_ISLNK(mode)  (((mode) & S_IFMT) == S_IFLNK)
+#define	S_ISSOCK(mode) (((mode) & S_IFMT) == S_IFSOCK)
+#define	S_ISCHR(mode)  (((mode) & S_IFMT) == S_IFCHR)
+#define	S_ISBLK(mode)  (((mode) & S_IFMT) == S_IFBLK)
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+typedef struct dirent
+{
+   char d_name[MAX_PATH + 1];                  /* File name */
+   size_t d_namlen;                            /* Length of name without \0 */
+   int d_type;                                 /* File type */
+} dirent;
+
+
+typedef struct DIR
+{
+   dirent           curentry;                  /* Current directory entry */
+   WIN32_FIND_DATAA find_data;                 /* Private file data */
+   int              cached;                    /* True if data is valid */
+   HANDLE           search_handle;             /* Win32 search handle */
+   char             patt[MAX_PATH + 3];        /* Initial directory name */
+} DIR;
+
+
+/* Forward declarations */
+static DIR *opendir(const char *dirname);
+static struct dirent *readdir(DIR *dirp);
+static int closedir(DIR *dirp);
+static void rewinddir(DIR* dirp);
+
+
+/* Use the new safe string functions introduced in Visual Studio 2005 */
+#if defined(_MSC_VER) && _MSC_VER >= 1400
+# define DIRENT_STRNCPY(dest,src,size) strncpy_s((dest),(size),(src),_TRUNCATE)
+#else
+# define DIRENT_STRNCPY(dest,src,size) strncpy((dest),(src),(size))
+#endif
+
+/* Set errno variable */
+#if defined(_MSC_VER)
+#define DIRENT_SET_ERRNO(x) _set_errno (x)
+#else
+#define DIRENT_SET_ERRNO(x) (errno = (x))
+#endif
+
+
+/*****************************************************************************
+ * Open directory stream DIRNAME for read and return a pointer to the
+ * internal working area that is used to retrieve individual directory
+ * entries.
+ */
+static DIR *opendir(const char *dirname)
+{
+   DIR *dirp;
+
+   /* ensure that the resulting search pattern will be a valid file name */
+   if (dirname == NULL) {
+      DIRENT_SET_ERRNO (ENOENT);
+      return NULL;
+   }
+   if (strlen (dirname) + 3 >= MAX_PATH) {
+      DIRENT_SET_ERRNO (ENAMETOOLONG);
+      return NULL;
+   }
+
+   /* construct new DIR structure */
+   dirp = (DIR*) malloc (sizeof (struct DIR));
+   if (dirp != NULL) {
+      int error;
+
+      /*
+       * Convert relative directory name to an absolute one.  This
+       * allows rewinddir() to function correctly when the current working
+       * directory is changed between opendir() and rewinddir().
+       */
+      if (GetFullPathNameA (dirname, MAX_PATH, dirp->patt, NULL)) {
+         char *p;
+
+         /* append the search pattern "\\*\0" to the directory name */
+         p = strchr (dirp->patt, '\0');
+         if (dirp->patt < p  &&  *(p-1) != '\\'  &&  *(p-1) != ':') {
+           *p++ = '\\';
+         }
+         *p++ = '*';
+         *p = '\0';
+
+         /* open directory stream and retrieve the first entry */
+         dirp->search_handle = FindFirstFileA (dirp->patt, &dirp->find_data);
+         if (dirp->search_handle != INVALID_HANDLE_VALUE) {
+            /* a directory entry is now waiting in memory */
+            dirp->cached = 1;
+            error = 0;
+         } else {
+            /* search pattern is not a directory name? */
+            DIRENT_SET_ERRNO (ENOENT);
+            error = 1;
+         }
+      } else {
+         /* buffer too small */
+         DIRENT_SET_ERRNO (ENOMEM);
+         error = 1;
+      }
+
+      if (error) {
+         free (dirp);
+         dirp = NULL;
+      }
+   }
+
+   return dirp;
+}
+
+
+/*****************************************************************************
+ * Read a directory entry, and return a pointer to a dirent structure
+ * containing the name of the entry in d_name field.  Individual directory
+ * entries returned by this very function include regular files,
+ * sub-directories, pseudo-directories "." and "..", but also volume labels,
+ * hidden files and system files may be returned.
+ */
+static struct dirent *readdir(DIR *dirp)
+{
+   DWORD attr;
+   if (dirp == NULL) {
+      /* directory stream did not open */
+      DIRENT_SET_ERRNO (EBADF);
+      return NULL;
+   }
+
+   /* get next directory entry */
+   if (dirp->cached != 0) {
+      /* a valid directory entry already in memory */
+      dirp->cached = 0;
+   } else {
+      /* get the next directory entry from stream */
+      if (dirp->search_handle == INVALID_HANDLE_VALUE) {
+         return NULL;
+      }
+      if (FindNextFileA (dirp->search_handle, &dirp->find_data) == FALSE) {
+         /* the very last entry has been processed or an error occured */
+         FindClose (dirp->search_handle);
+         dirp->search_handle = INVALID_HANDLE_VALUE;
+         return NULL;
+      }
+   }
+
+   /* copy as a multibyte character string */
+   DIRENT_STRNCPY ( dirp->curentry.d_name,
+             dirp->find_data.cFileName,
+             sizeof(dirp->curentry.d_name) );
+   dirp->curentry.d_name[MAX_PATH] = '\0';
+
+   /* compute the length of name */
+   dirp->curentry.d_namlen = strlen (dirp->curentry.d_name);
+
+   /* determine file type */
+   attr = dirp->find_data.dwFileAttributes;
+   if ((attr & FILE_ATTRIBUTE_DEVICE) != 0) {
+      dirp->curentry.d_type = DT_CHR;
+   } else if ((attr & FILE_ATTRIBUTE_DIRECTORY) != 0) {
+      dirp->curentry.d_type = DT_DIR;
+   } else {
+      dirp->curentry.d_type = DT_REG;
+   }
+   return &dirp->curentry;
+}
+
+
+/*****************************************************************************
+ * Close directory stream opened by opendir() function.  Close of the
+ * directory stream invalidates the DIR structure as well as any previously
+ * read directory entry.
+ */
+static int closedir(DIR *dirp)
+{
+   if (dirp == NULL) {
+      /* invalid directory stream */
+      DIRENT_SET_ERRNO (EBADF);
+      return -1;
+   }
+
+   /* release search handle */
+   if (dirp->search_handle != INVALID_HANDLE_VALUE) {
+      FindClose (dirp->search_handle);
+      dirp->search_handle = INVALID_HANDLE_VALUE;
+   }
+
+   /* release directory structure */
+   free (dirp);
+   return 0;
+}
+
+
+/*****************************************************************************
+ * Resets the position of the directory stream to which dirp refers to the
+ * beginning of the directory.  It also causes the directory stream to refer
+ * to the current state of the corresponding directory, as a call to opendir()
+ * would have done.  If dirp does not refer to a directory stream, the effect
+ * is undefined.
+ */
+static void rewinddir(DIR* dirp)
+{
+   if (dirp != NULL) {
+      /* release search handle */
+      if (dirp->search_handle != INVALID_HANDLE_VALUE) {
+         FindClose (dirp->search_handle);
+      }
+
+      /* open new search handle and retrieve the first entry */
+      dirp->search_handle = FindFirstFileA (dirp->patt, &dirp->find_data);
+      if (dirp->search_handle != INVALID_HANDLE_VALUE) {
+         /* a directory entry is now waiting in memory */
+         dirp->cached = 1;
+      } else {
+         /* failed to re-open directory: no directory entry in memory */
+         dirp->cached = 0;
+      }
+   }
+}
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /*DIRENT_H*/

=== modified file 'swig/XQuery.i'
--- swig/XQuery.i	2012-03-28 05:19:57 +0000
+++ swig/XQuery.i	2012-04-11 19:41:20 +0000
@@ -14,9 +14,202 @@
  * limitations under the License.
  */
 
+
 %{  // start Implementation
 
+<<<<<<< TREE
   std::string XQuery::execute()
+=======
+class Iterator 
+{
+protected:
+  friend class DynamicContext;
+  zorba::Iterator_t theIterator;
+  zorba::Item theItem;
+  bool theConsumed;
+
+public:
+  Iterator() {}
+  Iterator(const Iterator& anIterator)
+    : theIterator(anIterator.theIterator),
+      theItem(anIterator.theItem),
+      theConsumed(false)
+  {}
+
+  Iterator(zorba::Iterator_t anIterator)
+    : theIterator(anIterator),
+      theConsumed(false)
+  {}
+
+  Iterator(zorba::Item& aItem)
+    : theIterator(0),
+      theItem(aItem),
+      theConsumed(false)
+  {}
+
+  void open()
+  {
+    if (theIterator)
+      theIterator->open();
+    theConsumed = false;
+  }
+
+  bool next(Item& aItem);
+
+  void close()
+  {
+    if (theIterator)
+      theIterator->close();
+    theConsumed = true;
+  }
+
+  void destroy()
+  {
+    theIterator = 0;
+  }
+
+}; // class Iterator
+
+
+
+class Item 
+{
+  friend class Iterator;
+  friend class StaticContext;
+  friend class DocumentManager; 
+  friend class SingletonIterator;
+  friend class DynamicContext;
+  friend class ItemFactory;
+
+private:
+  zorba::Item theItem;
+
+public:
+  Item() {}
+  Item(const Item& aItem) : theItem(aItem.theItem) {}
+  Item(const zorba::Item& aZItem) : theItem(aZItem) {}
+
+  static Item createEmptyItem()
+  { return Item(); }
+
+  std::string getStringValue() const
+  { return std::string(theItem.getStringValue().c_str()); }
+
+  std::string serialize() const
+  {
+    std::stringstream lStream; 
+    Zorba_SerializerOptions_t lOptions; 
+    zorba::Serializer_t lSerializer = zorba::Serializer::createSerializer(lOptions); 
+    zorba::SingletonItemSequence lSequence(theItem); 
+    lSerializer->serialize(&lSequence, lStream); 
+    return lStream.str();
+  }
+  
+  Iterator getAtomizationValue () const
+  { return Iterator(theItem.getAtomizationValue()); }
+  
+  Iterator getAttributes () const
+  { return Iterator(theItem.getAttributes()); }
+  
+  bool getBooleanValue () const
+  { return theItem.getBooleanValue(); }
+
+  Iterator getChildren () const
+  { return Iterator(theItem.getChildren()); }
+
+  Item getEBV () const
+  { return Item(theItem.getEBV()); }
+
+  int getIntValue () const
+  { return theItem.getIntValue(); }
+  
+  std::string getLocalName () const
+  { return std::string(theItem.getLocalName().c_str()); }
+
+  std::string getNamespace () const
+  { return std::string(theItem.getNamespace().c_str()); }
+
+  bool getNodeName (Item &aNodeName) const
+  { return theItem.getNodeName( aNodeName.theItem ); }
+
+  std::string getPrefix () const
+  { return std::string(theItem.getPrefix().c_str()); }
+
+  Item getType () const
+  { return Item( theItem.getType() ); }
+
+  unsigned int getUnsignedIntValue () const
+  { return theItem.getUnsignedIntValue(); }
+
+  bool isAtomic () const
+  { return theItem.isAtomic(); }
+
+  bool isNaN () const
+  { return theItem.isNaN(); }
+
+  bool isNode () const
+  { return theItem.isNode(); }
+
+  bool isNull () const
+  { return theItem.isNull(); }
+
+  bool isPosOrNegInf () const
+  { return theItem.isPosOrNegInf(); }
+  
+  int getNodeKind () const
+  { return theItem.getNodeKind(); }
+
+}; // class Item
+
+class DynamicContext
+{
+private:
+  zorba::DynamicContext* theContext;
+
+public:
+  DynamicContext()
+    : theContext(0)
+  {
+  }
+
+  DynamicContext(const DynamicContext& aCtx)
+    : theContext(aCtx.theContext)
+  {
+  }
+
+  DynamicContext(zorba::DynamicContext* aCtx)
+    : theContext(aCtx)
+  {
+  }
+
+  void
+  setVariable(
+    const std::string& aNamespace,
+    const std::string& aLocalname,
+    Iterator aIter)
+  {
+    theContext->setVariable(aNamespace, aLocalname, aIter.theIterator);
+  }
+
+  void
+  setContextItem(Item aItem)
+  {
+    theContext->setContextItem(aItem.theItem);
+  }
+};
+
+class XQuery 
+{
+private:
+  zorba::XQuery_t theQuery;
+
+public:
+  XQuery() {}
+  XQuery(const XQuery& aXQuery) : theQuery(aXQuery.theQuery) {}
+  XQuery(zorba::XQuery_t aQuery) : theQuery(aQuery) {}
+
+  std::string execute()
+>>>>>>> MERGE-SOURCE
   {
     std::stringstream lStream;
     lStream << theQuery;
@@ -70,6 +263,85 @@
   void XQuery::destroy() { theQuery = 0; }
   Iterator XQuery::iterator() { return Iterator(theQuery->iterator()); }
 
-%}  // end   Implementation
-
-%include "XQuery.h"
\ No newline at end of file
+
+%}          // end   Implementation
+
+
+<<<<<<< TREE
+%include "XQuery.h"=======
+
+// Interfaces
+
+
+
+class DynamicContext
+{
+public:
+  void
+  setVariable(
+    const std::string& aNamespace,
+    const std::string& aLocalname,
+    Iterator);
+
+  void
+  setContextItem(Item);
+};
+
+
+class Item
+{
+public: 
+  static Item createEmptyItem();
+
+  std::string serialize() const;
+  std::string getStringValue() const;
+  Iterator getAtomizationValue () const;
+  Iterator getAttributes () const;
+  bool getBooleanValue () const;
+  Iterator getChildren () const;
+  Item getEBV () const;
+  int getIntValue () const;
+  std::string getLocalName () const;
+  std::string getNamespace () const;
+  bool getNodeName (Item &aNodeName) const;
+  std::string getPrefix () const;
+  Item getType () const;
+  unsigned int getUnsignedIntValue () const;
+
+  int getNodeKind() const;
+  bool isAtomic () const;
+  bool isNaN () const;
+  bool isNode () const;
+  bool isNull () const;
+  bool isPosOrNegInf () const;
+}; // class Item
+
+
+class Iterator 
+{
+public:
+  void open();
+  bool next(Item&);
+  void close();
+  void destroy();
+}; // class Iterator
+
+
+class XQuery 
+{
+public:
+  std::string execute();
+  std::string printPlanAsXML();
+  std::string printPlanAsDOT();
+  void compile (const std::string &aQuery);
+  void compile (const std::string &aQuery, StaticContext &aStaticContext);
+
+#ifdef SWIGPYTHON
+  void executeSAX(SAX2ContentHandlerProxy* contentHandlerProxy);
+#endif
+
+  void destroy();
+  Iterator iterator();
+  DynamicContext getDynamicContext();
+}; // class XQuery
+>>>>>>> MERGE-SOURCE

=== modified file 'swig/java/CMakeLists.txt'
--- swig/java/CMakeLists.txt	2012-03-28 05:19:57 +0000
+++ swig/java/CMakeLists.txt	2012-04-11 19:41:20 +0000
@@ -102,6 +102,7 @@
 		ENDIF(NOT WIN32)
   ENDIF ( APPLE )
 
+
 ELSE (JAVA_INCLUDE_PATH)
   MESSAGE ( STATUS "SWIG Java: not generating JAVA API because jni headers not found.")
 ENDIF (JAVA_INCLUDE_PATH)

=== added file 'swig/various.i'
--- swig/various.i	1970-01-01 00:00:00 +0000
+++ swig/various.i	2012-04-11 19:41:20 +0000
@@ -0,0 +1,184 @@
+/* This is from http://www.opensource.apple.com/source/swig/swig-6/swig/Lib/java/various.i?txt */
+
+/* -----------------------------------------------------------------------------
+ * See the LICENSE file for information on copyright, usage and redistribution
+ * of SWIG, and the README file for authors - http://www.swig.org/release.html.
+ *
+ * various.i
+ *
+ * SWIG Typemap library for Java.
+ * Various useful typemaps.
+ * ----------------------------------------------------------------------------- */
+
+#ifdef SWIGJAVA
+
+/*
+ * char **STRING_ARRAY typemaps.
+ * These typemaps are for C String arrays which are NULL terminated.
+ *   char *values[] = { "one", "two", "three", NULL }; // note NULL
+ * char ** is mapped to a Java String[].
+ *
+ * Example usage wrapping:
+ *   %apply char **STRING_ARRAY { char **input };
+ *   char ** foo(char **input);
+ *
+ * Java usage:
+ *   String numbers[] = { "one", "two", "three" };
+ *   String[] ret = modulename.foo( numbers };
+ */
+%typemap(jni) char **STRING_ARRAY "jobjectArray"
+%typemap(jtype) char **STRING_ARRAY "String[]"
+%typemap(jstype) char **STRING_ARRAY "String[]"
+%typemap(in) char **STRING_ARRAY (jint size) {
+    int i = 0;
+    size = JCALL1(GetArrayLength, jenv, $input);
+#ifdef __cplusplus
+    $1 = new char*[size+1];
+#else
+    $1 = (char **)calloc(size+1, sizeof(char *));
+#endif
+    for (i = 0; i<size; i++) {
+        jstring j_string = (jstring)JCALL2(GetObjectArrayElement, jenv, $input, i);
+        const char *c_string = JCALL2(GetStringUTFChars, jenv, j_string, 0);
+#ifdef __cplusplus
+        $1[i] = new char [strlen(c_string)+1];
+#else
+        $1[i] = (char *)calloc(strlen(c_string)+1, sizeof(const char *));
+#endif
+        strcpy($1[i], c_string);
+        JCALL2(ReleaseStringUTFChars, jenv, j_string, c_string);
+        JCALL1(DeleteLocalRef, jenv, j_string);
+    }
+    $1[i] = 0;
+}
+
+%typemap(freearg) char **STRING_ARRAY {
+    int i;
+    for (i=0; i<size$argnum-1; i++)
+#ifdef __cplusplus
+      delete[] $1[i];
+    delete[] $1;
+#else
+      free($1[i]);
+    free($1);
+#endif
+}
+
+%typemap(out) char **STRING_ARRAY {
+    int i;
+    int len=0;
+    jstring temp_string;
+    const jclass clazz = JCALL1(FindClass, jenv, "java/lang/String");
+
+    while ($1[len]) len++;
+    jresult = JCALL3(NewObjectArray, jenv, len, clazz, NULL);
+    /* exception checking omitted */
+
+    for (i=0; i<len; i++) {
+      temp_string = JCALL1(NewStringUTF, jenv, *result++);
+      JCALL3(SetObjectArrayElement, jenv, jresult, i, temp_string);
+      JCALL1(DeleteLocalRef, jenv, temp_string);
+    }
+}
+
+%typemap(javain) char **STRING_ARRAY "$javainput"
+%typemap(javaout) char **STRING_ARRAY  {
+    return $jnicall;
+  }
+
+/*
+ * char **STRING_OUT typemaps.
+ * These are typemaps for returning strings when using a C char ** parameter type.
+ * The returned string appears in the 1st element of the passed in Java String array.
+ *
+ * Example usage wrapping:
+ *   void foo(char **string_out);
+ *
+ * Java usage:
+ *   String stringOutArray[] = { "" };
+ *   modulename.foo(stringOutArray);
+ *   System.out.println( stringOutArray[0] );
+ */
+%typemap(jni) char **STRING_OUT "jobjectArray"
+%typemap(jtype) char **STRING_OUT "String[]"
+%typemap(jstype) char **STRING_OUT "String[]"
+%typemap(javain) char **STRING_OUT "$javainput"
+
+%typemap(in) char **STRING_OUT($*1_ltype temp) {
+  if (!$input) {
+    SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "array null");
+    return $null;
+  }
+  if (JCALL1(GetArrayLength, jenv, $input) == 0) {
+    SWIG_JavaThrowException(jenv, SWIG_JavaIndexOutOfBoundsException, "Array must contain at least 1 element");
+    return $null;
+  }
+  $1 = &temp;
+}
+
+%typemap(argout) char **STRING_OUT {
+  jstring jnewstring = NULL;
+  if($1) {
+     jnewstring = JCALL1(NewStringUTF, jenv, *$1);
+  }
+  JCALL3(SetObjectArrayElement, jenv, $input, 0, jnewstring);
+}
+
+/*
+ * char *BYTE typemaps.
+ * These are input typemaps for mapping a Java byte[] array to a C char array.
+ * Note that as a Java array is used and thus passeed by reference, the C routine
+ * can return data to Java via the parameter.
+ *
+ * Example usage wrapping:
+ *   void foo(char *array);
+ *
+ * Java usage:
+ *   byte b[] = new byte[20];
+ *   modulename.foo(b);
+ */
+%typemap(jni) char *BYTE "jbyteArray"
+%typemap(jtype) char *BYTE "byte[]"
+%typemap(jstype) char *BYTE "byte[]"
+%typemap(in) char *BYTE {
+    $1 = (char *) JCALL2(GetByteArrayElements, jenv, $input, 0);
+}
+
+%typemap(argout) char *BYTE {
+    JCALL3(ReleaseByteArrayElements, jenv, $input, (jbyte *) $1, 0);
+}
+
+%typemap(javain) char *BYTE "$javainput"
+
+/* Prevent default freearg typemap from being used */
+%typemap(freearg) char *BYTE ""
+
+#else
+
+#endif
+
+
+/*  %include "typemaps.i"
+
+#if defined(SWIGJAVA)
+
+%typemap(in)     (char * BYTE, int LENGTH)
+{
+    // Functions from jni.h
+    $1 = (char *) JCALL2(GetByteArrayElements, jenv, $input, 0);
+    $2 = (int)    JCALL1(GetArrayLength,       jenv, $input);
+}
+
+%typemap(jni)    (char * BYTE, int LENGTH) "jbyteArray"
+%typemap(jtype)  (char * BYTE, int LENGTH) "byte[]"
+%typemap(jstype) (char * BYTE, int LENGTH) "byte[]"
+%typemap(javain) (char * BYTE, int LENGTH) "$javainput"
+
+// Specify signature of method to handle
+%apply (char * BYTE, int LENGTH)   { (char * byteArray, long len) };
+
+#else
+%apply (char * BYTE, int LENGTH)   { (char * byteArray, long len) };
+#endif
+
+*/

=== modified file 'swig/zorba_api.i'
--- swig/zorba_api.i	2012-03-28 05:19:57 +0000
+++ swig/zorba_api.i	2012-04-11 19:41:20 +0000
@@ -15,6 +15,8 @@
  */
 
 %module zorba_api
+
+
 %include "std_string.i"
 %include "std_pair.i"
 %include "exception.i"
@@ -39,6 +41,7 @@
   }
 }
 
+<<<<<<< TREE
 #ifndef SWIGRUBY
 namespace std {
   %template(StringPairVector) vector< pair<string, string> >;
@@ -47,6 +50,10 @@
 }
 #endif
 
+=======
+
+
+>>>>>>> MERGE-SOURCE
 %{  // Implementations
 
 
@@ -91,6 +98,7 @@
   #include "XmlDataManager.h"
 %}
 
+<<<<<<< TREE
 #ifndef SWIGRUBY
 namespace std {
   %template(ItemVector) vector<Item>; 
@@ -105,6 +113,11 @@
 %include "DynamicContext.i"
 %include "CompilerHints.i"
 %include "StaticContext.i"
+=======
+
+/* %include "various.i" */
+
+>>>>>>> MERGE-SOURCE
 %include "XQuery.i"
 %include "Store.i"
 %include "Exceptions.i"

=== modified file 'test/rbkt/modules/CMakeLists.txt'
--- test/rbkt/modules/CMakeLists.txt	2012-03-28 05:19:57 +0000
+++ test/rbkt/modules/CMakeLists.txt	2012-04-11 19:41:20 +0000
@@ -58,3 +58,5 @@
 # This is as good a place as any to test this feature
 DECLARE_ZORBA_URI_FILE(FILE "random-file.txt"
   URI "http://www.zorba-xquery.com/random-file"; TEST_ONLY)
+
+ADD_SUBDIRECTORY(java)

=== added directory 'test/rbkt/modules/java'
=== added file 'test/rbkt/modules/java/CMakeLists.txt'
--- test/rbkt/modules/java/CMakeLists.txt	1970-01-01 00:00:00 +0000
+++ test/rbkt/modules/java/CMakeLists.txt	2012-04-11 19:41:20 +0000
@@ -0,0 +1,40 @@
+# Copyright 2006-2008 The FLWOR Foundation.
+# 
+# Licensed under the Apache License, Version 2.0 (the "License")
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# 
+# http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# For now we only test building a .jar that we want Zorba to make available
+# on the JVM claspath. This test scenario should be extended to include a
+# Zorba module using the .jar, etc.
+# We make use of the much-improved Java support added in CMake 2.8.6.
+COMPARE_VERSION_STRINGS (${CMAKE_VERSION} "2.8.6" RESULT)
+IF (${RESULT} GREATER -1)
+  FIND_PACKAGE (Java COMPONENTS Development)
+  IF (Java_Development_FOUND)
+    INCLUDE (UseJava)
+
+    # Declare two "different" jars, for testing
+    ADD_JAR (JavaTest Test.java)
+    ADD_JAR (JavaTest2 Test.java)
+
+    # Tell Zorba about the jars
+    GET_PROPERTY (JavaTest_JAR_FILE TARGET JavaTest PROPERTY JAR_FILE)
+    GET_PROPERTY (JavaTest2_JAR_FILE TARGET JavaTest2 PROPERTY JAR_FILE)
+    DECLARE_ZORBA_JAR(FILE ${JavaTest_JAR_FILE} TARGET JavaTest TEST_ONLY)
+    DECLARE_ZORBA_JAR(FILE ${JavaTest2_JAR_FILE} TARGET JavaTest2 TEST_ONLY)
+
+    # Pretend to tell Zorba about some system jars
+    DECLARE_ZORBA_JAR(EXTERNAL FILE
+      "${PROJECT_SOURCE_DIR}/MyJar.jar" "${PROJECT_SOURCE_DIR}/MyJar2.jar")
+
+  ENDIF (Java_Development_FOUND)
+ENDIF (${RESULT} GREATER -1)

=== added file 'test/rbkt/modules/java/Test.java'
--- test/rbkt/modules/java/Test.java	1970-01-01 00:00:00 +0000
+++ test/rbkt/modules/java/Test.java	2012-04-11 19:41:20 +0000
@@ -0,0 +1,7 @@
+package org.zorbaxquery;
+
+public class Test {
+    public static void main(String[] args) {
+	System.out.println("Hello, world");
+    }
+}


Follow ups