Re: [Zorba-coders] [Merge] lp:~zorba-coders/zorba/object-lookup-context-item into lp:zorba

2013-10-12 Thread Markos Zaharioudakis
Review: Approve


-- 
https://code.launchpad.net/~zorba-coders/zorba/object-lookup-context-item/+merge/190115
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


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

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

Commit message:
fixed bug #1237383

Requested reviews:
  Markos Zaharioudakis (markos-za)

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

fixed bug #1237383
-- 
https://code.launchpad.net/~zorba-coders/zorba/markos-scratch/+merge/190817
Your team Zorba Coders is subscribed to branch lp:zorba.
=== modified file 'src/compiler/translator/translator.cpp'
--- src/compiler/translator/translator.cpp	2013-10-10 03:54:10 +
+++ src/compiler/translator/translator.cpp	2013-10-13 00:41:30 +
@@ -10908,17 +10908,15 @@
   // for each predicate in the list, before calling accept() on the predicate
   // expression itself.
 
-  // get the predicate input seq
-  expr* inputSeqExpr = pop_nodestack();
-
   if (dynamic_castconst JSONArrayConstructor*(pred) != NULL)
   {
-// for $$dot in predInputSeq
-flwor_expr* flworExpr = wrap_expr_in_flwor(inputSeqExpr, false);
-push_nodestack(flworExpr);
+return;
   }
   else
   {
+// get the predicate input seq
+expr* inputSeqExpr = pop_nodestack();
+
 // let $$temp := predInputSeq
 // let $$last-idx := count($$temp)
 // for $$dot at $$pos in $$temp
@@ -10942,18 +10940,9 @@
   const QueryLoc loc = predExpr-get_loc();
   xqtref_t predType = predExpr-get_return_type();
 
-  expr* f = pop_nodestack();
-  ZORBA_ASSERT(f-get_expr_kind() == flwor_expr_kind);
-  flwor_expr* flworExpr = static_castflwor_expr*(f);
-
   if (dynamic_castconst JSONArrayConstructor*(pred) != NULL)
   {
-assert(flworExpr-num_clauses() == 1);
-assert(flworExpr-get_clause(0)-get_kind() == flwor_clause::for_clause);
-
-for_clause* sourceClause = static_castfor_clause*(flworExpr-get_clause(0));
-
-expr* arrayExpr = sourceClause-get_expr();
+expr* arrayExpr = pop_nodestack();
 expr* selectorExpr = static_castjson_array_expr*(predExpr)-get_expr();
 expr* accessorExpr;
 
@@ -10974,13 +10963,15 @@
   generate_fn_body(BUILTIN_FUNC(OP_ZORBA_SINGLE_ARRAY_LOOKUP_2), args, loc);
 }
 
-pop_scope();
-
 push_nodestack(accessorExpr);
 
 return;
   }
 
+  expr* f = pop_nodestack();
+  ZORBA_ASSERT(f-get_expr_kind() == flwor_expr_kind);
+  flwor_expr* flworExpr = static_castflwor_expr*(f);
+
   ZORBA_ASSERT(flworExpr-num_clauses() == 3);
 
   if (TypeOps::is_subtype(tm, *predType, *rtm.INTEGER_TYPE_QUESTION, loc))

=== modified file 'test/driver/testdriver.cpp'
--- test/driver/testdriver.cpp	2013-09-26 07:38:44 +
+++ test/driver/testdriver.cpp	2013-10-13 00:41:30 +
@@ -26,7 +26,7 @@
 #include time.h
 #endif
 
-//#define ZORBA_TEST_PLAN_SERIALIZATION
+#define ZORBA_TEST_PLAN_SERIALIZATION
 
 #include testdriverconfig.h // SRC and BIN dir definitions
 #include specification.h // parsing spec files

=== added file 'test/rbkt/ExpQueryResults/zorba/jsoniq/nav_06.xml.res'
=== added file 'test/rbkt/Queries/zorba/jsoniq/nav_06.jq'
--- test/rbkt/Queries/zorba/jsoniq/nav_06.jq	1970-01-01 00:00:00 +
+++ test/rbkt/Queries/zorba/jsoniq/nav_06.jq	2013-10-13 00:41:30 +
@@ -0,0 +1,7 @@
+
+jsoniq version 1.0;
+
+()[[$$]]
+
+
+

=== modified file 'test/rbkt/Queries/zorba/sctx/sctx-functions-02.jq'
--- test/rbkt/Queries/zorba/sctx/sctx-functions-02.jq	2013-10-01 22:00:14 +
+++ test/rbkt/Queries/zorba/sctx/sctx-functions-02.jq	2013-10-13 00:41:30 +
@@ -3,11 +3,15 @@
 import module namespace file = http://expath.org/ns/file;;
 import module namespace sctx = http://zorba.io/modules/sctx;;
 
+1+1
+(:
 for $f in sctx:functions()
 where exists( $f.annotations )
 order by namespace-uri-from-QName($f.name),
  local-name-from-QName($f.name),
  $f.arity
 return $f
+:)
+
 
 (: vim:set syntax=xquery et sw=2 ts=2: :)

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


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

2013-10-12 Thread Markos Zaharioudakis
Review: Approve


-- 
https://code.launchpad.net/~zorba-coders/zorba/markos-scratch/+merge/190817
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


[Zorba-coders] [Merge] lp:~zorba-coders/zorba/threads into lp:zorba

2013-10-01 Thread Markos Zaharioudakis
Markos Zaharioudakis has proposed merging lp:~zorba-coders/zorba/threads into 
lp:zorba.

Commit message:
fixed a failing PathExpr test in XQTS

Requested reviews:
  Markos Zaharioudakis (markos-za)

For more details, see:
https://code.launchpad.net/~zorba-coders/zorba/threads/+merge/188554

fixed a failing PathExpr test in XQTS
-- 
https://code.launchpad.net/~zorba-coders/zorba/threads/+merge/188554
Your team Zorba Coders is subscribed to branch lp:zorba.
=== modified file 'src/compiler/expression/expr_type.cpp'
--- src/compiler/expression/expr_type.cpp	2013-09-23 09:11:02 +
+++ src/compiler/expression/expr_type.cpp	2013-10-01 11:12:39 +
@@ -319,6 +319,9 @@
   stepType = axis_step_type(theSctx,
 axisStep,
 static_castconst NodeXQType*(stepType.getp()));
+
+  if (stepType-is_empty() || stepType-is_none())
+break;
 }
 
 newType = stepType.getp();
@@ -1141,6 +1144,10 @@
 case store::StoreConsts::commentNode:
   return RTM.COMMENT_TYPE_STAR;
 
+case store::StoreConsts::attributeNode:
+case store::StoreConsts::documentNode:
+  return RTM.EMPTY_TYPE;
+
 default:
   ZORBA_ASSERT(false);
 }

=== modified file 'test/driver/testdriver_comparator.cpp'
--- test/driver/testdriver_comparator.cpp	2013-05-16 08:22:46 +
+++ test/driver/testdriver_comparator.cpp	2013-10-01 11:12:39 +
@@ -34,7 +34,8 @@
 /***
 
 /
-int canonicalizeAndCompare(const std::string aComparisonMethod,
+int canonicalizeAndCompare(
+const std::string aComparisonMethod,
 const char* aRefFile,
 const char* aResultFile,
 std::ostream aOutput)
@@ -224,7 +225,7 @@
 zorba::printFile(aOutput, lCanonicalRefFile);
 
 aOutput  std::endl  std::endl;
-
+#if 0
 aOutput  See line   lLine  , col   lCol 
 of expected result.   std::endl;
 aOutput  Actual:   ;
@@ -235,7 +236,7 @@
 aOutput  lRefLine;
 
 aOutputstd::endl;
-
+#endif
 return 8;
   }
   return 0;

=== modified file 'test/driver/testdriver_mt.cpp'
--- test/driver/testdriver_mt.cpp	2013-09-26 07:38:44 +
+++ test/driver/testdriver_mt.cpp	2013-10-01 11:12:39 +
@@ -364,6 +364,7 @@
   }
   else
   {
+#if 0
 printErrors(errHandler, Unexpected errors executing query, true, lOutput);
 
 std::ofstream errFile(errHandler.getErrorFile().c_str());
@@ -375,6 +376,7 @@
   errFile *lIter;
 }
 errFile  std::endl;
+#endif
 return false;
   }
 }
@@ -539,16 +541,23 @@
 // in the pathname of the result and error files.
 resultFilePath = fs::path(queries-theResultsDir) / (relativeQueryFile);
 resultFilePath = fs::change_extension(resultFilePath, (.res_ + tnoStr));
+
+if (fs::exists(resultFilePath))
+  fs::remove(resultFilePath);
+
+std::ofstream resFileStream;
+createPath(resultFilePath, resFileStream);
+
+#if 0
 errorFilePath = fs::path(queries-theResultsDir) / (relativeQueryFile);
 errorFilePath = fs::change_extension(errorFilePath, (.err_ + tnoStr));
 
-if (fs::exists(resultFilePath)) fs::remove(resultFilePath);
-if (fs::exists(errorFilePath)) fs::remove(errorFilePath);
+if (fs::exists(errorFilePath))
+  fs::remove(errorFilePath);
 
-std::ofstream resFileStream;
 std::ofstream errFileStream;
-createPath(resultFilePath, resFileStream);
 createPath(errorFilePath, errFileStream);
+#endif
 
 queries-theQueryLocks[queryNo]-unlock();
 
@@ -615,8 +624,6 @@
 //
 zorba::XQuery_t query = zorba-createQuery(errHandler);
 
-query-registerDiagnosticHandler(errHandler);
-
 //
 // Compile the query
 //

=== modified file 'test/rbkt/Queries/w3c_known_failures.txt'
--- test/rbkt/Queries/w3c_known_failures.txt	2013-07-02 09:58:23 +
+++ test/rbkt/Queries/w3c_known_failures.txt	2013-10-01 11:12:39 +
@@ -52,7 +52,6 @@
 test/rbkt/w3c_testsuite/XQuery/Functions/HigherOrder/Map/map-005
 test/rbkt/w3c_testsuite/XQuery/Functions/HigherOrder/Map/map-007
 test/rbkt/w3c_testsuite/XQuery/Functions/HigherOrder/Map/map-003
-test/rbkt/w3c_testsuite/XQuery/PathExpr/Steps/Axes/K2-Axes-86
 test/rbkt/w3c_testsuite/XQuery/PathExpr/Steps/Axes/K2-Axes-52
 test/rbkt/w3c_testsuite/XQuery/StaticTyping/STFunctions/ST-Data001
 test/rbkt/w3c_testsuite/XQuery/StaticTyping/STFLWORExpr/ST-PITest-02

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


Re: [Zorba-coders] [Merge] lp:~zorba-coders/zorba/threads into lp:zorba

2013-10-01 Thread Markos Zaharioudakis
Review: Approve


-- 
https://code.launchpad.net/~zorba-coders/zorba/threads/+merge/188554
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


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

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

Commit message:
Added/fixed some comments for SequenceType.

Requested reviews:
  Markos Zaharioudakis (markos-za)

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

Added/fixed some comments for SequenceType.

-- 
https://code.launchpad.net/~zorba-coders/zorba/markos-scratch/+merge/188000
Your team Zorba Coders is subscribed to branch lp:zorba.
=== modified file 'include/zorba/typeident.h'
--- include/zorba/typeident.h	2013-09-26 20:20:24 +
+++ include/zorba/typeident.h	2013-09-27 09:23:49 +
@@ -85,13 +85,18 @@
   static SequenceType createItemType(Quantifier q = QUANT_ONE);
 
   /**
-   * \brief Create an AtomicOrUnion type with quantifier
+   * \brief Create a generalized atomic type (see
+   * http://www.w3.org/TR/xquery-30/#dt-generalized-atomic-type ) with quantifier
*
-   * An AtomicOrUnion type is specified simply as a QName, which may identify
-   * an XMLSchema builtin atomic type or a user-defined atomic or union type.
+   * A generalized atomic type is specified simply as a QName, which may identify
+   * an XMLSchema builtin atomic type or a user-defined atomic or pure union type.
* In the case of user-defined types, the QName must be among the in-scope
* type names of a given static context. Otherwise, for builtin types, the
* given sctx may be NULL.
+   *
+   * If the given QName (uri and local name pair) does not specify a generalized
+   * atomic type among the in-scope type names of a given static context, an
+   * invalid SequenceType is returned.
*/
   static SequenceType createAtomicOrUnionType(
   const StaticContext_t sctx,
@@ -128,12 +133,18 @@
   bool nillable,
   Quantifier quant = QUANT_ONE);
 
+  /**
+   *
+   */
   static SequenceType createSchemaElementType(
   const StaticContext_t sctx,
   const String uri,
   const String localName,
   Quantifier quant = QUANT_ONE);
   
+  /**
+   *
+   */
   static SequenceType createAttributeType(
   const StaticContext_t sctx,
   const String nodeUri,
@@ -142,29 +153,59 @@
   const String contentTypeLocalName,
   Quantifier quant = QUANT_ONE);
 
+  /**
+   *
+   */
   static SequenceType createSchemaAttributeType(
   const StaticContext_t sctx,
   const String uri,
   const String localName,
   Quantifier quant = QUANT_ONE);
   
+  /**
+   *
+   */
   static SequenceType createPIType(Quantifier q = QUANT_ONE);
 
+  /**
+   *
+   */
   static SequenceType createTextType(Quantifier q = QUANT_ONE);
 
+  /**
+   *
+   */
   static SequenceType createCommentType(Quantifier q = QUANT_ONE);
 
+  /**
+   *
+   */
   static SequenceType createNamespaceType(Quantifier q = QUANT_ONE);
 
+  /**
+   *
+   */
   static SequenceType createJSONItemType(Quantifier q = QUANT_ONE);
 
+  /**
+   *
+   */
   static SequenceType createJSONObjectType(Quantifier q = QUANT_ONE);
 
+  /**
+   *
+   */
   static SequenceType createJSONArrayType(Quantifier q = QUANT_ONE);
 
  public:
+  /**
+   * Constructor for an invalid (NULL) type.
+   */
   SequenceType();
 
+  /**
+   * Copy constructor
+   */
   SequenceType(const SequenceType other);
 
   /**
@@ -173,7 +214,7 @@
   ~SequenceType();
 
   /**
-   *
+   * Returns true if this a valid (non-NULL) type; otherwise, returns false.
*/
   bool isValid() const;
 
@@ -188,29 +229,32 @@
   Quantifier getQuantifier() const;
 
   /**
-   * If this is an atomic or union type, this method returns the URI of
+   * If this is a generalized atomic type, this method returns the URI of
* the type name. For other kinds of types, an empty string is returned.
*/
   String getTypeUri() const;
 
   /**
-   * If this is an atomic or union type, this method returns the local part of
+   * If this is a generalized atomic type, this method returns the local part of
* the type name. For other kinds of types, an empty string is returned.
*/
   String getTypeLocalName() const;
 
   /**
* If this is an element() or attribute() type that contains a NodeName,
-   * this method returns the URI of that NodeName. In all other cases, an
-   * empty string is returned.
+   * this method returns the URI of that NodeName. If this is a schema-element(N)
+   * or schema-attribute(N) type, the method returns the URI of N. In all other
+   * cases, an empty string is returned.
*/
   String getNodeUri() const;
 
   /**
* If this is an element() or attribute() type that contains a NodeName,
-   * this method returns the URI of that NodeName. If this is a 
-   * processing-instruction() that contains a TargetName, that TargetName is
-   * returned. In all other cases, an empty string is returned.
+   * this method returns the local part of that NodeName. If this is a
+   * schema-element(N) or schema-attribute(N) type, the method returns the
+   * local part of N. If this is a processing

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

2013-09-27 Thread Markos Zaharioudakis
Review: Approve


-- 
https://code.launchpad.net/~zorba-coders/zorba/markos-scratch/+merge/188000
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


[Zorba-coders] [Merge] lp:~zorba-coders/zorba/bug-archiver into lp:zorba

2013-09-26 Thread Markos Zaharioudakis
Markos Zaharioudakis has proposed merging lp:~zorba-coders/zorba/bug-archiver 
into lp:zorba.

Commit message:
1. Fixed plan serializer bug: no more only_for_eval fields
2. invoke() can also be used to invoke function items. 


Requested reviews:
  Markos Zaharioudakis (markos-za)

For more details, see:
https://code.launchpad.net/~zorba-coders/zorba/bug-archiver/+merge/187699

1. Fixed plan serializer bug: no more only_for_eval fields
2. invoke() can also be used to invoke function items. 
-- 
https://code.launchpad.net/~zorba-coders/zorba/bug-archiver/+merge/187699
Your team Zorba Coders is subscribed to branch lp:zorba.
=== modified file 'modules/zorba-query/zorba-query.xq'
--- modules/zorba-query/zorba-query.xq	2013-08-14 06:22:00 +
+++ modules/zorba-query/zorba-query.xq	2013-09-26 09:43:49 +
@@ -456,12 +456,3 @@
 declare function zq:load-from-query-plan($plan as xs:base64Binary,
   $resolver as item()?, $mapper as item()?) as xs:anyURI external;
 
-(:~
- : pInternal helper function. Only necessary because of incomplete HOF
- : support in Zorba./p
- :)
-declare %private function zq:hof-invoker($hof as item(),
-  $ns as xs:string, $entity as xs:string) as item()*
-{
-   $hof($ns, $entity)
-};

=== modified file 'modules/zorba-query/zorba-query.xq.src/zorba-query.cpp'
--- modules/zorba-query/zorba-query.xq.src/zorba-query.cpp	2013-09-19 20:47:26 +
+++ modules/zorba-query/zorba-query.xq.src/zorba-query.cpp	2013-09-26 09:43:49 +
@@ -22,8 +22,8 @@
 /***
 
 /
-zorba::ExternalFunction*
-ZorbaQueryModule::getExternalFunction(const zorba::String localName)
+zorba::ExternalFunction* ZorbaQueryModule::getExternalFunction(
+const zorba::String localName)
 {
   FuncMap_t::iterator lIte = theFunctions.find(localName);
 
@@ -102,7 +102,7 @@
 
 
 /***
-
+  Invoked from static_context::~static_context()
 /
 void ZorbaQueryModule::destroy() 
 {
@@ -231,7 +231,9 @@
 /***
 
 /
-void ZorbaQueryFunction::throwError(const char *err_localname, const std::string aErrorMessage)
+void ZorbaQueryFunction::throwError(
+const char *err_localname,
+const std::string aErrorMessage)
 {
   String errNS(ZORBA_QUERY_MODULE_NAMESPACE);
   String errName(err_localname);
@@ -356,18 +358,12 @@
   
   //construct the arguments for the url resolver
   std::vectorItemSequence_t lArgs;
-  ItemSequence_t lSeq0 = new SingletonItemSequence(theFunction);
   ItemSequence_t lSeq1 = new SingletonItemSequence(ZorbaQueryModule::getItemFactory()-createString(aUri));
   ItemSequence_t lSeq2 = new SingletonItemSequence(ZorbaQueryModule::getItemFactory()-createString(lDataKind));
-  lArgs.push_back(lSeq0);
   lArgs.push_back(lSeq1);
   lArgs.push_back(lSeq2);
 
-  //invoke the HOF helper function using the arguments generated
-  Item lHofHelper = ZorbaQueryModule::getItemFactory()-
-  createQName(http://zorba.io/modules/zorba-query;, zq, hof-invoker);
-
-  ItemSequence_t lResult = theCtx-invoke(lHofHelper, lArgs);
+  ItemSequence_t lResult = theCtx-invoke(theFunction, lArgs);
   
   //Check if the result is an empty sequence by creating an Iterator, this is
   // cheaper than serializing the result and then checking if it was empty.
@@ -406,18 +402,12 @@
 
   //construct the arguments for the url resolver
   std::vectorItemSequence_t lArgs;
-  ItemSequence_t lSeq0 = new SingletonItemSequence(theFunction);
   ItemSequence_t lSeq1 = new SingletonItemSequence(ZorbaQueryModule::getItemFactory()-createString(aUrl));
   ItemSequence_t lSeq2 = new SingletonItemSequence(ZorbaQueryModule::getItemFactory()-createString(lDataKind));
-  lArgs.push_back(lSeq0);
   lArgs.push_back(lSeq1);
   lArgs.push_back(lSeq2);
   
-  //invoke the HOF helper function using the arguments generated
-  Item lHofHelper = ZorbaQueryModule::getItemFactory()-
-  createQName(http://zorba.io/modules/zorba-query;, zq, hof-invoker);
-
-  ItemSequence_t lResult = theCtx-invoke(lHofHelper, lArgs);
+  ItemSequence_t lResult = theCtx-invoke(theFunction, lArgs);
 
   // Check if the result is an empty sequence by creating an Iterator, this is
   // cheaper than serializing the result and then checking if it was empty.
@@ -460,8 +450,10 @@
   DynamicContext* lDynCtx = const_castDynamicContext*(aDctx);
   StaticContext_t lSctxChild = aSctx-createChildContext();

-  QueryMap* lQueryMap;
-  if (!(lQueryMap = dynamic_castQueryMap*(lDynCtx-getExternalFunctionParameter(zqQueryMap
+  QueryMap* lQueryMap =
+  dynamic_castQueryMap*(lDynCtx-getExternalFunctionParameter(zqQueryMap));
+
+  if (!lQueryMap

Re: [Zorba-coders] [Merge] lp:~zorba-coders/zorba/bug-archiver into lp:zorba

2013-09-26 Thread Markos Zaharioudakis
Review: Approve


-- 
https://code.launchpad.net/~zorba-coders/zorba/bug-archiver/+merge/187699
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


[Zorba-coders] [Merge] lp:~zorba-coders/zorba/bug-archiver into lp:zorba

2013-09-26 Thread Markos Zaharioudakis
The proposal to merge lp:~zorba-coders/zorba/bug-archiver into lp:zorba has 
been updated.

Status: Needs review = Approved

For more details, see:
https://code.launchpad.net/~zorba-coders/zorba/bug-archiver/+merge/187699
-- 
https://code.launchpad.net/~zorba-coders/zorba/bug-archiver/+merge/187699
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


[Zorba-coders] [Merge] lp:~zorba-coders/zorba/threads into lp:zorba

2013-09-26 Thread Markos Zaharioudakis
The proposal to merge lp:~zorba-coders/zorba/threads into lp:zorba has been 
updated.

Description changed to:

1. Adding Xereces mutex for multi-thread safety
2. parse-xml() function will not use cached document

For more details, see:
https://code.launchpad.net/~zorba-coders/zorba/threads/+merge/187178
-- 
https://code.launchpad.net/~zorba-coders/zorba/threads/+merge/187178
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


[Zorba-coders] [Merge] lp:~zorba-coders/zorba/threads into lp:zorba

2013-09-26 Thread Markos Zaharioudakis
The proposal to merge lp:~zorba-coders/zorba/threads into lp:zorba has been 
updated.

Commit Message changed to:

1. Adding Xereces mutex for multi-thread safety
2. parse-xml() function will not use cached document

For more details, see:
https://code.launchpad.net/~zorba-coders/zorba/threads/+merge/187178
-- 
https://code.launchpad.net/~zorba-coders/zorba/threads/+merge/187178
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


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

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

Commit message:
added comments and getContentType() method to SequenceType class

Requested reviews:
  Markos Zaharioudakis (markos-za)

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

added comments and getContentType() method to SequenceType class
-- 
https://code.launchpad.net/~zorba-coders/zorba/markos-scratch/+merge/187917
Your team Zorba Coders is subscribed to branch lp:zorba.
=== modified file 'include/zorba/typeident.h'
--- include/zorba/typeident.h	2013-09-16 09:08:27 +
+++ include/zorba/typeident.h	2013-09-26 20:59:19 +
@@ -35,10 +35,6 @@
  * SequenceType may be returned by methods of Zorba's C++ API. The class also
  * provides static methods to create instances of SequenceType, which can then
  * be passed as arguments to other methods of Zorba's C++ API.
- *
- * Note: This class is reference counted. When writing multi-threaded clients,
- * it is the responibility of the client code to synchronize assignments to the
- * SmartPtr holding this object.
  */
 class ZORBA_DLL_PUBLIC SequenceType
 {
@@ -51,18 +47,18 @@
 FUNCTION_TYPE,// function(*) and subtypes
 STRUCTURED_ITEM_TYPE, // structured-item()
 NODE_TYPE,// node()
-DOCUMENT_TYPE,
-ELEMENT_TYPE,
-SCHEMA_ELEMENT_TYPE,
-ATTRIBUTE_TYPE,
-SCHEMA_ATTRIBUTE_TYPE,
-PI_TYPE,
-TEXT_TYPE,
-COMMENT_TYPE,
-NAMESPACE_TYPE,
-JSON_ITEM_TYPE,
-JSON_OBJECT_TYPE,
-JSON_ARRAY_TYPE,
+DOCUMENT_TYPE,// document-node() and subtypes
+ELEMENT_TYPE, // element() and subtypes
+SCHEMA_ELEMENT_TYPE,  // schema-element() and subtypes
+ATTRIBUTE_TYPE,   // attribute() and subtypes
+SCHEMA_ATTRIBUTE_TYPE,// schema-attribute() and subtypes
+PI_TYPE,  // processing-instruction() and subtypes
+TEXT_TYPE,// text()
+COMMENT_TYPE, // comment()
+NAMESPACE_TYPE,   // namespace-node()
+JSON_ITEM_TYPE,   // json-item()
+JSON_OBJECT_TYPE, // object()
+JSON_ARRAY_TYPE,  // array()
 INVALID_TYPE
   } Kind;
   
