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

2012-01-20 Thread Rodolfo Ochoa
Review: Approve


-- 
https://code.launchpad.net/~zorba-coders/zorba/bug905035/+merge/89099
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/bug905035 into lp:zorba

2012-01-20 Thread Zorba Build Bot
Validation queue starting for merge proposal.
Log at: 
http://zorbatest.lambda.nu:8080/remotequeue/bug905035-2012-01-21T00-06-05.414Z/log.html
-- 
https://code.launchpad.net/~zorba-coders/zorba/bug905035/+merge/89099
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/bug905035 into lp:zorba

2012-01-20 Thread Zorba Build Bot
Validation queue job bug905035-2012-01-21T00-06-05.414Z is finished. The final 
status was:

All tests succeeded!
-- 
https://code.launchpad.net/~zorba-coders/zorba/bug905035/+merge/89099
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/bug905035 into lp:zorba

2012-01-20 Thread noreply
The proposal to merge lp:~zorba-coders/zorba/bug905035 into lp:zorba has been 
updated.

Status: Approved = Merged

For more details, see:
https://code.launchpad.net/~zorba-coders/zorba/bug905035/+merge/89099
-- 
https://code.launchpad.net/~zorba-coders/zorba/bug905035/+merge/89099
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/bug905035 into lp:zorba

2012-01-18 Thread Markos Zaharioudakis
Matthias, the getNamespaceBindings method is rather inefficient as it will copy 
the actual strings twice. And it should also pre-allocated the space for the 
returned vector. I don't think this is going to be a major bottleneck, so I 
have approved the proposal. But in the spirit of best practices, it is better 
if it is fixed.
-- 
https://code.launchpad.net/~zorba-coders/zorba/bug905035/+merge/88922
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/bug905035 into lp:zorba

2012-01-18 Thread Markos Zaharioudakis
Review: Approve


-- 
https://code.launchpad.net/~zorba-coders/zorba/bug905035/+merge/88922
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/bug905035 into lp:zorba

2012-01-18 Thread Matthias Brantner
Matthias Brantner has proposed merging lp:~zorba-coders/zorba/bug905035 into 
lp:zorba.

Requested reviews:
  Hybridum (hybridum)
  Markos Zaharioudakis (markos-za)
  Rodolfo Ochoa (rodolfo-ochoa)
Related bugs:
  Bug #905035 in Zorba: there is no way to get the Namespace Prefixes
  https://bugs.launchpad.net/zorba/+bug/905035

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

Implemented StaticContext::getNamespaceBindings to resolve bug #905035. In the 
same commit, the function getNamespaceURIByPrefix was deprecated because it's 
superseded by the new function.
-- 
https://code.launchpad.net/~zorba-coders/zorba/bug905035/+merge/89099
Your team Zorba Coders is subscribed to branch lp:zorba.
=== modified file 'ChangeLog'
--- ChangeLog	2012-01-18 12:18:59 +
+++ ChangeLog	2012-01-18 18:13:27 +
@@ -22,6 +22,8 @@
 support.
   * zerr is not predeclared anymore to be http://www.zorba-xquery.com/errors
   * Added API method Item::getNamespaceBindings().
