[Zorba-coders] [Merge] lp:~zorba-coders/zorba/get-namespace-bindings into lp:zorba
The proposal to merge lp:~zorba-coders/zorba/get-namespace-bindings into lp:zorba has been updated. Status: Needs review = Approved For more details, see: https://code.launchpad.net/~zorba-coders/zorba/get-namespace-bindings/+merge/87187 -- https://code.launchpad.net/~zorba-coders/zorba/get-namespace-bindings/+merge/87187 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/get-namespace-bindings into lp:zorba
Validation queue starting for merge proposal. Log at: http://zorbatest.lambda.nu:8080/remotequeue/get-namespace-bindings-2012-01-10T08-12-08.927Z/log.html -- https://code.launchpad.net/~zorba-coders/zorba/get-namespace-bindings/+merge/87187 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/get-namespace-bindings into lp:zorba
Validation queue job get-namespace-bindings-2012-01-10T08-12-08.927Z is finished. The final status was: All tests succeeded! -- https://code.launchpad.net/~zorba-coders/zorba/get-namespace-bindings/+merge/87187 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/get-namespace-bindings into lp:zorba
Voting does not meet specified criteria. Required: Approve 1, Disapprove 1. Got: 1 Approve, 1 Needs Fixing. -- https://code.launchpad.net/~zorba-coders/zorba/get-namespace-bindings/+merge/87187 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/get-namespace-bindings into lp:zorba
The proposal to merge lp:~zorba-coders/zorba/get-namespace-bindings into lp:zorba has been updated. Status: Approved = Needs review For more details, see: https://code.launchpad.net/~zorba-coders/zorba/get-namespace-bindings/+merge/87187 -- https://code.launchpad.net/~zorba-coders/zorba/get-namespace-bindings/+merge/87187 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/get-namespace-bindings into lp:zorba
The proposal to merge lp:~zorba-coders/zorba/get-namespace-bindings into lp:zorba has been updated. Status: Needs review = Approved For more details, see: https://code.launchpad.net/~zorba-coders/zorba/get-namespace-bindings/+merge/87187 -- https://code.launchpad.net/~zorba-coders/zorba/get-namespace-bindings/+merge/87187 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/get-namespace-bindings into lp:zorba
Validation queue starting for merge proposal. Log at: http://zorbatest.lambda.nu:8080/remotequeue/get-namespace-bindings-2012-01-10T16-00-10.868Z/log.html -- https://code.launchpad.net/~zorba-coders/zorba/get-namespace-bindings/+merge/87187 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/get-namespace-bindings into lp:zorba
The proposal to merge lp:~zorba-coders/zorba/get-namespace-bindings into lp:zorba has been updated. Status: Approved = Merged For more details, see: https://code.launchpad.net/~zorba-coders/zorba/get-namespace-bindings/+merge/87187 -- https://code.launchpad.net/~zorba-coders/zorba/get-namespace-bindings/+merge/87187 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/get-namespace-bindings into lp:zorba
One more thing. Could we pass the NsBindings parameter as reference without breaking backwards compatibly? No, at least not for createElementNode(); it would break binary compatibility. If you don't mind that, I could make the change - it should still be source- compatible, at least. It seems like it not being a reference is not a good idea for performance reasons. I think it's ok to break binary compatibility. -- https://code.launchpad.net/~zorba-coders/zorba/get-namespace-bindings/+merge/87187 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/get-namespace-bindings into lp:zorba
Review: Approve Ok, I moved NsBindings to zorba:: scope (in item.h), and changed createElementNode() to also use it (and clients of createElementNode() to use it also). I've changed the usages of createElementNode() in non-core modules as well, but they compile fine without changes (confirming backwards-compatibility). I'll propose them for merging individually once this change is on the trunk. -- https://code.launchpad.net/~zorba-coders/zorba/get-namespace-bindings/+merge/87187 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/get-namespace-bindings into lp:zorba
The proposal to merge lp:~zorba-coders/zorba/get-namespace-bindings into lp:zorba has been updated. Status: Needs review = Approved For more details, see: https://code.launchpad.net/~zorba-coders/zorba/get-namespace-bindings/+merge/87187 -- https://code.launchpad.net/~zorba-coders/zorba/get-namespace-bindings/+merge/87187 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/get-namespace-bindings into lp:zorba
Validation queue job get-namespace-bindings-2012-01-06T02-19-10.63Z is finished. The final status was: All tests succeeded! -- https://code.launchpad.net/~zorba-coders/zorba/get-namespace-bindings/+merge/87187 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/get-namespace-bindings into lp:zorba
Voting does not meet specified criteria. Required: Approve 1, Disapprove 1. Got: 1 Approve, 1 Needs Fixing. -- https://code.launchpad.net/~zorba-coders/zorba/get-namespace-bindings/+merge/87187 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/get-namespace-bindings into lp:zorba
Review: Needs Fixing One more thing. Could we pass the NsBindings parameter as reference without breaking backwards compatibly? Also, before merging, could you please mention the API extension in the ChangeLog? -- https://code.launchpad.net/~zorba-coders/zorba/get-namespace-bindings/+merge/87187 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/get-namespace-bindings into lp:zorba
One more thing. Could we pass the NsBindings parameter as reference without breaking backwards compatibly? No, at least not for createElementNode(); it would break binary compatibility. If you don't mind that, I could make the change - it should still be source-compatible, at least. Also, before merging, could you please mention the API extension in the ChangeLog? Oops, right - yes, I'll do that. -- https://code.launchpad.net/~zorba-coders/zorba/get-namespace-bindings/+merge/87187 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/get-namespace-bindings into lp:zorba
Regarding vector vs. map, after thinking about it a bit, I agree with you that map would be at least a bit better user experience. However, ItemFactory::createElementNode() takes a vectorpair already, and that can't be changed. I think probably it's best that getNamespaceBindings() be consistent with that API. Fair enough. In fact, probably createElementNode() should be changed to use the same typedef as getNamespaceBindings(). Should I move the typedef for NsBindings into store_consts.h? No, I don't think so. Because the internal NsBindings uses zstring (not zorba::String) -- https://code.launchpad.net/~zorba-coders/zorba/get-namespace-bindings/+merge/87187 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/get-namespace-bindings into lp:zorba
Chris Hillery has proposed merging lp:~zorba-coders/zorba/get-namespace-bindings into lp:zorba. Requested reviews: Zorba Coders (zorba-coders) For more details, see: https://code.launchpad.net/~zorba-coders/zorba/get-namespace-bindings/+merge/87187 Exposes Item::getNamespaceBindings() through the public API. This is necessary for the CSX module. I am not sure whether defining the NsBindings typedef and NsScoping enum on the Item class itself was a good idea or not. -- https://code.launchpad.net/~zorba-coders/zorba/get-namespace-bindings/+merge/87187 Your team Zorba Coders is requested to review the proposed merge of lp:~zorba-coders/zorba/get-namespace-bindings into lp:zorba. === modified file 'doc/cxx/examples/simple.cpp' --- doc/cxx/examples/simple.cpp 2011-06-14 14:21:49 + +++ doc/cxx/examples/simple.cpp 2011-12-31 09:17:24 + @@ -33,14 +33,14 @@ std::cout lQuery std::endl; - return true; + return true; } bool example_2(Zorba* aZorba) { - XQuery_t lQuery = aZorba-compileQuery(1+2); + XQuery_t lQuery = aZorba-compileQuery(1+2); Iterator_t lIterator = lQuery-iterator(); lIterator-open(); @@ -53,7 +53,7 @@ lIterator-close(); - return true; + return true; } @@ -61,7 +61,7 @@ example_3(Zorba* aZorba) { - XQuery_t lQuery = aZorba-compileQuery(1 div 0); + XQuery_t lQuery = aZorba-compileQuery(1 div 0); try { std::cout lQuery std::endl; } catch ( ZorbaException e ) { @@ -69,7 +69,7 @@ return true; } - return false; + return false; } @@ -125,9 +125,7 @@ bool example_7() { - std::cout Zorba::version() std::endl; - return true; } @@ -246,7 +244,8 @@ bool example_12(Zorba* aZorba) { - XQuery_t lQuery = aZorba-compileQuery(ab attr='1'/b attr='2'//a); + XQuery_t lQuery = aZorba-compileQuery + (a xmlns:foo='http://www.zorba-xquery.com/'b attr='1' xmlns:bar='http://www.zorba-xquery.com/uri2'/b attr='2'//a); Iterator_t lIterator = lQuery-iterator(); lIterator-open(); @@ -263,16 +262,22 @@ Item lNodeName; lChild.getNodeName(lNodeName); std::cout node name lNodeName.getStringValue() std::endl; + Iterator_t lAttrIter = lChild.getAttributes(); - lAttrIter-open(); - Item lAttr; while (lAttrIter-next(lAttr)) { std::coutattribute value lAttr.getStringValue() std::endl; } lAttrIter-close(); + + Item::NsBindings lBindings; + lChild.getNamespaceBindings(lBindings, Item::ONLY_LOCAL_NAMESPACES); + for (Item::NsBindings::const_iterator ite = lBindings.begin(); + ite != lBindings.end(); ++ite) { +std::coutnamespace binding ite-first - ite-second std::endl; + } } lChildIter-close(); } === modified file 'include/zorba/item.h' --- include/zorba/item.h 2011-06-14 17:26:33 + +++ include/zorba/item.h 2011-12-31 09:17:24 + @@ -19,6 +19,7 @@ #include iostream #include zorba/config.h #include zorba/api_shared_types.h +#include vector namespace zorba { @@ -266,7 +267,7 @@ /** \brief Get an iterator for the children of this (node) Item. * * Note that this function is only available for node Items. - * The file \link simple.cpp \endlink contains some basic examples the demonstrate + * The file \link simple.cpp \endlink contains some basic examples that demonstrate * the use of this function. * * @return Iterator over the children of this node. @@ -278,7 +279,7 @@ /** \brief Get an iterator for the attributes of this (node) Item. * * Note that this function is only available for node Items. - * The file \link simple.cpp \endlink contains some basic examples the demonstrate + * The file \link simple.cpp \endlink contains some basic examples that demonstrate * the use of this function. * * @return Iterator over the attributes of this node. @@ -287,6 +288,29 @@ Iterator_t getAttributes() const; + /** \brief Get an iterator for the namespace bindings of this (element) Item. +* +* Note that this function is only available for element Items. +* 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 aScope 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). +* @throw ZorbaException if an error occured, e.g. the Item is not of type element. +*/ + typedef std::vectorstd::pairString, String NsBindings; + enum NsScoping { +ALL_NAMESPACES, +ONLY_LOCAL_NAMESPACES, +ONLY_PARENT_NAMESPACES + }; + void + getNamespaceBindings(NsBindings
[Zorba-coders] [Merge] lp:~zorba-coders/zorba/get-namespace-bindings into lp:zorba
The proposal to merge lp:~zorba-coders/zorba/get-namespace-bindings into lp:zorba has been updated. Status: Needs review = Approved For more details, see: https://code.launchpad.net/~zorba-coders/zorba/get-namespace-bindings/+merge/87187 -- https://code.launchpad.net/~zorba-coders/zorba/get-namespace-bindings/+merge/87187 Your team Zorba Coders is requested to review the proposed merge of lp:~zorba-coders/zorba/get-namespace-bindings into 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/get-namespace-bindings into lp:zorba
The proposal to merge lp:~zorba-coders/zorba/get-namespace-bindings into lp:zorba has been updated. Status: Approved = Needs review For more details, see: https://code.launchpad.net/~zorba-coders/zorba/get-namespace-bindings/+merge/87187 -- https://code.launchpad.net/~zorba-coders/zorba/get-namespace-bindings/+merge/87187 Your team Zorba Coders is requested to review the proposed merge of lp:~zorba-coders/zorba/get-namespace-bindings into 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