@@ -176,28 +172,88 @@
*/
   ~SequenceType();
 
+  /**
+   *
+   */
   bool isValid() const;
 
+  /**
+   *
+   */
   Kind getKind() const;
 
+  /**
+   *
+   */
   Quantifier getQuantifier() const;
 
+  /**
+   * If this is an atomic or union type, this method returns the URI of
+   * the type name. For other kinds of types, an empty string is returned.
+   */
   String getTypeUri() const;
 
+  /**
+   * If this is an atomic or union type, this method returns the local part of
+   * the type name. For other kinds of types, an empty string is returned.
+   */
   String getTypeLocalName() const;
 
+  /**
+   * If this is an element() or attribute() type that contains a NodeName,
+   * this method returns the URI of that NodeName. In all other cases, an
+   * empty string is returned.
+   */
   String getNodeUri() const;
 
+  /**
+   * If this is an element() or attribute() type that contains a NodeName,
+   * this method returns the URI of that NodeName. If this is a 
+   * processing-instruction() that contains a TargetName, that TargetName is
+   * returned. In all other cases, an empty string is returned.
+   */
   String getNodeLocalName() const;
 
+  /**
+   * If this is an element() or attribute() type that does not contain a
+   * NodeName, this method returns true. In all other cases, false is returned.
+   */
   bool isWildcard() const;
 
+  /**
+   * If this is an document-node() type that contains an embedded element()
+   * type, this method returns the embedded element() type. In all other cases,
+   * an invalid SequenceType is returned.
+   */
+  SequenceType getContentType() const;
+
+  /**
+   * If this is an element() or attribute() type that contains a TypeName, this
+   * method returns the URI of that TypeName. If this is a schema-element(N) or
+   * schema-attribute(N) type, the method returns the URI of the XMLSchema type
+   * associated with the global element or attribute declaration N. In all other
+   * cases, it returns an empty string.
+   */
   String getContentTypeUri() const;
 
+  /**
+   * If this is an element() or attribute() type that contains a TypeName, this
+   * method returns the local name of that TypeName. If this is a schema-element(N)
+   * or schema-attribute(N) type, the method returns the local name of the
+   * XMLSchema type associated with the global element or attribute declaration N.
+   * In all other cases, it returns an empty string.
+   */
   String getContentTypeLocalName() const;
 
+  /**
+   * Return true if this type is a schema-element() or schema-attribute() type,
+   * Otherwise return false.
+   */
   bool isSchemaTest() const;
 
+  /**
+   *
+   */
   std::ostream emit(std::ostream) const

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

2013-09-26 Thread Markos Zaharioudakis
Review: Approve


-- 
https://code.launchpad.net/~zorba-coders/zorba/markos-scratch/+merge/187917
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


[Zorba-coders] [Merge] lp:~zorba-coders/zorba/threads into lp:zorba

2013-09-24 Thread Markos Zaharioudakis
Markos Zaharioudakis has proposed merging lp:~zorba-coders/zorba/threads into 
lp:zorba.

Commit message:
Adding Xereces mutex for multi-thread safety

Requested reviews:
  Markos Zaharioudakis (markos-za)

For more details, see:
https://code.launchpad.net/~zorba-coders/zorba/threads/+merge/187178

Adding Xereces mutex for multi-thread safety
-- 
https://code.launchpad.net/~zorba-coders/zorba/threads/+merge/187178
Your team Zorba Coders is subscribed to branch lp:zorba.
=== modified file 'src/system/globalenv.cpp'
--- src/system/globalenv.cpp	2013-09-19 16:47:08 +
+++ src/system/globalenv.cpp	2013-09-24 09:51:29 +
@@ -96,7 +96,7 @@
 
   ZORBA_FATAL(store != NULL, Must provide store during zorba initialization);
 
-  m_globalEnv-m_store = store;
+  m_globalEnv-theStore = store;
 
   m_globalEnv-theRootTypeManager = new RootTypeManager;
   RCHelper::addReference(m_globalEnv-theRootTypeManager);
@@ -169,7 +169,7 @@
 
   AnnotationInternal::destroyBuiltIn();
 
-  m_globalEnv-m_store = NULL;
+  m_globalEnv-theStore = NULL;
 
   // we shutdown icu
   // again it is important to mention this in the documentation
@@ -206,7 +206,7 @@
 /
 GlobalEnvironment::GlobalEnvironment()
   :
-  m_store(0), 
+  theStore(0), 
   theRootTypeManager(NULL),
   theRootStaticContext(0),
   m_compilerSubSys(0)
@@ -310,19 +310,19 @@
 
 store::Store GlobalEnvironment::getStore()
 {
-  return *m_store;
+  return *theStore;
 }
 
 
 store::ItemFactory* GlobalEnvironment::getItemFactory()
 {
-  return m_store-getItemFactory();
+  return theStore-getItemFactory();
 }
 
 
 store::IteratorFactory* GlobalEnvironment::getIteratorFactory()
 {
-  return m_store-getIteratorFactory();
+  return theStore-getIteratorFactory();
 }
 
 

=== modified file 'src/system/globalenv.h'
--- src/system/globalenv.h	2013-09-17 21:12:49 +
+++ src/system/globalenv.h	2013-09-24 09:51:29 +
@@ -61,7 +61,7 @@
   static GlobalEnvironment* m_globalEnv;
 
 private:
-  store::Store* m_store;
+  store::Store* theStore;
 
   RootTypeManager * theRootTypeManager;
 

=== modified file 'src/types/casting.cpp'
--- src/types/casting.cpp	2013-09-17 21:12:49 +
+++ src/types/casting.cpp	2013-09-24 09:51:29 +
@@ -2657,7 +2657,8 @@
 
   if (!targetType-isAtomicOne())
   {
-if ( throw_on_error ) {
+if ( throw_on_error )
+{
   RAISE_ERROR(err::XPST0051, loc,
   ERROR_PARAMS(ZED(XPST0051_Atomic_2), targetType));
 }
@@ -2700,9 +2701,11 @@
   {
 CastFunc castFunc = theCastMatrix[theMapping[sourceTypeCode]]
   [theMapping[targetTypeCode]];
-if (castFunc == 0) {
+if (castFunc == 0)
+{
   if ( throw_on_error )
 throwXPTY0004Exception(errInfo);
+
   return false;
 }
 
@@ -3202,7 +3205,7 @@
 TypeManager* tm)
 {
 #ifndef ZORBA_NO_XMLSCHEMA
-  if (targetType-type_kind() == XQType::USER_DEFINED_KIND )
+  if (targetType-type_kind() == XQType::USER_DEFINED_KIND)
   {
 const UserDefinedXQType* udt = static_castconst UserDefinedXQType*(targetType);
 if (!udt-isComplex())
@@ -3254,20 +3257,19 @@
 /
 bool GenericCast::isCastable(
 const zstring str,
-const XQType* aTargetType,
+const XQType* targetType,
 TypeManager* tm)
 {
 #ifndef ZORBA_NO_XMLSCHEMA
-  if (aTargetType-type_kind() == XQType::USER_DEFINED_KIND )
+  if (targetType-type_kind() == XQType::USER_DEFINED_KIND )
   {
-const UserDefinedXQType* udt = static_castconst UserDefinedXQType*(aTargetType);
+const UserDefinedXQType* udt = static_castconst UserDefinedXQType*(targetType);
 if (!udt-isComplex())
 {
   tm-initializeSchema();
 
   return tm-getSchema()-
- isCastableUserSimpleTypes(str,
-   udt-getBaseType().getp());
+ isCastableUserSimpleTypes(str, udt-getBaseType().getp());
 }
   }
 #endif // ZORBA_NO_XMLSCHEMA
@@ -3276,8 +3278,9 @@
 
   xqtref_t lSourceType = rtm.STRING_TYPE_ONE;
 
-  TypeConstants::castable_t lIsCastable = TypeOps::castability(*lSourceType,
-   *aTargetType);
+  TypeConstants::castable_t lIsCastable =
+  TypeOps::castability(*lSourceType, *targetType);
+
   switch(lIsCastable)
   {
   case TypeConstants::NOT_CASTABLE:
@@ -3292,7 +3295,7 @@
 {
   store::Item_t dummy;
   zstring copyStr = str;
-  return castStringToAtomic(dummy, copyStr, aTargetType, tm, NULL, QueryLoc::null, false);
+  return castStringToAtomic(dummy, copyStr, targetType, tm, NULL, QueryLoc::null, false);
 }
 catch (ZorbaException const)
 {

=== modified file 'src/types/root_typemanager.h'
--- src/types/root_typemanager.h	2013-06-15 02:57:08 +
+++ src/types/root_typemanager.h	2013-09-24 09:51:29 +
@@ -18,9

Re: [Zorba-coders] [Merge] lp:~zorba-coders/zorba/threads into lp:zorba

2013-09-24 Thread Markos Zaharioudakis
Review: Approve


-- 
https://code.launchpad.net/~zorba-coders/zorba/threads/+merge/187178
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


[Zorba-coders] [Merge] lp:~zorba-coders/zorba/threads into lp:zorba

2013-09-24 Thread Markos Zaharioudakis
The proposal to merge lp:~zorba-coders/zorba/threads into lp:zorba has been 
updated.

Status: Needs review = Approved

For more details, see:
https://code.launchpad.net/~zorba-coders/zorba/threads/+merge/187178
-- 
https://code.launchpad.net/~zorba-coders/zorba/threads/+merge/187178
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


Re: [Zorba-coders] [Merge] lp:~zorba-coders/zorba/threads into lp:zorba

2013-09-19 Thread Markos Zaharioudakis
Review: Approve


-- 
https://code.launchpad.net/~zorba-coders/zorba/threads/+merge/186514
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


Re: [Zorba-coders] [Merge] lp:~zorba-coders/zorba/type-api into lp:zorba

2013-09-16 Thread Markos Zaharioudakis
Review: Approve


-- 
https://code.launchpad.net/~zorba-coders/zorba/type-api/+merge/169278
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


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

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

Commit message:
cleanup + new test

Requested reviews:
  Markos Zaharioudakis (markos-za)

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

cleanup + new test

-- 
https://code.launchpad.net/~zorba-coders/zorba/markos-scratch/+merge/185216
Your team Zorba Coders is subscribed to branch lp:zorba.
=== modified file 'src/compiler/expression/expr.cpp'
--- src/compiler/expression/expr.cpp	2013-05-15 23:22:01 +
+++ src/compiler/expression/expr.cpp	2013-09-12 08:26:43 +
@@ -806,6 +806,9 @@
   theInput(input)
 {
   compute_scripting_kind();
+
+  if (theInput-get_expr_kind() == var_expr_kind)
+static_castvar_expr*(theInput)-add_ref();
 }
 
 

=== modified file 'src/compiler/translator/translator.cpp'
--- src/compiler/translator/translator.cpp	2013-09-12 07:54:03 +
+++ src/compiler/translator/translator.cpp	2013-09-12 08:26:43 +
@@ -1669,13 +1669,10 @@
 argVars.push_back(argVar);
 
 expr* arg = CREATE(wrapper)(theRootSctx, theUDF, loc, argVar);
-argVar-add_ref();
 arg = normalize_fo_arg(i, arg, inlineUDF.get(), loc);
 arguments.push_back(arg);
   }
 
-  fiSubstVar-add_ref();
-
   expr* body = 
   CREATE(dynamic_function_invocation)(theRootSctx,
   theUDF,
@@ -1938,8 +1935,6 @@
 // compute the size of the input seq
 expr* varWrapper = CREATE(wrapper)(theRootSctx, theUDF, loc, lcInputVar);
 
-lcInputVar-add_ref();
-
 fo_expr* countExpr = CREATE(fo)(theRootSctx,
 theUDF,
 loc,
@@ -6617,18 +6612,12 @@
   expr* valueExpr = pop_nodestack();
 
   if (varType != NULL)
-valueExpr = theExprManager-create_treat_expr(theRootSctx,
-  theUDF,
-  loc,
-  valueExpr,
-  varType,
-  TREAT_TYPE_MATCH);
+valueExpr = CREATE(treat)(theRootSctx, theUDF, loc,
+  valueExpr,
+  varType,
+  TREAT_TYPE_MATCH);
 
-  push_nodestack(theExprManager-create_var_set_expr(theRootSctx,
- theUDF,
- loc,
- ve,
- valueExpr));
+  push_nodestack(CREATE(var_set)(theRootSctx, theUDF, loc, ve, valueExpr));
 
   theAssignedVars.back().push_back(ve);
 }
@@ -7636,8 +7625,6 @@
 
   inputExpr = CREATE(wrapper)(theRootSctx, theUDF, specLoc, inputExpr);
 
-  var-getVar()-add_ref();
-
   inputExpr = wrap_in_atomization(inputExpr);
 
   inputExpr = wrap_in_type_match(inputExpr,
@@ -7687,10 +7674,7 @@
 
 bind_var(ngVar, theSctx);
 
-expr* inputExpr =
-theExprManager-create_wrapper_expr(theRootSctx, theUDF, loc, inputVar);
-
-inputVar-add_ref();
+expr* inputExpr = CREATE(wrapper)(theRootSctx, theUDF, loc, inputVar);
 
 nongrouping_rebind.push_back(std::pairexpr*, var_expr*(inputExpr, ngVar));
   }
@@ -10357,8 +10341,6 @@
   relpath_expr* predPathExpr = CREATE(relpath)(theRootSctx, theUDF, loc);
   predPathExpr-add_back(CREATE(wrapper)(theRootSctx, theUDF, loc, fcOuterDot-get_var()));
 
-  fcOuterDot-get_var()-add_ref();
-
   predPathExpr-add_back(axisExpr);
 
   expr* predInputExpr = predPathExpr;
@@ -11331,8 +11313,6 @@
 throw;
   }
 
-  ve-add_ref();
-
   if (ve-get_kind() == var_expr::prolog_var)
   {
 TypeManager* tm = CTX_TM;
@@ -11405,8 +11385,6 @@
 }
   }
 
-  dotVar-add_ref();
-
   return CREATE(wrapper)(theRootSctx, theUDF, loc, dotVar);
 }
 
@@ -11426,8 +11404,6 @@
 }
   }
 
-  posVar-add_ref();
-
   return CREATE(wrapper)(theRootSctx, theUDF, loc, posVar);
 }
 
@@ -11447,8 +11423,6 @@
 }
   }
 
-  sizeVar-add_ref();
-
   return CREATE(wrapper)(theRootSctx, theUDF, loc, sizeVar);
 }
 
@@ -12353,8 +12327,6 @@
 std::vectorexpr* fncall_args;
 fncall_args.push_back(CREATE(wrapper)(theRootSctx, theUDF, loc, seq_fc-get_var()));
 