+  * Added API method StaticContext::getNamespaceBindings() (see bug #905035)
+  * Deprecated StaticContext:getNamespaceURIByPrefix()
 
 version 2.1
 

=== modified file 'include/zorba/static_context.h'
--- include/zorba/static_context.h	2011-12-21 14:40:33 +
+++ include/zorba/static_context.h	2012-01-18 18:13:27 +
@@ -99,10 +99,21 @@
* could be found for the given prefix and an DiagnosticHandler has been
* registered.
* @throw ZorbaException if an error occured (e.g. no URI could be found for the given prefix).
+   *
+   * @deprecated This function is deprecated. Use getNamespaceBindings instead.
*/
   virtual String
   getNamespaceURIByPrefix( const String aPrefix ) const = 0;
 
+  /**
+   * \brief Get the list of all namespace bindings (prefix, uri)
+   *   declared in this and its parent static contexts.
+   *
+   * @param aBindings the bindings are added to this list
+   */
+  virtual void
+  getNamespaceBindings( NsBindings aBindings ) const = 0;
+
   /** \brief Set the default element and type namespace
* (see http://www.w3.org/TR/xquery/#static_context)
*

=== modified file 'src/api/item.cpp'
--- src/api/item.cpp	2012-01-11 17:30:25 +
+++ src/api/item.cpp	2012-01-18 18:13:27 +
@@ -389,12 +389,18 @@
 
   store::NsBindings lStoreBindings;
   m_item-getNamespaceBindings(lStoreBindings, aNsScoping);
+  aBindings.reserve(aBindings.size() + lStoreBindings.size());
+
   store::NsBindings::iterator ite = lStoreBindings.begin();
   store::NsBindings::iterator end = lStoreBindings.end();
   for (; ite != end; ++ite) {
 zstring prefix = ite-first;
 zstring nsuri = ite-second;
-aBindings.push_back(std::pairString, String(prefix.str(), nsuri.str()));
+aBindings.push_back(
+std::pairString, String(
+  Unmarshaller::newString(prefix),
+  Unmarshaller::newString(nsuri))
+  );
   }
 
   ITEM_CATCH

=== modified file 'src/api/staticcontextimpl.cpp'
--- src/api/staticcontextimpl.cpp	2012-01-11 17:30:25 +
+++ src/api/staticcontextimpl.cpp	2012-01-18 18:13:27 +
@@ -215,6 +215,38 @@
   return ;
 }
 
+/***
+
+/
+void
+StaticContextImpl::getNamespaceBindings( NsBindings aBindings ) const
+{
+  try
+  {
+store::NsBindings lBindings;
+theCtx-get_namespace_bindings(lBindings);
+aBindings.reserve(aBindings.size() + lBindings.size());
+
+for (store::NsBindings::const_iterator lIter = lBindings.begin();
+ lIter != lBindings.end(); ++lIter)
+{
+  aBindings.push_back(
+std::pairzorba::String, zorba::String(
+  Unmarshaller::newString(lIter-first),
+  Unmarshaller::newString(lIter-second)
+)
+  );
+}
+  }
+  catch (ZorbaException const e)
+  {
+ZorbaImpl::notifyError(theDiagnosticHandler, e);
+  }
+  catch (std::exception const e)
+  {
+ZorbaImpl::notifyError(theDiagnosticHandler, e.what());
+  }
+}
 
 /***
 

=== modified file 'src/api/staticcontextimpl.h'
--- src/api/staticcontextimpl.h	2011-12-21 14:40:33 +
+++ src/api/staticcontextimpl.h	2012-01-18 18:13:27 +
@@ -78,6 +78,9 @@
 
   String getNamespaceURIByPrefix( const String prefix ) const;
 
+  void
+  getNamespaceBindings( NsBindings aBindings ) const;
+
   bool setDefaultElementAndTypeNamespace( const String URI );
 
   String getDefaultElementAndTypeNamespace( ) const;

=== modified file 'test/unit/CMakeLists.txt'
--- test/unit/CMakeLists.txt	2012-01-11 17:30:25 +
+++ test/unit/CMakeLists.txt	2012-01-18 18:13:27 +
@@ -94,6 +94,7 @@
   xquery_functions.cpp
   xmldatamanager.cpp
   staticcollectionmanager.cpp
+  static_context.cpp
 )
 
 IF (NOT ZORBA_NO_FULL_TEXT)

=== added file 

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

2012-01-18 Thread Matthias Brantner
The proposal to merge lp:~zorba-coders/zorba/bug905035 into lp:zorba has been 
updated.

Commit Message changed to:

Implemented StaticContext::getNamespaceBindings to resolve bug #905035. In the 
same commit, the function getNamespaceURIByPrefix was deprecated because it's 
superseded by the new function.

For more details, see:
https://code.launchpad.net/~zorba-coders/zorba/bug905035/+merge/89099
-- 
https://code.launchpad.net/~zorba-coders/zorba/bug905035/+merge/89099
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/bug905035 into lp:zorba

2012-01-18 Thread Markos Zaharioudakis
Review: Approve


-- 
https://code.launchpad.net/~zorba-coders/zorba/bug905035/+merge/89099
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/bug905035 into lp:zorba

2012-01-17 Thread Matthias Brantner
Matthias Brantner has proposed merging lp:~zorba-coders/zorba/bug905035 into 
lp:zorba.

Requested reviews:
  Markos Zaharioudakis (markos-za)
  Hybridum (hybridum)
  Rodolfo Ochoa (rodolfo-ochoa)
Related bugs:
  Bug #905035 in Zorba: there is no way to get the Namespace Prefixes
  https://bugs.launchpad.net/zorba/+bug/905035

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

Implemented StaticContext::getNamespaceBindings to resolve bug #905035. In the 
same commit, the function getNamespaceURIByPrefix was deprecated because it's 
superseded by the new function.
-- 
https://code.launchpad.net/~zorba-coders/zorba/bug905035/+merge/88922
Your team Zorba Coders is subscribed to branch lp:zorba.
=== modified file 'ChangeLog'
--- ChangeLog	2012-01-11 17:30:25 +
+++ ChangeLog	2012-01-17 19:11:32 +
@@ -21,6 +21,8 @@
 support.
   * zerr is not predeclared anymore to be http://www.zorba-xquery.com/errors
   * Added API method Item::getNamespaceBindings().
+  * Added API method StaticContext::getNamespaceBindings() (see bug #905035)
+  * Deprecated StaticContext:getNamespaceURIByPrefix()
 
 version 2.1
 

=== modified file 'include/zorba/static_context.h'
--- include/zorba/static_context.h	2011-12-21 14:40:33 +
+++ include/zorba/static_context.h	2012-01-17 19:11:32 +
@@ -99,10 +99,21 @@
* could be found for the given prefix and an DiagnosticHandler has been
* registered.
* @throw ZorbaException if an error occured (e.g. no URI could be found for the given prefix).
+   *
+   * @deprecated This function is deprecated. Use getNamespaceBindings instead.
*/
   virtual String
   getNamespaceURIByPrefix( const String aPrefix ) const = 0;
 
+  /**
+   * \brief Get the list of all namespace bindings (prefix, uri)
+   *   declared in this and its parent static contexts.
+   *
+   * @param aBindings the bindings are added to this list
+   */
+  virtual void
+  getNamespaceBindings( NsBindings aBindings ) const = 0;
+
   /** \brief Set the default element and type namespace
* (see http://www.w3.org/TR/xquery/#static_context)
*

=== modified file 'src/api/staticcontextimpl.cpp'
--- src/api/staticcontextimpl.cpp	2012-01-11 17:30:25 +
+++ src/api/staticcontextimpl.cpp	2012-01-17 19:11:32 +
@@ -215,6 +215,37 @@
   return ;
 }
 
+/***
+
+/
+void
+StaticContextImpl::getNamespaceBindings( NsBindings aBindings ) const
+{
+  try
+  {
+store::NsBindings lBindings;
+theCtx-get_namespace_bindings(lBindings);
+
+for (store::NsBindings::const_iterator lIter = lBindings.begin();
+ lIter != lBindings.end(); ++lIter)
+{
+  aBindings.push_back(
+std::pairzorba::String, zorba::String(
+  lIter-first.str(),
+  lIter-second.str()
+)
+  );
+}
+  }
+  catch (ZorbaException const e)
+  {
+ZorbaImpl::notifyError(theDiagnosticHandler, e);
+  }
+  catch (std::exception const e)
+  {
+ZorbaImpl::notifyError(theDiagnosticHandler, e.what());
+  }
+}
 
 /***
 

=== modified file 'src/api/staticcontextimpl.h'
--- src/api/staticcontextimpl.h	2011-12-21 14:40:33 +
+++ src/api/staticcontextimpl.h	2012-01-17 19:11:32 +
@@ -78,6 +78,9 @@
 
   String getNamespaceURIByPrefix( const String prefix ) const;
 
+  void
+  getNamespaceBindings( NsBindings aBindings ) const;
+
   bool setDefaultElementAndTypeNamespace( const String URI );
 
   String getDefaultElementAndTypeNamespace( ) const;

=== modified file 'test/unit/CMakeLists.txt'
--- test/unit/CMakeLists.txt	2012-01-11 17:30:25 +
+++ test/unit/CMakeLists.txt	2012-01-17 19:11:32 +
@@ -94,6 +94,7 @@
   xquery_functions.cpp
   xmldatamanager.cpp
   staticcollectionmanager.cpp
+  static_context.cpp
 )
 
 IF (NOT ZORBA_NO_FULL_TEXT)

=== added file 'test/unit/static_context.cpp'
--- test/unit/static_context.cpp	1970-01-01 00:00:00 +
+++ test/unit/static_context.cpp	2012-01-17 19:11:32 +
@@ -0,0 +1,75 @@
+/*
+ * Copyright 2006-2012 The FLWOR Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include cassert
+#include iostream
+#include list
+#include map
+
+#include sstream
+#include zorba/store_manager.h
+#include zorba/zorba.h
+#include 

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

2012-01-17 Thread Matthias Brantner
I have adapted the fix as suggested. However, I'm not sure how to address 
Rodolfo's issues regarding other language bindings. This seems to be a bigger 
problem which is present in many places in our api.
-- 
https://code.launchpad.net/~zorba-coders/zorba/bug905035/+merge/88922
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/bug905035 into lp:zorba

2012-01-17 Thread Rodolfo Ochoa
Review: Approve

I think I can use it like it is now...
BTW: NSBindings class is no on zorba website's documentation

-- 
https://code.launchpad.net/~zorba-coders/zorba/bug905035/+merge/88922
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/bug905035 into lp:zorba

2012-01-13 Thread Hybridum
Review: Approve


-- 
https://code.launchpad.net/~zorba-coders/zorba/bug905035/+merge/88271
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/bug905035 into lp:zorba

2012-01-12 Thread Rodolfo Ochoa
The proposal to merge lp:~zorba-coders/zorba/bug905035 into lp:zorba has been 
updated.

Status: Needs review = Approved

For more details, see:
https://code.launchpad.net/~zorba-coders/zorba/bug905035/+merge/88271
-- 
https://code.launchpad.net/~zorba-coders/zorba/bug905035/+merge/88271
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/bug905035 into lp:zorba

2012-01-12 Thread Zorba Build Bot
Validation queue starting for merge proposal.
Log at: 
http://zorbatest.lambda.nu:8080/remotequeue/bug905035-2012-01-12T22-04-03.62Z/log.html
-- 
https://code.launchpad.net/~zorba-coders/zorba/bug905035/+merge/88271
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/bug905035 into lp:zorba

2012-01-12 Thread Zorba Build Bot
Validation queue job bug905035-2012-01-12T22-04-03.62Z is finished. The final 
status was:

All tests succeeded!
-- 
https://code.launchpad.net/~zorba-coders/zorba/bug905035/+merge/88271
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/bug905035 into lp:zorba

2012-01-12 Thread Zorba Build Bot
Voting does not meet specified criteria. Required: Approve  1, Disapprove  1. 
Got: 1 Approve, 2 Pending.
-- 
https://code.launchpad.net/~zorba-coders/zorba/bug905035/+merge/88271
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/bug905035 into lp:zorba

2012-01-12 Thread Zorba Build Bot
The proposal to merge lp:~zorba-coders/zorba/bug905035 into lp:zorba has been 
updated.

Status: Approved = Needs review

For more details, see:
https://code.launchpad.net/~zorba-coders/zorba/bug905035/+merge/88271
-- 
https://code.launchpad.net/~zorba-coders/zorba/bug905035/+merge/88271
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/bug905035 into lp:zorba

2012-01-11 Thread Matthias Brantner
Matthias Brantner has proposed merging lp:~zorba-coders/zorba/bug905035 into 
lp:zorba.

Requested reviews:
  Markos Zaharioudakis (markos-za)
  Rodolfo Ochoa (hybridum)
Related bugs:
  Bug #905035 in Zorba: there is no way to get the Namespace Prefixes
  https://bugs.launchpad.net/zorba/+bug/905035

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

implemented StaticContext::getDeclaredPrefixes to resolve bug #905035
-- 
https://code.launchpad.net/~zorba-coders/zorba/bug905035/+merge/88271
Your team Zorba Coders is subscribed to branch lp:zorba.
=== modified file 'ChangeLog'
--- ChangeLog	2012-01-11 17:30:25 +
+++ ChangeLog	2012-01-11 20:46:24 +
@@ -21,6 +21,7 @@
 support.
   * zerr is not predeclared anymore to be http://www.zorba-xquery.com/errors
   * Added API method Item::getNamespaceBindings().
+  * Added API method StaticContext::getDeclaredPrefixes() (see bug #905035)
 
 version 2.1
 

=== modified file 'include/zorba/static_context.h'
--- include/zorba/static_context.h	2011-12-21 14:40:33 +
+++ include/zorba/static_context.h	2012-01-11 20:46:24 +
@@ -103,6 +103,14 @@
   virtual String
   getNamespaceURIByPrefix( const String aPrefix ) const = 0;
 
+  /**
+   * \brief Get the list of prefixes declared in this static context.
+   *
+   * @param aPrefixes the list of prefixes is added to this vector
+   */
+  virtual void
+  getDeclaredPrefixes( std::vectorString aPrefixes ) const = 0;
+
   /** \brief Set the default element and type namespace
* (see http://www.w3.org/TR/xquery/#static_context)
*

=== modified file 'src/api/staticcontextimpl.cpp'
--- src/api/staticcontextimpl.cpp	2012-01-11 17:30:25 +
+++ src/api/staticcontextimpl.cpp	2012-01-11 20:46:24 +
@@ -215,6 +215,32 @@
   return ;
 }
 
+/***
+
+/
+void
+StaticContextImpl::getDeclaredPrefixes( std::vectorString aPrefixes ) const
+{
+  try
+  {
+store::NsBindings lBindings;
+theCtx-get_namespace_bindings(lBindings);
+
+for (store::NsBindings::const_iterator lIter = lBindings.begin();
+ lIter != lBindings.end(); ++lIter)
+{
+  aPrefixes.push_back(lIter-first.str());
+}
+  }
+  catch (ZorbaException const e)
+  {
+ZorbaImpl::notifyError(theDiagnosticHandler, e);
+  }
+  catch (std::exception const e)
+  {
+ZorbaImpl::notifyError(theDiagnosticHandler, e.what());
+  }
+}
 
 /***
 

=== modified file 'src/api/staticcontextimpl.h'
--- src/api/staticcontextimpl.h	2011-12-21 14:40:33 +
+++ src/api/staticcontextimpl.h	2012-01-11 20:46:24 +
@@ -78,6 +78,9 @@
 
   String getNamespaceURIByPrefix( const String prefix ) const;
 
+  void
+  getDeclaredPrefixes( std::vectorString aPrefixes ) const;
+
   bool setDefaultElementAndTypeNamespace( const String URI );
 
   String getDefaultElementAndTypeNamespace( ) const;

=== modified file 'test/unit/CMakeLists.txt'
--- test/unit/CMakeLists.txt	2012-01-11 17:30:25 +
+++ test/unit/CMakeLists.txt	2012-01-11 20:46:24 +
@@ -94,6 +94,7 @@
   xquery_functions.cpp
   xmldatamanager.cpp
   staticcollectionmanager.cpp
+  static_context.cpp
 )
 
 IF (NOT ZORBA_NO_FULL_TEXT)

=== added file 'test/unit/static_context.cpp'
--- test/unit/static_context.cpp	1970-01-01 00:00:00 +
+++ test/unit/static_context.cpp	2012-01-11 20:46:24 +
@@ -0,0 +1,75 @@
+/*
+ * Copyright 2006-2012 The FLWOR Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include cassert
+#include iostream
+#include list
+#include map
+
+#include sstream
+#include zorba/store_manager.h
+#include zorba/zorba.h
+#include zorba/zorba_exception.h
+
+using namespace std;
+using namespace zorba;
+using namespace zorba::locale;
+
+bool
+sctx_test_1(Zorba* const zorba)
+{
+  StaticContext_t lSctx = zorba-createStaticContext();
+
+  Zorba_CompilerHints_t lHints;
+
+  std::stringstream lProlog;
+  lProlog  declare namespace foo = 'http://www.example.com';;
+
+  lSctx-loadProlog(lProlog.str(), lHints);
+
+  std::vectorString lPrefixes;
+  lSctx-getDeclaredPrefixes(lPrefixes);
+
+  bool lFooFound = false;
+
+  for (std::vectorString::const_iterator lIter = lPrefixes.begin();
+   lIter != lPrefixes.end(); ++lIter)
+  {
+std::cout  prefix:   *lIter   bound to 
+  

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

2012-01-11 Thread Matthias Brantner
The proposal to merge lp:~zorba-coders/zorba/bug905035 into lp:zorba has been 
updated.

Status: Needs review = Approved

For more details, see:
https://code.launchpad.net/~zorba-coders/zorba/bug905035/+merge/88271
-- 
https://code.launchpad.net/~zorba-coders/zorba/bug905035/+merge/88271
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/bug905035 into lp:zorba

2012-01-11 Thread Zorba Build Bot
Validation queue starting for merge proposal.
Log at: 
http://zorbatest.lambda.nu:8080/remotequeue/bug905035-2012-01-11T20-48-04.305Z/log.html
-- 
https://code.launchpad.net/~zorba-coders/zorba/bug905035/+merge/88271
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/bug905035 into lp:zorba

2012-01-11 Thread Zorba Build Bot
Voting does not meet specified criteria. Required: Approve  1, Disapprove  1. 
Got: 2 Pending.
-- 
https://code.launchpad.net/~zorba-coders/zorba/bug905035/+merge/88271
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/bug905035 into lp:zorba

2012-01-11 Thread Zorba Build Bot
The proposal to merge lp:~zorba-coders/zorba/bug905035 into lp:zorba has been 
updated.

Status: Approved = Needs review

For more details, see:
https://code.launchpad.net/~zorba-coders/zorba/bug905035/+merge/88271
-- 
https://code.launchpad.net/~zorba-coders/zorba/bug905035/+merge/88271
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/bug905035 into lp:zorba

2012-01-11 Thread Zorba Build Bot
Validation queue job bug905035-2012-01-11T20-48-04.305Z is finished. The final 
status was:

All tests succeeded!
-- 
https://code.launchpad.net/~zorba-coders/zorba/bug905035/+merge/88271
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/bug905035 into lp:zorba

2012-01-11 Thread Rodolfo Ochoa
How hard is to get a zorba iterator instead?
-- 
https://code.launchpad.net/~zorba-coders/zorba/bug905035/+merge/88271
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/bug905035 into lp:zorba

2012-01-11 Thread Chris Hillery
IMHO a Zorba iterator wouldn't be the appropriate way to return this 
information, since it would require wrapping each prefix into an Item (which 
the end-user would probably just call getStringValue() on anyway).
-- 
https://code.launchpad.net/~zorba-coders/zorba/bug905035/+merge/88271
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/bug905035 into lp:zorba

2012-01-11 Thread Rodolfo Ochoa
Review: Approve

It's fine, just FYI, this wouldn't work on Ruby, any usage of vectors from STL 
are excluded from Ruby.
-- 
https://code.launchpad.net/~zorba-coders/zorba/bug905035/+merge/88271
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