-seq_fc-get_var()-add_ref();
-
 expr* dynamic_fncall = 
 CREATE(dynamic_function_invocation)(theRootSctx, theUDF, loc,
 arguments[1],
@@ -12384,8 +12356,6 @@
 std::vectorexpr* fncall_args;
 fncall_args.push_back(CREATE(wrapper)(theRootSctx, theUDF, loc, seq_fc-get_var()));
 
-seq_fc-get_var()-add_ref();
-
 expr* dynamic_fncall =
 CREATE(dynamic_function_invocation)(theRootSctx, theUDF, loc,
 arguments[1],
@@ -12568,8 +12538,6 @@
 
 sourceExpr = CREATE(wrapper)(theRootSctx, theUDF, loc, fc-get_var());
 
-fc-get_var

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

2013-09-12 Thread Markos Zaharioudakis
Review: Approve


-- 
https://code.launchpad.net/~zorba-coders/zorba/markos-scratch/+merge/185216
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


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

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

Commit message:
fixed bug #1223313

Requested reviews:
  Markos Zaharioudakis (markos-za)

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

fixed bug #1223313
-- 
https://code.launchpad.net/~zorba-coders/zorba/markos-scratch/+merge/185228
Your team Zorba Coders is subscribed to branch lp:zorba.
=== modified file 'src/compiler/translator/translator.cpp'
--- src/compiler/translator/translator.cpp	2013-09-12 08:25:47 +
+++ src/compiler/translator/translator.cpp	2013-09-12 09:55:43 +
@@ -10870,8 +10870,6 @@
 {
   accessorExpr =
   generate_fn_body(BUILTIN_FUNC(OP_ZORBA_MULTI_ARRAY_LOOKUP_2), args, loc);
-
-  pop_scope();
 }
 else
 {
@@ -10879,6 +10877,8 @@
   generate_fn_body(BUILTIN_FUNC(OP_ZORBA_SINGLE_ARRAY_LOOKUP_2), args, loc);
 }
 
+pop_scope();
+
 push_nodestack(accessorExpr);
 
 return;

=== added file 'test/rbkt/ExpQueryResults/zorba/jsoniq/member_05.xml.res'
=== added file 'test/rbkt/Queries/zorba/jsoniq/member_05.xq'
--- test/rbkt/Queries/zorba/jsoniq/member_05.xq	1970-01-01 00:00:00 +
+++ test/rbkt/Queries/zorba/jsoniq/member_05.xq	2013-09-12 09:55:43 +
@@ -0,0 +1,1 @@
+()[[1]][[1]]

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


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

2013-09-11 Thread Markos Zaharioudakis
Review: Approve


-- 
https://code.launchpad.net/~zorba-coders/zorba/markos-scratch/+merge/185014
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


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

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

Commit message:
More aggressive eliminationof unused LET variables

Requested reviews:
  Markos Zaharioudakis (markos-za)

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

More aggressive eliminationof unused LET variables
-- 
https://code.launchpad.net/~zorba-coders/zorba/markos-scratch/+merge/185014
Your team Zorba Coders is subscribed to branch lp:zorba.
=== modified file 'ChangeLog'
--- ChangeLog	2013-08-21 10:25:42 +
+++ ChangeLog	2013-09-11 10:39:49 +
@@ -36,6 +36,7 @@
   * Optimized implementation of function caching and removed the restriction
 on the return type.
   * No node ordering/distinct required for self axis.
+  * More aggressive eliminationof unused LET variables
 
 Bug Fixes/Other Changes:
   * Fixed bug #1117952 (Improve XML error output format)

=== modified file 'src/compiler/expression/expr_base.h'
--- src/compiler/expression/expr_base.h	2013-05-29 04:17:01 +
+++ src/compiler/expression/expr_base.h	2013-09-11 10:39:49 +
@@ -234,6 +234,8 @@
 
   unsigned short get_scripting_detail() const { return theScriptingKind; }
 
+  void set_scripting_detail(unsigned short k) { theScriptingKind = k; }
+
   bool is_updating() const;
 
   bool is_sequential() const;
@@ -246,8 +248,6 @@
 
   void set_not_exiting();
 
-  void adjustSequential();
-
   void checkScriptingKind() const;
 
   void compute_return_type(bool deep, bool* modified);

=== modified file 'src/compiler/rewriter/rules/flwor_rules.cpp'
--- src/compiler/rewriter/rules/flwor_rules.cpp	2013-08-09 10:23:10 +
+++ src/compiler/rewriter/rules/flwor_rules.cpp	2013-09-11 10:39:49 +
@@ -566,7 +566,8 @@
 
   if (safe  numRefs == 0)
   {
-if (varDomExpr-isNonDiscardable() || !isSafeVar)
+if (varDomExpr-get_function_kind() == FunctionConsts::OP_CREATE_INTERNAL_INDEX_2 ||
+!isSafeVar)
 {
   return false;
 }

=== modified file 'src/compiler/xqddf/value_index.cpp'
--- src/compiler/xqddf/value_index.cpp	2013-05-31 01:47:24 +
+++ src/compiler/xqddf/value_index.cpp	2013-09-11 10:39:49 +
@@ -569,7 +569,7 @@
 
 expr* keyClone = theKeyExprs[i]-clone(udf, subst);
 
-keyClone-setNonDiscardable(ANNOTATION_TRUE_FIXED);
+keyClone-set_scripting_detail(SEQUENTIAL_FUNC_EXPR);
 
 const QueryLoc keyloc = keyClone-get_loc();
 

=== modified file 'src/functions/func_index_ddl.h'
--- src/functions/func_index_ddl.h	2013-02-07 17:24:36 +
+++ src/functions/func_index_ddl.h	2013-09-11 10:39:49 +
@@ -45,10 +45,15 @@
   {
   }
 
-  unsigned short getScriptingKind() const { return SIMPLE_EXPR; }
-
   bool accessesDynCtx() const { return true; }
 
+  unsigned short getScriptingKind() const 
+  {
+// Although the index creation will be applied immediately, we should
+// NOT mark this function as sequential.
+return SIMPLE_EXPR;
+  }
+
   bool mustCopyInputNodes(expr* fo, csize input) const { return false; }
 
   BoolAnnotationValue ignoresSortedNodes(expr* fo, csize input) const 

=== modified file 'test/rbkt/ExpCompilerResults/IterPlan/zorba/hashjoins/idx5.iter'
--- test/rbkt/ExpCompilerResults/IterPlan/zorba/hashjoins/idx5.iter	2013-02-07 17:24:36 +
+++ test/rbkt/ExpCompilerResults/IterPlan/zorba/hashjoins/idx5.iter	2013-09-11 10:39:49 +
@@ -19,40 +19,6 @@
   SingletonIterator value=xs:QName(,,tests)/
 /ElementIterator
   /CtxVarDeclareIterator
-  flwor::FLWORIterator
-LetVariable name=test_old materialize=true
-  flwor::FLWORIterator
-ForVariable name=$$context-item
-  CtxVarIterator varid=4 varname=tests varkind=global/
-/ForVariable
-WhereClause
-  FnBooleanIterator
-TypedValueCompareIterator_STRING
-  PromoteIterator type=xs:anyAtomicType
-FnDataIterator
-  ChildAxisIterator test kind=match_text_test qname=* typename=* nill allowed=0
-ForVarIterator varname=$$context-item/
-  /ChildAxisIterator
-/FnDataIterator
-  /PromoteIterator
-  PromoteIterator type=xs:anyAtomicType
-FnDataIterator
-  ChildAxisIterator test kind=match_text_test qname=* typename=* nill allowed=0
-CtxVarIterator varid=4 varname=tests varkind=global/
-  /ChildAxisIterator
-/FnDataIterator
-  /PromoteIterator
-/TypedValueCompareIterator_STRING
-  /FnBooleanIterator
-/WhereClause
-ReturnClause
-  ForVarIterator varname=$$context-item/
-/ReturnClause
-  /flwor::FLWORIterator
-/LetVariable
-ReturnClause
-  SingletonIterator value=xs:integer(1)/
-/ReturnClause
-  /flwor::FLWORIterator
+  SingletonIterator value=xs:integer(1)/
 /SequentialIterator
 

=== modified file 'test/rbkt/ExpCompilerResults

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

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

Commit message:
removed depracated fetchmethod from xmldatamanager

Requested reviews:
  Markos Zaharioudakis (markos-za)

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

removed depracated fetchmethod from xmldatamanager
-- 
https://code.launchpad.net/~zorba-coders/zorba/markos-scratch/+merge/184518
Your team Zorba Coders is subscribed to branch lp:zorba.
=== modified file 'include/zorba/xmldatamanager.h'
--- include/zorba/xmldatamanager.h	2013-08-06 08:41:26 +
+++ include/zorba/xmldatamanager.h	2013-09-09 08:51:29 +
@@ -186,13 +186,6 @@
   const String aBaseURI,
   ParseOptions aOptions) const = 0;
 
-  /** \brief Fetches an resource refered to by the given URI.
-   *
-   * @deprecated this function has been replaced by StaticContext::fetch.
-   */
-  virtual Item
-  fetch(const String aURI) const = 0;
-
   /** \brief Register a DiagnosticHandler to which errors occuring during the
* management of documents and collections are reported.
*

=== modified file 'src/api/xmldatamanagerimpl.cpp'
--- src/api/xmldatamanagerimpl.cpp	2013-08-06 08:41:26 +
+++ src/api/xmldatamanagerimpl.cpp	2013-09-09 08:51:29 +
@@ -110,7 +110,6 @@
   Zorba_CompilerHints_t lHints;
   std::ostringstream lProlog;
   lProlog
- import module namespace d = '  static_context::ZORBA_FETCH_FN_NS   ';
  import module namespace x = '  static_context::ZORBA_XML_FN_NS  ';
  import schema namespace opt = '  static_context::ZORBA_XML_FN_OPTIONS_NS  ';;
 
@@ -355,33 +354,6 @@
 /***
 
 /
-Item XmlDataManagerImpl::fetch(const String aURI) const
-{
-  ZORBA_DM_TRY
-  {
-Item lQName = theFactory-createQName(static_context::ZORBA_FETCH_FN_NS,
-  content);
-
-// create a streamable string item
-std::vectorItemSequence_t lArgs;
-lArgs.push_back(
-new SingletonItemSequence(theFactory-createString(aURI)));
-
-ItemSequence_t lSeq = theContext-invoke(lQName, lArgs);
-Iterator_t lIter = lSeq-getIterator();
-lIter-open();
-Item lRes;
-lIter-next(lRes);
-return lRes;
-  }
-  ZORBA_DM_CATCH
-  return 0;
-}
-
-
-/***
-
-/
 void XmlDataManagerImpl::registerDiagnosticHandler(DiagnosticHandler* aDiagnosticHandler)
 {
   theContext = new StaticContextImpl(aDiagnosticHandler);

=== modified file 'src/api/xmldatamanagerimpl.h'
--- src/api/xmldatamanagerimpl.h	2013-08-06 08:41:26 +
+++ src/api/xmldatamanagerimpl.h	2013-09-09 08:51:29 +
@@ -85,8 +85,6 @@
   const String aBaseURI,
   ParseOptions aOptions) const;
 
-  Item fetch(const String aURI) const;
-
   void registerDiagnosticHandler(DiagnosticHandler* aDiagnosticHandler);
 
 #ifndef ZORBA_NO_FULL_TEXT

=== modified file 'src/context/static_context.cpp'
--- src/context/static_context.cpp	2013-09-02 20:43:22 +
+++ src/context/static_context.cpp	2013-09-09 08:51:29 +
@@ -263,7 +263,7 @@
 ar  lURI;
 ar.set_is_temp_field(false);
 ar  dyn_loaded_module;
-ar  sctx;
+ar  theSctx;
   }
   else
   {
@@ -275,12 +275,12 @@
 ar  lURI;
 ar.set_is_temp_field(false);
 ar  dyn_loaded_module;
-ar  sctx;
+ar  theSctx;
 
 if (dyn_loaded_module)
 {
-  ZORBA_ASSERT(sctx);
-  module = GENV_DYNAMIC_LOADER-getExternalModule(lURI, *sctx);
+  ZORBA_ASSERT(theSctx);
+  module = GENV_DYNAMIC_LOADER-getExternalModule(lURI, *theSctx);
 
   // no way to get the module
   if (!module)
@@ -2951,7 +2951,7 @@
   ctx_module_t modinfo;
   modinfo.module = aModule;
   modinfo.dyn_loaded_module = aDynamicallyLoaded;
-  modinfo.sctx = this;
+  modinfo.theSctx = this;
 
   if (!theExternalModulesMap-insert(uri, modinfo))
   {

=== modified file 'src/context/static_context.h'
--- src/context/static_context.h	2013-08-24 23:38:45 +
+++ src/context/static_context.h	2013-09-09 08:51:29 +
@@ -473,7 +473,7 @@
   {
 ExternalModule * module;
 bool dyn_loaded_module;
-static_context * sctx;
+static_context * theSctx;
 
   public:
 SERIALIZABLE_CLASS(ctx_module_t)

=== modified file 'src/zorbaserialization/archiver_consts.h'
--- src/zorbaserialization/archiver_consts.h	2013-08-16 13:00:06 +
+++ src/zorbaserialization/archiver_consts.h	2013-09-09 08:51:29 +
@@ -36,7 +36,7 @@
   serialized when a pointer to it was encountered. In this case, during
   deserialization, the archiver will allocate the obj on the heap and fill-in
   its data members. If the kind is NORMAL, then the obj was serialized when the
-  objitself was encountered (e.g

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

2013-09-09 Thread Markos Zaharioudakis
Review: Approve


-- 
https://code.launchpad.net/~zorba-coders/zorba/markos-scratch/+merge/184518
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


Re: [Zorba-coders] [Merge] lp:~zorba-coders/zorba/bug-1026250 into lp:zorba

2013-08-30 Thread Markos Zaharioudakis
Review: Approve

I did not like very much the versioning solution for the collection deadlock. 
It certainly does not work with multi-threading. But this is not the only thing 
that is wrong for multi-threading, so I will approve.

I think a better solution would be that any dml:collection() function that is 
executed within a nonmaterialize pragma acquires the collection lock in 
exclussive mode. Of course that would require changes in the compiler, runtime, 
and store api.
-- 
https://code.launchpad.net/~zorba-coders/zorba/bug-1026250/+merge/138044
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


Re: [Zorba-coders] [Merge] lp:~zorba-coders/zorba/bug-1026250 into lp:zorba

2013-08-30 Thread Markos Zaharioudakis
Review: Approve

I did not like very much the versioning solution for the collection deadlock. 
It certainly does not work with multi-threading. But this is not the only thing 
that is wrong for multi-threading, so I will approve.

I think a better solution would be that any dml:collection() function that is 
executed within a nonmaterialize pragma acquires the collection lock in 
exclussive mode. Of course that would require changes in the compiler, runtime, 
and store api.
-- 
https://code.launchpad.net/~zorba-coders/zorba/bug-1026250/+merge/138044
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


Re: [Zorba-coders] [Merge] lp:~zorba-coders/zorba/use-dataguide into lp:zorba

2013-08-22 Thread Markos Zaharioudakis
1. The following query returns the wrong result:

jsoniq version 1.0;

declare variable $doc1 :=

  {
\foo\ :  { \name\ : \moto\, \price\ : 100 },
\boo\ :  { \name\ : \car\,  \price\ : 1000 }
  }
;

(
let $v := exactly-one(jn:parse-json($doc1))
return
  if ($v.foo.name eq moto)
  then
   $v
  else
   ()
).boo

2. You have now lost the dataguide that used to be produced in test 
dataguide-28.jq

-- 
https://code.launchpad.net/~zorba-coders/zorba/use-dataguide/+merge/176385
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


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

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

Commit message:
implicit iteration for jsoniq rename exprs

Requested reviews:
  Markos Zaharioudakis (markos-za)

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

implicit iteration for jsoniq rename exprs
-- 
https://code.launchpad.net/~zorba-coders/zorba/markos-scratch/+merge/181246
Your team Zorba Coders is subscribed to branch lp:zorba.
=== modified file 'ChangeLog'
--- ChangeLog	2013-08-14 16:34:05 +
+++ ChangeLog	2013-08-21 10:29:13 +
@@ -12,6 +12,16 @@
   * The grouping variable in a group by clause is now optional
   * New syntax for array lookup: expr1[[expr2]]
   * New jsoniq functions: jn:trim() and libjn:descendant-arrays()
+  * jsoniq extension: Object/array navigation allows item()* as the type of the
+input sequence (doing implicit iteration over the input sequence and skipping
+items that are not objects/arrays).
+  * jsoniq extension: Several of the jsoniq functions now allow item()* as the
+type of the input sequence (doing implicit iteration over the input sequence
+and skipping or simply propagating items that are not objects/arrays).
+  * jsoniq extension: implicit iteration is also done for jsoniq delete, renames,
+and value replacements.
+  * jsoniq extension: EBV on jsoniq items now returns true (instead of raising
+an error).
 
 Optimizations:
   * Implemented hoisting optimization for general FLWOR.
@@ -66,16 +76,9 @@
   * jn:keys function takes item()* as aparameter (instead of item())
   * Fixed bug #1189996 (Relocate some public API headers to util)
   * Fixed bug #1189790 (Update core module full-text)
-  * Object/array navigation allows item()* as the type of the input sequence
-(doing implicit iteration over the input sequence and skipping items
- that are not objects/arrays).
-  * Several of the jsoniq functions now allow item()* as the type of the input
-sequence (doing implicit iteration over the input sequence and skipping or
-simply propagating items that are not objects/arrays).
   * Bug fix: selector value in object/array navigation is always cast to
 string/integer
   * The function jn:is-null() has been removed.
-  * EBV on jsoniq items now returns true (instead of raising an error).
   * Removed from libjn module the functions that existed in the jn module as well.
   * Renamed xqxq module to zorba-query module(zq module).
 

=== modified file 'src/compiler/translator/translator.cpp'
--- src/compiler/translator/translator.cpp	2013-08-19 13:00:41 +
+++ src/compiler/translator/translator.cpp	2013-08-21 10:29:13 +
@@ -15291,19 +15291,19 @@
 
   std::vectorexpr* args(3);
 
-  args[0] = wrap_in_type_match(targetExpr,
-   theRTM.JSON_OBJECT_TYPE_ONE,
-   loc,
-   TREAT_JSONIQ_OBJECT_UPDATE_TARGET, // JNUP0008
-   NULL);
-
-  args[1] = wrap_in_type_promotion(nameExpr,
-   theRTM.STRING_TYPE_ONE,
-   PROMOTE_TYPE_PROMOTION);
-
-  args[2] = wrap_in_type_promotion(newNameExpr,
-   theRTM.STRING_TYPE_ONE,
-   PROMOTE_JSONIQ_OBJECT_SELECTOR); // JNUP0007
+  args[0] = targetExpr;
+
+  args[1] = create_cast_expr(nameExpr-get_loc(),
+ nameExpr,
+ theRTM.STRING_TYPE_ONE,
+ true,
+ true);
+
+  args[2] = create_cast_expr(newNameExpr-get_loc(),
+ newNameExpr,
+ theRTM.STRING_TYPE_ONE,
+ false,
+ true);
 
   fo_expr* updExpr = CREATE(fo)(theRootSctx,
 theUDF,

=== modified file 'src/functions/pregenerated/func_jsoniq_functions.cpp'
--- src/functions/pregenerated/func_jsoniq_functions.cpp	2013-08-19 13:00:41 +
+++ src/functions/pregenerated/func_jsoniq_functions.cpp	2013-08-21 10:29:13 +
@@ -504,8 +504,8 @@
   {
 DECL_WITH_KIND(sctx, op_zorba_json_rename,
 (createQName(http://zorba.io/internal/zorba-ops,,json-rename;), 
-GENV_TYPESYSTEM.JSON_OBJECT_TYPE_ONE, 
-GENV_TYPESYSTEM.STRING_TYPE_ONE, 
+GENV_TYPESYSTEM.ITEM_TYPE_STAR, 
+GENV_TYPESYSTEM.STRING_TYPE_QUESTION, 
 GENV_TYPESYSTEM.STRING_TYPE_ONE, 
 GENV_TYPESYSTEM.EMPTY_TYPE),
 FunctionConsts::OP_ZORBA_JSON_RENAME_3);

=== modified file 'src/runtime/json/jsoniq_functions_impl.cpp'
--- src/runtime/json/jsoniq_functions_impl.cpp	2013-08-19 13:00:41 +
+++ src/runtime/json/jsoniq_functions_impl.cpp	2013-08-21 10:29:13 +
@@ -1871,8 +1871,8 @@
 
 /***
   updating function op

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

2013-08-21 Thread Markos Zaharioudakis
Review: Approve


-- 
https://code.launchpad.net/~zorba-coders/zorba/markos-scratch/+merge/181246
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


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

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

Commit message:
implicit iteration for jsoniq delete and replace exprs

Requested reviews:
  Markos Zaharioudakis (markos-za)

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

implicit iteration for jsoniq delete and replace exprs
-- 
https://code.launchpad.net/~zorba-coders/zorba/markos-scratch/+merge/180865
Your team Zorba Coders is subscribed to branch lp:zorba.
=== modified file 'src/compiler/translator/translator.cpp'
--- src/compiler/translator/translator.cpp	2013-08-16 13:00:06 +
+++ src/compiler/translator/translator.cpp	2013-08-19 13:02:29 +
@@ -15199,7 +15199,7 @@
 
   PostfixExpr := PostfixExpr (( ArgList ))+
 
-  The parser also makes sure that each ArgList contains exactly one arg.
+  The parser also makes sure that the last ArgList contains exactly one arg.
 
   If there are N ArgLists, the last one is considered to be the selector expr
   and the PrimaryExpr together with the N-1 ArgLists constitute the target expr.
@@ -15215,26 +15215,18 @@
 {
   TRACE_VISIT_OUT();
 
-  expr* selExpr = pop_nodestack();
+  expr* selectorExpr = pop_nodestack();
   expr* targetExpr = pop_nodestack();
 
-  selExpr = wrap_in_type_promotion(selExpr,
-   theRTM.ANY_ATOMIC_TYPE_ONE,
-   PROMOTE_JSONIQ_SELECTOR, // JNUP0007
-   NULL);
-
-  targetExpr = wrap_in_type_match(targetExpr,
-  theRTM.JSON_ITEM_TYPE_ONE,
-  loc,
-  TREAT_JSONIQ_UPDATE_TARGET, // JNUP0008
-  NULL);
-
-  fo_expr* updExpr = theExprManager-
-  create_fo_expr(theRootSctx, theUDF,
- loc,
- BUILTIN_FUNC(OP_ZORBA_JSON_DELETE_2),
- targetExpr,
- selExpr);
+  selectorExpr = wrap_in_type_promotion(selectorExpr,
+theRTM.ANY_ATOMIC_TYPE_QUESTION,
+PROMOTE_TYPE_PROMOTION,
+NULL);
+
+  fo_expr* updExpr = CREATE(fo)(theRootSctx, theUDF, loc,
+BUILTIN_FUNC(OP_ZORBA_JSON_DELETE_2),
+targetExpr,
+selectorExpr);
 
   push_nodestack(updExpr);
 }
@@ -15255,32 +15247,25 @@
   TRACE_VISIT_OUT();
 
   expr* valueExpr = pop_nodestack();
-  expr* selExpr = pop_nodestack();
+  expr* selectorExpr = pop_nodestack();
   expr* targetExpr = pop_nodestack();
 
   std::vectorexpr* args(3);
 
-  args[0] = wrap_in_type_match(targetExpr,
-   theRTM.JSON_ITEM_TYPE_ONE,
-   loc,
-   TREAT_JSONIQ_UPDATE_TARGET, // JNUP0008
-   NULL);
+  args[0] = targetExpr;
 
-  args[1] = wrap_in_type_promotion(selExpr,
-   theRTM.ANY_ATOMIC_TYPE_ONE,
-   PROMOTE_JSONIQ_SELECTOR, // JNUP0007
+  args[1] = wrap_in_type_promotion(selectorExpr,
+   theRTM.ANY_ATOMIC_TYPE_QUESTION,
+   PROMOTE_TYPE_PROMOTION,
NULL);
 
-  args[2] = theExprManager-create_fo_expr(theRootSctx, theUDF,
-   valueExpr-get_loc(),
-   BUILTIN_FUNC(OP_ZORBA_JSON_BOX_1),
-   valueExpr);
+  args[2] = CREATE(fo)(theRootSctx, theUDF, valueExpr-get_loc(),
+   BUILTIN_FUNC(OP_ZORBA_JSON_BOX_1),
+   valueExpr);
 
-  fo_expr* updExpr = theExprManager-
-  create_fo_expr(theRootSctx, theUDF,
- loc,
- BUILTIN_FUNC(OP_ZORBA_JSON_REPLACE_VALUE_3),
- args);
+  fo_expr* updExpr = CREATE(fo)(theRootSctx, theUDF, loc,
+BUILTIN_FUNC(OP_ZORBA_JSON_REPLACE_VALUE_3),
+args);
 
   push_nodestack(updExpr);
 }
@@ -15314,7 +15299,7 @@
 
   args[1] = wrap_in_type_promotion(nameExpr,
theRTM.STRING_TYPE_ONE,
-   PROMOTE_JSONIQ_OBJECT_SELECTOR); // JNUP0007
+   PROMOTE_TYPE_PROMOTION);
 
   args[2] = wrap_in_type_promotion(newNameExpr,
theRTM.STRING_TYPE_ONE,

=== modified file 'src/functions/pregenerated/func_jsoniq_functions.cpp'
--- src/functions/pregenerated/func_jsoniq_functions.cpp	2013-08-16 16:05:18 +
+++ src/functions/pregenerated/func_jsoniq_functions.cpp	2013-08-19 13:02:29 +
@@ -173,7 +173,7 @@
   std::vectorPlanIter_t argv,
   expr ann) const
 {
-  return new JSONDeleteIterator(sctx, loc, argv);
+  return new

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

2013-08-19 Thread Markos Zaharioudakis
Review: Approve


-- 
https://code.launchpad.net/~zorba-coders/zorba/markos-scratch/+merge/180865
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


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

2013-08-16 Thread Markos Zaharioudakis
Review: Approve


-- 
https://code.launchpad.net/~zorba-coders/zorba/markos-scratch/+merge/180553
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


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

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

Commit message:
1. EBV on jsoniq items returns true instead of error
2. Updated signature (and implementation) of jn and libjn functions according 
to latest spec
3. Removed from libjn functions that were also in jn
4. Removed jn:json-doc function


Requested reviews:
  Markos Zaharioudakis (markos-za)

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

1. EBV on jsoniq items returns true instead of error
2. Updated signature (and implementation) of jn and libjn functions according 
to latest spec
3. Removed from libjn functions that were also in jn
4. Removed jn:json-doc function

-- 
https://code.launchpad.net/~zorba-coders/zorba/markos-scratch/+merge/180110
Your team Zorba Coders is subscribed to branch lp:zorba.
-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


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

2013-08-14 Thread Markos Zaharioudakis
Review: Approve


-- 
https://code.launchpad.net/~zorba-coders/zorba/markos-scratch/+merge/180110
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


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

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

Commit message:
removed jn:null() + allow empty seq as input to jn:size()

Requested reviews:
  Markos Zaharioudakis (markos-za)

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

removed jn:null() + allow empty seq as input to jn:size()
-- 
https://code.launchpad.net/~zorba-coders/zorba/markos-scratch/+merge/179692
Your team Zorba Coders is subscribed to branch lp:zorba.
=== modified file 'modules/org/jsoniq/www/functions.xq'
--- modules/org/jsoniq/www/functions.xq	2013-08-12 09:59:18 +
+++ modules/org/jsoniq/www/functions.xq	2013-08-12 12:50:29 +
@@ -215,7 +215,7 @@
  : @param $j A JSON Array.
  : @return The number of items in $j.
  :)
-declare function jn:size($j as array()) as xs:integer external;
+declare function jn:size($j as array()?) as xs:integer? external;
 
 
 (:~
@@ -260,14 +260,4 @@
 declare function jn:null() as js:null external;
 
 
-(:~
- : Tests whether the supplied atomic item is a JSON null.
- :
- : @param An atomic item.
- :
- : @return true if the item is of type js:null.
- :)
-declare function jn:is-null($i as xs:anyAtomicType) as xs:boolean external;
-
-
 

=== modified file 'src/functions/func_jsoniq_functions_impl.cpp'
--- src/functions/func_jsoniq_functions_impl.cpp	2013-08-09 10:23:10 +
+++ src/functions/func_jsoniq_functions_impl.cpp	2013-08-12 12:50:29 +
@@ -70,6 +70,18 @@
 /***
 
 /
+xqtref_t fn_jsoniq_size::getReturnType(const fo_expr* caller) const
+{
+  if (caller-get_arg(0)-get_return_type()-get_quantifier() == TypeConstants::QUANT_ONE)
+return GENV_TYPESYSTEM.INTEGER_TYPE_ONE;
+
+  return theSignature.returnType();
+}
+
+
+/***
+
+/
 PlanIter_t fn_jsoniq_keys::codegen(
   CompilerCB*,
   static_context* sctx,

=== modified file 'src/functions/pregenerated/func_jsoniq_functions.cpp'
--- src/functions/pregenerated/func_jsoniq_functions.cpp	2013-08-12 10:27:18 +
+++ src/functions/pregenerated/func_jsoniq_functions.cpp	2013-08-12 12:50:29 +
@@ -154,16 +154,6 @@
   return new JSONNullIterator(sctx, loc);
 }
 
-PlanIter_t fn_jsoniq_is_null::codegen(
-  CompilerCB*,
-  static_context* sctx,
-  const QueryLoc loc,
-  std::vectorPlanIter_t argv,
-  expr ann) const
-{
-  return new JSONIsNullIterator(sctx, loc, argv[0]);
-}
-
 PlanIter_t op_zorba_json_object_insert::codegen(
   CompilerCB*,
   static_context* sctx,
@@ -431,8 +421,8 @@
   {
 DECL_WITH_KIND(sctx, fn_jsoniq_size,
 (createQName(http://jsoniq.org/functions,,size;), 
-GENV_TYPESYSTEM.JSON_ARRAY_TYPE_ONE, 
-GENV_TYPESYSTEM.INTEGER_TYPE_ONE),
+GENV_TYPESYSTEM.JSON_ARRAY_TYPE_QUESTION, 
+GENV_TYPESYSTEM.INTEGER_TYPE_QUESTION),
 FunctionConsts::FN_JSONIQ_SIZE_1);
 
   }
@@ -464,18 +454,6 @@
 
 
   {
-DECL_WITH_KIND(sctx, fn_jsoniq_is_null,
-(createQName(http://jsoniq.org/functions,,is-null;), 
-GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_ONE, 
-GENV_TYPESYSTEM.BOOLEAN_TYPE_ONE),
-FunctionConsts::FN_JSONIQ_IS_NULL_1);
-
-  }
-
-
-
-
-  {
 DECL_WITH_KIND(sctx, op_zorba_json_object_insert,
 (createQName(http://zorba.io/internal/zorba-ops,,json-object-insert;), 
 GENV_TYPESYSTEM.JSON_OBJECT_TYPE_ONE, 

=== modified file 'src/functions/pregenerated/func_jsoniq_functions.h'
--- src/functions/pregenerated/func_jsoniq_functions.h	2013-08-09 10:23:10 +
+++ src/functions/pregenerated/func_jsoniq_functions.h	2013-08-12 12:50:29 +
@@ -287,6 +287,8 @@
 
   }
 
+  xqtref_t getReturnType(const fo_expr* caller) const;
+
   bool propagatesInputNodes(expr* fo, csize producer) const { return false; }
 
   bool mustCopyInputNodes(expr* fo, csize producer) const { return false; }
@@ -329,21 +331,6 @@
 };
 
 
-//fn-jsoniq:is-null
-class fn_jsoniq_is_null : public function
-{
-public:
-  fn_jsoniq_is_null(const signature sig, FunctionConsts::FunctionKind kind)
-: 
-function(sig, kind)
-  {
-
-  }
-
-  CODEGEN_DECL();
-};
-
-
 //op-zorba:json-object-insert
 class op_zorba_json_object_insert : public function
 {

=== modified file 'src/functions/pregenerated/function_enum.h'
--- src/functions/pregenerated/function_enum.h	2013-08-09 10:23:10 +
+++ src/functions/pregenerated/function_enum.h	2013-08-12 12:50:29 +
@@ -271,7 +271,6 @@
   FN_JSONIQ_SIZE_1,
   FN_JSONIQ_FLATTEN_1,
   FN_JSONIQ_NULL_0,
-  FN_JSONIQ_IS_NULL_1,
   OP_ZORBA_JSON_OBJECT_INSERT_2,
   OP_ZORBA_JSON_ARRAY_INSERT_3,
   OP_ZORBA_JSON_DELETE_2,

=== modified file 'src/runtime/json/jsoniq_functions_impl.cpp'
--- src/runtime/json/jsoniq_functions_impl.cpp	2013-08-09 10:23:10

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

2013-08-12 Thread Markos Zaharioudakis
Review: Approve


-- 
https://code.launchpad.net/~zorba-coders/zorba/markos-scratch/+merge/179692
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


[Zorba-coders] [Merge] lp:~zorba-coders/zorba/mz-couchbase-module into lp:zorba/couchbase-module

2013-08-12 Thread Markos Zaharioudakis
Markos Zaharioudakis has proposed merging 
lp:~zorba-coders/zorba/mz-couchbase-module into lp:zorba/couchbase-module.

Commit message:
jn:null() to be removed

Requested reviews:
  Markos Zaharioudakis (markos-za)

For more details, see:
https://code.launchpad.net/~zorba-coders/zorba/mz-couchbase-module/+merge/179700

jn:null() to be removed
-- 
https://code.launchpad.net/~zorba-coders/zorba/mz-couchbase-module/+merge/179700
Your team Zorba Coders is subscribed to branch lp:zorba/couchbase-module.
=== modified file 'test/Queries/couchbase_module/view.xq'
--- test/Queries/couchbase_module/view.xq	2013-03-24 05:25:54 +
+++ test/Queries/couchbase_module/view.xq	2013-08-12 13:26:30 +
@@ -15,5 +15,5 @@
 variable $data := cb:view($instance, $view-name, {stale : false});
 for $d in jn:members($data(rows))
 let $key := $d(key)
-where not(jn:is-null($key)) and $key 0
+where not($key instance of js:null) and $key 0
 return $d

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


Re: [Zorba-coders] [Merge] lp:~zorba-coders/zorba/mz-couchbase-module into lp:zorba/couchbase-module

2013-08-12 Thread Markos Zaharioudakis
Review: Approve


-- 
https://code.launchpad.net/~zorba-coders/zorba/mz-couchbase-module/+merge/179700
Your team Zorba Coders is subscribed to branch lp:zorba/couchbase-module.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


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

2013-08-09 Thread Markos Zaharioudakis
Review: Approve


-- 
https://code.launchpad.net/~zorba-coders/zorba/markos-scratch/+merge/179411
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


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

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

Commit message:
don't do unnecessary implicit iteration for jsoniq navigation

Requested reviews:
  Markos Zaharioudakis (markos-za)

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

don't do unnecessary implicit iteration for jsoniq navigation
-- 
https://code.launchpad.net/~zorba-coders/zorba/markos-scratch/+merge/179411
Your team Zorba Coders is subscribed to branch lp:zorba.
=== modified file 'modules/org/jsoniq/www/functions.xq'
--- modules/org/jsoniq/www/functions.xq	2013-06-19 14:19:40 +
+++ modules/org/jsoniq/www/functions.xq	2013-08-09 10:32:03 +
@@ -197,18 +197,6 @@
 
 
 (:~
- : Returns the value of a JSON Pair with a given name within a given JSON object.
- : If no such pair exists in the object, returns the empty sequence.
- :
- : @param $o A JSON Object.
- : @param $name The name of the pair whose value is to be retrieved
- : @return the value of specified pair within the given object, or the empty sequence.
- :)
-(: obsolete - use $o($name) instead :)
-declare function jn:value($o as item(), $name as item()?) as item()? external;
-
-
-(:~
  : Creates an object from the specified pairs of another given object. 
  : Specifically, for each name in $names, if the object $o has a pair with
  : that name, then a copy of that pair is included in the new object.
@@ -231,18 +219,6 @@
 
 
 (:~
- : Returns the member of an Array at the specified position (starting from 1).
- : If the position is out of bounds of the array, returns the empty sequence.
- :
- : @param $a A JSON Array.
- : @param $p The position in the array.
- : @return The member at the specified position, or empty sequence.
- :)
-(: obsolete - use $a($p) or $a[[$p]] instead :)
-declare function jn:member($a as item(), $p as item()?) as item()? external;
-
-
-(:~
  : Returns the items belonging to the arrays found inside a given sequence
  : of items. The items are returned in an implementation-defined order.
  :

=== modified file 'src/compiler/rewriter/rules/flwor_rules.cpp'
--- src/compiler/rewriter/rules/flwor_rules.cpp	2013-06-14 04:50:39 +
+++ src/compiler/rewriter/rules/flwor_rules.cpp	2013-08-09 10:32:03 +
@@ -462,7 +462,8 @@
   // since one value is still returned, count variables are changed to 1
   subst_vars(rCtx,
  static_castcount_clause*(clause)-get_var(),
- rCtx.theEM-create_const_expr(sctx, udf, loc, numeric_constsxs_integer::one()),
+ rCtx.theEM-create_const_expr(sctx, udf, loc,
+   numeric_constsxs_integer::one()),
  2);
 
   theFlwor-remove_clause(0);
@@ -537,7 +538,21 @@
   if (is_trivial_expr(varDomExpr))
   {
 numRefs = 2;
-return isSafeVar;
+
+if (isSafeVar)
+{
+  return true;
+}
+else
+{
+  expr* retExpr = theFlwor-get_return_expr();
+  xqtref_t type = retExpr-get_return_type_with_empty_input(var);
+
+  return TypeOps::is_equal(theFlwor-get_type_manager(),
+   *type,
+   *GENV_TYPESYSTEM.EMPTY_TYPE,
+   retExpr-get_loc());
+}
   }
 
   // If set to true, then it is unsafe to fold, but we may still be able to

=== modified file 'src/compiler/translator/translator.cpp'
--- src/compiler/translator/translator.cpp	2013-08-02 18:29:44 +
+++ src/compiler/translator/translator.cpp	2013-08-09 10:32:03 +
@@ -10843,7 +10843,7 @@
 args[1] = selectorExpr;
 
 expr* accessorExpr =
-generate_fn_body(BUILTIN_FUNC(FN_JSONIQ_MEMBER_2), args, loc);
+generate_fn_body(BUILTIN_FUNC(OP_ZORBA_ARRAY_MEMBER_2), args, loc);
 
 assert(accessorExpr-get_expr_kind() == fo_expr_kind);
 
@@ -10889,7 +10889,7 @@
   {
 fo_expr* pointExpr = 
 CREATE(fo)(sourceExpr-get_sctx(), theUDF, sourceExpr-get_loc(),
-   BUILTIN_FUNC(FN_JSONIQ_MEMBER_2),
+   BUILTIN_FUNC(OP_ZORBA_ARRAY_MEMBER_2),
arrayExpr,
predExpr);
 
@@ -11072,27 +11072,42 @@
 
   assert(selectExpr  objectExpr);
 
-  flwor_expr* flworExpr = wrap_expr_in_flwor(objectExpr, false);
-
-  for_clause* fc = static_castfor_clause*(flworExpr-get_clause(0));
-
-  expr* flworVarExpr = CREATE(wrapper)(theRootSctx, theUDF, loc, fc-get_var());
-
-  expr* accessorExpr;
-
-  std::vectorexpr* args(2);
-  args[0] = flworVarExpr;
-  args[1] = selectExpr;
-
-  accessorExpr = generate_fn_body(BUILTIN_FUNC(FN_JSONIQ_VALUE_2), args, loc);
-
-  assert(accessorExpr-get_expr_kind() == fo_expr_kind);
-
-  flworExpr-set_return_expr(accessorExpr);
-
-  pop_scope();
-
-  push_nodestack(flworExpr);
+  xqtref_t domainType = objectExpr-get_return_type();
+
+  if (domainType-max_card()  1)
+  {
+flwor_expr* flworExpr = wrap_expr_in_flwor

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

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

Commit message:
removed StaticContextImpl::checkInvokable() method == small optimization for 
invoke()

Requested reviews:
  Markos Zaharioudakis (markos-za)

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

removed StaticContextImpl::checkInvokable() method == small optimization for 
invoke()
-- 
https://code.launchpad.net/~zorba-coders/zorba/markos-scratch/+merge/178692
Your team Zorba Coders is subscribed to branch lp:zorba.
=== modified file 'bin/zorbacmd.cpp'
--- bin/zorbacmd.cpp	2013-08-05 11:24:53 +
+++ bin/zorbacmd.cpp	2013-08-06 08:48:31 +
@@ -904,13 +904,14 @@
   ItemSequence_t docsSeq = docMgr-availableDocuments();
   Iterator_t lIter = docsSeq-getIterator();
   lIter-open();
+
   Item uri;
   std::vectorItem docURIs;
-  while (lIter-next(uri)) 
+  while (docsIter-next(uri)) 
   {
 docURIs.push_back(uri);
   }
-  lIter-close();
+  docsIter-close();
 
   size_t numDocs = docURIs.size();
 

=== modified file 'doc/cxx/examples/datamanager.cpp'
--- doc/cxx/examples/datamanager.cpp	2013-08-05 11:24:53 +
+++ doc/cxx/examples/datamanager.cpp	2013-08-06 08:48:31 +
@@ -51,7 +51,7 @@
 Item lDoc = aDataManager-parseXML(lInStream);
 
 // (2) bind the document in the store using the DocumentManager
-DocumentManager* lDocMgr = aDataManager-getDocumentManager();
+DocumentManager_t lDocMgr = aZorba-getDocumentManager();
 lDocMgr-put(books.xml, lDoc);
 
 // (3) doc('books.xml') accesses the previously found document

=== modified file 'src/api/staticcontextimpl.cpp'
--- src/api/staticcontextimpl.cpp	2013-08-05 11:54:06 +
+++ src/api/staticcontextimpl.cpp	2013-08-06 08:48:31 +
@@ -962,6 +962,9 @@
 }
 
 
+/***
+
+/
 void
 StaticContextImpl::getFunctions(
 const String aFnNameUri,
@@ -992,6 +995,9 @@
 }
 
 
+/***
+
+/
 void
 StaticContextImpl::getFunctionAnnotations(
 const Item aQName,
@@ -1020,6 +1026,9 @@
 }
 
 
+/***
+
+/
 void
 StaticContextImpl::setContextItemStaticType(TypeIdentifier_t type)
 {
@@ -1032,6 +1041,9 @@
 }
 
 
+/***
+
+/
 TypeIdentifier_t
 StaticContextImpl::getContextItemStaticType() const
 {
@@ -1044,6 +1056,9 @@
 }
 
 
+/***
+
+/
 void
 StaticContextImpl::setTraceStream(std::ostream os)
 {
@@ -1051,6 +1066,9 @@
 }
 
 
+/***
+
+/
 void
 StaticContextImpl::resetTraceStream()
 {
@@ -1058,6 +1076,9 @@
 }
 
 
+/***
+
+/
 bool
 StaticContextImpl::getOption(const Item aQName, String aOptionValue) const
 {
@@ -1083,6 +1104,9 @@
 }
 
 
+/***
+
+/
 void
 StaticContextImpl::declareOption(const Item aQName, const String aOptionValue)
 {
@@ -1099,6 +1123,9 @@
 }
 
 
+/***
+
+/
 void StaticContextImpl::loadProlog(
 const String prolog,
 const Zorba_CompilerHints_t hints)
@@ -1119,6 +1146,9 @@
 }
 
 
+/***
+
+/
 static void
 toInternalPath(
 const std::vectorString aPublicStrings,
@@ -1140,6 +1170,9 @@
 }
 
 
+/***
+
+/
 static void
 toPublicPath(
 const std::vectorzstring aInternalStrings,
@@ -1153,6 +1186,9

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

2013-08-06 Thread Markos Zaharioudakis
The proposal to merge lp:~zorba-coders/zorba/markos-scratch into lp:zorba has 
been updated.

Commit Message changed to:

removed StaticContextImpl::checkInvokable() method == small optimization for 
invoke()
changed static base uri for root static context

For more details, see:
https://code.launchpad.net/~zorba-coders/zorba/markos-scratch/+merge/178692
-- 
https://code.launchpad.net/~zorba-coders/zorba/markos-scratch/+merge/178692
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


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

2013-08-06 Thread Markos Zaharioudakis
The proposal to merge lp:~zorba-coders/zorba/markos-scratch into lp:zorba has 
been updated.

Description changed to:

removed StaticContextImpl::checkInvokable() method == small optimization for 
invoke()
changed static base uri for root static context

For more details, see:
https://code.launchpad.net/~zorba-coders/zorba/markos-scratch/+merge/178692
-- 
https://code.launchpad.net/~zorba-coders/zorba/markos-scratch/+merge/178692
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


[Zorba-coders] [Merge] lp:~zorba-coders/zorba/threads into lp:zorba

2013-08-06 Thread Markos Zaharioudakis
Markos Zaharioudakis has proposed merging lp:~zorba-coders/zorba/threads into 
lp:zorba.

Commit message:
destroy the XmlDataManager before shuting down the store in zorbacmd

Requested reviews:
  Markos Zaharioudakis (markos-za)

For more details, see:
https://code.launchpad.net/~zorba-coders/zorba/threads/+merge/178750

destroy the XmlDataManager before shuting down the store in zorbacmd
-- 
https://code.launchpad.net/~zorba-coders/zorba/threads/+merge/178750
Your team Zorba Coders is subscribed to branch lp:zorba.
=== modified file 'bin/zorbacmd.cpp'
--- bin/zorbacmd.cpp	2013-08-06 09:10:25 +
+++ bin/zorbacmd.cpp	2013-08-06 13:26:52 +
@@ -1301,6 +1301,8 @@
   lAuditProvider-destroyConfiguration(config);
 #endif
 
+  xmlDataMgr = NULL;
+
   lZorbaInstance-shutdown();
   zorba::StoreManager::shutdownStore(store);
 

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


Re: [Zorba-coders] [Merge] lp:~zorba-coders/zorba/threads into lp:zorba

2013-08-06 Thread Markos Zaharioudakis
Review: Approve


-- 
https://code.launchpad.net/~zorba-coders/zorba/threads/+merge/178750
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


Re: [Zorba-coders] [Merge] lp:~zorba-coders/zorba/use-dataguide into lp:zorba

2013-08-05 Thread Markos Zaharioudakis
Review: Needs Fixing

1. The following query constructs the wrong dataguide (and returns the wrong 
result):

jsoniq version 1.0;

declare variable $doc1 :=

  {
\foo\ :  { \name\ : \moto\, \price\ : 100 },
\boo\ :  { \name\ : \car\,  \price\ : 1000 }
  }
;


let $v := exactly-one(jn:parse-json($doc1))
return
  if ($v.foo.name eq moto)
  then
   $v
  else
   ()

2. The following query does not construct any dataguide at all, although it 
should:

jsoniq version 1.0;

import module namespace ddl = 
http://www.zorba-xquery.com/modules/store/dynamic/collections/ddl;;
import module namespace dml = 
http://www.zorba-xquery.com/modules/store/dynamic/collections/dml;;

declare variable $test external := 1;

ddl:create(xs:QName(sales));
dml:insert-last(xs:QName(sales),
  ( { product :  { name : broiler,
 price : 100 
   },
  category1 : { category3 :
   { category4 : value4 }
   } 
}
  )
);


(
exactly-one
(
if ($test)
then
 dml:collection(xs:QName(sales))[1]
else
 dml:collection(xs:QName(sales))[2]
)
).category1


3. Window variables are not taken into account in getClauseVar

4. The implementation of the JsonDataguide rule does too much copying and 
allocations of dataguides. I have the feeling that this is not necessary. For 
example, what about the following approach? 
- There is only one dataguide_cb allocated per JsonDataguide application. It 
contains one entry for each json source encountered during the application of 
the rule.
- There is also a single map from expr* to std::vectorexpr*. The map contains 
one entry for each expr that may receive return json items coming from a json 
source. The value of the entry is the set of sources for the key expr.
I may be missing something, but if this works, it will eliminate all 
allocations and copies.


-- 
https://code.launchpad.net/~zorba-coders/zorba/use-dataguide/+merge/176385
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


Re: [Zorba-coders] [Merge] lp:~zorba-coders/zorba/use-dataguide into lp:zorba

2013-08-05 Thread Markos Zaharioudakis
Review: Needs Fixing

1. The following query constructs the wrong dataguide (and returns the wrong 
result):

jsoniq version 1.0;

declare variable $doc1 :=

  {
\foo\ :  { \name\ : \moto\, \price\ : 100 },
\boo\ :  { \name\ : \car\,  \price\ : 1000 }
  }
;


let $v := exactly-one(jn:parse-json($doc1))
return
  if ($v.foo.name eq moto)
  then
   $v
  else
   ()

2. The following query does not construct any dataguide at all, although it 
should:

jsoniq version 1.0;

import module namespace ddl = 
http://www.zorba-xquery.com/modules/store/dynamic/collections/ddl;;
import module namespace dml = 
http://www.zorba-xquery.com/modules/store/dynamic/collections/dml;;

declare variable $test external := 1;

ddl:create(xs:QName(sales));
dml:insert-last(xs:QName(sales),
  ( { product :  { name : broiler,
 price : 100 
   },
  category1 : { category3 :
   { category4 : value4 }
   } 
}
  )
);


(
exactly-one
(
if ($test)
then
 dml:collection(xs:QName(sales))[1]
else
 dml:collection(xs:QName(sales))[2]
)
).category1


3. Window variables are not taken into account in getClauseVar

4. The implementation of the JsonDataguide rule does too much copying and 
allocations of dataguides. I have the feeling that this is not necessary. For 
example, what about the following approach? 
- There is only one dataguide_cb allocated per JsonDataguide application. It 
contains one entry for each json source encountered during the application of 
the rule.
- There is also a single map from expr* to std::vectorexpr*. The map contains 
one entry for each expr that may receive return json items coming from a json 
source. The value of the entry is the set of sources for the key expr.
I may be missing something, but if this works, it will eliminate all 
allocations and copies.


-- 
https://code.launchpad.net/~zorba-coders/zorba/use-dataguide/+merge/176385
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


[Zorba-coders] [Merge] lp:~zorba-coders/zorba/threads into lp:zorba

2013-08-05 Thread Markos Zaharioudakis
The proposal to merge lp:~zorba-coders/zorba/threads into lp:zorba has been 
updated.

Commit Message changed to:

More work tawards thread-safe zorba:
1. XmlDataManager is not a singleton anymore
2. synchronize Item::getRefCount() method
3. fixed memory leak related to function annotations
4. removed 2 non-const global variables from locale
5. do not set annotations for builtin functions in the translator
6. make set_length() method a noop if this is the empty string
7. fixed a bug in StaticContext::validate()
8. datetime module is a pure builtin module
9. no stable ids for iterators in multi-threaded mode (for now at least)

For more details, see:
https://code.launchpad.net/~zorba-coders/zorba/threads/+merge/177897
-- 
https://code.launchpad.net/~zorba-coders/zorba/threads/+merge/177897
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


[Zorba-coders] [Merge] lp:~zorba-coders/zorba/threads into lp:zorba

2013-08-05 Thread Markos Zaharioudakis
The proposal to merge lp:~zorba-coders/zorba/threads into lp:zorba has been 
updated.

Commit Message changed to:

More work tawards thread-safe zorba:
1. XmlDataManager is not a singleton anymore
2. synchronize Item::getRefCount() method
3. fixed memory leak related to function annotations
4. removed 2 non-const global variables from locale
5. do not set annotations for builtin functions in the translator
6. make set_length() method a noop if this is the empty string
7. fixed a bug in StaticContext::validate()
8. datetime module is a pure builtin module
9. no stable ids for iterators in multi-threaded mode (for now at least)
10. bug fix in URI.cpp

For more details, see:
https://code.launchpad.net/~zorba-coders/zorba/threads/+merge/177897
-- 
https://code.launchpad.net/~zorba-coders/zorba/threads/+merge/177897
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


Re: [Zorba-coders] [Merge] lp:~zorba-coders/zorba/threads into lp:zorba

2013-08-05 Thread Markos Zaharioudakis
Review: Approve


-- 
https://code.launchpad.net/~zorba-coders/zorba/threads/+merge/177897
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


[Zorba-coders] [Merge] lp:~zorba-coders/zorba/threads into lp:zorba

2013-08-05 Thread Markos Zaharioudakis
The proposal to merge lp:~zorba-coders/zorba/threads into lp:zorba has been 
updated.

Description changed to:

More work tawards thread-safe zorba:
1. XmlDataManager is not a singleton anymore
2. synchronize Item::getRefCount() method
3. fixed memory leak related to function annotations
4. removed 2 non-const global variables from locale
5. do not set annotations for builtin functions in the translator
6. make set_length() method a noop if this is the empty string
7. fixed a bug in StaticContext::validate()
8. datetime module is a pure builtin module
9. no stable ids for iterators in multi-threaded mode (for now at least)
10. bug fix in URI.cpp

For more details, see:
https://code.launchpad.net/~zorba-coders/zorba/threads/+merge/177897
-- 
https://code.launchpad.net/~zorba-coders/zorba/threads/+merge/177897
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


[Zorba-coders] [Merge] lp:~zorba-coders/zorba/threads into lp:zorba

2013-08-05 Thread Markos Zaharioudakis
The proposal to merge lp:~zorba-coders/zorba/threads into lp:zorba has been 
updated.

Commit Message changed to:

More work tawards thread-safe zorba:
1. XmlDataManager is not a singleton anymore
2. synchronize Item::getRefCount() method
3. fixed memory leak related to function annotations
4. removed 2 non-const global variables from locale
5. do not set annotations for builtin functions in the translator
6. make set_length() method a noop if this is the empty string
7. fixed a bug in StaticContext::validate()
8. datetime module is a pure builtin module
9. no stable ids for iterators in multi-threaded mode (for now at least)
10. bug fix in URI.cpp
11. thread-safe MAPM

For more details, see:
https://code.launchpad.net/~zorba-coders/zorba/threads/+merge/177897
-- 
https://code.launchpad.net/~zorba-coders/zorba/threads/+merge/177897
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


[Zorba-coders] [Merge] lp:~zorba-coders/zorba/threads into lp:zorba

2013-08-05 Thread Markos Zaharioudakis
The proposal to merge lp:~zorba-coders/zorba/threads into lp:zorba has been 
updated.

Description changed to:

More work tawards thread-safe zorba:
1. XmlDataManager is not a singleton anymore
2. synchronize Item::getRefCount() method
3. fixed memory leak related to function annotations
4. removed 2 non-const global variables from locale
5. do not set annotations for builtin functions in the translator
6. make set_length() method a noop if this is the empty string
7. fixed a bug in StaticContext::validate()
8. datetime module is a pure builtin module
9. no stable ids for iterators in multi-threaded mode (for now at least)
10. bug fix in URI.cpp
11. thread-safe MAPM

For more details, see:
https://code.launchpad.net/~zorba-coders/zorba/threads/+merge/177897
-- 
https://code.launchpad.net/~zorba-coders/zorba/threads/+merge/177897
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


[Zorba-coders] [Merge] lp:~zorba-coders/zorba/mz-htlm-module into lp:zorba/html-module

2013-08-05 Thread Markos Zaharioudakis
Markos Zaharioudakis has proposed merging lp:~zorba-coders/zorba/mz-htlm-module 
into lp:zorba/html-module.

Commit message:
XmlDataManager is not a singleton anymore

Requested reviews:
  Markos Zaharioudakis (markos-za)

For more details, see:
https://code.launchpad.net/~zorba-coders/zorba/mz-htlm-module/+merge/178573

XmlDataManager is not a singleton anymore
-- 
https://code.launchpad.net/~zorba-coders/zorba/mz-htlm-module/+merge/178573
Your team Zorba Coders is subscribed to branch lp:zorba/html-module.
-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


Re: [Zorba-coders] [Merge] lp:~zorba-coders/zorba/mz-htlm-module into lp:zorba/html-module

2013-08-05 Thread Markos Zaharioudakis
Review: Approve


-- 
https://code.launchpad.net/~zorba-coders/zorba/mz-htlm-module/+merge/178573
Your team Zorba Coders is subscribed to branch lp:zorba/html-module.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


[Zorba-coders] [Merge] lp:~zorba-coders/zorba/mz-htlm-module into lp:zorba/html-module

2013-08-05 Thread Markos Zaharioudakis
Markos Zaharioudakis has proposed merging lp:~zorba-coders/zorba/mz-htlm-module 
into lp:zorba/html-module.

Commit message:
XmlDataManager is not a singleton any more

Requested reviews:
  Markos Zaharioudakis (markos-za)

For more details, see:
https://code.launchpad.net/~zorba-coders/zorba/mz-htlm-module/+merge/178585

XmlDataManager is not a singleton any more
-- 
https://code.launchpad.net/~zorba-coders/zorba/mz-htlm-module/+merge/178585
Your team Zorba Coders is subscribed to branch lp:zorba/html-module.
=== modified file 'src/html.xq.src/html.cpp'
--- src/html.xq.src/html.cpp	2011-10-06 07:40:17 +
+++ src/html.xq.src/html.cpp	2013-08-05 15:23:31 +
@@ -25,8 +25,8 @@
 
 namespace zorba
 {
-  namespace htmlmodule
-  {
+namespace htmlmodule
+{
 
 //*
 //*
@@ -36,72 +36,80 @@
 {
 }
 
+
 ItemSequence_t
 ParseFunction::evaluate(
-  const ExternalFunction::Arguments_t aArgs,
-  const StaticContext*  aSctxCtx,
-  const DynamicContext* aDynCtx) const
-  {
-std::auto_ptrstd::istringstream iss;
-std::istream *is;
-String docString;
-Item lStringItem, lOptionsItem;
-
-if (aArgs.size() = 1)
-{
-  Iterator_t lArg0Iter = aArgs[0]-getIterator();
-  lArg0Iter-open();
-  lArg0Iter-next(lStringItem);
-  lArg0Iter-close();
-}
-
-if ( lStringItem.isStreamable() )
-{
-  //
-  // The iss auto_ptr can NOT be used since it will delete the stream that,
-  // in this case, is a data member inside another object and not dynamically
-  // allocated.
-  //
-  // We can't replace iss with is since we still need the auto_ptr for
-  // the case when the result is not streamable.
-  //
-  is = lStringItem.getStream();
-}
-else
-{
-  docString = lStringItem.getStringValue();
-  iss.reset (new std::istringstream(docString.c_str()));
-  is = iss.get();
-}
-
-if (aArgs.size() == 2)
-{
-  Iterator_t lArg1Iter = aArgs[1]-getIterator();
-  lArg1Iter-open();
-  lArg1Iter-next(lOptionsItem);
-  lArg1Iter-close();
-}
-
-return ItemSequence_t(new SingletonItemSequence(
-  createHtmlItem( *is , lOptionsItem )));
-  }
-
-//*
-//*
-
-ItemFactory* HtmlModule::theFactory = 0;
+const ExternalFunction::Arguments_t aArgs,
+const StaticContext* aSctxCtx,
+const DynamicContext* aDynCtx) const
+{
+  std::auto_ptrstd::istringstream iss;
+  std::istream *is;
+  String docString;
+  Item lStringItem, lOptionsItem;
+
+  if (aArgs.size() = 1)
+  {
+Iterator_t lArg0Iter = aArgs[0]-getIterator();
+lArg0Iter-open();
+lArg0Iter-next(lStringItem);
+lArg0Iter-close();
+  }
+
+  if ( lStringItem.isStreamable() )
+  {
+//
+// The iss auto_ptr can NOT be used since it will delete the stream that,
+// in this case, is a data member inside another object and not dynamically
+// allocated.
+//
+// We can't replace iss with is since we still need the auto_ptr for
+// the case when the result is not streamable.
+//
+is = lStringItem.getStream();
+  }
+  else
+  {
+docString = lStringItem.getStringValue();
+iss.reset (new std::istringstream(docString.c_str()));
+is = iss.get();
+  }
+  
+  if (aArgs.size() == 2)
+  {
+Iterator_t lArg1Iter = aArgs[1]-getIterator();
+lArg1Iter-open();
+lArg1Iter-next(lOptionsItem);
+lArg1Iter-close();
+  }
+  
+  return ItemSequence_t(
+  new SingletonItemSequence(createHtmlItem(*is, lOptionsItem)));
+}
+
+
+//*
+//*
+HtmlModule::HtmlModule()
+{
+  Zorba* engine = Zorba::getInstance(0);
+
+  theFactory = engine-getItemFactory();
+}
+
 
 HtmlModule::~HtmlModule()
 {
   for ( FuncMap_t::const_iterator lIter = theFunctions.begin();
 lIter != theFunctions.end();
 ++lIter)
-   {
- delete lIter-second;
-   }
-   theFunctions.clear();
+  {
+delete lIter-second;
+  }
+  theFunctions.clear();
 }
 
+
 ExternalFunction*
 HtmlModule::getExternalFunction(const String aLocalname)
 {
@@ -127,6 +135,8 @@
   }
   delete this;
 }
+
+
 //*
 //*
 

=== modified file 'src/html.xq.src/html.h'
--- src/html.xq.src/html.h	2011-10-06 07:40:17 +
+++ src/html.xq.src/html.h	2013-08-05 15:23:31 +
@@ -26,87 +26,85 @@
 {
   namespace htmlmodule

Re: [Zorba-coders] [Merge] lp:~zorba-coders/zorba/mz-htlm-module into lp:zorba/html-module

2013-08-05 Thread Markos Zaharioudakis
Review: Approve


-- 
https://code.launchpad.net/~zorba-coders/zorba/mz-htlm-module/+merge/178585
Your team Zorba Coders is subscribed to branch lp:zorba/html-module.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


[Zorba-coders] [Merge] lp:~zorba-coders/zorba/threads into lp:zorba

2013-08-05 Thread Markos Zaharioudakis
Markos Zaharioudakis has proposed merging lp:~zorba-coders/zorba/threads into 
lp:zorba.

Commit message:
re-enabled html module

Requested reviews:
  Markos Zaharioudakis (markos-za)

For more details, see:
https://code.launchpad.net/~zorba-coders/zorba/threads/+merge/178588

re-enabled html module
-- 
https://code.launchpad.net/~zorba-coders/zorba/threads/+merge/178588
Your team Zorba Coders is subscribed to branch lp:zorba.
=== modified file 'modules/ExternalModules.conf'
--- modules/ExternalModules.conf	2013-08-05 14:54:22 +
+++ modules/ExternalModules.conf	2013-08-05 15:33:33 +
@@ -35,7 +35,7 @@
 geo bzr  lp:zorba/geo-module
 geoproj bzr  lp:zorba/geoproj-module  zorba-2.9
 graphvizbzr  lp:zorba/graphviz-module zorba-2.9
-#htmlbzr  lp:zorba/html-module zorba-2.9
+htmlbzr  lp:zorba/html-module zorba-2.9
 http-client bzr  lp:zorba/http-client-module  zorba-2.9
 image   bzr  lp:zorba/image-module
 jdbcbzr  lp:zorba/jdbc-module

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


Re: [Zorba-coders] [Merge] lp:~zorba-coders/zorba/threads into lp:zorba

2013-08-05 Thread Markos Zaharioudakis
Review: Approve


-- 
https://code.launchpad.net/~zorba-coders/zorba/threads/+merge/178588
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


[Zorba-coders] [Merge] lp:~zorba-coders/zorba/mz-lang-module into lp:zorba/languages-module

2013-08-05 Thread Markos Zaharioudakis
Markos Zaharioudakis has proposed merging lp:~zorba-coders/zorba/mz-lang-module 
into lp:zorba/languages-module.

Commit message:
XmlDataManager  is not a singleton any more

Requested reviews:
  Markos Zaharioudakis (markos-za)

For more details, see:
https://code.launchpad.net/~zorba-coders/zorba/mz-lang-module/+merge/178610

XmlDataManager  is not a singleton any more
-- 
https://code.launchpad.net/~zorba-coders/zorba/mz-lang-module/+merge/178610
Your team Zorba Coders is subscribed to branch lp:zorba/languages-module.
=== modified file 'src/com/zorba-xquery/www/modules/languages/xslt.xq.src/xslt.cpp'
--- src/com/zorba-xquery/www/modules/languages/xslt.xq.src/xslt.cpp	2011-08-13 00:08:39 +
+++ src/com/zorba-xquery/www/modules/languages/xslt.xq.src/xslt.cpp	2013-08-05 17:27:25 +
@@ -123,7 +123,7 @@
   
   std::istringstream iss( resStr.c_str() ); 
   
-  XmlDataManager* lDM = Zorba::getInstance(0)-getXmlDataManager();
+  XmlDataManager_t lDM = Zorba::getInstance(0)-getXmlDataManager();
   try
   {
 return ItemSequence_t(new SingletonItemSequence(lDM-parseXML(iss)));   

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


Re: [Zorba-coders] [Merge] lp:~zorba-coders/zorba/mz-lang-module into lp:zorba/languages-module

2013-08-05 Thread Markos Zaharioudakis
Review: Approve


-- 
https://code.launchpad.net/~zorba-coders/zorba/mz-lang-module/+merge/178610
Your team Zorba Coders is subscribed to branch lp:zorba/languages-module.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


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

2013-08-05 Thread Markos Zaharioudakis
Markos Zaharioudakis has proposed merging 
lp:~zorba-coders/zorba/mz-schema-tools-module into 
lp:~zorba-coders/zorba/schema-tools-module.

Commit message:
XmlDataManager  is not a singleton anymore

Requested reviews:
  Markos Zaharioudakis (markos-za)

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

XmlDataManager  is not a singleton anymore
-- 
https://code.launchpad.net/~zorba-coders/zorba/mz-schema-tools-module/+merge/178618
Your team Zorba Coders is subscribed to branch 
lp:~zorba-coders/zorba/schema-tools-module.
=== modified file 'CMakeLists.txt'
--- CMakeLists.txt	2012-06-14 12:39:26 +
+++ CMakeLists.txt	2013-08-05 18:21:28 +
@@ -17,12 +17,15 @@
 PROJECT (zorba_schema-tools_module)
 
 FIND_PACKAGE (zorba_util-jvm_module QUIET)
+INCLUDE (${zorba_util-jvm_module_USE_FILE})
 
 IF (zorba_util-jvm_module_FOUND)
-  ZORBA_FIND_JNI()
-  FIND_PACKAGE(Java)
   FIND_PACKAGE (Zorba REQUIRED HINTS ${ZORBA_BUILD_DIR})
   INCLUDE (${Zorba_USE_FILE})
+
+  SET_CMAKE_MODULE_PATH ()
+  FIND_PACKAGE(JNI)
+  FIND_PACKAGE(Java)
   
   IF (JNI_FOUND)
 INCLUDE_DIRECTORIES (${zorba_util-jvm_module_INCLUDE_DIRS})

=== added file 'cmake_modules/FindJNI.cmake'
--- cmake_modules/FindJNI.cmake	1970-01-01 00:00:00 +
+++ cmake_modules/FindJNI.cmake	2013-08-05 18:21:28 +
@@ -0,0 +1,310 @@
+# - Find JNI java libraries.
+# This module finds if Java is installed and determines where the
+# include files and libraries are. It also determines what the name of
+# the library is. This code sets the following variables:
+#   
+#  JNI_INCLUDE_DIRS  = the include dirs to use
+#  JNI_LIBRARIES = the libraries to use
+#  JNI_FOUND = TRUE if JNI headers and libraries were found.
+#  JAVA_AWT_LIBRARY  = the path to the jawt library
+#  JAVA_JVM_LIBRARY  = the path to the jvm library
+#  JAVA_INCLUDE_PATH = the include path to jni.h
+#  JAVA_INCLUDE_PATH2= the include path to jni_md.h
+#  JAVA_AWT_INCLUDE_PATH = the include path to jawt.h
+#
+
+#=
+# Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice,
+# this list of conditions and the following disclaimer.
+# 
+# * Redistributions in binary form must reproduce the above copyright notice,
+# this list of conditions and the following disclaimer in the documentation 
+# and/or other materials provided with the distribution.
+# 
+# * Neither the names of Kitware, Inc., the Insight Software Consortium, nor 
+# the names of their contributors may be used to endorse or promote products 
+# derived from this software without specific prior written  permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS AS IS 
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 
+# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 
+# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
+# POSSIBILITY OF SUCH DAMAGE.
+#=
+
+# Expand {libarch} occurences to java_libarch subdirectory(-ies) and set ${_var}
+MACRO(java_append_library_directories _var)
+# Determine java arch-specific library subdir
+# Mostly based on openjdk/jdk/make/common/shared/Platform.gmk as of openjdk
+# 1.6.0_18 + icedtea patches. However, it would be much better to base the
+# guess on the first part of the GNU config.guess platform triplet.
+IF(CMAKE_SYSTEM_PROCESSOR STREQUAL x86_64)
+SET(_java_libarch amd64)
+ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES ^i.86$)
+SET(_java_libarch i386)
+ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES ^alpha)
+SET(_java_libarch alpha)
+ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES ^arm)
+# Subdir is arm for both big-endian (arm) and little-endian (armel).
+SET(_java_libarch arm)
+ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES ^mips)
+# mips* machines are bi-endian mostly so processor does not tell
+# endianess of the underlying system.
+SET(_java_libarch ${CMAKE_SYSTEM_PROCESSOR} mips mipsel mipseb)
+ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES ^(powerpc|ppc)64)
+SET

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

2013-08-05 Thread Markos Zaharioudakis
Review: Approve


-- 
https://code.launchpad.net/~zorba-coders/zorba/mz-schema-tools-module/+merge/178618
Your team Zorba Coders is subscribed to branch 
lp:~zorba-coders/zorba/schema-tools-module.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


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

2013-08-05 Thread Markos Zaharioudakis
Markos Zaharioudakis has proposed merging 
lp:~zorba-coders/zorba/mz-schema-tools-module into lp:zorba/schema-tools-module.

Commit message:
XmlDataManager  is not a singleton anymore

Requested reviews:
  Markos Zaharioudakis (markos-za)

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

XmlDataManager  is not a singleton anymore
-- 
https://code.launchpad.net/~zorba-coders/zorba/mz-schema-tools-module/+merge/178620
Your team Zorba Coders is subscribed to branch lp:zorba/schema-tools-module.
=== modified file 'src/schema-tools.xq.src/schema-tools.cpp'
--- src/schema-tools.xq.src/schema-tools.cpp	2013-06-12 14:02:42 +
+++ src/schema-tools.xq.src/schema-tools.cpp	2013-08-05 18:27:25 +
@@ -57,13 +57,11 @@
   private:
 const ExternalModule* theModule;
 ItemFactory* theFactory;
-XmlDataManager* theDataManager;
 
   public:
 Inst2xsdFunction(const ExternalModule* aModule) :
   theModule(aModule),
-  theFactory(Zorba::getInstance(0)-getItemFactory()),
-  theDataManager(Zorba::getInstance(0)-getXmlDataManager())
+  theFactory(Zorba::getInstance(0)-getItemFactory())
 {}
 
 ~Inst2xsdFunction()
@@ -77,23 +75,22 @@
 { return inst2xsd-internal; }
 
 virtual ItemSequence_t 
-  evaluate(const ExternalFunction::Arguments_t args,
-   const zorba::StaticContext*,
-   const zorba::DynamicContext*) const;
+evaluate(const ExternalFunction::Arguments_t args,
+ const zorba::StaticContext*,
+ const zorba::DynamicContext*) const;
 };
 
+
 class Xsd2instFunction : public ContextualExternalFunction
 {
   private:
 const ExternalModule* theModule;
 ItemFactory* theFactory;
-XmlDataManager* theDataManager;
 
   public:
 Xsd2instFunction(const ExternalModule* aModule) :
   theModule(aModule),
-  theFactory(Zorba::getInstance(0)-getItemFactory()),
-  theDataManager(Zorba::getInstance(0)-getXmlDataManager())
+  theFactory(Zorba::getInstance(0)-getItemFactory())
 {}
 
 ~Xsd2instFunction()
@@ -355,7 +352,7 @@
   //std::coutlBinaryString '  lBinaryString  '  std::endl; std::cout.flush();
 
   std::stringstream lStream(lBinaryString);
-  Item lRes = theDataManager-parseXML(lStream);
+  Item lRes = Zorba::getInstance(0)-getXmlDataManager()-parseXML(lStream);
 
   vec.push_back(lRes);
 }
@@ -538,7 +535,7 @@
 //std::coutlBinaryString '  lBinaryString  '  std::endl; std::cout.flush();
 
 std::stringstream lStream(lBinaryString);
-Item lRes = theDataManager-parseXML(lStream);
+Item lRes = Zorba::getInstance(0)-getXmlDataManager()-parseXML(lStream);
 
 return ItemSequence_t(new SingletonItemSequence(lRes));
   }

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


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

2013-08-05 Thread Markos Zaharioudakis
Review: Approve


-- 
https://code.launchpad.net/~zorba-coders/zorba/mz-schema-tools-module/+merge/178620
Your team Zorba Coders is subscribed to branch lp:zorba/schema-tools-module.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


[Zorba-coders] [Merge] lp:~zorba-coders/zorba/threads into lp:zorba

2013-08-05 Thread Markos Zaharioudakis
Markos Zaharioudakis has proposed merging lp:~zorba-coders/zorba/threads into 
lp:zorba.

Commit message:
re-enabled languages and schema tools modules

Requested reviews:
  Markos Zaharioudakis (markos-za)

For more details, see:
https://code.launchpad.net/~zorba-coders/zorba/threads/+merge/178624

re-enabled languages and schema tools modules
-- 
https://code.launchpad.net/~zorba-coders/zorba/threads/+merge/178624
Your team Zorba Coders is subscribed to branch lp:zorba.
=== modified file 'modules/ExternalModules.conf'
--- modules/ExternalModules.conf	2013-08-05 15:31:02 +
+++ modules/ExternalModules.conf	2013-08-05 19:23:28 +
@@ -39,7 +39,7 @@
 http-client bzr  lp:zorba/http-client-module  zorba-2.9
 image   bzr  lp:zorba/image-module
 jdbcbzr  lp:zorba/jdbc-module
-#languages   bzr  lp:zorba/languages-module
+languages   bzr  lp:zorba/languages-module
 oracle-nosql-db bzr  lp:zorba/oracle-nosql-db-module
 oauth   bzr  lp:zorba/oauth-modulezorba-2.9
 process bzr  lp:zorba/process-module
@@ -48,7 +48,7 @@
 system  bzr  lp:zorba/system-module   zorba-2.9
 email   bzr  lp:zorba/email-module
 util-jvmbzr  lp:zorba/util-jvm-module
-#schema-toolsbzr  lp:zorba/schema-tools-module
+schema-toolsbzr  lp:zorba/schema-tools-module
 stack   bzr  lp:zorba/stack-module
 queue   bzr  lp:zorba/queue-module
 couchbase   bzr  lp:zorba/couchbase-module

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


Re: [Zorba-coders] [Merge] lp:~zorba-coders/zorba/threads into lp:zorba

2013-08-05 Thread Markos Zaharioudakis
Review: Approve


-- 
https://code.launchpad.net/~zorba-coders/zorba/threads/+merge/178624
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


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

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

Commit message:
added a DynamicContextImpl::setVariable() function + cosmetic

Requested reviews:
  Markos Zaharioudakis (markos-za)

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

added a DynamicContextImpl::setVariable() function + cosmetic
-- 
https://code.launchpad.net/~zorba-coders/zorba/markos-scratch/+merge/178011
Your team Zorba Coders is subscribed to branch lp:zorba.
=== modified file 'include/zorba/dynamic_context.h'
--- include/zorba/dynamic_context.h	2013-06-11 23:38:49 +
+++ include/zorba/dynamic_context.h	2013-08-01 08:00:47 +
@@ -68,6 +68,25 @@
   const String aQName,
   const Item aItem) = 0;
 
+  /** 
+   * \brief Defines the external variable identified by an expanded QName and
+   * assigns it the value of aItem.
+   *
+   * The named external variable may be located in the main query or in any
+   * modules imported directly or indirectly by the query.
+   *
+   * @param aNamespace the namespace URI of the variable's expanded QName
+   * @param aLocalname the local name of the variable's expanded QName
+   * @param aItem the Item that is used as value for the variable.
+   * @return true if the variable has been set successfully, false otherwise.
+   * @throw ZorbaException if an error occured (e.g. the given Item is not valid).
+   */
+  virtual bool
+  setVariable(
+  const String inNamespace,
+  const String inLocalname,
+  const Item inValue) = 0;
+
   /**
* \brief Defines the external variable identified by aQName and assigns it
* the sequence that is returned by evaluating aIterator.

=== modified file 'src/api/dynamiccontextimpl.cpp'
--- src/api/dynamiccontextimpl.cpp	2013-06-18 23:53:59 +
+++ src/api/dynamiccontextimpl.cpp	2013-08-01 08:00:47 +
@@ -34,6 +34,8 @@
 #include api/xqueryimpl.h
 #include api/resultiteratorimpl.h
 #include api/storeiteratorimpl.h
+//#include api/item_iter_query_result.h
+//#include api/item_iter_store.h
 #include api/dynamiccontextimpl.h
 
 #include compiler/parser/query_loc.h
@@ -231,6 +233,55 @@
 
 /
 bool DynamicContextImpl::setVariable(
+const String inVarName,
+const Iterator_t inValue)
+{
+  ZORBA_DCTX_TRY
+  {
+checkNoIterators();
+
+if (!inValue.get())
+{
+  throw ZORBA_EXCEPTION(zerr::ZAPI0014_INVALID_ARGUMENT,
+  ERROR_PARAMS(null, ZED( BadIterator)));
+}
+
+const zstring varName = Unmarshaller::getInternalString(inVarName);
+store::Iterator_t value = Unmarshaller::getInternalIterator(inValue.get());
+
+VarInfo* var = NULL;
+
+try
+{
+  var = get_var_info(varName);
+}
+catch (ZorbaException const e)
+{
+  // Normally, we should be throwing an exception if the variable has not
+  // been declared inside the xquery program, but this cases many failures
+  // with the w3c XQTS.
+  if (e.diagnostic() == err::XPST0008)
+  {
+return false;
+  }
+  throw;
+}
+
+ulong varId = var-getId();
+
+theCtx-add_variable(varId, value);
+
+return true;
+  }
+  ZORBA_DCTX_CATCH
+  return false;
+}
+
+
+///**
+
+/
+bool DynamicContextImpl::setVariable(
 const String inNamespace,
 const String inLocalname,
 const Iterator_t inValue)
@@ -247,6 +298,7 @@
 
 const zstring nameSpace = Unmarshaller::getInternalString(inNamespace);
 const zstring localName = Unmarshaller::getInternalString(inLocalname);
+
 store::Iterator_t value = Unmarshaller::getInternalIterator(inValue.get());
 
 VarInfo* var = NULL;
@@ -282,6 +334,53 @@
 
 /
 bool DynamicContextImpl::setVariable(
+const String inNamespace,
+const String inLocalname,
+const Item inValue)
+{
+  ZORBA_DCTX_TRY
+  {
+checkNoIterators();
+
+const zstring nameSpace = Unmarshaller::getInternalString(inNamespace);
+const zstring localName = Unmarshaller::getInternalString(inLocalname);
+
+store::Item_t value(Unmarshaller::getInternalItem(inValue));
+checkItem(value);
+
+VarInfo* var = NULL;
+
+try
+{
+  var = get_var_info(nameSpace, localName);
+}
+catch (ZorbaException const e)
+{
+  // Normally, we should be throwing an exception if the variable has not
+  // been declared inside the xquery program, but this causes many failures
+  // with the w3c XQTS.
+  if (e.diagnostic() == err::XPST0008)
+  {
+return false;
+  }
+  throw;
+}
+
+ulong varId = var-getId();
+
+theCtx-add_variable(varId, value);
+
+return true;
+  }
+  ZORBA_DCTX_CATCH
+  return false

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

2013-08-01 Thread Markos Zaharioudakis
Review: Approve


-- 
https://code.launchpad.net/~zorba-coders/zorba/markos-scratch/+merge/178011
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


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

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

Commit message:
Fixed an error message

Requested reviews:
  Markos Zaharioudakis (markos-za)

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

Fixed an error message
-- 
https://code.launchpad.net/~zorba-coders/zorba/markos-scratch/+merge/178016
Your team Zorba Coders is subscribed to branch lp:zorba.
=== modified file 'src/diagnostics/diagnostic_en.xml'
--- src/diagnostics/diagnostic_en.xml	2013-07-29 23:55:03 +
+++ src/diagnostics/diagnostic_en.xml	2013-08-01 08:33:33 +
@@ -2540,8 +2540,8 @@
   value$1: document already exists in store/value
 /diagnostic
 
-diagnostic code=ZAPI0021 name=ITEM_TO_LOAD_IS_NOT_NODE
-  value$1: item to load is not a node/value
+diagnostic code=ZAPI0021 name=ITEM_TO_LOAD_IS_NOT_XML_DOC
+  value$1: item to add to the store is not an XML document node/value
 /diagnostic
 
 diagnostic code=ZAPI0023 name=NON_ATOMIC_CONTEXT_SIZE_VALUE

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


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

2013-08-01 Thread Markos Zaharioudakis
Review: Approve


-- 
https://code.launchpad.net/~zorba-coders/zorba/markos-scratch/+merge/178016
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


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

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

Commit message:
added/clened-up comments

Requested reviews:
  Markos Zaharioudakis (markos-za)

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

added/clened-up comments
-- 
https://code.launchpad.net/~zorba-coders/zorba/markos-scratch/+merge/178030
Your team Zorba Coders is subscribed to branch lp:zorba.
=== modified file 'include/zorba/document_manager.h'
--- include/zorba/document_manager.h	2013-02-07 17:24:36 +
+++ include/zorba/document_manager.h	2013-08-01 09:54:32 +
@@ -21,30 +21,62 @@
 
 namespace zorba {
 
-  /** \brief 
-   *
-   */
-  class ZORBA_DLL_PUBLIC DocumentManager
-  {
-  public:
-virtual void
-put(const String aURI, const Item aDoc) = 0;
-
-virtual void
-remove(const String aURI) = 0;
-
-virtual Item
-document(const String aURI) const = 0;
-
-virtual ItemSequence_t
-availableDocuments() const = 0;
-
-virtual bool
-isAvailableDocument(const String aURI) const = 0;
-
-virtual ~DocumentManager() {}
-
-  }; /* class DocumentManager */
+/**
+ * \brief There is a single instance of DocumentManager, which provides methods
+ * for adding, removing, or accessing XML documents in the Zorba store. This single
+ * instance is accessible via the XmlDataManger::getDocumentManager() method.
+ */
+class ZORBA_DLL_PUBLIC DocumentManager
+{
+public:
+  virtual ~DocumentManager() {}
+
+  /**
+   * Add a document to the store, associating it with the given URI.
+   *
+   * This method adds the document to the available documents component of
+   * the dynamic context. This means that the document will remain in the
+   * store and be accessible to queries via the associated URI (e.g., by using
+   * the fn:doc() function) until it is explicitly removed via the
+   * DocumentManager::remove() method.
+   */
+  virtual void
+  put(const String aURI, const Item aDoc) = 0;
+
+  /**
+   * Remove the document with the given URI from the store.
+   *
+   * This method removes the document from the available documents component
+   * of the dynamic context. This means that the document will no longer be
+   * accessible to queries via the associated URI. However, the document is not
+   * necessarily destroyed by this method. It will be destroyed if/when no more
+   * references to it exist.
+   */
+  virtual void
+  remove(const String aURI) = 0;
+
+  /**
+   * Return a reference to the root node of the document with the given URI.
+   */
+  virtual Item
+  document(const String aURI) const = 0;
+
+  /**
+   * Returns an iterator over the root nodes of all the available documents
+   * (i.e., all the documents that have been added to the store via the
+   * DocumentManager::put() method).
+   */
+  virtual Iterator_t
+  availableDocuments() const = 0;
+  
+  /**
+   * Check if a document with a given URI is among the available documents
+   * (i.e., the documents that have been added to the store via the
+   * DocumentManager::put() method).
+   */
+  virtual bool
+  isAvailableDocument(const String aURI) const = 0;
+};
 
 } /* namespace zorba */
 #endif

=== modified file 'include/zorba/empty_sequence.h'
--- include/zorba/empty_sequence.h	2013-02-07 17:24:36 +
+++ include/zorba/empty_sequence.h	2013-08-01 09:54:32 +
@@ -13,8 +13,8 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#ifndef ZORBA_EMPTY_SEQUENCE_API_H
-#define ZORBA_EMPTY_SEQUENCE_API_H
+#ifndef ZORBA_EMPTY_ITEM_SEQUENCE_API_H
+#define ZORBA_EMPTY_ITEM_SEQUENCE_API_H
 
 #include zorba/config.h
 #include zorba/item_sequence.h
@@ -23,62 +23,47 @@
 
 namespace zorba { 
 
-  /** \brief This class is an implementation of the ItemSequence.
-   * Objects of this class return, on the first next call,
-   * an empty sequence.
+/**
+ * \brief This class is an implementation of the ItemSequence.
+ *Objects of this class represent the empty sequence.
+ *
+ * See ItemSequence
+ */
+class ZORBA_DLL_PUBLIC EmptySequence : public ItemSequence
+{
+  /**
+   * \brief Implements an iterator over the empty sequence.
+   * Assuming that the iterator is in the open state, its next() method will
+   * always return false.
*
-   * See ItemSequence
+   * See Iterator.
*/
-  class ZORBA_DLL_PUBLIC EmptySequence : public ItemSequence
+  class InternalIterator : public Iterator
   {
-class InternalIterator : public Iterator
-{
-private:
-  ItemSequence*theItemSequence;
-  bool is_open;
-public:
-  InternalIterator(ItemSequence *item_sequence);
-
-  /** \brief Start iterating.
-   *
-   * This function needs to be called before calling next().
-   *
-   */
-  virtual void open();
-  /** \brief Get the next Item of the sequence.
-   *
-   * This function returns false with no item.
-   * @param aItem

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

2013-08-01 Thread Markos Zaharioudakis
Review: Approve


-- 
https://code.launchpad.net/~zorba-coders/zorba/markos-scratch/+merge/178030
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


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

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

Commit message:
renamed files implementing our various item sequences + fixed bug in 
SingletonItemSequence::next()

Requested reviews:
  Markos Zaharioudakis (markos-za)

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

renamed files implementing our various item sequences + fixed bug in 
SingletonItemSequence::next()
-- 
https://code.launchpad.net/~zorba-coders/zorba/markos-scratch/+merge/178040
Your team Zorba Coders is subscribed to branch lp:zorba.
=== modified file 'modules/xqxq/xqxq.xq.src/xqxq.cpp'
--- modules/xqxq/xqxq.xq.src/xqxq.cpp	2013-05-28 00:58:27 +
+++ modules/xqxq/xqxq.xq.src/xqxq.cpp	2013-08-01 11:25:40 +
@@ -424,6 +424,7 @@
   lIter-open();
   lIter-next(lItem);
   lIter-close();
+  lIter = NULL;
 
   if (lItem.isNull())
 return NULL;

=== modified file 'src/api/CMakeLists.txt'
--- src/api/CMakeLists.txt	2013-06-21 06:20:46 +
+++ src/api/CMakeLists.txt	2013-08-01 11:25:40 +
@@ -43,11 +43,11 @@
 vectoriterator.cpp
 iterator_singleton.cpp
 serialization_callback.cpp
-vector_item_sequence.cpp
-singleton_item_sequence.cpp
-invoke_item_sequence.cpp
-item_sequence_chainer.cpp
-empty_sequence.cpp
+item_seq_vector.cpp
+item_seq_singleton.cpp
+item_seq_invoke.cpp
+item_seq_chainer.cpp
+item_seq_empty.cpp
 serializerimpl.cpp
 base64impl.cpp
 base64_streambuf.cpp

=== renamed file 'src/api/item_sequence_chainer.cpp' = 'src/api/item_seq_chainer.cpp'
=== renamed file 'src/api/empty_sequence.cpp' = 'src/api/item_seq_empty.cpp'
--- src/api/empty_sequence.cpp	2013-08-01 10:36:40 +
+++ src/api/item_seq_empty.cpp	2013-08-01 11:25:40 +
@@ -17,34 +17,45 @@
 
 #include zorba/singleton_item_sequence.h
 #include zorba/empty_sequence.h
+
 #include diagnostics/assert.h
 
-namespace zorba { 
+namespace zorba
+{ 
 
 Iterator_t EmptySequence::getIterator()
 {
   return new InternalIterator(this);
 }
 
-EmptySequence::InternalIterator::InternalIterator(ItemSequence *item_sequence) : theItemSequence(item_sequence)
-{
-  theIsOpen = false;
-}
+
+EmptySequence::InternalIterator::InternalIterator(ItemSequence* seq)
+  :
+  theItemSequence(seq),
+  theIsOpen(false)
+{
+}
+
+
+bool EmptySequence::InternalIterator::isOpen() const
+{
+  return theIsOpen;
+}
+
 
 void EmptySequence::InternalIterator::open()
 {
+  ZORBA_ASSERT(!theIsOpen);
   theIsOpen = true;
 }
 
+
 void EmptySequence::InternalIterator::close()
 {
+  ZORBA_ASSERT(theIsOpen);
   theIsOpen = false;
 }
 
-bool EmptySequence::InternalIterator::isOpen() const
-{
-  return theIsOpen;
-}
 
 bool EmptySequence::InternalIterator::next(Item aItem)
 {

=== renamed file 'src/api/invoke_item_sequence.cpp' = 'src/api/item_seq_invoke.cpp'
--- src/api/invoke_item_sequence.cpp	2013-02-07 17:24:36 +
+++ src/api/item_seq_invoke.cpp	2013-08-01 11:25:40 +
@@ -16,30 +16,30 @@
 #include stdafx.h
 
 #include zorba/iterator.h
-#include api/invoke_item_sequence.h
+
+#include api/item_seq_invoke.h
 #include api/xqueryimpl.h
 #include api/staticcontextimpl.h
 
-namespace zorba { 
+namespace zorba 
+{
 
-InvokeItemSequence::InvokeItemSequence(
-XQueryImpl* aQuery,
-Iterator_t aIter,
-StaticContext* aSctx)
-  : theIterator(aIter),
-theXQuery(aQuery),
-theSctx(aSctx)
+InvokeItemSequence::InvokeItemSequence(const XQuery_t query, StaticContext* sctx)
+  :
+  theXQuery(query),
+  theSctx(sctx)
 {
 }
 
+
 InvokeItemSequence::~InvokeItemSequence()
 {
-  delete theXQuery;
 }
 
+
 Iterator_t InvokeItemSequence::getIterator()
 {
-  return theIterator;
+  return theXQuery-iterator();
 }
 
 } // namespace zorba

=== renamed file 'src/api/invoke_item_sequence.h' = 'src/api/item_seq_invoke.h'
--- src/api/invoke_item_sequence.h	2013-02-07 17:24:36 +
+++ src/api/item_seq_invoke.h	2013-08-01 11:25:40 +
@@ -14,47 +14,48 @@
  * limitations under the License.
  */
 #pragma once
-#ifndef ZORBA_ITERATOR_ITEM_SEQUENCE_API_H
-#define ZORBA_ITERATOR_ITEM_SEQUENCE_API_H
+#ifndef ZORBA_API_ITEM_SEQUENCE_INVOKE
+#define ZORBA_API_ITEM_SEQUENCE_INVOKE
 
 #include zorba/config.h
 #include zorba/item_sequence.h
 
 namespace zorba { 
 
-  class XQueryImpl;
-
-  /** \brief A sequence backed by an iterator and it's corresponding query.
-   *
-   * See ItemSequence
-   */
-  class ZORBA_DLL_PUBLIC InvokeItemSequence : public ItemSequence
-  {
-public:
-  /**
-   * Construct a sequence using an Iterator and its XQuery
-   */
-  InvokeItemSequence(
-  XQueryImpl* aQuery,
-  Iterator_t aIter,
-  StaticContext* aSctx);
-
-  /** \brief Destructor
-   */
-  virtual ~InvokeItemSequence();
-
-  /** \brief get the Iterator over the items
-   * @return an iterator over the items
-  */
-  virtual Iterator_t  getIterator();
-
-protected:
-  Iterator_t theIterator

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

2013-08-01 Thread Markos Zaharioudakis
Review: Approve


-- 
https://code.launchpad.net/~zorba-coders/zorba/markos-scratch/+merge/178040
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


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

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

Commit message:
renamed item_sequence_chainer.h + cosmetic

Requested reviews:
  Markos Zaharioudakis (markos-za)

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

renamed item_sequence_chainer.h + cosmetic
-- 
https://code.launchpad.net/~zorba-coders/zorba/markos-scratch/+merge/178048
Your team Zorba Coders is subscribed to branch lp:zorba.
=== modified file 'src/api/item_seq_chainer.cpp'
--- src/api/item_seq_chainer.cpp	2013-08-01 11:24:18 +
+++ src/api/item_seq_chainer.cpp	2013-08-01 12:01:31 +
@@ -16,7 +16,7 @@
 #include stdafx.h
 
 #include zorba/iterator.h
-#include api/item_sequence_chainer.h
+#include api/item_seq_chainer.h
 #include cassert
 
 namespace zorba { 

=== renamed file 'src/api/item_sequence_chainer.h' = 'src/api/item_seq_chainer.h'
--- src/api/item_sequence_chainer.h	2013-02-07 17:24:36 +
+++ src/api/item_seq_chainer.h	2013-08-01 12:01:31 +
@@ -29,84 +29,84 @@
 
 namespace zorba { 
 
-  /** \brief 
-   *
-   * See ItemSequence
+/** \brief 
+ *
+ * See ItemSequence
+ */
+class ZORBA_DLL_PUBLIC ItemSequenceChainer : public ItemSequence
+{
+ public:
+  /**
*/
-  class ZORBA_DLL_PUBLIC ItemSequenceChainer : public ItemSequence
-  {
-public:
-  /**
-   */
-  ItemSequenceChainer(
+  ItemSequenceChainer(
   const std::vectorItemSequence_t aSequences,
   bool aDoDupElim = false);
 
-  /** \brief Destructor
-   */
-  virtual ~ItemSequenceChainer();
-
-  /** \brief get the Iterator over the items
-   * @return an iterator over the items
-  */
-  virtual Iterator_t  getIterator();
-
-protected:
-  std::vectorItemSequence_t theSequences;
-  booltheDoDupElim;
-
-protected:
-  class Iterator : public zorba::Iterator
-  {
-public:
-  Iterator(
+  /** \brief Destructor
+   */
+  virtual ~ItemSequenceChainer();
+
+  /** \brief get the Iterator over the items
+   * @return an iterator over the items
+   */
+  virtual Iterator_t  getIterator();
+
+ protected:
+  std::vectorItemSequence_t theSequences;
+  booltheDoDupElim;
+
+ protected:
+  class Iterator : public zorba::Iterator
+  {
+  public:
+Iterator(
   const std::vectorItemSequence_t aSequences,
   bool aDoDupElim);
 
-  virtual ~Iterator();
-
-  virtual void 
-  open();
-
-  virtual bool
-  next(Item aItem);
+virtual ~Iterator();
+
+virtual void 
+open();
+
+virtual bool
+next(Item aItem);
   
-  virtual void 
-  close();
-
-  virtual bool
-  isOpen() const;
-
-protected:
-  std::vectorItemSequence_t   theSequences;
-  std::vectorItemSequence_t::iterator theSeqIter;
-  zorba::Iterator_t theIter;
-  bool  theIsOpen;
-  bool  theDoDupElim;
-  
-  struct Comparator {
-bool operator()(const Item i1, const Item i2) const
-{
-  assert(i1.getType().getLocalName() == QName);
-  assert(i2.getType().getLocalName() == QName);
-	  int lNamespaceComparison = i1.getNamespace().compare(i2.getNamespace());
-  if (lNamespaceComparison  0)
-  {
-return true;
-  }
-  if (lNamespaceComparison  0)
-  {
-return false;
-	  } 
-	  // Namespaces are equal, comparing local names.
-  return (i1.getLocalName().compare(i2.getLocalName())  0);
-}
-  };
-
-  std::setItem, Comparator theDupElimSet;
-  };
-  }; /* class ItemSequenceChainer */
-
+virtual void 
+close();
+
+virtual bool
+isOpen() const;
+
+  protected:
+std::vectorItemSequence_t   theSequences;
+std::vectorItemSequence_t::iterator theSeqIter;
+zorba::Iterator_t theIter;
+bool  theIsOpen;
+bool  theDoDupElim;
+  
+struct Comparator {
+  bool operator()(const Item i1, const Item i2) const
+  {
+assert(i1.getType().getLocalName() == QName);
+assert(i2.getType().getLocalName() == QName);
+int lNamespaceComparison = i1.getNamespace().compare(i2.getNamespace());
+if (lNamespaceComparison  0)
+{
+  return true;
+}
+if (lNamespaceComparison  0)
+{
+  return false;
+} 
+// Namespaces are equal, comparing local names.
+return (i1.getLocalName().compare(i2.getLocalName())  0);
+  }
+};
+
+std::setItem, Comparator   theDupElimSet;
+  };
+}; /* class ItemSequenceChainer

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

2013-08-01 Thread Markos Zaharioudakis
Review: Approve


-- 
https://code.launchpad.net/~zorba-coders/zorba/markos-scratch/+merge/178048
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


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

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

Commit message:
renamed files implementing our various item iterators + cosmetic

Requested reviews:
  Markos Zaharioudakis (markos-za)

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

renamed files implementing our various item iterators + cosmetic
-- 
https://code.launchpad.net/~zorba-coders/zorba/markos-scratch/+merge/178133
Your team Zorba Coders is subscribed to branch lp:zorba.
=== modified file 'src/api/CMakeLists.txt'
--- src/api/CMakeLists.txt	2013-08-01 11:39:44 +
+++ src/api/CMakeLists.txt	2013-08-01 17:29:31 +
@@ -23,7 +23,6 @@
 sax2impl.cpp
 staticcontextimpl.cpp
 dynamiccontextimpl.cpp
-resultiteratorimpl.cpp
 zorba_string.cpp
 hexbinaryimpl.cpp
 hexbinary_streambuf.cpp
@@ -39,10 +38,11 @@
 collectionimpl.cpp
 options.cpp
 functionimpl.cpp
-storeiteratorimpl.cpp
-vectoriterator.cpp
-iterator_singleton.cpp
 serialization_callback.cpp
+item_iter_singleton.cpp
+item_iter_vector.cpp
+item_iter_store.cpp
+item_iter_query_result.cpp
 item_seq_vector.cpp
 item_seq_singleton.cpp
 item_seq_invoke.cpp

=== modified file 'src/api/dynamiccontextimpl.cpp'
--- src/api/dynamiccontextimpl.cpp	2013-08-01 07:57:57 +
+++ src/api/dynamiccontextimpl.cpp	2013-08-01 17:29:31 +
@@ -32,10 +32,8 @@
 #include api/unmarshaller.h
 #include api/zorbaimpl.h
 #include api/xqueryimpl.h
-#include api/resultiteratorimpl.h
-#include api/storeiteratorimpl.h
-//#include api/item_iter_query_result.h
-//#include api/item_iter_store.h
+#include api/item_iter_query_result.h
+#include api/item_iter_store.h
 #include api/dynamiccontextimpl.h
 
 #include compiler/parser/query_loc.h

=== modified file 'src/api/item.cpp'
--- src/api/item.cpp	2013-06-21 05:17:24 +
+++ src/api/item.cpp	2013-08-01 17:29:31 +
@@ -28,8 +28,8 @@
 
 #include api/zorbaimpl.h
 #include api/serialization/serializer.h
-#include api/storeiteratorimpl.h
-#include api/iterator_singleton.h
+#include api/item_iter_store.h
+#include api/item_iter_singleton.h
 #include api/unmarshaller.h
 
 #include store/api/item.h

=== renamed file 'src/api/resultiteratorimpl.cpp' = 'src/api/item_iter_query_result.cpp'
--- src/api/resultiteratorimpl.cpp	2013-02-07 17:24:36 +
+++ src/api/item_iter_query_result.cpp	2013-08-01 17:29:31 +
@@ -22,7 +22,7 @@
 
 #include system/globalenv.h
 
-#include api/resultiteratorimpl.h
+#include api/item_iter_query_result.h
 #include api/unmarshaller.h
 #include api/xqueryimpl.h
 #include api/zorbaimpl.h

=== renamed file 'src/api/resultiteratorimpl.h' = 'src/api/item_iter_query_result.h'
=== renamed file 'src/api/iterator_singleton.cpp' = 'src/api/item_iter_singleton.cpp'
--- src/api/iterator_singleton.cpp	2013-02-07 17:24:36 +
+++ src/api/item_iter_singleton.cpp	2013-08-01 17:29:31 +
@@ -15,11 +15,10 @@
  */
 #include stdafx.h
 
-#include api/iterator_singleton.h
-
 #include zorba/item.h
 
 #include api/zorbaimpl.h
+#include api/item_iter_singleton.h
 
 #include system/globalenv.h
 

=== renamed file 'src/api/iterator_singleton.h' = 'src/api/item_iter_singleton.h'
=== renamed file 'src/api/storeiteratorimpl.cpp' = 'src/api/item_iter_store.cpp'
--- src/api/storeiteratorimpl.cpp	2013-02-07 17:24:36 +
+++ src/api/item_iter_store.cpp	2013-08-01 17:29:31 +
@@ -15,12 +15,11 @@
  */
 #include stdafx.h
 
-#include api/storeiteratorimpl.h
-
 #include zorba/item.h
 
 #include system/globalenv.h
 
+#include api/item_iter_store.h
 #include api/zorbaimpl.h
 
 #include diagnostics/xquery_diagnostics.h
@@ -73,7 +72,7 @@
 
 /
 StoreIteratorImpl::StoreIteratorImpl(
-store::Iterator_t aIter,
+const store::Iterator_t aIter,
 DiagnosticHandler* aDiagnosticHandler)
   :
   theIterator(aIter),

=== renamed file 'src/api/storeiteratorimpl.h' = 'src/api/item_iter_store.h'
--- src/api/storeiteratorimpl.h	2013-02-07 17:24:36 +
+++ src/api/item_iter_store.h	2013-08-01 17:29:31 +
@@ -34,15 +34,15 @@
   friend class DynamicContextImpl;
 
 protected:
-  store::Iterator_t  theIterator; 
-  DiagnosticHandler* theDiagnosticHandler;
-  bool   theOwnDiagnosticHandler;
-  bool   theIsOpen; 
-  bool   theHaveLock;
+  store::Iterator_t   theIterator; 
+  DiagnosticHandler * theDiagnosticHandler;
+  booltheOwnDiagnosticHandler;
+  booltheIsOpen; 
+  booltheHaveLock;
 
-  StoreIteratorImpl(store::Iterator_t, DiagnosticHandler*);
-
 public:
+  StoreIteratorImpl(const store::Iterator_t, DiagnosticHandler*);
+
   virtual ~StoreIteratorImpl();
 
   virtual void open();

=== renamed file 'src/api/vectoriterator.cpp' = 'src/api/item_iter_vector.cpp'
--- src/api/vectoriterator.cpp	2013-02-07 17:24:36 +
+++ src/api

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

2013-08-01 Thread Markos Zaharioudakis
Review: Approve


-- 
https://code.launchpad.net/~zorba-coders/zorba/markos-scratch/+merge/178133
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


[Zorba-coders] [Merge] lp:~zorba-coders/zorba/threads into lp:zorba

2013-07-31 Thread Markos Zaharioudakis
Markos Zaharioudakis has proposed merging lp:~zorba-coders/zorba/threads into 
lp:zorba.

Commit message:
fixed memory leak related to function annotations

Requested reviews:
  Markos Zaharioudakis (markos-za)

For more details, see:
https://code.launchpad.net/~zorba-coders/zorba/threads/+merge/177897

fixed memory leak related to function annotations
-- 
https://code.launchpad.net/~zorba-coders/zorba/threads/+merge/177897
Your team Zorba Coders is subscribed to branch lp:zorba.
=== modified file 'bin/zorbacmd.cpp'
--- bin/zorbacmd.cpp	2013-06-14 23:46:26 +
+++ bin/zorbacmd.cpp	2013-07-31 16:13:34 +
@@ -272,14 +272,14 @@
 /
 bool populateDynamicContext(
 Zorba* zorba,
+XmlDataManager* xmlMgr,
 zorba::DynamicContext* aDynamicContext,
 const ZorbaCMDProperties props)
 {
   if ( props.contextItem().size() != 0 ) 
   {
-XmlDataManager* lXmlMgr = zorba-getXmlDataManager();
 std::ifstream lInStream(props.contextItem().c_str());
-Item lDoc = lXmlMgr-parseXML(lInStream);
+Item lDoc = xmlMgr-parseXML(lInStream);
 aDynamicContext-setContextItem(lDoc);
   }
 
@@ -293,9 +293,8 @@
 {
   if ((*lIter).inline_file)
   {
-XmlDataManager* lXmlMgr = zorba-getXmlDataManager();
 std::ifstream lInStream((*lIter).var_value.c_str());
-Item lDoc = lXmlMgr-parseXML(lInStream);
+Item lDoc = xmlMgr-parseXML(lInStream);
 aDynamicContext-setVariable((*lIter).var_name, lDoc);
   }
   else
@@ -642,6 +641,7 @@
 int
 compileAndExecute(
 zorba::Zorba* zorbaInstance,
+zorba::XmlDataManager* xmlDataMgr,
 const ZorbaCMDProperties properties,
 zorba::StaticContext_t staticContext,
 const std::string qfilepath,
@@ -715,7 +715,8 @@
 lHints.lib_module = true;
   }
 
-  Zorba_SerializerOptions lSerOptions = Zorba_SerializerOptions::SerializerOptionsFromStringParams(properties.getSerializerParameters());
+  Zorba_SerializerOptions lSerOptions = 
+  Zorba_SerializerOptions::SerializerOptionsFromStringParams(properties.getSerializerParameters());
 
   createSerializerOptions(lSerOptions, properties);
 
@@ -831,7 +832,10 @@
 zorba::DynamicContext* lDynamicContext = query-getDynamicContext();
 try
 {
-  if ( ! populateDynamicContext(zorbaInstance, lDynamicContext, properties) )
+  if ( ! populateDynamicContext(zorbaInstance,
+xmlDataMgr,
+lDynamicContext,
+properties) )
   {
 properties.printHelp(std::cout);
 return 21;
@@ -894,11 +898,9 @@
 //
 if (doTiming)
 {
-  XmlDataManager* store = zorbaInstance-getXmlDataManager();
-
   timing.startTimer(TimingInfo::UNLOAD_TIMER, i);
 
-  DocumentManager* docMgr = store-getDocumentManager();
+  DocumentManager* docMgr = xmlDataMgr-getDocumentManager();
   ItemSequence_t docsSeq = docMgr-availableDocuments();
   Iterator_t lIter = docsSeq-getIterator();
   lIter-open();
@@ -1019,6 +1021,8 @@
 
   zorba::Zorba* lZorbaInstance = zorba::Zorba::getInstance(store);
 
+  zorba::XmlDataManager_t xmlDataMgr = lZorbaInstance-createXmlDataManager();
+
 #ifdef DO_AUDIT
   zorba::audit::Provider* lAuditProvider = lZorbaInstance-getAuditProvider();
 
@@ -1240,7 +1244,11 @@
 
 lQuery-compile(*lXQ.get(), lHints);
 zorba::DynamicContext* lDynamicContext = lQuery-getDynamicContext();
-if (!populateDynamicContext(lZorbaInstance, lDynamicContext, properties)) {
+if (!populateDynamicContext(lZorbaInstance,
+xmlDataMgr,
+lDynamicContext,
+properties))
+{
   return 9;
 }
 

=== modified file 'include/zorba/api_shared_types.h'
--- include/zorba/api_shared_types.h	2013-06-12 04:55:14 +
+++ include/zorba/api_shared_types.h	2013-07-31 16:13:34 +
@@ -61,6 +61,7 @@
 typedef SmartPtrQueryLocation   QueryLocation_t;
 typedef SmartPtrSerializer  Serializer_t;
 typedef SmartPtrStaticContext   StaticContext_t;
+typedef SmartPtrXmlDataManager  XmlDataManager_t;
 typedef SmartPtrTypeIdentifier  TypeIdentifier_t;
 typedef SmartPtrXQuery  XQuery_t;
 

=== modified file 'include/zorba/xmldatamanager.h'
--- include/zorba/xmldatamanager.h	2013-02-07 17:24:36 +
+++ include/zorba/xmldatamanager.h	2013-07-31 16:13:34 +
@@ -23,224 +23,223 @@
 
 namespace zorba {
 
-  /** \brief Using the XmlDataManager one can manage documents and collections.
-   *
-   * The XmlDataManager is a singleton instance. The Zorba object is reponsible
-   * for maintaining its lifetime. The instance can be accessed by calling
-   * getXmlDataManager() on the Zorba object. It may not be accessed anymore
-   * after Zorba::shutdown() has been called

[Zorba-coders] [Merge] lp:~zorba-coders/zorba/threads into lp:zorba

2013-07-11 Thread Markos Zaharioudakis
The proposal to merge lp:~zorba-coders/zorba/threads into lp:zorba has been 
updated.

Commit Message changed to:

Some work towards multi-threading
1. Fixed a couple of threading bugs in qname pool
2. Redefined free() method for root_static_context and for builtin functions
3. Annotations are not RCObjects anymore
4. Use atomic ints are counters in RCObjects
5. No query cloning in testdriver_mt

For more details, see:
https://code.launchpad.net/~zorba-coders/zorba/threads/+merge/174198
-- 
https://code.launchpad.net/~zorba-coders/zorba/threads/+merge/174198
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


[Zorba-coders] [Merge] lp:~zorba-coders/zorba/threads into lp:zorba

2013-07-11 Thread Markos Zaharioudakis
The proposal to merge lp:~zorba-coders/zorba/threads into lp:zorba has been 
updated.

Description changed to:

Some work towards multi-threading
1. Fixed a couple of threading bugs in qname pool
2. Redefined free() method for root_static_context and for builtin functions
3. Annotations are not RCObjects anymore
4. Use atomic ints are counters in RCObjects
5. No query cloning in testdriver_mt


For more details, see:
https://code.launchpad.net/~zorba-coders/zorba/threads/+merge/174198
-- 
https://code.launchpad.net/~zorba-coders/zorba/threads/+merge/174198
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


Re: [Zorba-coders] [Merge] lp:~zorba-coders/zorba/threads into lp:zorba

2013-07-11 Thread Markos Zaharioudakis
Review: Approve


-- 
https://code.launchpad.net/~zorba-coders/zorba/threads/+merge/174198
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


Re: [Zorba-coders] [Merge] lp:~zorba-coders/zorba/skiplimit into lp:zorba

2013-07-05 Thread Markos Zaharioudakis
Review: Needs Information

1. I think Dana will have to approve the adding of proprietary syntax to do 
what is essentially syntactic sugar for fn:subsequence().

2. Why allow multiple offset/limit clauses when, as far as I can understand, 
only the last offset/limit clause takes effect?


-- 
https://code.launchpad.net/~zorba-coders/zorba/skiplimit/+merge/173126
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


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

2013-07-02 Thread Markos Zaharioudakis
Review: Approve


-- 
https://code.launchpad.net/~zorba-coders/zorba/markos-scratch/+merge/172509
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


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

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

Commit message:
ZORBA_FOR_ONE_THREAD_ONLY is now ON by default

Requested reviews:
  Markos Zaharioudakis (markos-za)

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

ZORBA_FOR_ONE_THREAD_ONLY is now ON by default
-- 
https://code.launchpad.net/~zorba-coders/zorba/markos-scratch/+merge/172509
Your team Zorba Coders is subscribed to branch lp:zorba.
=== modified file 'CMakeConfiguration.txt'
--- CMakeConfiguration.txt	2013-06-15 02:57:08 +
+++ CMakeConfiguration.txt	2013-07-02 09:31:28 +
@@ -67,7 +67,7 @@
 SET(ZORBA_WITH_CODE_PROFILE OFF CACHE BOOL compile the code with information for a code profiling analysis)
 MESSAGE(STATUS ZORBA_WITH_CODE_PROFILE:   ${ZORBA_WITH_CODE_PROFILE})
 
-SET(ZORBA_FOR_ONE_THREAD_ONLY OFF CACHE BOOL compile zorba for single threaded use)
+SET(ZORBA_FOR_ONE_THREAD_ONLY ON CACHE BOOL compile zorba for single threaded use)
 MESSAGE(STATUS ZORBA_FOR_ONE_THREAD_ONLY: ${ZORBA_FOR_ONE_THREAD_ONLY})
 
 IF (DEFINED UNIX)

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


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

2013-07-01 Thread Markos Zaharioudakis
The proposal to merge lp:~zorba-coders/zorba/markos-scratch into lp:zorba has 
been updated.

Status: Needs review = Approved

For more details, see:
https://code.launchpad.net/~zorba-coders/zorba/markos-scratch/+merge/172205
-- 
https://code.launchpad.net/~zorba-coders/zorba/markos-scratch/+merge/172205
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


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

2013-07-01 Thread Markos Zaharioudakis
The proposal to merge lp:~zorba-coders/zorba/markos-scratch into lp:zorba has 
been updated.

Status: Needs review = Approved

For more details, see:
https://code.launchpad.net/~zorba-coders/zorba/markos-scratch/+merge/172205
-- 
https://code.launchpad.net/~zorba-coders/zorba/markos-scratch/+merge/172205
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


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

2013-07-01 Thread Markos Zaharioudakis
The proposal to merge lp:~zorba-coders/zorba/markos-scratch into lp:zorba has 
been updated.

Status: Needs review = Approved

For more details, see:
https://code.launchpad.net/~zorba-coders/zorba/markos-scratch/+merge/172205
-- 
https://code.launchpad.net/~zorba-coders/zorba/markos-scratch/+merge/172205
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


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

2013-06-30 Thread Markos Zaharioudakis
The proposal to merge lp:~zorba-coders/zorba/markos-scratch into lp:zorba has 
been updated.

Status: Needs review = Approved

For more details, see:
https://code.launchpad.net/~zorba-coders/zorba/markos-scratch/+merge/172205
-- 
https://code.launchpad.net/~zorba-coders/zorba/markos-scratch/+merge/172205
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


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

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

Commit message:
API change - Fixed bug #938574 (changed the names and semantics of the 
NsScoping enum)

Requested reviews:
  Markos Zaharioudakis (markos-za)

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

API change - Fixed bug #938574 (changed the names and semantics of the 
NsScoping enum)
-- 
https://code.launchpad.net/~zorba-coders/zorba/markos-scratch/+merge/172205
Your team Zorba Coders is subscribed to branch lp:zorba.
=== modified file 'ChangeLog'
--- ChangeLog	2013-06-28 03:52:18 +
+++ ChangeLog	2013-06-29 18:40:35 +
@@ -44,6 +44,7 @@
   * Fixed bug #1188100 (regex issues with 'q' flag in fn:tokenize)
   * Fixed invalid memory access error occuring during sequence type matching
 for user-defined types.
+  * API change - Fixed bug #938574 (changed the names and semantics of the NsScoping enum)
   * Fixed bug #1190710 (fn-format-date failures)
   * Fixed bug #1190407 (wrong rewrite of if-then-else return clause in case
 of general flwor)

=== modified file 'doc/cxx/examples/simple.cpp'
--- doc/cxx/examples/simple.cpp	2013-02-07 17:24:36 +
+++ doc/cxx/examples/simple.cpp	2013-06-29 18:40:35 +
@@ -274,7 +274,7 @@
 
   NsBindings lBindings;
   lChild.getNamespaceBindings(lBindings,
-  store::StoreConsts::ONLY_LOCAL_NAMESPACES);
+  store::StoreConsts::ONLY_LOCAL_BINDINGS);
   for (NsBindings::const_iterator ite = lBindings.begin();
ite != lBindings.end(); ++ite) {
 std::coutnamespace binding   ite-first

=== modified file 'include/zorba/item.h'
--- include/zorba/item.h	2013-06-15 02:57:08 +
+++ include/zorba/item.h	2013-06-29 18:40:35 +
@@ -316,18 +316,21 @@
 * The file \link simple.cpp \endlink contains some basic examples that demonstrate
 * the use of this function.
 *
-* @param aBindings An STL list to receive the namespace bindings of this node (each
-* represented as a std::pairzorba::String,zorba::String where the
-* first string is the namespace prefix and the second is the namespace URI).
-* @param aNsScoping An instance of NsScoping to declare which bindings to return:
-* those local to the element; those local to all parent elements; or all bindings
-* (the default).
+* @param aBindings An std::vector to receive the namespace bindings of this
+*node (each represented as a std::pairzorba::String,zorba::String
+*where the first string is the namespace prefix and the second is the
+*namespace URI).
+* @param scope A value to specify which bindings to return: all bindings (the
+*default); only those that are specified by the namespace declaration
+*attributes of the node (if any); or those that are implied by the
+*qnames of the node and its attributes plus those that are specified
+*by the namespace declaration attributes of the node (if any)
 * @throw ZorbaException if an error occured, e.g. the Item is not of type element.
 */
   void
-  getNamespaceBindings(NsBindings aBindings,
-store::StoreConsts::NsScoping aNsScoping = store::StoreConsts::ALL_NAMESPACES)
-const;
+  getNamespaceBindings(
+  NsBindings aBindings,
+  store::StoreConsts::NsScoping scope = store::StoreConsts::ALL_BINDINGS) const;
 
   /** \brief Get parent of this (node) Item.
*
@@ -487,7 +490,7 @@
   store::Item * m_item;
 private:
   //for plan serialization
-  friend void zorba::serialization::operator(zorba::serialization::Archiver ar, Item obj);
+  friend void zorba::serialization::operator(zorba::serialization::Archiver ar, Item obj);
 };
 
 } // namespace zorba

=== modified file 'include/zorba/store_consts.h'
--- include/zorba/store_consts.h	2013-03-12 17:03:31 +
+++ include/zorba/store_consts.h	2013-06-29 18:40:35 +
@@ -98,11 +98,29 @@
 {
  public:
 
+  /**
+   * NsScoping defines the three values that can be given as arguments to
+   * the Item::getNamespaceBindings() method. The semantics of the three
+   * values are as follows:
+   *
+   * ALL_BINDINGS:
+   * All the namespace bindings of an element node, as defined by the W3C
+   * XQuery and XPath Data Model specification.
+   *
+   * ONLY_LOCAL_BINDINGS:
+   * The bindings that are implied by the qnames of an element node and its
+   * attributes, plus those that are specified by the namespace declaration
+   * attributes of the element node.
+   *
+   * ONLY_LOCALLY_DECLARED_BINDINGS:
+   * The bindings that are specified by the namespace declaration attributes
+   * of an element node.
+   */
   enum NsScoping
   {
-ALL_NAMESPACES,
-ONLY_LOCAL_NAMESPACES,
-ONLY_PARENT_NAMESPACES
+ALL_BINDINGS,
+ONLY_LOCAL_BINDINGS,
+ONLY_LOCALLY_DECLARED_BINDINGS
   };
 
   enum NodeKind

=== modified file 'src

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

2013-06-29 Thread Markos Zaharioudakis
Review: Approve


-- 
https://code.launchpad.net/~zorba-coders/zorba/markos-scratch/+merge/172205
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


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

2013-06-29 Thread Markos Zaharioudakis
Review: Approve


-- 
https://code.launchpad.net/~zorba-coders/zorba/markos-scratch/+merge/172205
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


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

2013-06-29 Thread Markos Zaharioudakis
The proposal to merge lp:~zorba-coders/zorba/markos-scratch into lp:zorba has 
been updated.

Status: Needs review = Approved

For more details, see:
https://code.launchpad.net/~zorba-coders/zorba/markos-scratch/+merge/172205
-- 
https://code.launchpad.net/~zorba-coders/zorba/markos-scratch/+merge/172205
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


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

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

Commit message:
Fixed bug #1188281 (casting to xs:anySimpleType not allowed)

Requested reviews:
  Markos Zaharioudakis (markos-za)

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

Fixed bug #1188281 (casting to xs:anySimpleType not allowed)
-- 
https://code.launchpad.net/~zorba-coders/zorba/markos-scratch/+merge/171029
Your team Zorba Coders is subscribed to branch lp:zorba.
=== modified file 'ChangeLog'
--- ChangeLog	2013-06-20 15:23:53 +
+++ ChangeLog	2013-06-24 07:58:29 +
@@ -44,6 +44,7 @@
   * Fixed bug #1190710 (fn-format-date failures)
   * Fixed bug #1190407 (wrong rewrite of if-then-else return clause in case
 of general flwor)
+  * Fixed bug #1188281 (casting to xs:anySimpleType not allowed)
   * jn:members function takes item()* as aparameter (instead of item())
   * jn:keys function takes item()* as aparameter (instead of item())
   * Fixed bug #1189996 (Relocate some public API headers to util)

=== modified file 'src/compiler/translator/translator.cpp'
--- src/compiler/translator/translator.cpp	2013-06-21 12:07:22 +
+++ src/compiler/translator/translator.cpp	2013-06-24 07:58:29 +
@@ -9345,7 +9345,8 @@
   if (TypeOps::is_equal(tm, *type, *theRTM.NOTATION_TYPE_ONE, loc) ||
   TypeOps::is_equal(tm, *type, *theRTM.NOTATION_TYPE_QUESTION, loc) ||
   TypeOps::is_equal(tm, *type, *theRTM.ANY_ATOMIC_TYPE_ONE, loc) ||
-  TypeOps::is_equal(tm, *type, *theRTM.ANY_ATOMIC_TYPE_QUESTION, loc))
+  TypeOps::is_equal(tm, *type, *theRTM.ANY_ATOMIC_TYPE_QUESTION, loc) ||
+  TypeOps::is_equal(tm, *type, *theRTM.ANY_SIMPLE_TYPE, loc))
   {
 RAISE_ERROR(err::XPST0080, loc, ERROR_PARAMS(type-toString()));
   }

=== modified file 'src/types/typeops.cpp'
--- src/types/typeops.cpp	2013-06-15 02:57:08 +
+++ src/types/typeops.cpp	2013-06-24 07:58:29 +
@@ -379,7 +379,7 @@
 return false;
   }
 
-  switch(type1.type_kind()) 
+  switch (type1.type_kind()) 
   {
 case XQType::ATOMIC_TYPE_KIND:
 {

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


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

2013-06-24 Thread Markos Zaharioudakis
Review: Approve


-- 
https://code.launchpad.net/~zorba-coders/zorba/markos-scratch/+merge/171029
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


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

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

Commit message:
Fixed bug #1188095 (do correct normalization for fn:string-length()))

Requested reviews:
  Markos Zaharioudakis (markos-za)

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

Fixed bug #1188095 (do correct normalization for fn:string-length()))
-- 
https://code.launchpad.net/~zorba-coders/zorba/markos-scratch/+merge/171047
Your team Zorba Coders is subscribed to branch lp:zorba.
=== modified file 'src/compiler/translator/translator.cpp'
--- src/compiler/translator/translator.cpp	2013-06-24 07:56:21 +
+++ src/compiler/translator/translator.cpp	2013-06-24 10:01:28 +
@@ -11985,7 +11985,15 @@
 resultExpr = CREATE(wrapper)(theRootSctx, theUDF, loc, ve);
 break;
   }
-  case FunctionConsts::FN_STRING_LENGTH_0: 
+  case FunctionConsts::FN_STRING_LENGTH_0:
+  {
+arguments.push_back(dotRef(loc));
+
+arguments[0] = generate_fn_body(BUILTIN_FUNC(FN_STRING_1), arguments, loc);
+
+f = theSctx-lookup_fn(f-getName(), 1, loc);
+break;
+  } 
   case FunctionConsts::FN_NORMALIZE_SPACE_0:
   case FunctionConsts::FN_ROOT_0:
   case FunctionConsts::FN_BASE_URI_0:

=== modified file 'test/fots/CMakeLists.txt'
--- test/fots/CMakeLists.txt	2013-06-24 08:15:37 +
+++ test/fots/CMakeLists.txt	2013-06-24 10:01:28 +
@@ -164,8 +164,6 @@
 EXPECTED_FOTS_FAILURE (fn-resolve-uri fn-resolve-uri-28 1188088)
 EXPECTED_FOTS_FAILURE (fn-serialize serialize-xml-007a 1188122)
 EXPECTED_FOTS_FAILURE (fn-serialize serialize-xml-008 1188122)
-EXPECTED_FOTS_FAILURE (fn-string-length fn-string-length-22 1188095)
-EXPECTED_FOTS_FAILURE (fn-string-length fn-string-length-24 1188095)
 EXPECTED_FOTS_FAILURE (fn-unparsed-text fn-unparsed-text-038 1123835)
 EXPECTED_FOTS_FAILURE (fn-unparsed-text fn-unparsed-text-039 1123835)
 EXPECTED_FOTS_FAILURE (fn-unparsed-text fn-unparsed-text-042 1123835)

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


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

2013-06-24 Thread Markos Zaharioudakis
Review: Approve


-- 
https://code.launchpad.net/~zorba-coders/zorba/markos-scratch/+merge/171047
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


  1   2   3   4   5   6   7   8   9   10   >