Merge lp:~zorba-coders/zorba/jsoniq into lp:zorba

Proposed by Chris Hillery
Status: Superseded
Proposed branch: lp:~zorba-coders/zorba/jsoniq
Merge into: lp:zorba
Diff against target: 76314 lines (+37920/-17325)
470 files modified
CMakeConfiguration.txt (+3/-0)
ChangeLog (+1/-0)
NOTICE.txt (+0/-740)
doc/cxx/examples/CMakeLists.txt (+4/-0)
doc/cxx/examples/jsoniq.cpp (+255/-0)
doc/zorba/indexpage.dox.in (+1/-1)
doc/zorba/jsoniq.dox (+66/-0)
include/zorba/config.h.cmake (+1/-0)
include/zorba/diagnostic.h (+9/-1)
include/zorba/error.h (+7/-0)
include/zorba/identtypes.h (+16/-4)
include/zorba/internal/qname.h (+40/-0)
include/zorba/item.h (+92/-0)
include/zorba/options.h (+5/-1)
include/zorba/pregenerated/diagnostic_list.h (+68/-0)
include/zorba/store_consts.h (+42/-8)
include/zorba/typeident.h (+44/-34)
modules/ExternalModules.conf (+1/-1)
modules/com/zorba-xquery/www/modules/CMakeLists.txt (+9/-0)
modules/com/zorba-xquery/www/modules/converters/json-options.xsd (+47/-0)
modules/com/zorba-xquery/www/modules/converters/json.xq (+231/-0)
modules/com/zorba-xquery/www/modules/pregenerated/errors.xq (+73/-1)
modules/com/zorba-xquery/www/modules/store/jsoniq/dynamic/collections/ddl.xq (+122/-0)
modules/com/zorba-xquery/www/modules/store/jsoniq/dynamic/collections/dml.xq (+354/-0)
modules/org/CMakeLists.txt (+2/-0)
modules/org/jsoniq/CMakeLists.txt (+15/-0)
modules/org/jsoniq/www/CMakeLists.txt (+21/-0)
modules/org/jsoniq/www/functions.xq (+272/-0)
modules/org/jsoniq/www/pregenerated/errors.xq (+104/-0)
src/annotations/annotations.h (+1/-1)
src/api/collectionimpl.cpp (+11/-6)
src/api/dynamiccontextimpl.cpp (+2/-1)
src/api/item.cpp (+108/-0)
src/api/options.cpp (+12/-1)
src/api/serialization/serializer.cpp (+379/-26)
src/api/serialization/serializer.h (+116/-19)
src/api/serializerimpl.cpp (+18/-3)
src/api/typeidentimpl.cpp (+61/-7)
src/compiler/codegen/plan_visitor.cpp (+110/-6)
src/compiler/expression/CMakeLists.txt (+1/-0)
src/compiler/expression/abstract_expr_visitor.h (+9/-2)
src/compiler/expression/expr.cpp (+4/-6)
src/compiler/expression/expr.h (+6/-0)
src/compiler/expression/expr_annotations.cpp (+0/-71)
src/compiler/expression/expr_annotations.h (+0/-54)
src/compiler/expression/expr_base.cpp (+5/-0)
src/compiler/expression/expr_base.h (+6/-0)
src/compiler/expression/expr_classes.h (+6/-0)
src/compiler/expression/expr_iter.cpp (+40/-0)
src/compiler/expression/expr_put.cpp (+44/-14)
src/compiler/expression/expr_type.cpp (+40/-26)
src/compiler/expression/expr_visitor.h (+6/-0)
src/compiler/expression/flwor_expr.cpp (+1/-1)
src/compiler/expression/fo_expr.cpp (+1/-2)
src/compiler/expression/json_exprs.cpp (+197/-0)
src/compiler/expression/json_exprs.h (+156/-0)
src/compiler/expression/script_exprs.h (+0/-14)
src/compiler/parser/xquery_parser.cpp (+8276/-7583)
src/compiler/parser/xquery_parser.hpp (+29/-24)
src/compiler/parser/xquery_parser.y (+253/-51)
src/compiler/parser/xquery_scanner.cpp (+3215/-3117)
src/compiler/parser/xquery_scanner.l (+35/-12)
src/compiler/parsetree/parsenode_print_dot_visitor.h (+6/-0)
src/compiler/parsetree/parsenode_print_xml_visitor.cpp (+84/-27)
src/compiler/parsetree/parsenode_print_xqdoc_visitor.cpp (+9/-2)
src/compiler/parsetree/parsenode_print_xquery_visitor.cpp (+31/-13)
src/compiler/parsetree/parsenode_visitor.h (+8/-0)
src/compiler/parsetree/parsenodes.cpp (+117/-1)
src/compiler/parsetree/parsenodes.h (+118/-4)
src/compiler/rewriter/rules/flwor_rules.cpp (+4/-9)
src/compiler/rewriter/rules/fold_rules.cpp (+4/-8)
src/compiler/rewriter/rules/hoist_rules.cpp (+2/-4)
src/compiler/rewriter/rules/index_join_rule.cpp (+3/-3)
src/compiler/rewriter/rules/nodeid_rules.cpp (+85/-12)
src/compiler/rewriter/rules/type_rules.cpp (+2/-2)
src/compiler/rewriter/tools/dataflow_annotations.cpp (+15/-3)
src/compiler/translator/translator.cpp (+463/-93)
src/compiler/xqddf/value_index.cpp (+1/-1)
src/context/default_url_resolvers.cpp (+1/-1)
src/context/root_static_context.cpp (+10/-10)
src/context/static_context.cpp (+44/-2)
src/context/static_context.h (+7/-0)
src/diagnostics/CMakeLists.txt (+22/-3)
src/diagnostics/diagnostic.cpp (+8/-0)
src/diagnostics/diagnostic_en.xml (+213/-19)
src/diagnostics/diagnostic_list_cpp.xq (+1/-0)
src/diagnostics/diagnostic_list_h.xq (+1/-0)
src/diagnostics/diagnostic_list_xq.xq (+3/-1)
src/diagnostics/pregenerated/diagnostic_list.cpp (+99/-0)
src/diagnostics/pregenerated/dict_en.cpp (+77/-7)
src/diagnostics/qname.cpp (+41/-0)
src/functions/CMakeLists.txt (+6/-0)
src/functions/func_accessors_impl.cpp (+1/-1)
src/functions/func_arithmetic.cpp (+5/-5)
src/functions/func_booleans_impl.cpp (+1/-1)
src/functions/func_collections_impl.cpp (+651/-331)
src/functions/func_enclosed.cpp (+41/-1)
src/functions/func_jsoniq_functions_impl.cpp (+76/-0)
src/functions/func_sequences_impl.cpp (+8/-4)
src/functions/function.cpp (+3/-5)
src/functions/library.cpp (+10/-0)
src/functions/pregenerated/func_accessors.cpp (+36/-36)
src/functions/pregenerated/func_any_uri.cpp (+6/-6)
src/functions/pregenerated/func_base64.cpp (+6/-6)
src/functions/pregenerated/func_booleans.cpp (+9/-9)
src/functions/pregenerated/func_collections.cpp (+641/-291)
src/functions/pregenerated/func_collections.h (+348/-348)
src/functions/pregenerated/func_context.cpp (+24/-24)
src/functions/pregenerated/func_documents.cpp (+15/-15)
src/functions/pregenerated/func_durations_dates_times.cpp (+63/-63)
src/functions/pregenerated/func_errors_and_diagnostics.cpp (+15/-15)
src/functions/pregenerated/func_fetch.cpp (+6/-6)
src/functions/pregenerated/func_fnput.cpp (+3/-3)
src/functions/pregenerated/func_function_item_iter.cpp (+12/-12)
src/functions/pregenerated/func_ic_ddl.cpp (+9/-9)
src/functions/pregenerated/func_json.cpp (+87/-0)
src/functions/pregenerated/func_json.h (+79/-0)
src/functions/pregenerated/func_jsoniq_functions.cpp (+679/-0)
src/functions/pregenerated/func_jsoniq_functions.h (+503/-0)
src/functions/pregenerated/func_maps.cpp (+28/-28)
src/functions/pregenerated/func_maths.cpp (+78/-78)
src/functions/pregenerated/func_node_position.cpp (+72/-72)
src/functions/pregenerated/func_nodes.cpp (+75/-75)
src/functions/pregenerated/func_numerics.cpp (+33/-33)
src/functions/pregenerated/func_other_diagnostics.cpp (+6/-6)
src/functions/pregenerated/func_parse_fragment.cpp (+6/-6)
src/functions/pregenerated/func_parsing_and_serializing.cpp (+12/-12)
src/functions/pregenerated/func_qnames.cpp (+24/-24)
src/functions/pregenerated/func_random.cpp (+12/-12)
src/functions/pregenerated/func_schema.cpp (+12/-12)
src/functions/pregenerated/func_sctx.cpp (+75/-75)
src/functions/pregenerated/func_sequences.cpp (+121/-121)
src/functions/pregenerated/func_strings.cpp (+136/-136)
src/functions/pregenerated/func_xqdoc.cpp (+6/-6)
src/functions/pregenerated/function_enum.h (+93/-46)
src/precompiled/stdafx.h (+1/-1)
src/runtime/CMakeLists.txt (+7/-0)
src/runtime/accessors/accessors_impl.cpp (+22/-3)
src/runtime/base/plan_iterator.h (+4/-0)
src/runtime/booleans/BooleanImpl.cpp (+6/-2)
src/runtime/collections/collections_base.cpp (+25/-18)
src/runtime/collections/collections_base.h (+45/-56)
src/runtime/collections/collections_impl.cpp (+506/-658)
src/runtime/collections/collections_impl.h (+12/-3)
src/runtime/collections/pregenerated/collections.h (+137/-84)
src/runtime/core/constructors.cpp (+15/-17)
src/runtime/core/constructors.h (+12/-0)
src/runtime/core/path_iterators.cpp (+39/-33)
src/runtime/core/path_iterators.h (+2/-2)
src/runtime/core/sequencetypes.cpp (+15/-15)
src/runtime/json/jansson_wrapper.cpp (+729/-0)
src/runtime/json/jansson_wrapper.h (+56/-0)
src/runtime/json/json_constructors.cpp (+276/-0)
src/runtime/json/json_constructors.h (+135/-0)
src/runtime/json/json_impl.cpp (+527/-0)
src/runtime/json/jsoniq_functions_impl.cpp (+1025/-0)
src/runtime/json/pregenerated/json.cpp (+94/-0)
src/runtime/json/pregenerated/json.h (+114/-0)
src/runtime/json/pregenerated/jsoniq_functions.cpp (+654/-0)
src/runtime/json/pregenerated/jsoniq_functions.h (+892/-0)
src/runtime/spec/codegen-cpp.xq (+20/-7)
src/runtime/spec/codegen-h.xq (+13/-0)
src/runtime/spec/collections/collections.xml (+436/-316)
src/runtime/spec/json/json.xml (+52/-0)
src/runtime/spec/json/jsoniq_functions.xml (+614/-0)
src/runtime/spec/mappings.xml (+35/-15)
src/runtime/update/update.cpp (+5/-1)
src/runtime/visitors/planiter_visitor_impl_code.h (+8/-0)
src/runtime/visitors/planiter_visitor_impl_include.h (+7/-0)
src/runtime/visitors/pregenerated/planiter_visitor.h (+157/-0)
src/runtime/visitors/pregenerated/printer_visitor.cpp (+345/-0)
src/runtime/visitors/pregenerated/printer_visitor.h (+111/-0)
src/runtime/visitors/printer_visitor_impl.cpp (+8/-0)
src/runtime/visitors/printer_visitor_impl.h (+5/-0)
src/store/api/collection.h (+7/-4)
src/store/api/item.h (+105/-13)
src/store/api/item_factory.h (+21/-0)
src/store/api/pul.h (+66/-8)
src/store/api/store.h (+25/-6)
src/store/api/update_consts.h (+23/-0)
src/store/api/xs_type_codes.h (+2/-0)
src/store/naive/CMakeLists.txt (+8/-0)
src/store/naive/collection_set.cpp (+41/-25)
src/store/naive/collection_set.h (+86/-85)
src/store/naive/item.cpp (+163/-29)
src/store/naive/json_items.cpp (+704/-0)
src/store/naive/json_items.h (+479/-0)
src/store/naive/json_loader.cpp (+312/-0)
src/store/naive/json_loader.h (+72/-0)
src/store/naive/name_iterator.h (+68/-62)
src/store/naive/node_items.cpp (+2/-3)
src/store/naive/node_items.h (+2/-2)
src/store/naive/pul_primitive_factory.cpp (+245/-169)
src/store/naive/pul_primitive_factory.h (+74/-8)
src/store/naive/pul_primitives.cpp (+365/-68)
src/store/naive/pul_primitives.h (+197/-27)
src/store/naive/shared_types.h (+22/-0)
src/store/naive/simple_collection.cpp (+404/-184)
src/store/naive/simple_collection.h (+29/-37)
src/store/naive/simple_item_factory.cpp (+106/-18)
src/store/naive/simple_item_factory.h (+24/-0)
src/store/naive/simple_pul.cpp (+372/-78)
src/store/naive/simple_pul.h (+88/-9)
src/store/naive/simple_store.cpp (+88/-24)
src/store/naive/simple_store.h (+29/-4)
src/types/casting.cpp (+124/-87)
src/types/casting.h (+2/-2)
src/types/root_typemanager.cpp (+251/-156)
src/types/root_typemanager.h (+72/-30)
src/types/schema/EventSchemaValidator.cpp (+3/-1)
src/types/schema/revalidateUtils.cpp (+3/-2)
src/types/schema/validate.cpp (+5/-2)
src/types/typeimpl.cpp (+416/-59)
src/types/typeimpl.h (+253/-175)
src/types/typemanager.h (+24/-16)
src/types/typemanagerimpl.cpp (+140/-95)
src/types/typemanagerimpl.h (+31/-23)
src/types/typeops.cpp (+663/-502)
src/types/typeops.h (+0/-39)
src/unit_tests/CMakeLists.txt (+2/-0)
src/unit_tests/json_parser.cpp (+636/-0)
src/unit_tests/json_parser.cpp.moved (+623/-0)
src/unit_tests/unit_test_list.h (+1/-0)
src/unit_tests/unit_tests.cpp (+1/-0)
src/util/CMakeLists.txt (+1/-0)
src/util/json_parser.cpp (+634/-0)
src/util/json_parser.h (+553/-0)
src/util/stl_util.h (+2/-0)
src/zorbamisc/ns_consts.h (+9/-0)
test/parser/parsertestdriver.cpp (+2/-0)
test/rbkt/ExpCompilerResults/IterPlan/zorba/hashjoins/idx4.iter (+24/-22)
test/rbkt/ExpCompilerResults/IterPlan/zorba/no-copy/hashjoin-idx4.iter (+24/-22)
test/rbkt/ExpQueryResults/zorba/json/json-parse-array-01.xml.res (+3/-0)
test/rbkt/ExpQueryResults/zorba/json/json-parse-array-02.xml.res (+3/-0)
test/rbkt/ExpQueryResults/zorba/json/json-parse-array-03.xml.res (+3/-0)
test/rbkt/ExpQueryResults/zorba/json/json-parse-array-04.xml.res (+3/-0)
test/rbkt/ExpQueryResults/zorba/json/json-parse-array-05.xml.res (+4/-0)
test/rbkt/ExpQueryResults/zorba/json/json-parse-object-01.xml.res (+3/-0)
test/rbkt/ExpQueryResults/zorba/json/json-parse-object-02.xml.res (+4/-0)
test/rbkt/ExpQueryResults/zorba/json/json-parse-snelson.xml.res (+14/-0)
test/rbkt/ExpQueryResults/zorba/json/json-serialize-array-01.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/jsoniq/arr_constr_01.xml.res (+2/-0)
test/rbkt/ExpQueryResults/zorba/jsoniq/arr_constr_02.xml.res (+2/-0)
test/rbkt/ExpQueryResults/zorba/jsoniq/arr_constr_03.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/jsoniq/arr_constr_14.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/jsoniq/arr_constr_15.xml.res (+2/-0)
test/rbkt/ExpQueryResults/zorba/jsoniq/arr_constr_16.xml.res (+2/-0)
test/rbkt/ExpQueryResults/zorba/jsoniq/arr_constr_17.xml.res (+2/-0)
test/rbkt/ExpQueryResults/zorba/jsoniq/arr_constr_18.xml.res (+2/-0)
test/rbkt/ExpQueryResults/zorba/jsoniq/arr_constr_21.xml.res (+2/-0)
test/rbkt/ExpQueryResults/zorba/jsoniq/arr_constr_210.xml.res (+2/-0)
test/rbkt/ExpQueryResults/zorba/jsoniq/arr_constr_211.xml.res (+2/-0)
test/rbkt/ExpQueryResults/zorba/jsoniq/arr_constr_212.xml.res (+2/-0)
test/rbkt/ExpQueryResults/zorba/jsoniq/arr_constr_213.xml.res (+2/-0)
test/rbkt/ExpQueryResults/zorba/jsoniq/arr_constr_22.xml.res (+2/-0)
test/rbkt/ExpQueryResults/zorba/jsoniq/arr_constr_23.xml.res (+2/-0)
test/rbkt/ExpQueryResults/zorba/jsoniq/arr_constr_24.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/jsoniq/arr_constr_25.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/jsoniq/arr_constr_26.xml.res (+2/-0)
test/rbkt/ExpQueryResults/zorba/jsoniq/arr_constr_27.xml.res (+2/-0)
test/rbkt/ExpQueryResults/zorba/jsoniq/arr_constr_28.xml.res (+2/-0)
test/rbkt/ExpQueryResults/zorba/jsoniq/arr_constr_29.xml.res (+2/-0)
test/rbkt/ExpQueryResults/zorba/jsoniq/arr_constr_3_1.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/jsoniq/arr_constr_3_2.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/jsoniq/arr_constr_3_3.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/jsoniq/arr_constr_3_4.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/jsoniq/arr_constr_3_5.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/jsoniq/arr_constr_3_6.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/jsoniq/arr_constr_3_7.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/jsoniq/arr_constr_4_1.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/jsoniq/arr_constr_4_2.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/jsoniq/arr_constr_4_3.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/jsoniq/arr_constr_5_1.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/jsoniq/arr_constr_5_2.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/jsoniq/arr_constr_6_1.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/jsoniq/arr_constr_6_3.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/jsoniq/arr_constr_7_1.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/jsoniq/arr_constr_7_2.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/jsoniq/arr_constr_7_3.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/jsoniq/arr_constr_7_5.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/jsoniq/arr_constr_7_6.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/jsoniq/coll_dyn_01.xml.res (+7/-0)
test/rbkt/ExpQueryResults/zorba/jsoniq/coll_dyn_03.xml.res (+14/-0)
test/rbkt/ExpQueryResults/zorba/jsoniq/delete01.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/jsoniq/delete02.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/jsoniq/delete10.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/jsoniq/delete11.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/jsoniq/empty_member01.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/jsoniq/empty_member02.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/jsoniq/empty_member03.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/jsoniq/empty_member04.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/jsoniq/empty_member05.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/jsoniq/empty_member06.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/jsoniq/flatten_01.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/jsoniq/fn_boolean_01.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/jsoniq/insert01.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/jsoniq/insert03.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/jsoniq/insert04.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/jsoniq/insert05.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/jsoniq/insert06.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/jsoniq/member_01.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/jsoniq/names_01.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/jsoniq/names_02.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/jsoniq/null01.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/jsoniq/null02.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/jsoniq/null03.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/jsoniq/obj_constr_01.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/jsoniq/object_01.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/jsoniq/object_02.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/jsoniq/pair_01.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/jsoniq/rename01.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/jsoniq/replace01.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/jsoniq/string01.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/jsoniq/use_case01.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/jsoniq/use_case01_2.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/jsoniq/use_case02.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/jsoniq/use_case03.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/jsoniq/use_case04.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/jsoniq/use_case05.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/jsoniq/use_case06.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/jsoniq/use_case07.xml.res (+2/-0)
test/rbkt/ExpQueryResults/zorba/jsoniq/use_case08.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/jsoniq/use_case09.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/jsoniq/use_case10.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/jsoniq/use_case11.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/jsoniq/value_01.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/jsoniq/values_01.xml.res (+1/-0)
test/rbkt/Queries/CMakeLists.txt (+7/-0)
test/rbkt/Queries/zorba/json/json-parse-array-01.xq (+5/-0)
test/rbkt/Queries/zorba/json/json-parse-array-02.xq (+5/-0)
test/rbkt/Queries/zorba/json/json-parse-array-03.xq (+5/-0)
test/rbkt/Queries/zorba/json/json-parse-array-04.xq (+5/-0)
test/rbkt/Queries/zorba/json/json-parse-array-05.xq (+5/-0)
test/rbkt/Queries/zorba/json/json-parse-object-01.xq (+5/-0)
test/rbkt/Queries/zorba/json/json-parse-object-02.xq (+5/-0)
test/rbkt/Queries/zorba/json/json-parse-snelson.xq (+20/-0)
test/rbkt/Queries/zorba/json/json-serialize-array-01.xq (+8/-0)
test/rbkt/Queries/zorba/jsoniq/arr_constr_01.xq (+4/-0)
test/rbkt/Queries/zorba/jsoniq/arr_constr_02.xq (+2/-0)
test/rbkt/Queries/zorba/jsoniq/arr_constr_03.xq (+2/-0)
test/rbkt/Queries/zorba/jsoniq/arr_constr_14.xq (+2/-0)
test/rbkt/Queries/zorba/jsoniq/arr_constr_15.xq (+7/-0)
test/rbkt/Queries/zorba/jsoniq/arr_constr_16.xq (+4/-0)
test/rbkt/Queries/zorba/jsoniq/arr_constr_17.xq (+5/-0)
test/rbkt/Queries/zorba/jsoniq/arr_constr_18.xq (+4/-0)
test/rbkt/Queries/zorba/jsoniq/arr_constr_21.xq (+6/-0)
test/rbkt/Queries/zorba/jsoniq/arr_constr_210.xq (+9/-0)
test/rbkt/Queries/zorba/jsoniq/arr_constr_211.xq (+9/-0)
test/rbkt/Queries/zorba/jsoniq/arr_constr_212.xq (+9/-0)
test/rbkt/Queries/zorba/jsoniq/arr_constr_213.xq (+9/-0)
test/rbkt/Queries/zorba/jsoniq/arr_constr_22.xq (+7/-0)
test/rbkt/Queries/zorba/jsoniq/arr_constr_23.xq (+6/-0)
test/rbkt/Queries/zorba/jsoniq/arr_constr_24.xq (+6/-0)
test/rbkt/Queries/zorba/jsoniq/arr_constr_25.xq (+6/-0)
test/rbkt/Queries/zorba/jsoniq/arr_constr_26.xq (+10/-0)
test/rbkt/Queries/zorba/jsoniq/arr_constr_27.xq (+10/-0)
test/rbkt/Queries/zorba/jsoniq/arr_constr_28.xq (+10/-0)
test/rbkt/Queries/zorba/jsoniq/arr_constr_29.xq (+9/-0)
test/rbkt/Queries/zorba/jsoniq/arr_constr_3_1.xq (+11/-0)
test/rbkt/Queries/zorba/jsoniq/arr_constr_3_2.xq (+10/-0)
test/rbkt/Queries/zorba/jsoniq/arr_constr_3_3.xq (+10/-0)
test/rbkt/Queries/zorba/jsoniq/arr_constr_3_4.xq (+14/-0)
test/rbkt/Queries/zorba/jsoniq/arr_constr_3_5.xq (+6/-0)
test/rbkt/Queries/zorba/jsoniq/arr_constr_3_6.xq (+6/-0)
test/rbkt/Queries/zorba/jsoniq/arr_constr_3_7.xq (+6/-0)
test/rbkt/Queries/zorba/jsoniq/arr_constr_4_1.xq (+3/-0)
test/rbkt/Queries/zorba/jsoniq/arr_constr_4_2.xq (+2/-0)
test/rbkt/Queries/zorba/jsoniq/arr_constr_4_3.xq (+1/-0)
test/rbkt/Queries/zorba/jsoniq/arr_constr_5_1.xq (+2/-0)
test/rbkt/Queries/zorba/jsoniq/arr_constr_5_2.xq (+2/-0)
test/rbkt/Queries/zorba/jsoniq/arr_constr_6_1.xq (+2/-0)
test/rbkt/Queries/zorba/jsoniq/arr_constr_6_2.xq (+2/-0)
test/rbkt/Queries/zorba/jsoniq/arr_constr_6_3.xq (+2/-0)
test/rbkt/Queries/zorba/jsoniq/arr_constr_7_1.xq (+4/-0)
test/rbkt/Queries/zorba/jsoniq/arr_constr_7_2.xq (+2/-0)
test/rbkt/Queries/zorba/jsoniq/arr_constr_7_3.xq (+2/-0)
test/rbkt/Queries/zorba/jsoniq/arr_constr_7_4.xq (+2/-0)
test/rbkt/Queries/zorba/jsoniq/arr_constr_7_5.xq (+2/-0)
test/rbkt/Queries/zorba/jsoniq/arr_constr_7_6.xq (+2/-0)
test/rbkt/Queries/zorba/jsoniq/coll_dyn_01.xq (+57/-0)
test/rbkt/Queries/zorba/jsoniq/coll_dyn_02.spec (+1/-0)
test/rbkt/Queries/zorba/jsoniq/coll_dyn_02.xq (+16/-0)
test/rbkt/Queries/zorba/jsoniq/coll_dyn_03.xq (+94/-0)
test/rbkt/Queries/zorba/jsoniq/data01.spec (+1/-0)
test/rbkt/Queries/zorba/jsoniq/data01.xq (+1/-0)
test/rbkt/Queries/zorba/jsoniq/data02.spec (+1/-0)
test/rbkt/Queries/zorba/jsoniq/data02.xq (+1/-0)
test/rbkt/Queries/zorba/jsoniq/data03.spec (+1/-0)
test/rbkt/Queries/zorba/jsoniq/data03.xq (+1/-0)
test/rbkt/Queries/zorba/jsoniq/data04.spec (+1/-0)
test/rbkt/Queries/zorba/jsoniq/data04.xq (+1/-0)
test/rbkt/Queries/zorba/jsoniq/delete01.xq (+7/-0)
test/rbkt/Queries/zorba/jsoniq/delete02.xq (+8/-0)
test/rbkt/Queries/zorba/jsoniq/delete03.spec (+1/-0)
test/rbkt/Queries/zorba/jsoniq/delete03.xq (+5/-0)
test/rbkt/Queries/zorba/jsoniq/delete04.spec (+1/-0)
test/rbkt/Queries/zorba/jsoniq/delete04.xq (+6/-0)
test/rbkt/Queries/zorba/jsoniq/delete05.spec (+2/-0)
test/rbkt/Queries/zorba/jsoniq/delete05.xq (+5/-0)
test/rbkt/Queries/zorba/jsoniq/delete06.spec (+1/-0)
test/rbkt/Queries/zorba/jsoniq/delete06.xq (+5/-0)
test/rbkt/Queries/zorba/jsoniq/delete07.spec (+1/-0)
test/rbkt/Queries/zorba/jsoniq/delete07.xq (+5/-0)
test/rbkt/Queries/zorba/jsoniq/delete08.spec (+1/-0)
test/rbkt/Queries/zorba/jsoniq/delete08.xq (+5/-0)
test/rbkt/Queries/zorba/jsoniq/delete09.spec (+1/-0)
test/rbkt/Queries/zorba/jsoniq/delete09.xq (+5/-0)
test/rbkt/Queries/zorba/jsoniq/delete10.xq (+6/-0)
test/rbkt/Queries/zorba/jsoniq/delete11.xq (+11/-0)
test/rbkt/Queries/zorba/jsoniq/empty_member01.xq (+7/-0)
test/rbkt/Queries/zorba/jsoniq/empty_member02.xq (+10/-0)
test/rbkt/Queries/zorba/jsoniq/empty_member03.xq (+1/-0)
test/rbkt/Queries/zorba/jsoniq/empty_member04.xq (+1/-0)
test/rbkt/Queries/zorba/jsoniq/empty_member05.xq (+1/-0)
test/rbkt/Queries/zorba/jsoniq/empty_member06.xq (+12/-0)
test/rbkt/Queries/zorba/jsoniq/flatten_01.xq (+3/-0)
test/rbkt/Queries/zorba/jsoniq/fn_boolean_01.xq (+5/-0)
test/rbkt/Queries/zorba/jsoniq/insert01.xq (+7/-0)
test/rbkt/Queries/zorba/jsoniq/insert02.spec (+1/-0)
test/rbkt/Queries/zorba/jsoniq/insert02.xq (+3/-0)
test/rbkt/Queries/zorba/jsoniq/insert03.xq (+8/-0)
test/rbkt/Queries/zorba/jsoniq/insert04.xq (+12/-0)
test/rbkt/Queries/zorba/jsoniq/insert05.xq (+10/-0)
test/rbkt/Queries/zorba/jsoniq/insert06.xq (+27/-0)
test/rbkt/Queries/zorba/jsoniq/insert07.spec (+2/-0)
test/rbkt/Queries/zorba/jsoniq/insert07.xq (+9/-0)
test/rbkt/Queries/zorba/jsoniq/member_01.xq (+4/-0)
test/rbkt/Queries/zorba/jsoniq/member_03.spec (+1/-0)
test/rbkt/Queries/zorba/jsoniq/member_03.xq (+5/-0)
test/rbkt/Queries/zorba/jsoniq/names_01.xq (+3/-0)
test/rbkt/Queries/zorba/jsoniq/names_02.xq (+4/-0)
test/rbkt/Queries/zorba/jsoniq/null01.xq (+3/-0)
test/rbkt/Queries/zorba/jsoniq/null02.xq (+3/-0)
test/rbkt/Queries/zorba/jsoniq/null03.xq (+4/-0)
test/rbkt/Queries/zorba/jsoniq/obj_constr_01.xq (+3/-0)
test/rbkt/Queries/zorba/jsoniq/object_01.xq (+4/-0)
test/rbkt/Queries/zorba/jsoniq/object_02.xq (+16/-0)
test/rbkt/Queries/zorba/jsoniq/pair_01.xq (+5/-0)
test/rbkt/Queries/zorba/jsoniq/pair_02.spec (+1/-0)
test/rbkt/Queries/zorba/jsoniq/pair_02.xq (+6/-0)
test/rbkt/Queries/zorba/jsoniq/parser_01.spec (+1/-0)
test/rbkt/Queries/zorba/jsoniq/parser_01.xq (+3/-0)
test/rbkt/Queries/zorba/jsoniq/rename01.xq (+7/-0)
test/rbkt/Queries/zorba/jsoniq/rename02.spec (+1/-0)
test/rbkt/Queries/zorba/jsoniq/rename02.xq (+5/-0)
test/rbkt/Queries/zorba/jsoniq/rename03.spec (+1/-0)
test/rbkt/Queries/zorba/jsoniq/rename03.xq (+5/-0)
test/rbkt/Queries/zorba/jsoniq/replace01.xq (+8/-0)
test/rbkt/Queries/zorba/jsoniq/string01.xq (+1/-0)
test/rbkt/Queries/zorba/jsoniq/string02.spec (+1/-0)
test/rbkt/Queries/zorba/jsoniq/string02.xq (+1/-0)
test/rbkt/Queries/zorba/jsoniq/use_case01.xq (+30/-0)
test/rbkt/Queries/zorba/jsoniq/use_case01_2.xq (+29/-0)
test/rbkt/Queries/zorba/jsoniq/use_case02.xq (+26/-0)
test/rbkt/Queries/zorba/jsoniq/use_case03.xq (+62/-0)
test/rbkt/Queries/zorba/jsoniq/use_case04.xq (+32/-0)
test/rbkt/Queries/zorba/jsoniq/use_case05.xml (+44/-0)
test/rbkt/Queries/zorba/jsoniq/use_case05.xq (+10/-0)
test/rbkt/Queries/zorba/jsoniq/use_case06.xq (+16/-0)
test/rbkt/Queries/zorba/jsoniq/use_case07.xq (+33/-0)
test/rbkt/Queries/zorba/jsoniq/use_case08.xq (+24/-0)
test/rbkt/Queries/zorba/jsoniq/use_case09.xq (+33/-0)
test/rbkt/Queries/zorba/jsoniq/use_case10.xq (+20/-0)
test/rbkt/Queries/zorba/jsoniq/use_case11.xq (+53/-0)
test/rbkt/Queries/zorba/jsoniq/value_01.xq (+3/-0)
test/rbkt/Queries/zorba/jsoniq/values_01.xq (+4/-0)
test/rbkt/Queries/zorba/xqddf/daniel/i1.xq (+3/-1)
test/rbkt/specification.h (+7/-1)
test/rbkt/testdriver.cpp (+5/-0)
test/unit/CMakeLists.txt (+1/-0)
To merge this branch: bzr merge lp:~zorba-coders/zorba/jsoniq
Reviewer Review Type Date Requested Status
Zorba Coders Pending
Review via email: mp+90812@code.launchpad.net

This proposal has been superseded by a proposal from 2012-02-07.

Commit message

Adds JSONiq. (Please replace with more comprehensive commit message; this is just to make the validation queue start.)

Description of the change

Adds JSONiq.

To post a comment you must log in.
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

Validation queue starting for merge proposal.
Log at: http://zorbatest.lambda.nu:8080/remotequeue/-2012-01-31T00-53-26.285Z/log.html

Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

The attempt to merge lp:zorba/3.0 into lp:zorba failed. Below is the output from the failed tests.

CMake Error at /home/ceej/zo/testing/zorbatest/tester/TarmacLander.cmake:71 (list):
  list index: 2 out of range (-2, 1)

CMake Error at /home/ceej/zo/testing/zorbatest/tester/TarmacLander.cmake:274 (message):
  Validation queue job -2012-01-31T00-53-26.285Z is finished. The final
  status was:

  43 tests did not succeed - changes not commited.

Error in read script: /home/ceej/zo/testing/zorbatest/tester/TarmacLander.cmake

Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

Validation queue starting for merge proposal.
Log at: http://zorbatest.lambda.nu:8080/remotequeue/-2012-01-31T01-44-59.475Z/log.html

Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

The attempt to merge lp:zorba/3.0 into lp:zorba failed. Below is the output from the failed tests.

CMake Error at /home/ceej/zo/testing/zorbatest/tester/TarmacLander.cmake:71 (list):
  list index: 2 out of range (-2, 1)

CMake Error at /home/ceej/zo/testing/zorbatest/tester/TarmacLander.cmake:274 (message):
  Validation queue job -2012-01-31T01-44-59.475Z is finished. The final
  status was:

  17 tests did not succeed - changes not commited.

Error in read script: /home/ceej/zo/testing/zorbatest/tester/TarmacLander.cmake

lp:~zorba-coders/zorba/jsoniq updated
10604. By Matthias Brantner

- typed value for null and pairs
- return pairs in order of insertion
- most of the delete UP (no errors or undo, yet)

10605. By Chris Hillery

More serialization method changes:
1. Re-introduced json_emitter which only outputs JSON ("json" output method
will explicitly use this)
2. Introduce new jsoniq_emitter which detects whether first item is JDM or
XDM and uses an xml_emitter or json_emitter accordingly ("jsoniq" output
method will use this, and is the default)

10606. By Markos Zaharioudakis

work on jsoniq collections

10607. By Matthias Brantner

error checking and fixes for json:delete

10608. By Till Westmann

added support for the serialization method "JSONiq" in the testdriver

10609. By Till Westmann

introduced diagnostic categories JSONIQ_CORE and JSONIQ_UPDATE

10610. By Till Westmann

fixed expeted error for jsoniq/insert02

10611. By Markos Zaharioudakis

work on jsoniq collections

10612. By Matthias Brantner

array inserting updates

10613. By Matthias Brantner

fix generation of the jsoniq error module

10614. By Matthias Brantner

- manual maintenance of reference count for array members
- cleanup json puls

10615. By Markos Zaharioudakis

implemented ddl module for dynamic jsoniq collections + fixed bug #924595 + added syntax for structured-item() type test

10616. By Markos Zaharioudakis

work on jsoniq collections + fixed a bug in SimpleJSONArray::copy

10617. By Markos Zaharioudakis

work on jsoniq collections

10618. By Matthias Brantner

- upd:rename
- upd:replace-value
- improved upd:delete (with type promotion)
- fixed implementation of delete by using the position of an array in apply

10619. By Markos Zaharioudakis

finished DML module for dynamic jsoniq collections + fixed memory problem in root_typemanager

10620. By Paul J. Lucas

Merge from trunk.

10621. By Matthias Brantner

bugfix to report errors for duplicate keys in an object

10622. By Matthias Brantner

fixed the build without ZORBA_WITH_JSON

10623. By Matthias Brantner

fixed error messages

10624. By Matthias Brantner

empty member accessor

10625. By Chris Hillery

Support all atomic types when serializing, including those serialized as
"JSONiq value".

10626. By Matthias Brantner

- objects and pairs don't have a string value
- better error for fn:data on objects and arrays
- fixed return type for j:size()

10627. By Matthias Brantner

- fixed copy-transform to also allow json-items
- fixed flatten for json pairs
- added all queries from the use case document as tests

10628. By Matthias Brantner

better error for member accessor with wrong arg type

10629. By Chris Hillery

Add serialization of nested XML. Escape all strings appropriately.

10630. By Markos Zaharioudakis

fixed bug in implicit invocation of json item accessor functions

10631. By Chris Hillery

Added Item API methods for JSONiq.

10632. By Matthias Brantner

undo fix for type-promotion wrapping. this is fixed by normalize_fo

10633. By Matthias Brantner

raise an error if json:values is called with a pair

10634. By Matthias Brantner

hack for allowing true, false, and null in the content of a pair

10635. By Matthias Brantner

hack to treat a block whose expression returns only pairs as an object constructor

this means that the top-level sequential top-level program can never return pairs (only an object)

10636. By Matthias Brantner

fixed fn:boolean for json pairs and json:null

- fn:boolean(json:null()) => false
- fn:boolean(pair) => fn:boolean(value(pair))
- fn:booelean(pair*) => error

10637. By Matthias Brantner

merge

10638. By Matthias Brantner

fixed test case such that fn:data and explicit unboxing and flattening is not needed anymore

10639. By Matthias Brantner

changed semantics of the member selector to automatically do iteration

10640. By Matthias Brantner

implicit iteration for member selectors

10641. By Matthias Brantner

allow true, false, and null everywhere

10642. By Matthias Brantner

support for pairs with colon operator (removed direct and computed object and array constructors)

10643. By Chris Hillery

Fix serialization of control sequences.

10644. By Chris Hillery

Ignore standard "build" directory, and CMakeLists.txt.user (which is a
project file created by the QtCreator IDE).

10645. By Chris Hillery

Adding documentation for all functions.

10646. By Chris Hillery

Merge from trunk.

10647. By Chris Hillery

Added ItemFactory methods to create JSON items, along with test cases.

10648. By Markos Zaharioudakis

predeclared jn prefix

10649. By Markos Zaharioudakis

predeclared jn prefix (2nd try)

10650. By Matthias Brantner

commit the pre-generated parser files

10651. By Matthias Brantner

fixed jsoniq namespace + always process the jsoniq module because it contains udfs

10652. By Matthias Brantner

build fixes for without json

10653. By Matthias Brantner

added two tutorials as html. also temporarily removed the json module declaration
in order to make xqdoc work

10654. By Matthias Brantner

merge with trunk

10655. By Matthias Brantner

always indent by default in the swig bindings (this is a hack to get a nicer output in the web interface)

10656. By Matthias Brantner

fixed output of JSON_Test in xqdoc (e.g. array())

10657. By Chris Hillery

Allow "jsoniq" serialization method to serve for SAX output.

10658. By Chris Hillery

There are now 6 built-in namespace bindings (including jn: ).

10659. By Chris Hillery

Use Store::populateJSONArray() in ItemFactory.

10660. By Matthias Brantner

updated namespace prefix in the jsoniq module to jn

10661. By Matthias Brantner

- revert rev. 10655
- in execute, make the default indent + no xml decl

10662. By Matthias Brantner

updated jsoniq tutorials to latest drafts

10663. By Nicolae Brinza

Implementation of the new Cloudscript grammar.

10664. By Markos Zaharioudakis

removed pairs from type system and compiler

10665. By Markos Zaharioudakis

merge from trunk

10666. By Markos Zaharioudakis

forbid json items in xml constructors

10667. By Markos Zaharioudakis

translation of json constructor exprs

10668. By Markos Zaharioudakis

re-implemented json constructors

10669. By Markos Zaharioudakis

fixed EBV for jsoniq

10670. By Markos Zaharioudakis

work on jsoniq functions

10671. By Markos Zaharioudakis

fixed error codes and tests

10672. By Markos Zaharioudakis

implemented values( as object()) function

10673. By Markos Zaharioudakis

implemented accumulating object constructor

10674. By Markos Zaharioudakis

implemented the project function

10675. By Markos Zaharioudakis

implemented object insertions

10676. By Markos Zaharioudakis

more work on jsoniq updates

10677. By Markos Zaharioudakis

more work on jsoniq updates

10678. By Chris Hillery

Add Cloudscript-defined serialization parameters (boilerplate; not all
features implemented fully yet). Enable setting of serialization
parameters via .spec files.

10679. By Chris Hillery

Added CloudScript serialization error codes, and implementation checks to
throw them when appropriate. Several test cases.

10680. By Markos Zaharioudakis

done with object updates

10681. By Markos Zaharioudakis

fixed tests failing due to serialization changes

10682. By Markos Zaharioudakis

more work on array updates

10683. By Markos Zaharioudakis

done with array updates

10684. By Markos Zaharioudakis

renamed jn:names to jn:keys + removed 0-arity navigation

10685. By Markos Zaharioudakis

removed array(ItemType) type

10686. By Markos Zaharioudakis

introduced JNTY0002 error

10687. By Markos Zaharioudakis

merge from trunk + work on static and dynamic collection modules

10688. By Markos Zaharioudakis

merged with trunk

10689. By Markos Zaharioudakis

fixed no-copy rule omission

10690. By Chris Hillery

Re-enable support for "old-style" Serialization: .spec file options
(should be deprecated, but still used by some non-core modules)

10691. By Chris Hillery

Remove public API methods that are specific to Object Pairs (no longer part
of the JSONiq spec).

10692. By Ghislain Fourny

Merged jsoniq-plan_serialization branch.

10693. By Ghislain Fourny

Merged trunk back.

10694. By Ghislain Fourny

Fixed flwor expression clause getter.

10695. By Ghislain Fourny

Now compiles and links.

10696. By Ghislain Fourny

Merged trunk back (10838).

10697. By Ghislain Fourny

Fixed some tests.

10698. By Chris Hillery

Additional fixes to handle old-style --method Serialization args correctly.

10699. By Ghislain Fourny

Copied pregenerated scanner and parser files.

10700. By Ghislain Fourny

Merged changes from child branch.

10701. By Ghislain Fourny

Merged trunk back.

10702. By Ghislain Fourny

Added curly braces in JSON insert expressions.

10703. By Ghislain Fourny

Extended update syntax to general FilterExprs.

10704. By Ghislain Fourny

Solved memory leak.

10705. By Ghislain Fourny

Adding tests.

10706. By Ghislain Fourny

Collection functions now work with general items.

10707. By Ghislain Fourny

Began removing pairs in the implementation. Still build errors.

10708. By Ghislain Fourny

Now compiles, but does not link yet.

10709. By Ghislain Fourny

Now links.

10710. By Ghislain Fourny

All JSONiq tests now pass.

10711. By Ghislain Fourny

Renamed cloudscript-extensions to jsoniq-extensions

10712. By Ghislain Fourny

Renamed cloudscript to jsoniq.

10713. By Ghislain Fourny

Renamed cloudscript to jsoniq.

10714. By Ghislain Fourny

Renamed cloudscript to jsoniq.

10715. By Ghislain Fourny

Now outputs INF upon positive infinity.

10716. By Ghislain Fourny

Using the pre-imported jn: prefix in some tests.

10717. By Ghislain Fourny

JSON items are now pointing to the root of their tree.

10718. By Ghislain Fourny

Indices should now work.

10719. By Ghislain Fourny

Index creation and probe should now work.

10720. By Ghislain Fourny

Reverted rename.

10721. By Ghislain Fourny

Reverted renaming.

10722. By Ghislain Fourny

Merged trunk back.

10723. By Ghislain Fourny

Merged jsoniq-deactivated back.

10724. By Ghislain Fourny

Fixed index maintenance.

10725. By Ghislain Fourny

Fixed tests.

10726. By Ghislain Fourny

Merged trunk back.

10727. By Ghislain Fourny

Synced error codes.

10728. By Ghislain Fourny

Added guards.

10729. By Ghislain Fourny

Deactivating JSON for merge proposal and one more fix.

10730. By Ghislain Fourny

Synced error codes.

10731. By Ghislain Fourny

Solved bug 918151 by allowing mixed items if a flag is set.

10732. By Ghislain Fourny

Removed useless and obsolete code that still contained JSON Pairs.

10733. By Ghislain Fourny

Fixed comment.

10734. By Ghislain Fourny

Added files.

10735. By Markos Zaharioudakis

small cosmetic changes

10736. By Ghislain Fourny

Implemented Markos' comments 1 through 5.

10737. By Ghislain Fourny

Implemented Markos' comments 7, 8 and 9.

10738. By Ghislain Fourny

Changed signature of getArraySize() to xs_integer.

10739. By Ghislain Fourny

Corrected bug and reverted mappings.xml to JSONiq deactivated version.

10740. By Ghislain Fourny

Adding tests.

10741. By Ghislain Fourny

Updated pregenerated parser files.

10742. By Ghislain Fourny

Generating preprocessor guards for STRUCTURED_ITEM.

10743. By Ghislain Fourny

Fixed emit_end().

10744. By Ghislain Fourny

Updated updating error code and adding wrappers.

10745. By Ghislain Fourny

Now back to original order when outputting keys.

10746. By Ghislain Fourny

Optimized JSON root management system.

10747. By Ghislain Fourny

Optimized JSON item value memory management.

10748. By Ghislain Fourny

Using items instead of zstrings as keys in JSON objects.

10749. By Ghislain Fourny

Replaced dynamic casts with static casts and added dynamic cast assertions for debug mode.

10750. By Ghislain Fourny

Merged trunk back.

10751. By Markos Zaharioudakis

compilation fixes

10752. By Markos Zaharioudakis

compilation fixes

10753. By Markos Zaharioudakis

added all variants of getStringValue() for JSONNull + cosmetic

10754. By Markos Zaharioudakis

merge from trunk

10755. By Ghislain Fourny

Implemented Markos' comments, except 10.

10756. By Ghislain Fourny

Merged trunk back.

10757. By Ghislain Fourny

Fixed tests.

10758. By Ghislain Fourny

Merged trunk back.

10759. By Ghislain Fourny

Implemented more efficient data structure on objects.

10760. By Ghislain Fourny

Changed parameter of getObjectValue() to an item.

10761. By Ghislain Fourny

Removed free list.

10762. By Ghislain Fourny

changed 1st param of setJSONRoot() to Item* to save some ref counting + eliminated some compiler warnings

10763. By Ghislain Fourny

Fixed compilation error on Windows.

10764. By Ghislain Fourny

Improved efficiency of removing an object pair.

10765. By Markos Zaharioudakis

a better implementation for SimpleJSONObject::remove()

10766. By Markos Zaharioudakis

small optimizations + cosmetic

10767. By Markos Zaharioudakis

commented out ZORBA_TEST_PLAN_SERIALIZATION flag in testdriver.cpp

10768. By Markos Zaharioudakis

fixed compiler warnings

10769. By Markos Zaharioudakis

fixed print out of jsoniq errors

10770. By Markos Zaharioudakis

added missing <value> to a couple of jsoniq errors

10771. By Ghislain Fourny

Deactivated invariant assertions for the moment.

10772. By Ghislain Fourny

Merged trunk back.

10773. By Ghislain Fourny

Regenerated files.

10774. By Ghislain Fourny

A small fix (already in trunk).

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'CMakeConfiguration.txt'
2--- CMakeConfiguration.txt 2012-01-11 17:30:25 +0000
3+++ CMakeConfiguration.txt 2012-02-07 00:26:21 +0000
4@@ -152,6 +152,9 @@
5 SET(ZORBA_WITH_BIG_INTEGER OFF CACHE BOOL "enable arbitrary precision integers")
6 MESSAGE(STATUS "ZORBA_WITH_BIG_INTEGER: " ${ZORBA_WITH_BIG_INTEGER})
7
8+SET(ZORBA_WITH_JSON ON CACHE BOOL "enable integrated JSON support")
9+MESSAGE(STATUS "ZORBA_WITH_JSON: " ${ZORBA_WITH_JSON})
10+
11 IF (ZORBA_SUPPRESS_SWIG)
12 SET (no_swig ON)
13 ELSE (ZORBA_SUPPRESS_SWIG)
14
15=== modified file 'ChangeLog'
16--- ChangeLog 2012-02-02 09:56:52 +0000
17+++ ChangeLog 2012-02-07 00:26:21 +0000
18@@ -35,6 +35,7 @@
19 * Fixed bug #918157 (Add XQFTTS to validation queue)
20 * Fixed bug with unversioned modules with C++ external functions
21
22+
23 version 2.1
24
25 New Features:
26
27=== added file 'NOTICE.txt'
28--- NOTICE.txt 1970-01-01 00:00:00 +0000
29+++ NOTICE.txt 2012-02-07 00:26:21 +0000
30@@ -0,0 +1,740 @@
31+-----------
32+Zorba 2.1.0
33+-----------
34+
35+(Note: This file is generated automatically from NOTICE.xml.
36+Please do not modify this file directly.)
37+
38+
39+
40+
41+Apache 2
42+
43+ Copyright 2006-2011 The FLWOR Foundation
44+
45+ See LICENSE.txt for license information.
46+
47+ ------------------------
48+ This product includes software developed at
49+ The FLWOR Foundation (http://www.flworfound.org/).
50+
51+ ------------------------
52+ Portions of this software were developed at the Systems
53+ Group of the ETH Zurich, Switzerland.
54+
55+
56+Other files used by this project:
57+----------------------------------------------------
58+
59+src/zorbatypes/m_apm.h
60+src/zorbatypes/mapm/
61+
62+Copyright: 1999-2007 Michael C. Ring
63+Website: http://www.tc.umn.edu/~ringx004/mapm-main.html
64+
65+ This software is Freeware.
66+
67+ Permission to use, copy, and distribute this software and its
68+ documentation for any purpose with or without fee is hereby granted,
69+ provided that the above copyright notice appear in all copies and
70+ that both that copyright notice and this permission notice appear
71+ in supporting documentation.
72+
73+ Permission to modify the software is granted. Permission to distribute
74+ the modified code is granted. Modifications are to be distributed by
75+ using the file 'license.txt' as a template to modify the file header.
76+ 'license.txt' is available in the official MAPM distribution.
77+
78+ To distribute modified source code, insert the file 'license.txt'
79+ at the top of all modified source code files and edit accordingly.
80+
81+ This software is provided "as is" without express or implied warranty.
82+
83+----------------------------------------------------
84+
85+src/zorbamisc/config/stdint.h
86+
87+Copyright: 2006 Alexander Chemeris
88+
89+
90+ Redistribution and use in source and binary forms, with or without
91+ modification, are permitted provided that the following conditions are met:
92+
93+ 1. Redistributions of source code must retain the above copyright notice,
94+ this list of conditions and the following disclaimer.
95+
96+ 2. Redistributions in binary form must reproduce the above copyright
97+ notice, this list of conditions and the following disclaimer in the
98+ documentation and/or other materials provided with the distribution.
99+
100+ 3. The name of the author may be used to endorse or promote products
101+ derived from this software without specific prior written permission.
102+
103+ THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
104+ WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
105+ MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
106+ EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
107+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
108+ PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
109+ OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
110+ WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
111+ OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
112+ ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
113+
114+----------------------------------------------------
115+
116+src/zorbautils/stemmer/
117+
118+Copyright: 2001 Dr. Martin Porter
119+
120+
121+ All the software given out on this Snowball site is covered by the BSD
122+ License (see http://www.opensource.org/licenses/bsd-license.html), with
123+ Copyright (c) 2001, Dr Martin Porter, and (for the Java developments)
124+ Copyright (c) 2002, Richard Boulton.
125+
126+ Essentially, all this means is that you can do what you like with the code,
127+ except claim another Copyright for it, or claim that it is issued under a
128+ different license. The software is also issued without warranties, which
129+ means that if anyone suffers through its use, they cannot come back and sue
130+ you. You also have to alert anyone to whom you give the Snowball software to
131+ the fact that it is covered by the BSD license.
132+
133+ We have not bothered to insert the licensing arrangement into the text of
134+ the Snowball software.
135+
136+----------------------------------------------------
137+
138+src/util/less.h
139+
140+Copyright: 1998 Paul J. Lucas
141+
142+
143+ Redistribution and use in source and binary forms, with or without
144+ modification, are permitted provided that the following conditions are met:
145+
146+ o Redistributions of source code must retain the above copyright notice,
147+ this list of conditions and the following disclaimer.
148+
149+ o Redistributions in binary form must reproduce the above copyright
150+ notice, this list of conditions and the following disclaimer in the
151+ documentation and/or other materials provided with the distribution.
152+
153+ o The name of the author may not be used to endorse or promote products
154+ derived from this software without specific prior written permission.
155+
156+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
157+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
158+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
159+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
160+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
161+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
162+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
163+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
164+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
165+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
166+ POSSIBILITY OF SUCH DAMAGE.
167+
168+----------------------------------------------------
169+
170+src/util/auto_vector.h (has been modified)
171+
172+Copyright: 2003 Reliable Software
173+
174+
175+ Redistribution and use in source and binary forms, with or without
176+ modification, are permitted provided that the following conditions are met:
177+
178+ o Redistributions of source code must retain the above copyright notice,
179+ this list of conditions and the following disclaimer.
180+
181+ o Redistributions in binary form must reproduce the above copyright
182+ notice, this list of conditions and the following disclaimer in the
183+ documentation and/or other materials provided with the distribution.
184+
185+ o The name of the author may not be used to endorse or promote products
186+ derived from this software without specific prior written permission.
187+
188+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
189+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
190+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
191+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
192+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
193+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
194+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
195+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
196+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
197+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
198+ POSSIBILITY OF SUCH DAMAGE.
199+
200+----------------------------------------------------
201+
202+cmake_modules/FindBoost.cmake
203+
204+Copyright:
205+ 2006-2008 Andreas Schneider <mail@cynapses.org>
206+ 2007 Wengo
207+ 2007 Mike Jackson
208+ 2008 Andreas Pakulat <apaku@gmx.de>
209+
210+
211+
212+ Redistribution AND use is allowed according to the terms of the New BSD license.
213+ For details see the accompanying COPYING-CMAKE-SCRIPTS file.
214+
215+----------------------------------------------------
216+
217+cmake_modules/FindJNI.cmake
218+cmake_modules/FindPythonLibs.cmake
219+cmake_modules/FindSWIG.cmake
220+
221+Copyright: 2001-2009 Kitware, Inc.
222+
223+
224+ Distributed under the OSI-approved BSD License (the "License");
225+ see accompanying file Copyright.txt for details.
226+
227+ This software is distributed WITHOUT ANY WARRANTY; without even the
228+ implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
229+ See the License for more information.
230+
231+ CMake - Cross Platform Makefile Generator
232+ Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
233+ All rights reserved.
234+
235+ Redistribution and use in source and binary forms, with or without
236+ modification, are permitted provided that the following conditions
237+ are met:
238+
239+ * Redistributions of source code must retain the above copyright
240+ notice, this list of conditions and the following disclaimer.
241+
242+ * Redistributions in binary form must reproduce the above copyright
243+ notice, this list of conditions and the following disclaimer in the
244+ documentation and/or other materials provided with the distribution.
245+
246+ * Neither the names of Kitware, Inc., the Insight Software Consortium,
247+ nor the names of their contributors may be used to endorse or promote
248+ products derived from this software without specific prior written
249+ permission.
250+
251+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
252+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
253+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
254+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
255+ HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
256+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
257+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
258+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
259+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
260+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
261+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
262+
263+ ------------------------------------------------------------------------------
264+
265+ The above copyright and license notice applies to distributions of
266+ CMake in source and binary form. Some source files contain additional
267+ notices of original copyright by their contributors; see each source
268+ for details. Third-party software packages supplied with CMake under
269+ compatible licenses provide their own copyright notices documented in
270+ corresponding subdirectories.
271+
272+ ------------------------------------------------------------------------------
273+
274+ CMake was initially developed by Kitware with the following sponsorship:
275+
276+ * National Library of Medicine at the National Institutes of Health
277+ as part of the Insight Segmentation and Registration Toolkit (ITK).
278+
279+ * US National Labs (Los Alamos, Livermore, Sandia) ASC Parallel
280+ Visualization Initiative.
281+
282+ * National Alliance for Medical Image Computing (NAMIC) is funded by the
283+ National Institutes of Health through the NIH Roadmap for Medical Research,
284+ Grant U54 EB005149.
285+
286+ * Kitware, Inc.
287+
288+----------------------------------------------------
289+
290+/xml.xsd
291+
292+Copyright: 2001 World Wide Web Consortium, (Massachusetts Institute of Technology, European Research Consortium for Informatics and Mathematics, Keio University)
293+
294+
295+ All Rights Reserved. This work is distributed under the W3C Software License [1] in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
296+
297+ W3C Software Notice and License
298+
299+ This work (and included software, documentation such as READMEs, or other related items) is being provided by the copyright holders under the following license.
300+
301+ License
302+
303+ By obtaining, using and/or copying this work, you (the licensee) agree that you have read, understood, and will comply with the following terms and conditions.
304+
305+ Permission to copy, modify, and distribute this software and its documentation, with or without modification, for any purpose and without fee or royalty is hereby granted, provided that you include the following on ALL copies of the software and documentation or portions thereof, including modifications:
306+ •The full text of this NOTICE in a location viewable to users of the redistributed or derivative work.
307+ •Any pre-existing intellectual property disclaimers, notices, or terms and conditions. If none exist, the W3C Software Short Notice should be included (hypertext is preferred, text is permitted) within the body of any redistributed or derivative code.
308+ •Notice of any changes or modifications to the files, including the date changes were made. (We recommend you provide URIs to the location from which the code is derived.)
309+
310+ Disclaimers
311+
312+ THIS SOFTWARE AND DOCUMENTATION IS PROVIDED "AS IS," AND COPYRIGHT HOLDERS MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THE SOFTWARE OR DOCUMENTATION WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS.
313+
314+ COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE SOFTWARE OR DOCUMENTATION.
315+
316+ The name and trademarks of copyright holders may NOT be used in advertising or publicity pertaining to the software without specific, written prior permission. Title to copyright in this software and any associated documentation will at all times remain with copyright holders.
317+
318+----------------------------------------------------
319+
320+schemas/xslt-xquery-serialization.xsd
321+
322+Copyright: 2010 World Wide Web Consortium, (Massachusetts Institute of Technology, European Research Consortium for Informatics and Mathematics, Keio University)
323+
324+
325+ All Rights Reserved. This work is distributed under the W3C Software License [1] in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
326+
327+ W3C Software Notice and License
328+
329+ This work (and included software, documentation such as READMEs, or other related items) is being provided by the copyright holders under the following license.
330+
331+ License
332+
333+ By obtaining, using and/or copying this work, you (the licensee) agree that you have read, understood, and will comply with the following terms and conditions.
334+
335+ Permission to copy, modify, and distribute this software and its documentation, with or without modification, for any purpose and without fee or royalty is hereby granted, provided that you include the following on ALL copies of the software and documentation or portions thereof, including modifications:
336+ •The full text of this NOTICE in a location viewable to users of the redistributed or derivative work.
337+ •Any pre-existing intellectual property disclaimers, notices, or terms and conditions. If none exist, the W3C Software Short Notice should be included (hypertext is preferred, text is permitted) within the body of any redistributed or derivative code.
338+ •Notice of any changes or modifications to the files, including the date changes were made. (We recommend you provide URIs to the location from which the code is derived.)
339+
340+ Disclaimers
341+
342+ THIS SOFTWARE AND DOCUMENTATION IS PROVIDED "AS IS," AND COPYRIGHT HOLDERS MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THE SOFTWARE OR DOCUMENTATION WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS.
343+
344+ COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE SOFTWARE OR DOCUMENTATION.
345+
346+ The name and trademarks of copyright holders may NOT be used in advertising or publicity pertaining to the software without specific, written prior permission. Title to copyright in this software and any associated documentation will at all times remain with copyright holders.
347+
348+----------------------------------------------------
349+
350+modules/w3c/xpath-functions.xsd
351+
352+Copyright: 2005 World Wide Web Consortium, (Massachusetts Institute of Technology, European Research Consortium for Informatics and Mathematics, Keio University)
353+
354+
355+ All Rights Reserved. This work is distributed under the W3C Software License [1] in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
356+
357+ W3C Software Notice and License
358+
359+ This work (and included software, documentation such as READMEs, or other related items) is being provided by the copyright holders under the following license.
360+
361+ License
362+
363+ By obtaining, using and/or copying this work, you (the licensee) agree that you have read, understood, and will comply with the following terms and conditions.
364+
365+ Permission to copy, modify, and distribute this software and its documentation, with or without modification, for any purpose and without fee or royalty is hereby granted, provided that you include the following on ALL copies of the software and documentation or portions thereof, including modifications:
366+ •The full text of this NOTICE in a location viewable to users of the redistributed or derivative work.
367+ •Any pre-existing intellectual property disclaimers, notices, or terms and conditions. If none exist, the W3C Software Short Notice should be included (hypertext is preferred, text is permitted) within the body of any redistributed or derivative code.
368+ •Notice of any changes or modifications to the files, including the date changes were made. (We recommend you provide URIs to the location from which the code is derived.)
369+
370+ Disclaimers
371+
372+ THIS SOFTWARE AND DOCUMENTATION IS PROVIDED "AS IS," AND COPYRIGHT HOLDERS MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THE SOFTWARE OR DOCUMENTATION WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS.
373+
374+ COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE SOFTWARE OR DOCUMENTATION.
375+
376+ The name and trademarks of copyright holders may NOT be used in advertising or publicity pertaining to the software without specific, written prior permission. Title to copyright in this software and any associated documentation will at all times remain with copyright holders.
377+
378+----------------------------------------------------
379+
380+include/xqc.h
381+
382+Copyright: 2008, Matthias Brantner, John Snelson
383+
384+
385+ * All rights reserved.
386+ *
387+ * Redistribution and use in source and binary forms, with or without
388+ * modification, are permitted provided that the following conditions are met:
389+ *
390+ * * Redistributions of source code must retain the above copyright notice,
391+ * this list of conditions and the following disclaimer.
392+ * * Redistributions in binary form must reproduce the above copyright
393+ * notice, this list of conditions and the following disclaimer in the
394+ * documentation and/or other materials provided with the distribution.
395+ * * Neither the name of the developers nor the names of contributors may be
396+ * used to endorse or promote products derived from this software without
397+ * specific prior written permission.
398+ *
399+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
400+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
401+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
402+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
403+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
404+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
405+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
406+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
407+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
408+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
409+ * POSSIBILITY OF SUCH DAMAGE.
410+
411+----------------------------------------------------
412+
413+modules/functx/functx.xq
414+
415+Copyright: 2007 Datypic
416+
417+
418+ : This library is free software; you can redistribute it and/or
419+ : modify it under the terms of the GNU Lesser General Public
420+ : License as published by the Free Software Foundation; either
421+ : version 2.1 of the License.
422+
423+ : This library is distributed in the hope that it will be useful,
424+ : but WITHOUT ANY WARRANTY; without even the implied warranty of
425+ : MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
426+ : Lesser General Public License for more details.
427+
428+ : You should have received a copy of the GNU Lesser General Public
429+ : License along with this library; if not, write to the Free Software
430+ : Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
431+
432+----------------------------------------------------
433+
434+src/compiler/parser/FlexLexer.h
435+
436+Copyright: 1993 The Regents of the University of California
437+
438+
439+ // All rights reserved.
440+ //
441+ // This code is derived from software contributed to Berkeley by
442+ // Kent Williams and Tom Epperly.
443+ //
444+ // Redistribution and use in source and binary forms, with or without
445+ // modification, are permitted provided that the following conditions
446+ // are met:
447+
448+ // 1. Redistributions of source code must retain the above copyright
449+ // notice, this list of conditions and the following disclaimer.
450+ // 2. Redistributions in binary form must reproduce the above copyright
451+ // notice, this list of conditions and the following disclaimer in the
452+ // documentation and/or other materials provided with the distribution.
453+
454+ // Neither the name of the University nor the names of its contributors
455+ // may be used to endorse or promote products derived from this software
456+ // without specific prior written permission.
457+
458+ // THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
459+ // IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
460+ // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
461+ // PURPOSE.
462+
463+----------------------------------------------------
464+
465+src/diagnostics/StackWalker.cpp
466+src/diagnostics/StackWalker.h
467+
468+Copyright: 2005 Jochen Kalmbach
469+
470+
471+ Under BSD License: http://www.opensource.org/licenses/bsd-license.php
472+
473+----------------------------------------------------
474+
475+src/util/singleton.h
476+src/util/threads.h
477+
478+Copyright: 2001 Andrei Alexandrescu
479+
480+
481+ This code accompanies the book:
482+ Alexandrescu, Andrei. "Modern C++ Design: Generic Programming and Design
483+ Patterns Applied". Copyright (c) 2001. Addison-Wesley.
484+ Permission to use, copy, modify, distribute and sell this software for any
485+ purpose is hereby granted without fee, provided that the above copyright
486+ notice appear in all copies and that both that copyright notice and this
487+ permission notice appear in supporting documentation.
488+ The author or Addison-Wesley Longman make no representations about the
489+ suitability of this software for any purpose. It is provided "as is"
490+ without express or implied warranty.
491+
492+
493+External libraries used by this project:
494+----------------------------------------------------
495+
496+Name: LIBXML2
497+Preferred version: 2.2.16 or higher
498+Is mandatory: true
499+Website: http://xmlsoft.org/
500+License: MIT
501+Copyright: 1998-2002 Daniel Veillard. All Rights Reserved.
502+External notice:
503+
504+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
505+
506+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
507+
508+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
509+
510+ Except as contained in this notice, the name of Daniel Veillard shall not
511+ be used in advertising or otherwise to promote the sale, use or other deal-
512+ ings in this Software without prior written authorization from him.
513+
514+----------------------------------------------------
515+
516+Name: LIBXSLT
517+Preferred version: 1.1.26
518+Is mandatory: false
519+Website: http://xmlsoft.org/XSLT/
520+License: MIT
521+Copyright: 2001-2002 Daniel Veillard. All Rights Reserved.
522+External notice:
523+
524+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
525+
526+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
527+
528+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL DANIEL VEILLARD BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
529+
530+
531+ Except as contained in this notice, the name of Daniel Veillard shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from him.
532+
533+
534+----------------------------------------------------
535+
536+Name: ICU4C
537+Preferred version: 3.6 or higher
538+Is mandatory: true
539+Website: http://www.icu-project.org/
540+License: ICU License
541+Copyright: 1995-2011 International Business Machines Corporation and others
542+External notice:
543+
544+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, provided that the above copyright notice(s) and this permission notice appear in all copies of the Software and that both the above copyright notice(s) and this permission notice appear in supporting documentation.
545+
546+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
547+
548+ Except as contained in this notice, the name of a copyright holder shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization of the copyright holder.
549+
550+----------------------------------------------------
551+
552+Name: CURL
553+Preferred version: above 7.12
554+Is mandatory: false
555+Website: http://curl.haxx.se/
556+License: MIT/X derivate license
557+Copyright: 1996 - 2011, Daniel Stenberg, <daniel@haxx.se>.
558+External notice:
559+
560+ All rights reserved.
561+
562+ Permission to use, copy, modify, and distribute this software for any purpose
563+ with or without fee is hereby granted, provided that the above copyright
564+ notice and this permission notice appear in all copies.
565+
566+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
567+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
568+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN
569+ NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
570+ DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
571+ OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
572+ OR OTHER DEALINGS IN THE SOFTWARE.
573+
574+ Except as contained in this notice, the name of a copyright holder shall not
575+ be used in advertising or otherwise to promote the sale, use or other dealings
576+ in this Software without prior written authorization of the copyright holder.
577+
578+----------------------------------------------------
579+
580+Name: ICONV
581+Preferred version: above 1.12
582+Is mandatory: true
583+Website: http://www.gnu.org/software/libiconv/
584+License: LGPL
585+Copyright: 1998, 2010 Free Software Foundation, Inc.
586+External notice:
587+
588+----------------------------------------------------
589+
590+Name: ZLIB
591+Preferred version: 1.2.5
592+Is mandatory: true
593+Website: http://www.zlib.net/
594+Copyright: 1995-2004 Jean-loup Gailly and Mark Adler
595+External notice:
596+
597+ This software is provided 'as-is', without any express or implied
598+ warranty. In no event will the authors be held liable for any damages
599+ arising from the use of this software.
600+
601+ Permission is granted to anyone to use this software for any purpose,
602+ including commercial applications, and to alter it and redistribute it
603+ freely, subject to the following restrictions:
604+
605+ 1. The origin of this software must not be misrepresented; you must not
606+ claim that you wrote the original software. If you use this software
607+ in a product, an acknowledgment in the product documentation would be
608+ appreciated but is not required.
609+ 2. Altered source versions must be plainly marked as such, and must not be
610+ misrepresented as being the original software.
611+ 3. This notice may not be removed or altered from any source distribution.
612+
613+ Jean-loup Gailly jloup@gzip.org
614+ Mark Adler madler@alumni.caltech.edu
615+
616+----------------------------------------------------
617+
618+Name: XERCES
619+Preferred version: 2.8.0 or higher
620+Is mandatory: true
621+Website: http://xerces.apache.org/xerces-c/
622+License: Apache 2
623+Copyright: Copyright © 1999-2010 The Apache Software Foundation. All Rights Reserved.
624+External notice:
625+
626+ http://www.apache.org/licenses/LICENSE-2.0
627+
628+----------------------------------------------------
629+
630+Name: BOOST (boost_filesystem)
631+Preferred version: 1.32 or higher
632+Is mandatory: false
633+Website: http://www.boost.org/
634+License: Boost Software License v1.0
635+Copyright:
636+ Beman Dawes, David Abrahams, 1998-2005.
637+ Rene Rivera 2004-2007
638+
639+External notice:
640+
641+ Permission is hereby granted, free of charge, to any person or organization
642+ obtaining a copy of the software and accompanying documentation covered by
643+ this license (the "Software") to use, reproduce, display, distribute,
644+ execute, and transmit the Software, and to prepare derivative works of the
645+ Software, and to permit third-parties to whom the Software is furnished to
646+ do so, all subject to the following:
647+
648+ The copyright notices in the Software and this entire statement, including
649+ the above license grant, this restriction and the following disclaimer,
650+ must be included in all copies of the Software, in whole or in part, and
651+ all derivative works of the Software, unless such copies or derivative
652+ works are solely in the form of machine-executable object code generated by
653+ a source language processor.
654+
655+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
656+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
657+ FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
658+ SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
659+ FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
660+ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
661+ DEALINGS IN THE SOFTWARE.
662+
663+
664+External applications used by this project:
665+----------------------------------------------------
666+
667+Name: FLEX
668+Preferred version: 2.5.33
669+Is mandatory: false
670+Website: http://flex.sourceforge.net/
671+Copyright:
672+ 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 The Flex Project.
673+ 1990, 1997 The Regents of the University of California. All rights reserved.
674+
675+External notice:
676+
677+ Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
678+
679+ 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
680+ 2. 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.
681+
682+ Neither the name of the University nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
683+
684+ THIS SOFTWARE IS PROVIDED “AS IS” AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
685+
686+----------------------------------------------------
687+
688+Name: BISON
689+Preferred version: 2.4 or higher
690+Is mandatory: false
691+Website: http://www.gnu.org/software/bison/
692+License: GPL
693+Copyright: 1998, 2001, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
694+External notice:
695+
696+----------------------------------------------------
697+
698+Name: DOXYGEN
699+Preferred version: v1.7.4
700+Is mandatory: false
701+Website: www.doxygen.org
702+License: GPL
703+Copyright: 1997-2011 by Dimitri van Heesch
704+External notice:
705+
706+ Permission to use, copy, modify, and distribute this software and its documentation under the terms of the GNU General Public License is hereby granted.
707+ No representations are made about the suitability of this software for any purpose.
708+ It is provided "as is" without express or implied warranty.
709+ See the GNU General Public License for more details.
710+
711+ Documents produced by doxygen are derivative works derived from the input used in their production; they are not affected by this license.
712+
713+----------------------------------------------------
714+
715+Name: CMAKE
716+Preferred version: 2.8.4
717+Is mandatory: true
718+Website: http://www.cmake.org/
719+License: Creative Commons Attribution-NoDerivs 3.0 Unported License
720+Copyright: 2000-2009 Kitware, Inc., Insight Software Consortium. All rights reserved.
721+External notice:
722+
723+ Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
724+
725+ Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
726+
727+ 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.
728+
729+ 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.
730+
731+ 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.
732+
733+----------------------------------------------------
734+
735+Name: SWIG
736+Preferred version: 2.0.4 or above
737+Is mandatory: false
738+Website: http://www.swig.org/
739+License: GPL
740+Copyright:
741+ 1995-2011 The SWIG Developers
742+ 2005-2006 Arizona Board of Regents (University of Arizona).
743+ 1998-2005 University of Chicago.
744+ 1995-1998 The University of Utah and the Regents of the University of California
745+
746+External notice:
747+
748+ SWIG is free software: you can redistribute it and/or modify it
749+ under the terms of the GNU General Public License as published by
750+ the Free Software Foundation, either version 3 of the License, or
751+ (at your option) any later version. See the LICENSE-GPL file for
752+ the full terms of the GNU General Public license version 3.
753+
754+ Portions of SWIG are also licensed under the terms of the licenses
755+ in the file LICENSE-UNIVERSITIES. You must observe the terms of
756+ these licenses, as well as the terms of the GNU General Public License,
757+ when you distribute SWIG.
758+
759+ The SWIG library and examples, under the Lib and Examples top level
760+ directories, are distributed under the following terms:
761+
762+ You may copy, modify, distribute, and make derivative works based on
763+ this software, in source code or object code form, without
764+ restriction. If you distribute the software to others, you may do
765+ so according to the terms of your choice. This software is offered as
766+ is, without warranty of any kind.
767+
768+ See the COPYRIGHT file for a list of contributors to SWIG and their
769+ copyright notices.
770+
771\ No newline at end of file
772
773=== removed file 'NOTICE.txt'
774--- NOTICE.txt 2011-10-21 08:09:17 +0000
775+++ NOTICE.txt 1970-01-01 00:00:00 +0000
776@@ -1,740 +0,0 @@
777------------
778-Zorba 2.1.0
779------------
780-
781-(Note: This file is generated automatically from NOTICE.xml.
782-Please do not modify this file directly.)
783-
784-
785-
786-
787-Apache 2
788-
789- Copyright 2006-2011 The FLWOR Foundation
790-
791- See LICENSE.txt for license information.
792-
793- ------------------------
794- This product includes software developed at
795- The FLWOR Foundation (http://www.flworfound.org/).
796-
797- ------------------------
798- Portions of this software were developed at the Systems
799- Group of the ETH Zurich, Switzerland.
800-
801-
802-Other files used by this project:
803-----------------------------------------------------
804-
805-src/zorbatypes/m_apm.h
806-src/zorbatypes/mapm/
807-
808-Copyright: 1999-2007 Michael C. Ring
809-Website: http://www.tc.umn.edu/~ringx004/mapm-main.html
810-
811- This software is Freeware.
812-
813- Permission to use, copy, and distribute this software and its
814- documentation for any purpose with or without fee is hereby granted,
815- provided that the above copyright notice appear in all copies and
816- that both that copyright notice and this permission notice appear
817- in supporting documentation.
818-
819- Permission to modify the software is granted. Permission to distribute
820- the modified code is granted. Modifications are to be distributed by
821- using the file 'license.txt' as a template to modify the file header.
822- 'license.txt' is available in the official MAPM distribution.
823-
824- To distribute modified source code, insert the file 'license.txt'
825- at the top of all modified source code files and edit accordingly.
826-
827- This software is provided "as is" without express or implied warranty.
828-
829-----------------------------------------------------
830-
831-src/zorbamisc/config/stdint.h
832-
833-Copyright: 2006 Alexander Chemeris
834-
835-
836- Redistribution and use in source and binary forms, with or without
837- modification, are permitted provided that the following conditions are met:
838-
839- 1. Redistributions of source code must retain the above copyright notice,
840- this list of conditions and the following disclaimer.
841-
842- 2. Redistributions in binary form must reproduce the above copyright
843- notice, this list of conditions and the following disclaimer in the
844- documentation and/or other materials provided with the distribution.
845-
846- 3. The name of the author may be used to endorse or promote products
847- derived from this software without specific prior written permission.
848-
849- THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
850- WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
851- MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
852- EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
853- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
854- PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
855- OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
856- WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
857- OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
858- ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
859-
860-----------------------------------------------------
861-
862-src/zorbautils/stemmer/
863-
864-Copyright: 2001 Dr. Martin Porter
865-
866-
867- All the software given out on this Snowball site is covered by the BSD
868- License (see http://www.opensource.org/licenses/bsd-license.html), with
869- Copyright (c) 2001, Dr Martin Porter, and (for the Java developments)
870- Copyright (c) 2002, Richard Boulton.
871-
872- Essentially, all this means is that you can do what you like with the code,
873- except claim another Copyright for it, or claim that it is issued under a
874- different license. The software is also issued without warranties, which
875- means that if anyone suffers through its use, they cannot come back and sue
876- you. You also have to alert anyone to whom you give the Snowball software to
877- the fact that it is covered by the BSD license.
878-
879- We have not bothered to insert the licensing arrangement into the text of
880- the Snowball software.
881-
882-----------------------------------------------------
883-
884-src/util/less.h
885-
886-Copyright: 1998 Paul J. Lucas
887-
888-
889- Redistribution and use in source and binary forms, with or without
890- modification, are permitted provided that the following conditions are met:
891-
892- o Redistributions of source code must retain the above copyright notice,
893- this list of conditions and the following disclaimer.
894-
895- o Redistributions in binary form must reproduce the above copyright
896- notice, this list of conditions and the following disclaimer in the
897- documentation and/or other materials provided with the distribution.
898-
899- o The name of the author may not be used to endorse or promote products
900- derived from this software without specific prior written permission.
901-
902- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
903- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
904- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
905- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
906- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
907- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
908- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
909- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
910- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
911- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
912- POSSIBILITY OF SUCH DAMAGE.
913-
914-----------------------------------------------------
915-
916-src/util/auto_vector.h (has been modified)
917-
918-Copyright: 2003 Reliable Software
919-
920-
921- Redistribution and use in source and binary forms, with or without
922- modification, are permitted provided that the following conditions are met:
923-
924- o Redistributions of source code must retain the above copyright notice,
925- this list of conditions and the following disclaimer.
926-
927- o Redistributions in binary form must reproduce the above copyright
928- notice, this list of conditions and the following disclaimer in the
929- documentation and/or other materials provided with the distribution.
930-
931- o The name of the author may not be used to endorse or promote products
932- derived from this software without specific prior written permission.
933-
934- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
935- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
936- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
937- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
938- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
939- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
940- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
941- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
942- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
943- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
944- POSSIBILITY OF SUCH DAMAGE.
945-
946-----------------------------------------------------
947-
948-cmake_modules/FindBoost.cmake
949-
950-Copyright:
951- 2006-2008 Andreas Schneider <mail@cynapses.org>
952- 2007 Wengo
953- 2007 Mike Jackson
954- 2008 Andreas Pakulat <apaku@gmx.de>
955-
956-
957-
958- Redistribution AND use is allowed according to the terms of the New BSD license.
959- For details see the accompanying COPYING-CMAKE-SCRIPTS file.
960-
961-----------------------------------------------------
962-
963-cmake_modules/FindJNI.cmake
964-cmake_modules/FindPythonLibs.cmake
965-cmake_modules/FindSWIG.cmake
966-
967-Copyright: 2001-2009 Kitware, Inc.
968-
969-
970- Distributed under the OSI-approved BSD License (the "License");
971- see accompanying file Copyright.txt for details.
972-
973- This software is distributed WITHOUT ANY WARRANTY; without even the
974- implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
975- See the License for more information.
976-
977- CMake - Cross Platform Makefile Generator
978- Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
979- All rights reserved.
980-
981- Redistribution and use in source and binary forms, with or without
982- modification, are permitted provided that the following conditions
983- are met:
984-
985- * Redistributions of source code must retain the above copyright
986- notice, this list of conditions and the following disclaimer.
987-
988- * Redistributions in binary form must reproduce the above copyright
989- notice, this list of conditions and the following disclaimer in the
990- documentation and/or other materials provided with the distribution.
991-
992- * Neither the names of Kitware, Inc., the Insight Software Consortium,
993- nor the names of their contributors may be used to endorse or promote
994- products derived from this software without specific prior written
995- permission.
996-
997- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
998- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
999- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
1000- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
1001- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
1002- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
1003- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
1004- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
1005- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
1006- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
1007- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
1008-
1009- ------------------------------------------------------------------------------
1010-
1011- The above copyright and license notice applies to distributions of
1012- CMake in source and binary form. Some source files contain additional
1013- notices of original copyright by their contributors; see each source
1014- for details. Third-party software packages supplied with CMake under
1015- compatible licenses provide their own copyright notices documented in
1016- corresponding subdirectories.
1017-
1018- ------------------------------------------------------------------------------
1019-
1020- CMake was initially developed by Kitware with the following sponsorship:
1021-
1022- * National Library of Medicine at the National Institutes of Health
1023- as part of the Insight Segmentation and Registration Toolkit (ITK).
1024-
1025- * US National Labs (Los Alamos, Livermore, Sandia) ASC Parallel
1026- Visualization Initiative.
1027-
1028- * National Alliance for Medical Image Computing (NAMIC) is funded by the
1029- National Institutes of Health through the NIH Roadmap for Medical Research,
1030- Grant U54 EB005149.
1031-
1032- * Kitware, Inc.
1033-
1034-----------------------------------------------------
1035-
1036-/xml.xsd
1037-
1038-Copyright: 2001 World Wide Web Consortium, (Massachusetts Institute of Technology, European Research Consortium for Informatics and Mathematics, Keio University)
1039-
1040-
1041- All Rights Reserved. This work is distributed under the W3C Software License [1] in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
1042-
1043- W3C Software Notice and License
1044-
1045- This work (and included software, documentation such as READMEs, or other related items) is being provided by the copyright holders under the following license.
1046-
1047- License
1048-
1049- By obtaining, using and/or copying this work, you (the licensee) agree that you have read, understood, and will comply with the following terms and conditions.
1050-
1051- Permission to copy, modify, and distribute this software and its documentation, with or without modification, for any purpose and without fee or royalty is hereby granted, provided that you include the following on ALL copies of the software and documentation or portions thereof, including modifications:
1052- •The full text of this NOTICE in a location viewable to users of the redistributed or derivative work.
1053- •Any pre-existing intellectual property disclaimers, notices, or terms and conditions. If none exist, the W3C Software Short Notice should be included (hypertext is preferred, text is permitted) within the body of any redistributed or derivative code.
1054- •Notice of any changes or modifications to the files, including the date changes were made. (We recommend you provide URIs to the location from which the code is derived.)
1055-
1056- Disclaimers
1057-
1058- THIS SOFTWARE AND DOCUMENTATION IS PROVIDED "AS IS," AND COPYRIGHT HOLDERS MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THE SOFTWARE OR DOCUMENTATION WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS.
1059-
1060- COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE SOFTWARE OR DOCUMENTATION.
1061-
1062- The name and trademarks of copyright holders may NOT be used in advertising or publicity pertaining to the software without specific, written prior permission. Title to copyright in this software and any associated documentation will at all times remain with copyright holders.
1063-
1064-----------------------------------------------------
1065-
1066-schemas/xslt-xquery-serialization.xsd
1067-
1068-Copyright: 2010 World Wide Web Consortium, (Massachusetts Institute of Technology, European Research Consortium for Informatics and Mathematics, Keio University)
1069-
1070-
1071- All Rights Reserved. This work is distributed under the W3C Software License [1] in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
1072-
1073- W3C Software Notice and License
1074-
1075- This work (and included software, documentation such as READMEs, or other related items) is being provided by the copyright holders under the following license.
1076-
1077- License
1078-
1079- By obtaining, using and/or copying this work, you (the licensee) agree that you have read, understood, and will comply with the following terms and conditions.
1080-
1081- Permission to copy, modify, and distribute this software and its documentation, with or without modification, for any purpose and without fee or royalty is hereby granted, provided that you include the following on ALL copies of the software and documentation or portions thereof, including modifications:
1082- •The full text of this NOTICE in a location viewable to users of the redistributed or derivative work.
1083- •Any pre-existing intellectual property disclaimers, notices, or terms and conditions. If none exist, the W3C Software Short Notice should be included (hypertext is preferred, text is permitted) within the body of any redistributed or derivative code.
1084- •Notice of any changes or modifications to the files, including the date changes were made. (We recommend you provide URIs to the location from which the code is derived.)
1085-
1086- Disclaimers
1087-
1088- THIS SOFTWARE AND DOCUMENTATION IS PROVIDED "AS IS," AND COPYRIGHT HOLDERS MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THE SOFTWARE OR DOCUMENTATION WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS.
1089-
1090- COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE SOFTWARE OR DOCUMENTATION.
1091-
1092- The name and trademarks of copyright holders may NOT be used in advertising or publicity pertaining to the software without specific, written prior permission. Title to copyright in this software and any associated documentation will at all times remain with copyright holders.
1093-
1094-----------------------------------------------------
1095-
1096-modules/w3c/xpath-functions.xsd
1097-
1098-Copyright: 2005 World Wide Web Consortium, (Massachusetts Institute of Technology, European Research Consortium for Informatics and Mathematics, Keio University)
1099-
1100-
1101- All Rights Reserved. This work is distributed under the W3C Software License [1] in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
1102-
1103- W3C Software Notice and License
1104-
1105- This work (and included software, documentation such as READMEs, or other related items) is being provided by the copyright holders under the following license.
1106-
1107- License
1108-
1109- By obtaining, using and/or copying this work, you (the licensee) agree that you have read, understood, and will comply with the following terms and conditions.
1110-
1111- Permission to copy, modify, and distribute this software and its documentation, with or without modification, for any purpose and without fee or royalty is hereby granted, provided that you include the following on ALL copies of the software and documentation or portions thereof, including modifications:
1112- •The full text of this NOTICE in a location viewable to users of the redistributed or derivative work.
1113- •Any pre-existing intellectual property disclaimers, notices, or terms and conditions. If none exist, the W3C Software Short Notice should be included (hypertext is preferred, text is permitted) within the body of any redistributed or derivative code.
1114- •Notice of any changes or modifications to the files, including the date changes were made. (We recommend you provide URIs to the location from which the code is derived.)
1115-
1116- Disclaimers
1117-
1118- THIS SOFTWARE AND DOCUMENTATION IS PROVIDED "AS IS," AND COPYRIGHT HOLDERS MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THE SOFTWARE OR DOCUMENTATION WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS.
1119-
1120- COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE SOFTWARE OR DOCUMENTATION.
1121-
1122- The name and trademarks of copyright holders may NOT be used in advertising or publicity pertaining to the software without specific, written prior permission. Title to copyright in this software and any associated documentation will at all times remain with copyright holders.
1123-
1124-----------------------------------------------------
1125-
1126-include/xqc.h
1127-
1128-Copyright: 2008, Matthias Brantner, John Snelson
1129-
1130-
1131- * All rights reserved.
1132- *
1133- * Redistribution and use in source and binary forms, with or without
1134- * modification, are permitted provided that the following conditions are met:
1135- *
1136- * * Redistributions of source code must retain the above copyright notice,
1137- * this list of conditions and the following disclaimer.
1138- * * Redistributions in binary form must reproduce the above copyright
1139- * notice, this list of conditions and the following disclaimer in the
1140- * documentation and/or other materials provided with the distribution.
1141- * * Neither the name of the developers nor the names of contributors may be
1142- * used to endorse or promote products derived from this software without
1143- * specific prior written permission.
1144- *
1145- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
1146- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
1147- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
1148- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
1149- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
1150- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
1151- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
1152- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
1153- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
1154- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
1155- * POSSIBILITY OF SUCH DAMAGE.
1156-
1157-----------------------------------------------------
1158-
1159-modules/functx/functx.xq
1160-
1161-Copyright: 2007 Datypic
1162-
1163-
1164- : This library is free software; you can redistribute it and/or
1165- : modify it under the terms of the GNU Lesser General Public
1166- : License as published by the Free Software Foundation; either
1167- : version 2.1 of the License.
1168-
1169- : This library is distributed in the hope that it will be useful,
1170- : but WITHOUT ANY WARRANTY; without even the implied warranty of
1171- : MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1172- : Lesser General Public License for more details.
1173-
1174- : You should have received a copy of the GNU Lesser General Public
1175- : License along with this library; if not, write to the Free Software
1176- : Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
1177-
1178-----------------------------------------------------
1179-
1180-src/compiler/parser/FlexLexer.h
1181-
1182-Copyright: 1993 The Regents of the University of California
1183-
1184-
1185- // All rights reserved.
1186- //
1187- // This code is derived from software contributed to Berkeley by
1188- // Kent Williams and Tom Epperly.
1189- //
1190- // Redistribution and use in source and binary forms, with or without
1191- // modification, are permitted provided that the following conditions
1192- // are met:
1193-
1194- // 1. Redistributions of source code must retain the above copyright
1195- // notice, this list of conditions and the following disclaimer.
1196- // 2. Redistributions in binary form must reproduce the above copyright
1197- // notice, this list of conditions and the following disclaimer in the
1198- // documentation and/or other materials provided with the distribution.
1199-
1200- // Neither the name of the University nor the names of its contributors
1201- // may be used to endorse or promote products derived from this software
1202- // without specific prior written permission.
1203-
1204- // THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
1205- // IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
1206- // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
1207- // PURPOSE.
1208-
1209-----------------------------------------------------
1210-
1211-src/diagnostics/StackWalker.cpp
1212-src/diagnostics/StackWalker.h
1213-
1214-Copyright: 2005 Jochen Kalmbach
1215-
1216-
1217- Under BSD License: http://www.opensource.org/licenses/bsd-license.php
1218-
1219-----------------------------------------------------
1220-
1221-src/util/singleton.h
1222-src/util/threads.h
1223-
1224-Copyright: 2001 Andrei Alexandrescu
1225-
1226-
1227- This code accompanies the book:
1228- Alexandrescu, Andrei. "Modern C++ Design: Generic Programming and Design
1229- Patterns Applied". Copyright (c) 2001. Addison-Wesley.
1230- Permission to use, copy, modify, distribute and sell this software for any
1231- purpose is hereby granted without fee, provided that the above copyright
1232- notice appear in all copies and that both that copyright notice and this
1233- permission notice appear in supporting documentation.
1234- The author or Addison-Wesley Longman make no representations about the
1235- suitability of this software for any purpose. It is provided "as is"
1236- without express or implied warranty.
1237-
1238-
1239-External libraries used by this project:
1240-----------------------------------------------------
1241-
1242-Name: LIBXML2
1243-Preferred version: 2.2.16 or higher
1244-Is mandatory: true
1245-Website: http://xmlsoft.org/
1246-License: MIT
1247-Copyright: 1998-2002 Daniel Veillard. All Rights Reserved.
1248-External notice:
1249-
1250- Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
1251-
1252- The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
1253-
1254- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1255-
1256- Except as contained in this notice, the name of Daniel Veillard shall not
1257- be used in advertising or otherwise to promote the sale, use or other deal-
1258- ings in this Software without prior written authorization from him.
1259-
1260-----------------------------------------------------
1261-
1262-Name: LIBXSLT
1263-Preferred version: 1.1.26
1264-Is mandatory: false
1265-Website: http://xmlsoft.org/XSLT/
1266-License: MIT
1267-Copyright: 2001-2002 Daniel Veillard. All Rights Reserved.
1268-External notice:
1269-
1270- Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
1271-
1272- The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
1273-
1274- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL DANIEL VEILLARD BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1275-
1276-
1277- Except as contained in this notice, the name of Daniel Veillard shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from him.
1278-
1279-
1280-----------------------------------------------------
1281-
1282-Name: ICU4C
1283-Preferred version: 3.6 or higher
1284-Is mandatory: true
1285-Website: http://www.icu-project.org/
1286-License: ICU License
1287-Copyright: 1995-2011 International Business Machines Corporation and others
1288-External notice:
1289-
1290- Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, provided that the above copyright notice(s) and this permission notice appear in all copies of the Software and that both the above copyright notice(s) and this permission notice appear in supporting documentation.
1291-
1292- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
1293-
1294- Except as contained in this notice, the name of a copyright holder shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization of the copyright holder.
1295-
1296-----------------------------------------------------
1297-
1298-Name: CURL
1299-Preferred version: above 7.12
1300-Is mandatory: false
1301-Website: http://curl.haxx.se/
1302-License: MIT/X derivate license
1303-Copyright: 1996 - 2011, Daniel Stenberg, <daniel@haxx.se>.
1304-External notice:
1305-
1306- All rights reserved.
1307-
1308- Permission to use, copy, modify, and distribute this software for any purpose
1309- with or without fee is hereby granted, provided that the above copyright
1310- notice and this permission notice appear in all copies.
1311-
1312- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1313- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1314- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN
1315- NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
1316- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
1317- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
1318- OR OTHER DEALINGS IN THE SOFTWARE.
1319-
1320- Except as contained in this notice, the name of a copyright holder shall not
1321- be used in advertising or otherwise to promote the sale, use or other dealings
1322- in this Software without prior written authorization of the copyright holder.
1323-
1324-----------------------------------------------------
1325-
1326-Name: ICONV
1327-Preferred version: above 1.12
1328-Is mandatory: true
1329-Website: http://www.gnu.org/software/libiconv/
1330-License: LGPL
1331-Copyright: 1998, 2010 Free Software Foundation, Inc.
1332-External notice:
1333-
1334-----------------------------------------------------
1335-
1336-Name: ZLIB
1337-Preferred version: 1.2.5
1338-Is mandatory: true
1339-Website: http://www.zlib.net/
1340-Copyright: 1995-2004 Jean-loup Gailly and Mark Adler
1341-External notice:
1342-
1343- This software is provided 'as-is', without any express or implied
1344- warranty. In no event will the authors be held liable for any damages
1345- arising from the use of this software.
1346-
1347- Permission is granted to anyone to use this software for any purpose,
1348- including commercial applications, and to alter it and redistribute it
1349- freely, subject to the following restrictions:
1350-
1351- 1. The origin of this software must not be misrepresented; you must not
1352- claim that you wrote the original software. If you use this software
1353- in a product, an acknowledgment in the product documentation would be
1354- appreciated but is not required.
1355- 2. Altered source versions must be plainly marked as such, and must not be
1356- misrepresented as being the original software.
1357- 3. This notice may not be removed or altered from any source distribution.
1358-
1359- Jean-loup Gailly jloup@gzip.org
1360- Mark Adler madler@alumni.caltech.edu
1361-
1362-----------------------------------------------------
1363-
1364-Name: XERCES
1365-Preferred version: 2.8.0 or higher
1366-Is mandatory: true
1367-Website: http://xerces.apache.org/xerces-c/
1368-License: Apache 2
1369-Copyright: Copyright © 1999-2010 The Apache Software Foundation. All Rights Reserved.
1370-External notice:
1371-
1372- http://www.apache.org/licenses/LICENSE-2.0
1373-
1374-----------------------------------------------------
1375-
1376-Name: BOOST (boost_filesystem)
1377-Preferred version: 1.32 or higher
1378-Is mandatory: false
1379-Website: http://www.boost.org/
1380-License: Boost Software License v1.0
1381-Copyright:
1382- Beman Dawes, David Abrahams, 1998-2005.
1383- Rene Rivera 2004-2007
1384-
1385-External notice:
1386-
1387- Permission is hereby granted, free of charge, to any person or organization
1388- obtaining a copy of the software and accompanying documentation covered by
1389- this license (the "Software") to use, reproduce, display, distribute,
1390- execute, and transmit the Software, and to prepare derivative works of the
1391- Software, and to permit third-parties to whom the Software is furnished to
1392- do so, all subject to the following:
1393-
1394- The copyright notices in the Software and this entire statement, including
1395- the above license grant, this restriction and the following disclaimer,
1396- must be included in all copies of the Software, in whole or in part, and
1397- all derivative works of the Software, unless such copies or derivative
1398- works are solely in the form of machine-executable object code generated by
1399- a source language processor.
1400-
1401- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1402- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1403- FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
1404- SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
1405- FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
1406- ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
1407- DEALINGS IN THE SOFTWARE.
1408-
1409-
1410-External applications used by this project:
1411-----------------------------------------------------
1412-
1413-Name: FLEX
1414-Preferred version: 2.5.33
1415-Is mandatory: false
1416-Website: http://flex.sourceforge.net/
1417-Copyright:
1418- 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 The Flex Project.
1419- 1990, 1997 The Regents of the University of California. All rights reserved.
1420-
1421-External notice:
1422-
1423- Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
1424-
1425- 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
1426- 2. 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.
1427-
1428- Neither the name of the University nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
1429-
1430- THIS SOFTWARE IS PROVIDED “AS IS” AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
1431-
1432-----------------------------------------------------
1433-
1434-Name: BISON
1435-Preferred version: 2.4 or higher
1436-Is mandatory: false
1437-Website: http://www.gnu.org/software/bison/
1438-License: GPL
1439-Copyright: 1998, 2001, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
1440-External notice:
1441-
1442-----------------------------------------------------
1443-
1444-Name: DOXYGEN
1445-Preferred version: v1.7.4
1446-Is mandatory: false
1447-Website: www.doxygen.org
1448-License: GPL
1449-Copyright: 1997-2011 by Dimitri van Heesch
1450-External notice:
1451-
1452- Permission to use, copy, modify, and distribute this software and its documentation under the terms of the GNU General Public License is hereby granted.
1453- No representations are made about the suitability of this software for any purpose.
1454- It is provided "as is" without express or implied warranty.
1455- See the GNU General Public License for more details.
1456-
1457- Documents produced by doxygen are derivative works derived from the input used in their production; they are not affected by this license.
1458-
1459-----------------------------------------------------
1460-
1461-Name: CMAKE
1462-Preferred version: 2.8.4
1463-Is mandatory: true
1464-Website: http://www.cmake.org/
1465-License: Creative Commons Attribution-NoDerivs 3.0 Unported License
1466-Copyright: 2000-2009 Kitware, Inc., Insight Software Consortium. All rights reserved.
1467-External notice:
1468-
1469- Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
1470-
1471- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
1472-
1473- 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.
1474-
1475- 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.
1476-
1477- 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.
1478-
1479-----------------------------------------------------
1480-
1481-Name: SWIG
1482-Preferred version: 2.0.4 or above
1483-Is mandatory: false
1484-Website: http://www.swig.org/
1485-License: GPL
1486-Copyright:
1487- 1995-2011 The SWIG Developers
1488- 2005-2006 Arizona Board of Regents (University of Arizona).
1489- 1998-2005 University of Chicago.
1490- 1995-1998 The University of Utah and the Regents of the University of California
1491-
1492-External notice:
1493-
1494- SWIG is free software: you can redistribute it and/or modify it
1495- under the terms of the GNU General Public License as published by
1496- the Free Software Foundation, either version 3 of the License, or
1497- (at your option) any later version. See the LICENSE-GPL file for
1498- the full terms of the GNU General Public license version 3.
1499-
1500- Portions of SWIG are also licensed under the terms of the licenses
1501- in the file LICENSE-UNIVERSITIES. You must observe the terms of
1502- these licenses, as well as the terms of the GNU General Public License,
1503- when you distribute SWIG.
1504-
1505- The SWIG library and examples, under the Lib and Examples top level
1506- directories, are distributed under the following terms:
1507-
1508- You may copy, modify, distribute, and make derivative works based on
1509- this software, in source code or object code form, without
1510- restriction. If you distribute the software to others, you may do
1511- so according to the terms of your choice. This software is offered as
1512- is, without warranty of any kind.
1513-
1514- See the COPYRIGHT file for a list of contributors to SWIG and their
1515- copyright notices.
1516-
1517\ No newline at end of file
1518
1519=== modified file 'doc/cxx/examples/CMakeLists.txt'
1520--- doc/cxx/examples/CMakeLists.txt 2011-08-19 00:03:31 +0000
1521+++ doc/cxx/examples/CMakeLists.txt 2012-02-07 00:26:21 +0000
1522@@ -36,6 +36,10 @@
1523 # LIST(APPEND API_EXAMPLES debugger.cpp)
1524 ENDIF(ZORBA_WITH_DEBUGGER)
1525
1526+IF (ZORBA_WITH_JSON)
1527+ LIST (APPEND API_EXAMPLES jsoniq.cpp)
1528+ENDIF (ZORBA_WITH_JSON)
1529+
1530 CREATE_TEST_SOURCELIST(
1531 examples
1532 examples.cpp
1533
1534=== added file 'doc/cxx/examples/jsoniq.cpp'
1535--- doc/cxx/examples/jsoniq.cpp 1970-01-01 00:00:00 +0000
1536+++ doc/cxx/examples/jsoniq.cpp 2012-02-07 00:26:21 +0000
1537@@ -0,0 +1,255 @@
1538+/*
1539+ * Copyright 2006-2008 The FLWOR Foundation.
1540+ *
1541+ * Licensed under the Apache License, Version 2.0 (the "License");
1542+ * you may not use this file except in compliance with the License.
1543+ * You may obtain a copy of the License at
1544+ *
1545+ * http://www.apache.org/licenses/LICENSE-2.0
1546+ *
1547+ * Unless required by applicable law or agreed to in writing, software
1548+ * distributed under the License is distributed on an "AS IS" BASIS,
1549+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1550+ * See the License for the specific language governing permissions and
1551+ * limitations under the License.
1552+ */
1553+
1554+#include <iostream>
1555+#include <sstream>
1556+
1557+#include <zorba/zorba.h>
1558+#include <zorba/store_manager.h>
1559+#include <zorba/serializer.h>
1560+#include <zorba/singleton_item_sequence.h>
1561+#include <zorba/zorba_exception.h>
1562+
1563+using namespace zorba;
1564+
1565+namespace jsoniq_test {
1566+
1567+/**
1568+ * Test accessing a JSONArray's members
1569+ */
1570+bool
1571+example_1(Zorba* aZorba)
1572+{
1573+ Iterator_t lIterator, lMembers;
1574+ XQuery_t lQuery = aZorba->compileQuery("[ 1, 2, 3 ]");
1575+ lIterator = lQuery->iterator();
1576+ lIterator->open();
1577+ Item lItem;
1578+ lIterator->next(lItem);
1579+
1580+ // Ensure we got a JSON array
1581+ if (!lItem.isJSONItem() ||
1582+ lItem.getJSONItemKind() != store::StoreConsts::jsonArray) {
1583+ std::cerr << "Item is not JSON Array!" << std::endl;
1584+ return false;
1585+ }
1586+
1587+ // Ensure array has 3 integer members
1588+ lMembers = lItem.getArrayMembers();
1589+ lMembers->open();
1590+ Item lMember;
1591+ int count = 0;
1592+ while (lMembers->next(lMember)) {
1593+ // This will throw an exception if the item isn't an integer
1594+ std::cout << lMember.getLongValue() << std::endl;
1595+ count++;
1596+ }
1597+ if (count != 3) {
1598+ std::cerr << count << " array members returned, expecting 3" << std::endl;
1599+ return false;
1600+ }
1601+ lMembers->close();
1602+ lIterator->close();
1603+
1604+ return true;
1605+}
1606+
1607+
1608+/**
1609+ * Test accessing a JSONObject's Object Pairs, as well as the Pairs'
1610+ * names and values
1611+ */
1612+bool
1613+example_2(Zorba* aZorba)
1614+{
1615+ Iterator_t lIterator, lPairs;
1616+ XQuery_t lQuery = aZorba->compileQuery("{ \"one\" : 1, \"two\" : 2 }");
1617+ lIterator = lQuery->iterator();
1618+ lIterator->open();
1619+ Item lItem;
1620+ lIterator->next(lItem);
1621+
1622+ // Ensure we got a JSON object
1623+ if (!lItem.isJSONItem() ||
1624+ lItem.getJSONItemKind() != store::StoreConsts::jsonObject) {
1625+ std::cerr << "Item is not JSON object!" << std::endl;
1626+ return false;
1627+ }
1628+
1629+ // Ensure object has 2 pairs with integer values
1630+ lPairs = lItem.getObjectPairs();
1631+ lPairs->open();
1632+ Item lPair;
1633+ int count = 0;
1634+ while (lPairs->next(lPair)) {
1635+ if (!lPair.isJSONItem() ||
1636+ lPair.getJSONItemKind() != store::StoreConsts::jsonPair) {
1637+ std::cerr << "Item is not a JSON pair!" << std::endl;
1638+ }
1639+ Item lName = lPair.getPairName();
1640+ std::cout << " \"" << lName.getStringValue() << "\": ";
1641+ Item lValue = lPair.getPairValue();
1642+ std::cout << lValue.getLongValue() << std::endl;
1643+ count++;
1644+ }
1645+ if (count != 2) {
1646+ std::cerr << count << " object pairs returned, expecting 2" << std::endl;
1647+ return false;
1648+ }
1649+ lPairs->close();
1650+ lIterator->close();
1651+
1652+ return true;}
1653+
1654+
1655+/**
1656+ * Test accessing a JSONArray's members directly by index
1657+ */
1658+bool
1659+example_3(Zorba* aZorba)
1660+{
1661+ Iterator_t lIterator;
1662+ XQuery_t lQuery = aZorba->compileQuery("[ 1, 2, 3 ]");
1663+ lIterator = lQuery->iterator();
1664+ lIterator->open();
1665+ Item lItem;
1666+ lIterator->next(lItem);
1667+
1668+ Item lMember;
1669+ for (int i = 1; i <= 3; i++) {
1670+ lMember = lItem.getArrayMember(i);
1671+ std::cout << lMember.getLongValue() << std::endl;
1672+ }
1673+
1674+ lIterator->close();
1675+
1676+ return true;
1677+}
1678+
1679+
1680+/**
1681+ * Test accessing a JSONObject's values directly by name
1682+ */
1683+bool
1684+example_4(Zorba* aZorba)
1685+{
1686+ Iterator_t lIterator;
1687+ XQuery_t lQuery = aZorba->compileQuery("{ \"one\" : 1, \"two\" : 2 }");
1688+ lIterator = lQuery->iterator();
1689+ lIterator->open();
1690+ Item lItem;
1691+ lIterator->next(lItem);
1692+
1693+ Item lValue;
1694+ lValue = lItem.getObjectValue("one");
1695+ std::cout << lValue.getLongValue() << std::endl;
1696+ lValue = lItem.getObjectValue("two");
1697+ std::cout << lValue.getLongValue() << std::endl;
1698+
1699+ lIterator->close();
1700+
1701+ return true;
1702+}
1703+
1704+/**
1705+ * Test accessing a non-existent JSONArray member
1706+ */
1707+bool
1708+example_5(Zorba* aZorba)
1709+{
1710+ Iterator_t lIterator, lMembers;
1711+ XQuery_t lQuery = aZorba->compileQuery("[ 1, 2, 3 ]");
1712+ lIterator = lQuery->iterator();
1713+ lIterator->open();
1714+ Item lItem;
1715+ lIterator->next(lItem);
1716+
1717+ Item lNonMember = lItem.getArrayMember(4);
1718+ lIterator->close();
1719+
1720+ if (!lNonMember.isNull()) {
1721+ return false;
1722+ }
1723+
1724+ return true;
1725+}
1726+
1727+/**
1728+ * Test accessing a non-existent JSONObject pair value
1729+ */
1730+bool
1731+example_6(Zorba* aZorba)
1732+{
1733+ Iterator_t lIterator;
1734+ XQuery_t lQuery = aZorba->compileQuery("{ \"one\" : 1, \"two\" : 2 }");
1735+ lIterator = lQuery->iterator();
1736+ lIterator->open();
1737+ Item lItem;
1738+ lIterator->next(lItem);
1739+
1740+ Item lNonValue = lItem.getObjectValue("three");
1741+ lIterator->close();
1742+
1743+ if (!lNonValue.isNull()) {
1744+ return false;
1745+ }
1746+ return true;
1747+}
1748+
1749+} /* namespace jsoniq-test */
1750+
1751+int
1752+jsoniq(int argc, char* argv[])
1753+{
1754+ void* lStore = StoreManager::getStore();
1755+ Zorba *lZorba = Zorba::getInstance(lStore);
1756+
1757+ bool res = false;
1758+
1759+ std::cout << "executing jsoniq example 1" << std::endl;
1760+ res = jsoniq_test::example_1(lZorba);
1761+ if (!res) return 1;
1762+ std::cout << std::endl;
1763+
1764+ std::cout << "executing jsoniq example 2" << std::endl;
1765+ res = jsoniq_test::example_2(lZorba);
1766+ if (!res) return 1;
1767+ std::cout << std::endl;
1768+
1769+ std::cout << "executing jsoniq example 3" << std::endl;
1770+ res = jsoniq_test::example_3(lZorba);
1771+ if (!res) return 1;
1772+ std::cout << std::endl;
1773+
1774+ std::cout << "executing jsoniq example 4" << std::endl;
1775+ res = jsoniq_test::example_4(lZorba);
1776+ if (!res) return 1;
1777+ std::cout << std::endl;
1778+
1779+ std::cout << "executing jsoniq example 5" << std::endl;
1780+ res = jsoniq_test::example_5(lZorba);
1781+ if (!res) return 1;
1782+ std::cout << std::endl;
1783+
1784+ std::cout << "executing jsoniq example 6" << std::endl;
1785+ res = jsoniq_test::example_6(lZorba);
1786+ if (!res) return 1;
1787+ std::cout << std::endl;
1788+
1789+ lZorba->shutdown();
1790+ StoreManager::shutdownStore(lStore);
1791+ return 0;
1792+}
1793
1794=== modified file 'doc/zorba/indexpage.dox.in'
1795--- doc/zorba/indexpage.dox.in 2011-10-07 08:28:43 +0000
1796+++ doc/zorba/indexpage.dox.in 2012-02-07 00:26:21 +0000
1797@@ -124,7 +124,7 @@
1798
1799 \ref options_and_annotations
1800
1801- <!--li>\ref extensions_update</li-->
1802+ \ref jsoniq
1803
1804
1805 </td></tr>
1806
1807=== added file 'doc/zorba/jsoniq.dox'
1808--- doc/zorba/jsoniq.dox 1970-01-01 00:00:00 +0000
1809+++ doc/zorba/jsoniq.dox 2012-02-07 00:26:21 +0000
1810@@ -0,0 +1,66 @@
1811+/** \page jsoniq JSONiq
1812+
1813+JSON is a lot simpler than XML in many data-oriented applications, and it is widely used in Web Service APIs and data feeds.
1814+But JSON has no full-featured query language, which means it is no longer simple for the most demanding applications.
1815+JSONiq is a small and simple set of extensions to XQuery that add support for JSON.
1816+
1817+The specification for the JSONiq XQuery extension can be found at http://www.jsoniq.org/.
1818+
1819+
1820+\section jsoniq_tutorial Tutorial
1821+
1822+\section jsoniq_functions Functions
1823+
1824+\section jsoniq_flavor Zorba's Flavor of JSONiq
1825+
1826+\subsection jsoniq_grammar Grammar
1827+
1828+\subsubsection jsoniq_constructors Constructor
1829+
1830+\begincode
1831+PrimaryExpr ::= .... BlockExpr |
1832+ JSONDirectObjectConstructor |
1833+ JSONComputedObjectConstructor |
1834+ JSONComputedPairConstructor
1835+
1836+BlockExpr ::= "{" Statement* Expr? "}"
1837+
1838+JSONComputedPairConstructor ::= "pair" "{" ExprSingle ":" ExprSingle "}"
1839+
1840+JSONComputedObjectConstructor ::= "object" "{" Expr? | JSONDirectObjectContent "}"
1841+
1842+JSONDirectObjectConstructor ::= "{" JSONDirectObjectContent "}"
1843+
1844+JSONDirectObjectContent ::= JSONDirectPairConstructor+
1845+
1846+JSONDirectPairConstructor ::= ExprSingle ":" ExprSingle
1847+\endcode
1848+
1849+\subsubsection jsoniq_types Types
1850+
1851+\begincode
1852+ItemType ::=
1853+...
1854+JSONTest
1855+
1856+JSONTest ::= StructuredItemTest
1857+ | JSONItemTest
1858+ | JSONObjectTest
1859+ | JSONArrayTest
1860+ | JSONPairTest
1861+
1862+StructuredItemTest ::= "structured-item" "(" ")"
1863+
1864+JSONItemTest ::= "json-item" "(" ")"
1865+
1866+JSONObjectTest ::= "object" "(" ")"
1867+
1868+JSONArrayTest ::= "array" "(" ")"
1869+
1870+JSONPairTest ::= "pair" "(" ")"
1871+\endcode
1872+
1873+
1874+\subsection jsoniq_serialization Serialization
1875+
1876+*/
1877
1878=== modified file 'include/zorba/config.h.cmake'
1879--- include/zorba/config.h.cmake 2012-02-05 12:31:20 +0000
1880+++ include/zorba/config.h.cmake 2012-02-07 00:26:21 +0000
1881@@ -155,6 +155,7 @@
1882 #cmakedefine ZORBA_WITH_BIG_INTEGER
1883 #cmakedefine ZORBA_WITH_DEBUGGER
1884 #cmakedefine ZORBA_WITH_FILE_ACCESS
1885+#cmakedefine ZORBA_WITH_JSON
1886 #cmakedefine ZORBA_WITH_LIBXML2_SAX
1887
1888 // Zorba parser configuration
1889
1890=== modified file 'include/zorba/diagnostic.h'
1891--- include/zorba/diagnostic.h 2011-07-01 16:07:54 +0000
1892+++ include/zorba/diagnostic.h 2012-02-07 00:26:21 +0000
1893@@ -239,7 +239,15 @@
1894 ZORBA_DEBUGGER, // Zorba Debugger
1895 ZORBA_OS, // Operating System
1896 ZORBA_SERIALIZATION,
1897- ZORBA_STORE
1898+ ZORBA_STORE,
1899+
1900+ JSON_PARSER,
1901+ JSON_SERIALIZATION,
1902+
1903+# ifdef ZORBA_WITH_JSON
1904+ JSONIQ_CORE,
1905+ JSONIQ_UPDATE
1906+# endif
1907 };
1908
1909 /**
1910
1911=== modified file 'include/zorba/error.h'
1912--- include/zorba/error.h 2011-07-04 21:23:55 +0000
1913+++ include/zorba/error.h 2012-02-07 00:26:21 +0000
1914@@ -42,6 +42,13 @@
1915 */
1916 typedef internal::SystemDiagnostic<internal::ZorbaErrQName> ZorbaErrorCode;
1917
1918+#ifdef ZORBA_WITH_JSON
1919+/**
1920+ * An %JSONiqErrorCode is a diagnostic for all JSONiq-specific errors.
1921+ */
1922+typedef internal::SystemDiagnostic<internal::JSONiqErrQName> JSONiqErrorCode;
1923+#endif
1924+
1925 ///////////////////////////////////////////////////////////////////////////////
1926
1927 /**
1928
1929=== modified file 'include/zorba/identtypes.h'
1930--- include/zorba/identtypes.h 2011-09-21 14:49:55 +0000
1931+++ include/zorba/identtypes.h 2012-02-07 00:26:21 +0000
1932@@ -18,10 +18,14 @@
1933
1934 #include <zorba/config.h>
1935
1936-namespace zorba {
1937-class ZORBA_DLL_PUBLIC IdentTypes {
1938+namespace zorba
1939+{
1940+
1941+class ZORBA_DLL_PUBLIC IdentTypes
1942+{
1943 public:
1944- typedef enum {
1945+ typedef enum
1946+ {
1947 NAMED_TYPE, // builtin atomic type
1948 ELEMENT_TYPE,
1949 ATTRIBUTE_TYPE,
1950@@ -30,12 +34,20 @@
1951 TEXT_TYPE,
1952 COMMENT_TYPE,
1953 ANY_NODE_TYPE, // node()
1954+#ifdef ZORBA_WITH_JSON
1955+ STRUCTURED_ITEM_TYPE,
1956+ JSON_ITEM_TYPE,
1957+ JSON_OBJECT_TYPE,
1958+ JSON_ARRAY_TYPE,
1959+ JSON_PAIR_TYPE,
1960+#endif
1961 ITEM_TYPE, // item()
1962 EMPTY_TYPE, // empty-sequence()
1963 INVALID_TYPE,
1964 } kind_t;
1965
1966- typedef enum {
1967+ typedef enum
1968+ {
1969 QUANT_ONE,
1970 QUANT_QUESTION,
1971 QUANT_PLUS,
1972
1973=== modified file 'include/zorba/internal/qname.h'
1974--- include/zorba/internal/qname.h 2011-06-30 16:42:30 +0000
1975+++ include/zorba/internal/qname.h 2012-02-07 00:26:21 +0000
1976@@ -182,6 +182,46 @@
1977
1978 ///////////////////////////////////////////////////////////////////////////////
1979
1980+#ifdef ZORBA_WITH_JSON
1981+
1982+/**
1983+ * An %JSONiqErrQName is-a FixedQName for standard JSONiq errors.
1984+ */
1985+class ZORBA_DLL_PUBLIC JSONiqErrQName :
1986+ public FixedQName<JSONiqErrQName,char const*>
1987+{
1988+ typedef FixedQName<JSONiqErrQName,char const*> base_type;
1989+public:
1990+ static char const NAMESPACE[];
1991+ static char const PREFIX[];
1992+
1993+ /**
1994+ * Constructs an %JSONiqErrQName.
1995+ *
1996+ * @param localname The local-name of the error.
1997+ */
1998+ JSONiqErrQName( char const *localname ) : base_type( localname ) { }
1999+
2000+ /**
2001+ * Gets the category of error this QName represents.
2002+ *
2003+ * @return Returns UNKNOWN_CATEGORY as there currently
2004+ * are no categories for JSONiq errors
2005+ */
2006+ zorba::diagnostic::category category() const;
2007+
2008+ /**
2009+ * Gets the kind of error this QName represents.
2010+ *
2011+ * @return Returns said kind.
2012+ */
2013+ zorba::diagnostic::kind kind() const;
2014+};
2015+
2016+#endif
2017+
2018+///////////////////////////////////////////////////////////////////////////////
2019+
2020 /**
2021 * An %ZorbaWarningQName is-a FixedQName for Zorba warnings.
2022 */
2023
2024=== modified file 'include/zorba/item.h'
2025--- include/zorba/item.h 2012-01-11 17:30:25 +0000
2026+++ include/zorba/item.h 2012-02-07 00:26:21 +0000
2027@@ -142,6 +142,21 @@
2028 Item
2029 getType() const;
2030
2031+#ifdef ZORBA_WITH_JSON
2032+
2033+ /**
2034+ * \brief Check if the Item is a JSON Item, that is, part of the JSONiq
2035+ * data model.
2036+ *
2037+ * Note that this function is available for all types of Items.
2038+ *
2039+ * @return true if the Item is a JSON Item, false otherwise.
2040+ */
2041+ bool
2042+ isJSONItem() const;
2043+
2044+#endif /* ZORBA_WITH_JSON */
2045+
2046 /** \brief Get the atomization value of the Item.
2047 *
2048 * The atomization value is the value that is returned by atomization
2049@@ -346,6 +361,83 @@
2050 int
2051 getNodeKind() const;
2052
2053+#ifdef ZORBA_WITH_JSON
2054+
2055+ /** \brief Get the kind of this (JSON) Item.
2056+ *
2057+ * Note that this function is only available for JSON Items, that is, Items
2058+ * which return true from isJSONItem().
2059+ *
2060+ * @return the kind of this JSON item
2061+ * @throw ZorbaException if an error occured (e.g. the Item is not of type JSON).
2062+ */
2063+ store::StoreConsts::JSONItemKind
2064+ getJSONItemKind() const;
2065+
2066+ /** \brief Get the pairs from a JSON Object.
2067+ *
2068+ * Note that this function is only available for JSON Objects.
2069+ *
2070+ * @return Iterator over the pairs in this object.
2071+ * @throw ZorbaException if an error occured (e.g. the Item is not of type JSON Object).
2072+ */
2073+ Iterator_t
2074+ getObjectPairs() const;
2075+
2076+ /** \brief Get the members of a JSON Array.
2077+ *
2078+ * Note that this function is only available for JSON Arrays.
2079+ *
2080+ * @return Iterator over the members of this array.
2081+ * @throw ZorbaException if an error occure (e.g. the Item is not of type JSON Array).
2082+ */
2083+ Iterator_t
2084+ getArrayMembers() const;
2085+
2086+ /** \brief Returns the value of a JSON Pair with the given name from a JSON Object.
2087+ *
2088+ * Note that this function is only available for JSON Objects.
2089+ *
2090+ * @param aName the name of the pair to return.
2091+ * @return Item the named Pair.
2092+ * @throw ZorbaException if an error occured (e.g. the Item is not of type JSON Object).
2093+ */
2094+ Item
2095+ getObjectValue(String aName) const;
2096+
2097+ /** \brief Returns the item in the JSON array at the specified index.
2098+ *
2099+ * Note that this function is only available for JSON Arrays.
2100+ *
2101+ * @param aIndex the index in the array.
2102+ * @return Item the indexed Item.
2103+ * @throw ZorbaException if an error occured (e.g. the Item is not of type JSON Array).
2104+ */
2105+ Item
2106+ getArrayMember(uint32_t aIndex) const;
2107+
2108+ /** \brief Returns the name of a JSON Pair.
2109+ *
2110+ * Note that this function is only available for JSON Pairs.
2111+ *
2112+ * @return Item the name of the Pair.
2113+ * @throw ZorbaException if an error occured (e.g. the Item is not of type JSON Pair).
2114+ */
2115+ Item
2116+ getPairName() const;
2117+
2118+ /** \brief Returns the value of a JSON Pair.
2119+ *
2120+ * Note that this function is only available for JSON Pairs.
2121+ *
2122+ * @return Item the value of the Pair.
2123+ * @throw ZorbaException if an error occured (e.g. the Item is not of type JSON Pair).
2124+ */
2125+ Item
2126+ getPairValue() const;
2127+
2128+#endif /* ZORBA_WITH_JSON */
2129+
2130 /**
2131 * Checks whether the item's content is streamable.
2132 *
2133
2134=== modified file 'include/zorba/options.h'
2135--- include/zorba/options.h 2012-01-11 17:30:25 +0000
2136+++ include/zorba/options.h 2012-02-07 00:26:21 +0000
2137@@ -83,7 +83,11 @@
2138 ZORBA_SERIALIZATION_METHOD_HTML,
2139 ZORBA_SERIALIZATION_METHOD_XHTML,
2140 ZORBA_SERIALIZATION_METHOD_TEXT,
2141- ZORBA_SERIALIZATION_METHOD_BINARY
2142+ ZORBA_SERIALIZATION_METHOD_BINARY,
2143+#ifdef ZORBA_WITH_JSON
2144+ ZORBA_SERIALIZATION_METHOD_JSON,
2145+ ZORBA_SERIALIZATION_METHOD_JSONIQ
2146+#endif
2147 } Zorba_serialization_method_t;
2148
2149
2150
2151=== modified file 'include/zorba/pregenerated/diagnostic_list.h'
2152--- include/zorba/pregenerated/diagnostic_list.h 2011-12-21 14:40:33 +0000
2153+++ include/zorba/pregenerated/diagnostic_list.h 2012-02-07 00:26:21 +0000
2154@@ -504,6 +504,12 @@
2155
2156 extern ZORBA_DLL_PUBLIC ZorbaErrorCode ZAPI0042_ITERATOR_CLOSED;
2157
2158+extern ZORBA_DLL_PUBLIC ZorbaErrorCode ZAPI0043_CANNOT_SERIALIZE_JSON_ITEM;
2159+
2160+extern ZORBA_DLL_PUBLIC ZorbaErrorCode ZAPI0044_CANNOT_SERIALIZE_XML_ITEM;
2161+
2162+extern ZORBA_DLL_PUBLIC ZorbaErrorCode ZAPI0045_CANNOT_SERIALIZE_MIXED_XDM_JDM;
2163+
2164 extern ZORBA_DLL_PUBLIC ZorbaErrorCode ZAPI0070_INVALID_SERIALIZATION_METHOD_FOR_SAX;
2165
2166 extern ZORBA_DLL_PUBLIC ZorbaErrorCode ZAPI0080_CANNOT_RETRIEVE_NODE_REFERENCE;
2167@@ -704,6 +710,8 @@
2168
2169 extern ZORBA_DLL_PUBLIC ZorbaErrorCode ZSTR0012_COLLECTION_ITEM_MUST_BE_A_NODE;
2170
2171+extern ZORBA_DLL_PUBLIC ZorbaErrorCode ZSTR0013_COLLECTION_ITEM_MUST_BE_STRUCTURED;
2172+
2173 extern ZORBA_DLL_PUBLIC ZorbaErrorCode ZSTR0015_IC_ALREADY_EXISTS;
2174
2175 extern ZORBA_DLL_PUBLIC ZorbaErrorCode ZSTR0016_IC_DOES_NOT_EXIST;
2176@@ -746,8 +754,68 @@
2177
2178 extern ZORBA_DLL_PUBLIC ZorbaErrorCode XSST0010;
2179
2180+extern ZORBA_DLL_PUBLIC ZorbaErrorCode ZJPE0001_ILLEGAL_CHARACTER;
2181+
2182+extern ZORBA_DLL_PUBLIC ZorbaErrorCode ZJPE0002_ILLEGAL_CODEPOINT;
2183+
2184+extern ZORBA_DLL_PUBLIC ZorbaErrorCode ZJPE0003_ILLEGAL_ESCAPE;
2185+
2186+extern ZORBA_DLL_PUBLIC ZorbaErrorCode ZJPE0004_ILLEGAL_LITERAL;
2187+
2188+extern ZORBA_DLL_PUBLIC ZorbaErrorCode ZJPE0005_ILLEGAL_NUMBER;
2189+
2190+extern ZORBA_DLL_PUBLIC ZorbaErrorCode ZJPE0006_UNEXPECTED_TOKEN;
2191+
2192+extern ZORBA_DLL_PUBLIC ZorbaErrorCode ZJPE0007_UNTERMINATED_STRING;
2193+
2194+extern ZORBA_DLL_PUBLIC ZorbaErrorCode ZJSE0001_NOT_DOCUMENT_OR_ELEMENT_NODE;
2195+
2196+extern ZORBA_DLL_PUBLIC ZorbaErrorCode ZJSE0002_ELEMENT_MISSING_ATTRIBUTE;
2197+
2198+extern ZORBA_DLL_PUBLIC ZorbaErrorCode ZJSE0003_BAD_ATTRIBUTE_VALUE;
2199+
2200+extern ZORBA_DLL_PUBLIC ZorbaErrorCode ZJSE0004_BAD_ELEMENT;
2201+
2202+extern ZORBA_DLL_PUBLIC ZorbaErrorCode ZJSE0005_BAD_CHILD_ELEMENT;
2203+
2204+extern ZORBA_DLL_PUBLIC ZorbaErrorCode ZJSE0006_NO_ELEMENT_CHILD;
2205+
2206+extern ZORBA_DLL_PUBLIC ZorbaErrorCode ZJSE0007_NO_TEXT_CHILD;
2207+
2208 } // namespace zerr
2209
2210+namespace jerr {
2211+
2212+#if defined(ZORBA_WITH_JSON)
2213+extern ZORBA_DLL_PUBLIC JSONiqErrorCode JSDY0001;
2214+
2215+extern ZORBA_DLL_PUBLIC JSONiqErrorCode JSDY0002;
2216+
2217+extern ZORBA_DLL_PUBLIC JSONiqErrorCode JSDY0003;
2218+
2219+extern ZORBA_DLL_PUBLIC JSONiqErrorCode JSDY0020;
2220+
2221+extern ZORBA_DLL_PUBLIC JSONiqErrorCode JSDY0040;
2222+
2223+extern ZORBA_DLL_PUBLIC JSONiqErrorCode JUDY0060;
2224+
2225+extern ZORBA_DLL_PUBLIC JSONiqErrorCode JUDY0061;
2226+
2227+extern ZORBA_DLL_PUBLIC JSONiqErrorCode JSTY0001;
2228+
2229+extern ZORBA_DLL_PUBLIC JSONiqErrorCode JSTY0002;
2230+
2231+extern ZORBA_DLL_PUBLIC JSONiqErrorCode JUDY0062;
2232+
2233+extern ZORBA_DLL_PUBLIC JSONiqErrorCode JUDY0063;
2234+
2235+extern ZORBA_DLL_PUBLIC JSONiqErrorCode JUDY0064;
2236+
2237+extern ZORBA_DLL_PUBLIC JSONiqErrorCode JUDY0065;
2238+#endif
2239+
2240+} // namespace jerr
2241+
2242 namespace zwarn {
2243
2244 extern ZORBA_DLL_PUBLIC ZorbaWarningCode ZWST0002_UNKNOWN_ANNOTATION;
2245
2246=== modified file 'include/zorba/store_consts.h'
2247--- include/zorba/store_consts.h 2011-06-14 17:26:33 +0000
2248+++ include/zorba/store_consts.h 2012-02-07 00:26:21 +0000
2249@@ -25,6 +25,13 @@
2250 {
2251 public:
2252
2253+ enum NsScoping
2254+ {
2255+ ALL_NAMESPACES,
2256+ ONLY_LOCAL_NAMESPACES,
2257+ ONLY_PARENT_NAMESPACES
2258+ };
2259+
2260 enum NodeKind
2261 {
2262 anyNode = 0,
2263@@ -36,16 +43,10 @@
2264 commentNode = 6
2265 };
2266
2267- enum NsScoping
2268- {
2269- ALL_NAMESPACES,
2270- ONLY_LOCAL_NAMESPACES,
2271- ONLY_PARENT_NAMESPACES
2272- };
2273-
2274 static std::string toString(NodeKind k)
2275 {
2276- switch(k) {
2277+ switch(k)
2278+ {
2279 case anyNode:
2280 return "anyNode";
2281
2282@@ -71,6 +72,39 @@
2283 return "<unknown NodeKind>";
2284 }
2285 }
2286+
2287+
2288+ /* ATTENTION: the ordering of the enum values is important. Do NOT change it! */
2289+ enum JSONItemKind
2290+ {
2291+ jsonItem = 0,
2292+ jsonObject = 1,
2293+ jsonArray = 2,
2294+ jsonPair = 3
2295+ };
2296+
2297+
2298+ static std::string toString(JSONItemKind k)
2299+ {
2300+ switch(k)
2301+ {
2302+ case jsonItem:
2303+ return "json-item";
2304+
2305+ case jsonObject:
2306+ return "object";
2307+
2308+ case jsonArray:
2309+ return "array";
2310+
2311+ case jsonPair:
2312+ return "pair";
2313+
2314+ default:
2315+ return "<unknown JSONItemKind>";
2316+ }
2317+ }
2318+
2319 };
2320
2321 } // namespace store
2322
2323=== modified file 'include/zorba/typeident.h'
2324--- include/zorba/typeident.h 2011-06-14 17:26:33 +0000
2325+++ include/zorba/typeident.h 2012-02-07 00:26:21 +0000
2326@@ -64,45 +64,55 @@
2327 const String& localNameName,
2328 bool localNameWildcard,
2329 TypeIdentifier_t contentType,
2330- IdentTypes::quantifier_t quantifier = IdentTypes::QUANT_ONE
2331- );
2332+ IdentTypes::quantifier_t q = IdentTypes::QUANT_ONE);
2333
2334 static
2335 TypeIdentifier_t
2336 createDocumentType(
2337 TypeIdentifier_t contentType,
2338- IdentTypes::quantifier_t quantifier = IdentTypes::QUANT_ONE
2339- );
2340-
2341- static
2342- TypeIdentifier_t
2343- createPIType(
2344- IdentTypes::quantifier_t quantifier = IdentTypes::QUANT_ONE
2345- );
2346-
2347- static
2348- TypeIdentifier_t
2349- createTextType(
2350- IdentTypes::quantifier_t quantifier = IdentTypes::QUANT_ONE
2351- );
2352-
2353- static
2354- TypeIdentifier_t
2355- createCommentType(
2356- IdentTypes::quantifier_t quantifier = IdentTypes::QUANT_ONE
2357- );
2358-
2359- static
2360- TypeIdentifier_t
2361- createAnyNodeType(
2362- IdentTypes::quantifier_t quantifier = IdentTypes::QUANT_ONE
2363- );
2364-
2365- static
2366- TypeIdentifier_t
2367- createItemType(
2368- IdentTypes::quantifier_t quantifier = IdentTypes::QUANT_ONE
2369- );
2370+ IdentTypes::quantifier_t q = IdentTypes::QUANT_ONE);
2371+
2372+ static
2373+ TypeIdentifier_t
2374+ createPIType(IdentTypes::quantifier_t q = IdentTypes::QUANT_ONE);
2375+
2376+ static
2377+ TypeIdentifier_t
2378+ createTextType(IdentTypes::quantifier_t q = IdentTypes::QUANT_ONE);
2379+
2380+ static
2381+ TypeIdentifier_t
2382+ createCommentType(IdentTypes::quantifier_t q = IdentTypes::QUANT_ONE);
2383+
2384+ static
2385+ TypeIdentifier_t
2386+ createAnyNodeType(IdentTypes::quantifier_t q = IdentTypes::QUANT_ONE);
2387+
2388+#ifdef ZORBA_WITH_JSON
2389+ static
2390+ TypeIdentifier_t
2391+ createStructuredItemType(IdentTypes::quantifier_t q = IdentTypes::QUANT_ONE);
2392+
2393+ static
2394+ TypeIdentifier_t
2395+ createJSONItemType(IdentTypes::quantifier_t q = IdentTypes::QUANT_ONE);
2396+
2397+ static
2398+ TypeIdentifier_t
2399+ createJSONObjectType(IdentTypes::quantifier_t q = IdentTypes::QUANT_ONE);
2400+
2401+ static
2402+ TypeIdentifier_t
2403+ createJSONArrayType(IdentTypes::quantifier_t q = IdentTypes::QUANT_ONE);
2404+
2405+ static
2406+ TypeIdentifier_t
2407+ createJSONPairType(IdentTypes::quantifier_t q = IdentTypes::QUANT_ONE);
2408+#endif
2409+
2410+ static
2411+ TypeIdentifier_t
2412+ createItemType(IdentTypes::quantifier_t q = IdentTypes::QUANT_ONE);
2413
2414 static
2415 TypeIdentifier_t
2416
2417=== modified file 'modules/ExternalModules.conf'
2418--- modules/ExternalModules.conf 2011-12-21 14:40:33 +0000
2419+++ modules/ExternalModules.conf 2012-02-07 00:26:21 +0000
2420@@ -27,7 +27,7 @@
2421 # currently only works for bzr, since svn tags are just different URLS)
2422
2423 data-cleaning bzr lp:zorba/data-cleaning-module zorba-2.1
2424-data-converters bzr lp:zorba/data-converters-module zorba-2.1
2425+data-converters bzr lp:zorba/data-converters-module
2426 data-formatting bzr lp:zorba/data-formatting-module zorba-2.1
2427 email bzr lp:zorba/email-module zorba-2.1
2428 excel bzr lp:zorba/excel-module zorba-2.1
2429
2430=== modified file 'modules/com/zorba-xquery/www/modules/CMakeLists.txt'
2431--- modules/com/zorba-xquery/www/modules/CMakeLists.txt 2012-02-05 12:31:20 +0000
2432+++ modules/com/zorba-xquery/www/modules/CMakeLists.txt 2012-02-07 00:26:21 +0000
2433@@ -67,10 +67,14 @@
2434 URI "http://www.zorba-xquery.com/modules/xml")
2435 DECLARE_ZORBA_MODULE(FILE xqdoc.xq VERSION 2.0
2436 URI "http://www.zorba-xquery.com/modules/xqdoc")
2437+DECLARE_ZORBA_MODULE(FILE converters/json.xq VERSION 2.0
2438+ URI "http://www.zorba-xquery.com/modules/converters/json")
2439
2440 # Subdirectories
2441 DECLARE_ZORBA_MODULE(FILE converters/base64.xq VERSION 2.0
2442 URI "http://www.zorba-xquery.com/modules/converters/base64")
2443+DECLARE_ZORBA_MODULE(FILE converters/json.xq VERSION 2.0
2444+ URI "http://www.zorba-xquery.com/modules/converters/json")
2445 DECLARE_ZORBA_MODULE(FILE introspection/sctx.xq VERSION 2.0
2446 URI "http://www.zorba-xquery.com/modules/introspection/sctx")
2447 DECLARE_ZORBA_MODULE(FILE xqdoc2xhtml/error.xq VERSION 2.0
2448@@ -103,6 +107,11 @@
2449 DECLARE_ZORBA_MODULE(FILE store/static/integrity_constraints/dml.xq VERSION 2.0
2450 URI "http://www.zorba-xquery.com/modules/store/static/integrity_constraints/dml")
2451
2452+DECLARE_ZORBA_MODULE(FILE store/jsoniq/dynamic/collections/ddl.xq VERSION 1.0
2453+ URI "http://www.zorba-xquery.com/modules/store/jsoniq/dynamic/collections/ddl")
2454+DECLARE_ZORBA_MODULE(FILE store/jsoniq/dynamic/collections/dml.xq VERSION 1.0
2455+ URI "http://www.zorba-xquery.com/modules/store/jsoniq/dynamic/collections/dml")
2456+
2457 # debugger client DBGP message handler module
2458 IF (ZORBA_WITH_DEBUGGER)
2459 DECLARE_ZORBA_MODULE (FILE debugger/dbgp-message-handler.xq VERSION 1.0
2460
2461=== added file 'modules/com/zorba-xquery/www/modules/converters/json-options.xsd'
2462--- modules/com/zorba-xquery/www/modules/converters/json-options.xsd 1970-01-01 00:00:00 +0000
2463+++ modules/com/zorba-xquery/www/modules/converters/json-options.xsd 2012-02-07 00:26:21 +0000
2464@@ -0,0 +1,47 @@
2465+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
2466+ xmlns:json="http://www.zorba-xquery.com/modules/converters/json-options"
2467+ targetNamespace="http://www.zorba-xquery.com/modules/converters/json-options"
2468+ elementFormDefault="qualified" attributeFormDefault="unqualified">
2469+<!--
2470+:: Copyright 2006-2008 The FLWOR Foundation.
2471+::
2472+:: Licensed under the Apache License, Version 2.0 (the "License");
2473+:: you may not use this file except in compliance with the License.
2474+:: You may obtain a copy of the License at
2475+::
2476+:: http://www.apache.org/licenses/LICENSE-2.0
2477+::
2478+:: Unless required by applicable law or agreed to in writing, software
2479+:: distributed under the License is distributed on an "AS IS" BASIS,
2480+:: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2481+:: See the License for the specific language governing permissions and
2482+:: limitations under the License.
2483+::
2484+-->
2485+
2486+
2487+ <xs:element name="options">
2488+ <xs:complexType>
2489+ <xs:sequence>
2490+ <xs:element name="json-param" minOccurs="1" maxOccurs="1">
2491+ <xs:complexType>
2492+ <xs:simpleContent>
2493+ <xs:extension base="xs:string">
2494+ <xs:attribute name="name" type="xs:string" use="required"/>
2495+ <xs:attribute name="value" use="required">
2496+ <xs:simpleType>
2497+ <xs:restriction base="xs:string">
2498+ <xs:enumeration value="simple-json"/>
2499+ <xs:enumeration value="json-ml"/>
2500+ </xs:restriction>
2501+ </xs:simpleType>
2502+ </xs:attribute>
2503+ <xs:attribute name="type" type="xs:string" use="optional"/>
2504+ </xs:extension>
2505+ </xs:simpleContent>
2506+ </xs:complexType>
2507+ </xs:element>
2508+ </xs:sequence>
2509+ </xs:complexType>
2510+ </xs:element>
2511+</xs:schema>
2512
2513=== added file 'modules/com/zorba-xquery/www/modules/converters/json.xq'
2514--- modules/com/zorba-xquery/www/modules/converters/json.xq 1970-01-01 00:00:00 +0000
2515+++ modules/com/zorba-xquery/www/modules/converters/json.xq 2012-02-07 00:26:21 +0000
2516@@ -0,0 +1,231 @@
2517+xquery version "3.0";
2518+
2519+ (:
2520+ : Copyright 2006-2009 The FLWOR Foundation.
2521+ :
2522+ : Licensed under the Apache License, Version 2.0 (the "License");
2523+ : you may not use this file except in compliance with the License.
2524+ : You may obtain a copy of the License at
2525+ :
2526+ : http://www.apache.org/licenses/LICENSE-2.0
2527+ :
2528+ : Unless required by applicable law or agreed to in writing, software
2529+ : distributed under the License is distributed on an "AS IS" BASIS,
2530+ : WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2531+ : See the License for the specific language governing permissions and
2532+ : limitations under the License.
2533+ :)
2534+
2535+ (:~
2536+ :
2537+ : <p>In order to enable JSON processing with XQuery, Zorba implements a set
2538+ : of functions that open XQuery developers the door to process JSON
2539+ : data. Specifically, this module provides two types of functions. Functions
2540+ : to:
2541+ : <ul>
2542+ : <li>parse JSON and convert it to XDM and</li>
2543+ : <li>serialize XDM in order to output JSON.</li>
2544+ : </ul>
2545+ : </p>
2546+ :
2547+ : <p>Both types of functions are available to parse and serialize two
2548+ : types of XDM-JSON mappings:<ul><li>the first mapping called in this document
2549+ : <strong>simple XDM-JSON</strong> has been
2550+ : <a href="http://john.snelson.org.uk/parsing-json-into-xquery">
2551+ : proposed by John Snelson</a></li><li>the second mapping is called
2552+ : <a href="http://jsonml.org/">JsonML</a></li></ul>In the following, we
2553+ : briefly describe both mappings.</p>
2554+ :
2555+ : <h2>Simple XDM-JSON Mapping</h2>
2556+ : <ul><li>In order to process JSON with XQuery, Zorba implements a mapping between
2557+ : JSON and XML that was initially proposed by John Snelson in his article
2558+ : <a href="http://snelson.org.uk/archives/2008/02/parsing_json_in.php#more"
2559+ : target="_blank">Parsing JSON into XQuery</a></li></ul>
2560+ :
2561+ : <h2>JsonML Mapping</h2>
2562+ : <ul>
2563+ : <li><a href="http://jsonml.org" target="_blank">JSonML</a> (JSON Markup Language)
2564+ : is an application of the JSON format.</li>
2565+ : <li>The purpose of JSonML is to provide a compact format for transporting
2566+ : XML-based markup as JSon. In contrast to the <strong>simple XDM-JSON</strong> mapping described above
2567+ : <strong>JsonML</strong> allows a lossless conversion back and forth.</li></ul>
2568+ :
2569+ : @author Sorin Nasoi
2570+ :
2571+ : @see <a href="http://john.snelson.org.uk/parsing-json-into-xquery">Mapping proposed by John Snelson</a>
2572+ : @see <a href="http://jsonml.org" target="_blank">JSonML</a>
2573+ : @project data processing/data converters
2574+ :
2575+ :)
2576+module namespace json = "http://www.zorba-xquery.com/modules/converters/json";
2577+
2578+import module namespace schema = "http://www.zorba-xquery.com/modules/schema";
2579+
2580+import schema namespace json-options = "http://www.zorba-xquery.com/modules/converters/json-options";
2581+
2582+declare namespace err = "http://www.w3.org/2005/xqt-errors";
2583+
2584+declare namespace ver = "http://www.zorba-xquery.com/options/versioning";
2585+declare option ver:module-version "2.0";
2586+
2587+(:~
2588+ : This function parses a JSON string and returns an XDM instance according
2589+ : to either one of the mappings described above.
2590+ :
2591+ : @param $arg a sequence of valid JSON strings.
2592+ : @param $options a set of name and value pairs that provide options
2593+ : to configure the JSON mapping process that have to be validated against the
2594+ : "http://www.zorba-xquery.com/modules/converters/json-options" schema.
2595+ : @return a sequence of nodes according to either one of the mappings described above.
2596+ : @error err:XQDY0027 if $options can not be validated against the json-options schema
2597+ : @error json:ParseError if the JSON string passed as parameter is not
2598+ : valid JSON.
2599+ : @example test_json/Queries/converters/jansson/parse_json_02.xq
2600+ : @example test_json/Queries/converters/jansson/parse_json_ml_01.xq
2601+ :)
2602+declare function json:parse(
2603+ $arg as xs:string?,
2604+ $options as element(json-options:options)
2605+) as element(*, xs:untyped)*
2606+{
2607+ let $validated-options := if(schema:is-validated($options)) then
2608+ $options
2609+ else
2610+ validate{$options}
2611+ return
2612+ json:parse-internal($arg, $validated-options)
2613+};
2614+
2615+(:~
2616+ : This function parses a JSON string and returns an XDM instance according
2617+ : to simple XDM-JSON mapping described above.
2618+ :
2619+ : @param $arg a sequence of valid JSON strings.
2620+ : @return a sequence of nodes according to Simple XDM-JSON mapping described above.
2621+ : @error json:ParseError if the JSON string passed as parameter is not
2622+ : valid JSON.
2623+ : @example test_json/Queries/converters/jansson/parse_json_11.xq
2624+ :)
2625+declare function json:parse(
2626+ $arg as xs:string?
2627+) as element(*, xs:untyped)*
2628+{
2629+ json:parse-internal($arg,
2630+ validate {
2631+ <options xmlns="http://www.zorba-xquery.com/modules/converters/json-options" >
2632+ <json-param name="mapping" value="simple-json" />
2633+ </options>
2634+ }
2635+ )
2636+};
2637+
2638+(:~
2639+ : This function parses a JSON string and returns an XDM instance according
2640+ : to JsonML mapping described above.
2641+ :
2642+ : @param $arg a sequence of valid JSON strings.
2643+ : @return a sequence of nodes according the JSON-ML mapping described above.
2644+ : @error json:ParseError if the JSON string passed as parameter is not
2645+ : valid JSON.
2646+ : @example test_json/Queries/converters/jansson/parse_json_ml_05.xq
2647+ :)
2648+declare function json:parse-ml(
2649+ $arg as xs:string?
2650+) as element(*, xs:untyped)*
2651+{
2652+ json:parse-internal($arg,
2653+ validate {
2654+ <options xmlns="http://www.zorba-xquery.com/modules/converters/json-options" >
2655+ <json-param name="mapping" value="json-ml" type="array"/>
2656+ </options>
2657+ }
2658+ )
2659+};
2660+
2661+declare %private function json:parse-internal(
2662+ $html as xs:string,
2663+ $options as item()?
2664+) as element()* external;
2665+
2666+
2667+(:~
2668+ : The serialize function takes a sequence of nodes as parameter and
2669+ : transforms each element into a valid JSON string according to one of the
2670+ : mappings described above.
2671+ :
2672+ : @param $xml a sequence of nodes.
2673+ : @param $options a set of name and value pairs that provide options
2674+ : to configure the JSON mapping process that have to be validated against the
2675+ : "http://www.zorba-xquery.com/modules/converters/json-options" schema.
2676+ : @return a JSON string.
2677+ : @error err:XQDY0027 if $options can not be validated against the json-options schema
2678+ : @error json:InvalidXDM if the input $xml is not a valid XDM
2679+ : representation of JSON or JSON ML.
2680+ : @example test_json/Queries/converters/jansson/serialize_json_01.xq
2681+ : @example test_json/Queries/converters/jansson/serialize_json_ml_01.xq
2682+ :)
2683+declare function json:serialize(
2684+ $xml as item()*,
2685+ $options as element(json-options:options)
2686+) as xs:string
2687+{
2688+ let $validated-options := if(schema:is-validated($options)) then
2689+ $options
2690+ else
2691+ validate{$options}
2692+ return
2693+ json:serialize-internal($xml, $validated-options)
2694+};
2695+
2696+(:~
2697+ : The serialize function takes a sequence of nodes as parameter and
2698+ : transforms each element into a valid JSON string according to the
2699+ : Simple XDM-JSON mapping described above
2700+ :
2701+ : @param $xml a sequence of nodes.
2702+ : @return a JSON string.
2703+ : @error json:InvalidXDM if the input $xml is not a valid XDM
2704+ : representation of JSON or JSON ML.
2705+ : @example test_json/Queries/converters/jansson/serialize_json_18.xq
2706+ :)
2707+declare function json:serialize(
2708+ $xml as item()*
2709+) as xs:string
2710+{
2711+ json:serialize-internal($xml,
2712+ validate {
2713+ <options xmlns="http://www.zorba-xquery.com/modules/converters/json-options" >
2714+ <json-param name="mapping" value="simple-json" />
2715+ </options>
2716+ }
2717+ )
2718+};
2719+
2720+(:~
2721+ : The serialize function takes a sequence of nodes as parameter and
2722+ : transforms each element into a valid JSON string according to the
2723+ : JsonML mapping described above.
2724+ :
2725+ : @param $xml a sequence of nodes.
2726+ : @return a JSON string.
2727+ : @error json:InvalidXDM if the input $xml is not a valid XDM
2728+ : representation of JSON or JSON ML.
2729+ : @example test_json/Queries/converters/jansson/serialize_json_ml_04.xq
2730+ :)
2731+declare function json:serialize-ml(
2732+ $xml as item()*
2733+) as xs:string
2734+{
2735+ json:serialize-internal($xml,
2736+ validate {
2737+ <options xmlns="http://www.zorba-xquery.com/modules/converters/json-options" >
2738+ <json-param name="mapping" value="json-ml" type="array"/>
2739+ </options>
2740+ }
2741+ )
2742+};
2743+
2744+declare %private function json:serialize-internal(
2745+ $xml as item()*,
2746+ $options as item()?
2747+ ) as xs:string external;
2748
2749=== modified file 'modules/com/zorba-xquery/www/modules/pregenerated/errors.xq'
2750--- modules/com/zorba-xquery/www/modules/pregenerated/errors.xq 2011-12-21 14:40:33 +0000
2751+++ modules/com/zorba-xquery/www/modules/pregenerated/errors.xq 2012-02-07 00:26:21 +0000
2752@@ -309,6 +309,18 @@
2753
2754 (:~
2755 :)
2756+declare variable $zerr:ZAPI0043 as xs:QName := fn:QName($zerr:NS, "zerr:ZAPI0043");
2757+
2758+(:~
2759+:)
2760+declare variable $zerr:ZAPI0044 as xs:QName := fn:QName($zerr:NS, "zerr:ZAPI0044");
2761+
2762+(:~
2763+:)
2764+declare variable $zerr:ZAPI0045 as xs:QName := fn:QName($zerr:NS, "zerr:ZAPI0045");
2765+
2766+(:~
2767+:)
2768 declare variable $zerr:ZAPI0070 as xs:QName := fn:QName($zerr:NS, "zerr:ZAPI0070");
2769
2770 (:~
2771@@ -704,6 +716,10 @@
2772
2773 (:~
2774 :)
2775+declare variable $zerr:ZSTR0013 as xs:QName := fn:QName($zerr:NS, "zerr:ZSTR0013");
2776+
2777+(:~
2778+:)
2779 declare variable $zerr:ZSTR0015 as xs:QName := fn:QName($zerr:NS, "zerr:ZSTR0015");
2780
2781 (:~
2782@@ -784,4 +800,60 @@
2783
2784 (:~
2785 :)
2786-declare variable $zerr:XSST0010 as xs:QName := fn:QName($zerr:NS, "zerr:XSST0010");
2787\ No newline at end of file
2788+declare variable $zerr:XSST0010 as xs:QName := fn:QName($zerr:NS, "zerr:XSST0010");
2789+
2790+(:~
2791+:)
2792+declare variable $zerr:ZJPE0001 as xs:QName := fn:QName($zerr:NS, "zerr:ZJPE0001");
2793+
2794+(:~
2795+:)
2796+declare variable $zerr:ZJPE0002 as xs:QName := fn:QName($zerr:NS, "zerr:ZJPE0002");
2797+
2798+(:~
2799+:)
2800+declare variable $zerr:ZJPE0003 as xs:QName := fn:QName($zerr:NS, "zerr:ZJPE0003");
2801+
2802+(:~
2803+:)
2804+declare variable $zerr:ZJPE0004 as xs:QName := fn:QName($zerr:NS, "zerr:ZJPE0004");
2805+
2806+(:~
2807+:)
2808+declare variable $zerr:ZJPE0005 as xs:QName := fn:QName($zerr:NS, "zerr:ZJPE0005");
2809+
2810+(:~
2811+:)
2812+declare variable $zerr:ZJPE0006 as xs:QName := fn:QName($zerr:NS, "zerr:ZJPE0006");
2813+
2814+(:~
2815+:)
2816+declare variable $zerr:ZJPE0007 as xs:QName := fn:QName($zerr:NS, "zerr:ZJPE0007");
2817+
2818+(:~
2819+:)
2820+declare variable $zerr:ZJSE0001 as xs:QName := fn:QName($zerr:NS, "zerr:ZJSE0001");
2821+
2822+(:~
2823+:)
2824+declare variable $zerr:ZJSE0002 as xs:QName := fn:QName($zerr:NS, "zerr:ZJSE0002");
2825+
2826+(:~
2827+:)
2828+declare variable $zerr:ZJSE0003 as xs:QName := fn:QName($zerr:NS, "zerr:ZJSE0003");
2829+
2830+(:~
2831+:)
2832+declare variable $zerr:ZJSE0004 as xs:QName := fn:QName($zerr:NS, "zerr:ZJSE0004");
2833+
2834+(:~
2835+:)
2836+declare variable $zerr:ZJSE0005 as xs:QName := fn:QName($zerr:NS, "zerr:ZJSE0005");
2837+
2838+(:~
2839+:)
2840+declare variable $zerr:ZJSE0006 as xs:QName := fn:QName($zerr:NS, "zerr:ZJSE0006");
2841+
2842+(:~
2843+:)
2844+declare variable $zerr:ZJSE0007 as xs:QName := fn:QName($zerr:NS, "zerr:ZJSE0007");
2845\ No newline at end of file
2846
2847=== added directory 'modules/com/zorba-xquery/www/modules/store/jsoniq'
2848=== added directory 'modules/com/zorba-xquery/www/modules/store/jsoniq/dynamic'
2849=== added directory 'modules/com/zorba-xquery/www/modules/store/jsoniq/dynamic/collections'
2850=== added file 'modules/com/zorba-xquery/www/modules/store/jsoniq/dynamic/collections/ddl.xq'
2851--- modules/com/zorba-xquery/www/modules/store/jsoniq/dynamic/collections/ddl.xq 1970-01-01 00:00:00 +0000
2852+++ modules/com/zorba-xquery/www/modules/store/jsoniq/dynamic/collections/ddl.xq 2012-02-07 00:26:21 +0000
2853@@ -0,0 +1,122 @@
2854+xquery version "3.0";
2855+
2856+(:
2857+ : Copyright 2006-2009 The FLWOR Foundation.
2858+ :
2859+ : Licensed under the Apache License, Version 2.0 (the "License");
2860+ : you may not use this file except in compliance with the License.
2861+ : You may obtain a copy of the License at
2862+ :
2863+ : http://www.apache.org/licenses/LICENSE-2.0
2864+ :
2865+ : Unless required by applicable law or agreed to in writing, software
2866+ : distributed under the License is distributed on an "AS IS" BASIS,
2867+ : WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2868+ : See the License for the specific language governing permissions and
2869+ : limitations under the License.
2870+:)
2871+
2872+(:~
2873+ : This modules defines a set of functions for managing persistent, ordered, and
2874+ : updatable collections that can contain both XML nodes and JSON objects and arrays.
2875+ :
2876+ : <p>Please refer to our documentation for <a href="../../html/data_lifecycle.html">
2877+ : more information</a> about the lifecycle management and the manipulation of such
2878+ : collections.</p>
2879+ :
2880+ : @see <a href="../../html/data_lifecycle.html">Data Lifecycle</a>
2881+ : @see http://www.zorba-xquery.com/modules/store/dynamic/collections/dml
2882+ : @see <a href="www.zorba-xquery.com_errors.html">http://www.zorba-xquery.com/errors</a>
2883+ :
2884+ : @author Matthias Brantner, David Graf, Till Westmann, Markos Zaharioudakis
2885+ :
2886+ : @project store/jsoniq/collections/dynamic
2887+ :
2888+ :)
2889+module namespace ddl = "http://www.zorba-xquery.com/modules/store/jsoniq/dynamic/collections/ddl";
2890+
2891+declare namespace zerr = "http://www.zorba-xquery.com/errors";
2892+declare namespace ver = "http://www.zorba-xquery.com/options/versioning";
2893+
2894+declare option ver:module-version "1.0";
2895+declare option ver:zorba-version "2.1";
2896+
2897+(:~
2898+ : The function returns true if a collection with the given QName is available.
2899+ :
2900+ : @param $name The QName of the collection that is being checked.
2901+ :
2902+ : @return true if the collection is available and false otherwise.
2903+ :
2904+ :)
2905+declare function ddl:is-available-collection($name as xs:QName) as xs:boolean external;
2906+
2907+
2908+(:~
2909+ : The function returns a sequence of QNames of the collections that are
2910+ : available. The sequence will be empty if there are no collections.
2911+ :
2912+ : @return A sequence of QNames, one for each available collection, or an emtpy sequence.
2913+ :
2914+ :)
2915+declare function ddl:available-collections() as xs:QName* external;
2916+
2917+
2918+(:~
2919+ : The create function is an updating function which creates
2920+ : the collection with the given expanded QName.
2921+ :
2922+ : @param $name The QName of the collection to create.
2923+ :
2924+ : @return The result of the function is an empty XDM instance and a
2925+ : pending update list which, once applied, creates a collection
2926+ : with the given name.
2927+ :
2928+ : @error zerr:ZDDY0002 if a collection with the given expanded QName already
2929+ : exists.
2930+ :
2931+ :)
2932+declare updating function ddl:create($name as xs:QName) external;
2933+
2934+
2935+(:~
2936+ : The create function is an updating function which creates
2937+ : the collection with the given expanded QName. Moreover, it adds copies
2938+ : of the sequence $content to the new collection.
2939+ :
2940+ : @param $name The QName of the collection to create.
2941+ : @param $content The sequence of items that should be added to the new collection.
2942+ : The sequence may contain any mix of XML nodes, JSON objects, or
2943+ : JSON arrays.
2944+ : @return The result of the function is an empty XDM instance and a
2945+ : pending update list which, once applied, creates a collection
2946+ : with the given name and inserts the given nodes into it.
2947+ :
2948+ : @error zerr:ZDDY0002 if a collection with the given expanded QName already
2949+ : exists.
2950+ :
2951+ : @see ddl:create
2952+ : @see ddl:insert-nodes-last
2953+ :
2954+ :)
2955+declare updating function ddl:create(
2956+ $name as xs:QName,
2957+ $content as structured-item()*) external;
2958+
2959+
2960+(:~
2961+ : The delete function is an updating function that removes
2962+ : the collection with the given expanded QName.
2963+ :
2964+ : @param $name The QName of the collection to delete.
2965+ :
2966+ : @return The result of the function is an empty XDM instance and a pending
2967+ : update list which, once applied, deletes the collection with the given
2968+ : name.
2969+ :
2970+ : @error zerr:ZDDY0003 if the collection with the given name does not exist.
2971+ : @error zerr:ZDDY0015 if any of the in-scope variables references a node that
2972+ : belongs to the collection with QName $name.
2973+ :
2974+ :)
2975+declare updating function ddl:delete($coll as xs:QName) external;
2976
2977=== added file 'modules/com/zorba-xquery/www/modules/store/jsoniq/dynamic/collections/dml.xq'
2978--- modules/com/zorba-xquery/www/modules/store/jsoniq/dynamic/collections/dml.xq 1970-01-01 00:00:00 +0000
2979+++ modules/com/zorba-xquery/www/modules/store/jsoniq/dynamic/collections/dml.xq 2012-02-07 00:26:21 +0000
2980@@ -0,0 +1,354 @@
2981+xquery version "3.0";
2982+
2983+(:
2984+ : Copyright 2006-2009 The FLWOR Foundation.
2985+ :
2986+ : Licensed under the Apache License, Version 2.0 (the "License");
2987+ : you may not use this file except in compliance with the License.
2988+ : You may obtain a copy of the License at
2989+ :
2990+ : http://www.apache.org/licenses/LICENSE-2.0
2991+ :
2992+ : Unless required by applicable law or agreed to in writing, software
2993+ : distributed under the License is distributed on an "AS IS" BASIS,
2994+ : WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2995+ : See the License for the specific language governing permissions and
2996+ : limitations under the License.
2997+:)
2998+
2999+(:~
3000+ : This modules provides a set of functions to modify a collection and retrieve the
3001+ : items contained in a particular collection. Collections that are accessed by the
3002+ : functions of this module may contain any mix of XML nodes, JSON objects, or
3003+ : JSON arrays. The term "structured item" is used in this module to refer to an
3004+ : XML node, JSON object, or JSON array.
3005+ :
3006+ : <p>Please refer to our documentation for <a href="../../html/data_lifecycle.html">
3007+ : more information</a> about the lifecycle management and the manipulation of such
3008+ : collections.</p>
3009+ :
3010+ : @see <a href="../../html/data_lifecycle.html">Data Lifecycle</a>
3011+ : @see http://www.zorba-xquery.com/modules/store/dynamic/collections/ddl
3012+ : @see <a href="www.zorba-xquery.com_errors.html">http://www.zorba-xquery.com/errors</a>
3013+ :
3014+ : @author Matthias Brantner, David Graf, Till Westmann, Markos Zaharioudakis
3015+ :
3016+ : @project store/jsoniq/collections/dynamic
3017+ :)
3018+module namespace dml = "http://www.zorba-xquery.com/modules/store/jsoniq/dynamic/collections/dml";
3019+
3020+declare namespace zerr = "http://www.zorba-xquery.com/errors";
3021+declare namespace ann = "http://www.zorba-xquery.com/annotations";
3022+
3023+declare namespace ver = "http://www.zorba-xquery.com/options/versioning";
3024+
3025+declare option ver:module-version "1.0";
3026+declare option ver:zorba-version "2.1";
3027+
3028+(:~
3029+ : The insert-nodes-first function is an updating function that inserts copies of the
3030+ : given structured items at the beginning of the collection.
3031+ :
3032+ : @param $name The name of the collection to which the items should be added.
3033+ : @param $content The sequences of structured items whose copies should be added
3034+ : to the collection.
3035+ :
3036+ : @return The result of the function is an empty XDM instance and a pending update
3037+ : list which, once applied, inserts the items into the collection.
3038+ :
3039+ : @error zerr:ZDDY0003 if the collection identified by $name is not available.
3040+ :
3041+ :)
3042+declare updating function dml:insert-nodes-first(
3043+ $name as xs:QName,
3044+ $content as structured-item()*) external;
3045+
3046+(:~
3047+ : The insert-nodes-last function is an updating function that inserts copies of the
3048+ : given structured items at the end of the collection.
3049+ :
3050+ : @param $name The name of the collection to which the items should be added.
3051+ : @param $content The sequences of structured items whose copies should be added
3052+ : to the collection.
3053+ :
3054+ : @return The result of the function is an empty XDM instance and a pending update list
3055+ : which, once applied, inserts the items into the collection.
3056+ :
3057+ : @error zerr:ZDDY0003 if the collection identified by $name is not available.
3058+ :
3059+ :)
3060+declare updating function dml:insert-nodes-last(
3061+ $name as xs:QName,
3062+ $content as structured-item()*) external;
3063+
3064+
3065+(:~
3066+ : The insert-nodes-before function is an updating function that inserts copies
3067+ : of the given structured items into a collection at the position directly
3068+ : preceding the given target item.
3069+ :
3070+ : @param $name The name of the collection to which the items should be added.
3071+ : @param $target The item in the collection before which the $content
3072+ : sequence should be inserted.
3073+ : @param $content The sequences of structured items whose copies should be
3074+ : added to the collection.
3075+ :
3076+ : @return The result of the function is an empty XDM instance and a pending update list
3077+ : which, once applied, inserts the items into the collection.
3078+ :
3079+ : @error zerr:ZDDY0003 if the collection identified by $name is not available.
3080+ : @error zerr:ZDDY0011 if the target item is not contained in the collection.
3081+ :
3082+ :)
3083+declare updating function dml:insert-nodes-before(
3084+ $name as xs:QName,
3085+ $target as structured-item(),
3086+ $content as structured-item()*) external;
3087+
3088+
3089+(:~
3090+ : The insert-nodes-after function is an updating function that inserts copies
3091+ : of the given structured items into a collection at the position directly
3092+ : following the given target item.
3093+ :
3094+ : @param $name The name of the collection to which the items should be added.
3095+ : @param $target The structured item in the collection after which the $content
3096+ : sequence should be inserted.
3097+ : @param $content The sequences of structured items whose copies should be added
3098+ : to the collection.
3099+ :
3100+ : @return The result of the function is an empty XDM instance and a pending update list
3101+ : which, once applied, inserts the items into the collection.
3102+ :
3103+ : @error zerr:ZDDY0003 if the collection identified by $name is not available.
3104+ : @error zerr:ZDDY0011 if the target item is not contained in the collection.
3105+ :
3106+ :)
3107+declare updating function dml:insert-nodes-after(
3108+ $name as xs:QName,
3109+ $pos as structured-item(),
3110+ $content as structured-item()*) external;
3111+
3112+
3113+(:~
3114+ : This function does the same as the insert-nodes function except
3115+ : it immediately applies the resulting pending updates and returns the
3116+ : structured items that have been inserted.
3117+ :
3118+ : @param $name The name of the collection to which the items should be added.
3119+ : @param $content The sequences of structured items whose copies should be added
3120+ : to the collection.
3121+ :
3122+ : @return The result of the function is the sequence of items that have been
3123+ : inserted into the collection.
3124+ :
3125+ : @error zerr:ZDDY0003 if the collection identified by $name is not available.
3126+ :
3127+ : @see dml:insert-nodes-first
3128+ :
3129+ :)
3130+declare %ann:sequential function dml:apply-insert-nodes-first(
3131+ $name as xs:QName,
3132+ $content as structured-item()*) as structured-item()* external;
3133+
3134+
3135+(:~
3136+ : This function does the same as the insert-nodes-last function except
3137+ : it immediately applies the resulting pending updates and returns the
3138+ : structured items that have been inserted.
3139+ :
3140+ : @param $name The name of the collection to which the items should be added.
3141+ : @param $content The sequences of structured items whose copies should be added
3142+ : to the collection.
3143+ :
3144+ : @return The result of the function is the sequence of items that have been
3145+ : inserted into the collection.
3146+ :
3147+ : @error zerr:ZDDY0003 if the collection identified by $name is not available.
3148+ :
3149+ : @see dml:insert-nodes-last
3150+ :
3151+ :)
3152+declare %ann:sequential function dml:apply-insert-nodes-last(
3153+ $name as xs:QName,
3154+ $content as structured-item()*) as structured-item()* external;
3155+
3156+
3157+(:~
3158+ : This function does the same as the insert-nodes-before function except
3159+ : it immediately applies the resulting pending updates and returns the
3160+ : structured items that have been inserted.
3161+ :
3162+ : @param $name The name of the collection to which the items should be added.
3163+ : @param $target The structured item in the collection before which the $content
3164+ : sequence should be inserted.
3165+ : @param $content The sequences of structured items whose copies should be added
3166+ : to the collection.
3167+ :
3168+ : @return The result of the function is the sequence of items that have been
3169+ : inserted into the collection.
3170+ :
3171+ : @error zerr:ZDDY0003 if the collection identified by $name is not available.
3172+ :
3173+ : @see dml:insert-nodes-before
3174+ :
3175+ :)
3176+declare %ann:sequential function dml:apply-insert-nodes-before(
3177+ $name as xs:QName,
3178+ $target as structured-item(),
3179+ $content as structured-item()*) as structured-item()* external;
3180+
3181+
3182+(:~
3183+ : This function does the same as the insert-nodes-after function except
3184+ : it immediately applies the resulting pending updates and returns the
3185+ : structured items that have been inserted.
3186+ :
3187+ : @param $name The name of the collection to which the items should be added.
3188+ : @param $target The structured item in the collection after which the $content
3189+ : sequence should be inserted.
3190+ : @param $content The sequences of structured items whose copies should be added
3191+ : to the collection.
3192+ :
3193+ : @return The result of the function is the sequence of items that have been
3194+ : inserted into the collection.
3195+ :
3196+ : @error zerr:ZDDY0003 if the collection identified by $name is not available.
3197+ :
3198+ : @see dml:insert-nodes-after
3199+ :
3200+ :)
3201+declare %ann:sequential function dml:apply-insert-nodes-after(
3202+ $name as xs:QName,
3203+ $pos as structured-item(),
3204+ $content as structured-item()*) as structured-item()* external;
3205+
3206+
3207+(:~
3208+ : The delete-nodes function is an updating function that deletes zero of more
3209+ : structured items from a collection.
3210+ :
3211+ : @param $target the structured items in the collection that should be deleted.
3212+ :
3213+ : @return The result of this function is an empty XDM instance and a pending update
3214+ : list which, once applied, deletes the items from their collections.
3215+ :
3216+ : @error zerr:ZDDY0011 if any items in the $target sequence is not a member of
3217+ : a collection or not all items of the $target sequence belong to the
3218+ : same collection.
3219+ :)
3220+declare updating function dml:delete-nodes($target as structured-item()*) external;
3221+
3222+
3223+(:~
3224+ : The delete-node-first function is an updating function that deletes the
3225+ : first item from a collection.
3226+ :
3227+ : @param $name The name of the collection from which the first item should be deleted.
3228+ :
3229+ : @return The result of this function is an empty XDM instance and a pending update
3230+ : list which, once applied, deletes the first item from the collection.
3231+ :
3232+ : @error zerr:ZDDY0011 if the collection doesn't contain any item.
3233+ :
3234+ :)
3235+declare updating function dml:delete-node-first($name as xs:QName) external;
3236+
3237+
3238+(:~
3239+ : The delete-nodes-first function is an updating function that deletes the
3240+ : first n items from a collection.
3241+ :
3242+ : @param $name The name of the collection from which the first items should be deleted.
3243+ : @param $number The number of items that should be removed from the beginning of
3244+ : the collection.
3245+ :
3246+ : @return The result of this function is an empty XDM instance and a pending update
3247+ : list which, once applied, deletes the items from the collection.
3248+ :
3249+ : @error zerr:ZDDY0011 if the collection doesn't contain the given number of items.
3250+ :
3251+ :)
3252+declare updating function dml:delete-nodes-first(
3253+ $name as xs:QName,
3254+ $number as xs:integer) external;
3255+
3256+
3257+(:~
3258+ : The delete-node-last function is an updating function that deletes the
3259+ : last item from a collection.
3260+ :
3261+ : @param $name The name of the collection from which the last item should be deleted.
3262+ :
3263+ : @return The result of this function is an empty XDM instance and a pending update
3264+ : list which, once applied, deletes the last item from the collection.
3265+ :
3266+ : @error zerr:ZDDY0009 If available collections does not provide a mapping
3267+ : for the expanded QName $name.
3268+ : @error zerr:ZDDY0011 if the collection doesn't contain any item.
3269+ :
3270+ :)
3271+declare updating function dml:delete-node-last($name as xs:QName) external;
3272+
3273+
3274+(:~
3275+ : The delete-nodes-last function is an updating function that deletes the
3276+ : last n items from an ordered collection.
3277+ :
3278+ : @param $name The name of the collection from which the last items should be deleted.
3279+ : @param $number The number of items to delete.
3280+ :
3281+ : @return The result of this function is an empty XDM instance and a pending update
3282+ : list which, once applied, deletes the last n items.
3283+ :
3284+ : @error zerr:ZDDY0009 If available collections does not provide a mapping
3285+ : for the expanded QName $name.
3286+ : @error zerr:ZDDY0011 if the collection doesn't contain the given number of items.
3287+ :
3288+ :)
3289+declare updating function dml:delete-nodes-last(
3290+ $name as xs:QName,
3291+ $number as xs:integer) external;
3292+
3293+
3294+(:~
3295+ : The index-of function returns the index of the given structured item in
3296+ : the collection.
3297+ :
3298+ : @param $item The structured item to retrieve the index of.
3299+ :
3300+ : @return Returns the position as xs:integer of the given item in the collection.
3301+ :
3302+ : @error zerr:ZDDY0011 if item is not contained in any collection.
3303+ :
3304+ :)
3305+declare function dml:index-of($item as structured-item()) as xs:integer external;
3306+
3307+
3308+(:~
3309+ : The collection function returns the sequence of structured items of the
3310+ : collection identified by the given name.
3311+ :
3312+ : @param $name The name of the collection.
3313+ :
3314+ : @return The sequence contained in the given collection.
3315+ :
3316+ : @error zerr:ZDDY0009 If available collections does not provide a mapping
3317+ : for the expanded QName $name.
3318+ :
3319+ :)
3320+declare function dml:collection($name as xs:QName) as structured-item()* external;
3321+
3322+
3323+(:~
3324+ : This function returns the name of the collection the given structured item
3325+ : belongs to.
3326+ :
3327+ : @param $item The item for which to get the name of the collection
3328+ : @return The result of this function is a QName which identifies the collection
3329+ : to which the given item belongs to.
3330+ :
3331+ : @error zerr:ZDDY0011 if the given item does not belong to a collection.
3332+ :
3333+ :)
3334+declare function dml:collection-name($item as structured-item()) as xs:QName external;
3335
3336=== added directory 'modules/com/zorba-xquery/www/modules/store/jsoniq/static'
3337=== modified file 'modules/org/CMakeLists.txt'
3338--- modules/org/CMakeLists.txt 2011-01-19 14:45:10 +0000
3339+++ modules/org/CMakeLists.txt 2012-02-07 00:26:21 +0000
3340@@ -12,3 +12,5 @@
3341 # See the License for the specific language governing permissions and
3342 # limitations under the License.
3343 ADD_SUBDIRECTORY(expath)
3344+ADD_SUBDIRECTORY(jsoniq)
3345+
3346
3347=== added directory 'modules/org/jsoniq'
3348=== added file 'modules/org/jsoniq/CMakeLists.txt'
3349--- modules/org/jsoniq/CMakeLists.txt 1970-01-01 00:00:00 +0000
3350+++ modules/org/jsoniq/CMakeLists.txt 2012-02-07 00:26:21 +0000
3351@@ -0,0 +1,15 @@
3352+# Copyright 2011 The FLWOR Foundation.
3353+#
3354+# Licensed under the Apache License, Version 2.0 (the "License");
3355+# you may not use this file except in compliance with the License.
3356+# You may obtain a copy of the License at
3357+#
3358+# http://www.apache.org/licenses/LICENSE-2.0
3359+#
3360+# Unless required by applicable law or agreed to in writing, software
3361+# distributed under the License is distributed on an "AS IS" BASIS,
3362+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3363+# See the License for the specific language governing permissions and
3364+# limitations under the License.
3365+
3366+ADD_SUBDIRECTORY(www)
3367
3368=== added directory 'modules/org/jsoniq/www'
3369=== added file 'modules/org/jsoniq/www/CMakeLists.txt'
3370--- modules/org/jsoniq/www/CMakeLists.txt 1970-01-01 00:00:00 +0000
3371+++ modules/org/jsoniq/www/CMakeLists.txt 2012-02-07 00:26:21 +0000
3372@@ -0,0 +1,21 @@
3373+# Copyright 2006-2008 The FLWOR Foundation.
3374+#
3375+# Licensed under the Apache License, Version 2.0 (the "License");
3376+# you may not use this file except in compliance with the License.
3377+# You may obtain a copy of the License at
3378+#
3379+# http://www.apache.org/licenses/LICENSE-2.0
3380+#
3381+# Unless required by applicable law or agreed to in writing, software
3382+# distributed under the License is distributed on an "AS IS" BASIS,
3383+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3384+# See the License for the specific language governing permissions and
3385+# limitations under the License.
3386+
3387+IF(ZORBA_WITH_JSON)
3388+ DECLARE_ZORBA_MODULE(FILE functions.xq VERSION 1.0
3389+ URI "http://www.jsoniq.org/functions")
3390+ DECLARE_ZORBA_MODULE (FILE pregenerated/errors.xq
3391+ URI "http://www.jsoniq.org/errors")
3392+ENDIF(ZORBA_WITH_JSON)
3393+
3394
3395=== added file 'modules/org/jsoniq/www/functions.xq'
3396--- modules/org/jsoniq/www/functions.xq 1970-01-01 00:00:00 +0000
3397+++ modules/org/jsoniq/www/functions.xq 2012-02-07 00:26:21 +0000
3398@@ -0,0 +1,272 @@
3399+module namespace j = "http://www.jsoniq.org/functions";
3400+
3401+import module namespace schema = "http://www.zorba-xquery.com/modules/schema";
3402+
3403+declare namespace jdm = "http://www.jsoniq.org/";
3404+
3405+declare namespace err = "http://www.w3.org/2005/xqt-errors";
3406+
3407+declare namespace ver = "http://www.zorba-xquery.com/options/versioning";
3408+declare option ver:module-version "1.0";
3409+
3410+(:~
3411+ :
3412+ : @param $a
3413+ : @return
3414+ :)
3415+declare function j:flatten($a as array()) as item()* external;
3416+
3417+(:~
3418+ :
3419+ : @param $j
3420+ : @return
3421+ :)
3422+declare function j:parse-json($j as xs:string) as json-item()? external;
3423+
3424+(:~
3425+ :
3426+ : @param $o
3427+ : @return
3428+ :)
3429+declare function j:names($o as object()) as xs:string* external;
3430+
3431+(:~
3432+ :
3433+ : @param $p
3434+ : @return
3435+ :)
3436+declare function j:name($p as pair()) as xs:string external;
3437+
3438+(:~
3439+ :
3440+ : @param $o
3441+ : @return
3442+ :)
3443+declare function j:pairs($o as object()) as pair()* external;
3444+
3445+(:~
3446+ :
3447+ : @param $o
3448+ : @param $n
3449+ : @return
3450+ :)
3451+declare function j:pair($o as object(), $n as xs:string) as pair()? external;
3452+
3453+(:~
3454+ :
3455+ : @param $o
3456+ : @param $n
3457+ : @return
3458+ :)
3459+declare function j:member($o as array(), $p as xs:integer) as item()? external;
3460+
3461+(:~
3462+ :
3463+ : @param $j
3464+ : @return
3465+ :)
3466+declare function j:size($j as json-item()) as xs:integer external;
3467+
3468+(:~
3469+ :
3470+ : @param $j
3471+ : @return
3472+ :)
3473+declare function j:values($j as json-item()) as item()* external;
3474+
3475+(:~
3476+ :
3477+ : @param $p
3478+ : @return
3479+ :)
3480+declare function j:value($p as pair()) as item() external;
3481+
3482+(:~
3483+ : Returns the jdm:null value null.
3484+ :
3485+ : @return the said value
3486+ :)
3487+declare function j:null() as jdm:null external;
3488+
3489+(:~
3490+ :
3491+ : @param $p
3492+ :
3493+ : @return
3494+ :
3495+ : @error j:JUDY0060 if pair with the given name already exists
3496+ :)
3497+declare updating function j:insert-into(
3498+ $o as object(),
3499+ $p as pair()*) external;
3500+
3501+(:~
3502+ :
3503+ : @param $p
3504+ : @return
3505+ :)
3506+declare updating function j:insert-as-first(
3507+ $a as array(),
3508+ $i as item()*) external;
3509+
3510+(:~
3511+ :
3512+ : @param $p
3513+ : @return
3514+ : @error j:JUDY0061 if the position doesn't select an existing array member
3515+ :)
3516+declare updating function j:insert-after(
3517+ $a as array(),
3518+ $pos as xs:integer,
3519+ $i as item()*) external;
3520+
3521+(:~
3522+ :
3523+ : @param $p
3524+ : @return
3525+ : @error j:JUDY0061 if the position doesn't select an existing array member
3526+ :)
3527+declare updating function j:insert-before(
3528+ $a as array(),
3529+ $pos as xs:integer,
3530+ $i as item()*) external;
3531+
3532+(:~
3533+ :
3534+ : @param $p
3535+ : @return
3536+ :)
3537+declare updating function j:insert-as-last(
3538+ $a as array(),
3539+ $i as item()*) external;
3540+
3541+(:~
3542+ :
3543+ : @param $p
3544+ : @return
3545+ :
3546+ : @error j:JUDY0061 if the selector doesn't select an existing pair or
3547+ : array member
3548+ : @error j:JUDY0062 if the first argument is a pair
3549+ : @error j:JUDY0063 invalid type for second argument (must be xs:integer
3550+ : if first argument is an array or xs:string if first argument is an object)
3551+ :)
3552+declare updating function j:delete(
3553+ $j as json-item(),
3554+ $selector as xs:anyAtomicType)
3555+{
3556+ try {
3557+ typeswitch ($j)
3558+ case $o as object()
3559+ return j:delete-pair($o, $selector treat as xs:string)
3560+ case $a as array()
3561+ return j:delete-member($a, $selector treat as xs:integer)
3562+ default return
3563+ fn:error(
3564+ fn:QName("http://www.jsoniq.org/errors", "JUDY0062"),
3565+ "first argument to delete function is pair() but must be array() or object()",
3566+ $j)
3567+ } catch err:XPDY0050 {
3568+ fn:error(
3569+ fn:QName("http://www.jsoniq.org/errors", "JUDY0063"),
3570+ concat(
3571+ schema:schema-type($selector),
3572+ ": invalid type for second argument; should be ",
3573+ typeswitch ($j)
3574+ case object() return "xs:string"
3575+ default return "xs:integer"
3576+ ),
3577+ $selector
3578+ )
3579+ }
3580+};
3581+
3582+(:~
3583+ :
3584+ : @param $p
3585+ : @return
3586+ :
3587+ : @error j:JUDY0061 if the key doesn't select an existing pair
3588+ :)
3589+declare updating function j:delete-pair(
3590+ $o as object(),
3591+ $key as xs:string) external;
3592+
3593+(:~
3594+ :
3595+ : @param $p
3596+ : @return
3597+ :
3598+ : @error j:JUDY0061 if the position doesn't select an existing member
3599+ :)
3600+declare updating function j:delete-member(
3601+ $a as array(),
3602+ $pos as xs:integer) external;
3603+
3604+(:~
3605+ :
3606+ : @param $p
3607+ : @return
3608+ :
3609+ : @error j:JUDY0061 if the position doesn't select an existing member
3610+ :)
3611+declare updating function j:rename(
3612+ $p as object(),
3613+ $old-name as xs:string,
3614+ $new-name as xs:string) external;
3615+
3616+(:~
3617+ :
3618+ : @param $p
3619+ : @return
3620+ :)
3621+declare updating function j:replace-value(
3622+ $j as json-item(),
3623+ $selector as xs:anyAtomicType,
3624+ $new-val as item())
3625+{
3626+ try {
3627+ typeswitch ($j)
3628+ case $o as object()
3629+ return j:replace-value-in-object($o, $selector treat as xs:string, $new-val)
3630+ case $a as array()
3631+ return j:replace-value-in-array($a, $selector treat as xs:integer, $new-val)
3632+ default return
3633+ fn:error(
3634+ fn:QName("http://www.jsoniq.org/errors", "JUDY0062"),
3635+ "first argument to replace-value function is pair() but must be array() or object()",
3636+ $j)
3637+ } catch err:XPDY0050 {
3638+ fn:error(
3639+ fn:QName("http://www.jsoniq.org/errors", "JUDY0063"),
3640+ concat(
3641+ schema:schema-type($selector),
3642+ ": invalid type for second argument; should be ",
3643+ typeswitch ($j)
3644+ case object() return "xs:string"
3645+ default return "xs:integer"
3646+ ),
3647+ $selector
3648+ )
3649+ }
3650+};
3651+
3652+(:~
3653+ :
3654+ : @param $p
3655+ : @return
3656+ :)
3657+declare updating function j:replace-value-in-object(
3658+ $o as object(),
3659+ $key as xs:string,
3660+ $new-val as item()) external;
3661+
3662+(:~
3663+ :
3664+ : @param $p
3665+ : @return
3666+ :)
3667+declare updating function j:replace-value-in-array(
3668+ $a as array(),
3669+ $pos as xs:integer,
3670+ $new-val as item()) external;
3671
3672=== added directory 'modules/org/jsoniq/www/pregenerated'
3673=== added file 'modules/org/jsoniq/www/pregenerated/errors.xq'
3674--- modules/org/jsoniq/www/pregenerated/errors.xq 1970-01-01 00:00:00 +0000
3675+++ modules/org/jsoniq/www/pregenerated/errors.xq 2012-02-07 00:26:21 +0000
3676@@ -0,0 +1,104 @@
3677+(:
3678+ : Copyright 2006-2011 The FLWOR Foundation.
3679+ :
3680+ : Licensed under the Apache License, Version 2.0 (the "License");
3681+ : you may not use this file except in compliance with the License.
3682+ : You may obtain a copy of the License at
3683+ :
3684+ : http://www.apache.org/licenses/LICENSE-2.0
3685+ :
3686+ : Unless required by applicable law or agreed to in writing, software
3687+ : distributed under the License is distributed on an "AS IS" BASIS,
3688+ : WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3689+ : See the License for the specific language governing permissions and
3690+ : limitations under the License.
3691+ :)
3692+
3693+ (:
3694+ : THIS FILE IS GENERATED.
3695+ : PLEASE DO NOT EDIT.
3696+ :)
3697+ (:~
3698+ : This module contains one declaration of a variable for each
3699+ : error of the http://www.jsoniq.org/errors namespace.
3700+ : The variables serves as documentation for the errors but can also
3701+ : be used in the code. For example, one useful scenario is to compare
3702+ : an error caught in the catch clause of a try-catch expression with one of
3703+ : the variables.
3704+ :
3705+ : @author Carlos Lopez
3706+ :
3707+ : @project error
3708+ :)
3709+
3710+xquery version '1.0';
3711+
3712+module namespace jerr = 'http://www.jsoniq.org/errors';
3713+
3714+declare variable $jerr:NS := 'http://www.jsoniq.org/errors';
3715+
3716+(:~
3717+:)
3718+declare variable $jerr:JSDY0001 as xs:QName := fn:QName($jerr:NS, "jerr:JSDY0001");
3719+
3720+(:~
3721+:)
3722+declare variable $jerr:JSDY0002 as xs:QName := fn:QName($jerr:NS, "jerr:JSDY0002");
3723+
3724+(:~
3725+ :error raised by object constructor
3726+:)
3727+declare variable $jerr:JSDY0003 as xs:QName := fn:QName($jerr:NS, "jerr:JSDY0003");
3728+
3729+
3730+declare variable $jerr:JSDY0020 as xs:QName := fn:QName($jerr:NS, "jerr:JSDY0020");
3731+
3732+(:~
3733+ :parser errors raised by the JSONIQLoader
3734+:)
3735+declare variable $jerr:JSDY0040 as xs:QName := fn:QName($jerr:NS, "jerr:JSDY0040");
3736+
3737+(:~
3738+ :error raised by insert-into
3739+:)
3740+declare variable $jerr:JUDY0060 as xs:QName := fn:QName($jerr:NS, "jerr:JUDY0060");
3741+
3742+(:~
3743+ :error raised by upd:delete, upd:insert-before/after
3744+:)
3745+declare variable $jerr:JUDY0061 as xs:QName := fn:QName($jerr:NS, "jerr:JUDY0061");
3746+
3747+(:~
3748+ :objects or arrays don't have a typed value
3749+:)
3750+declare variable $jerr:JSTY0001 as xs:QName := fn:QName($jerr:NS, "jerr:JSTY0001");
3751+
3752+(:~
3753+ :objects or arrays don't have a string value
3754+:)
3755+declare variable $jerr:JSTY0002 as xs:QName := fn:QName($jerr:NS, "jerr:JSTY0002");
3756+
3757+(:~
3758+ :error raised by upd:delete if the argument is not an object or array
3759+:)
3760+declare variable $jerr:JUDY0062 as xs:QName := fn:QName($jerr:NS, "jerr:JUDY0062");
3761+
3762+(:~
3763+ :error raised by upd:delete if the first argument is an
3764+ : object/array but second argument is not of type xs:string/xs:integer,
3765+ : respectively
3766+ :
3767+:)
3768+declare variable $jerr:JUDY0063 as xs:QName := fn:QName($jerr:NS, "jerr:JUDY0063");
3769+
3770+(:~
3771+ :error raised by mergeUpdates. An insert-before or insert-last
3772+ : UP must not have the same target as any other insert-before, -last, -as-first, or -as-last UP
3773+ :
3774+:)
3775+declare variable $jerr:JUDY0064 as xs:QName := fn:QName($jerr:NS, "jerr:JUDY0064");
3776+
3777+(:~
3778+ :error raised by upd:rename
3779+:)
3780+declare variable $jerr:JUDY0065 as xs:QName := fn:QName($jerr:NS, "jerr:JUDY0065");
3781\ No newline at end of file
3782
3783=== modified file 'src/annotations/annotations.h'
3784--- src/annotations/annotations.h 2012-01-11 17:30:25 +0000
3785+++ src/annotations/annotations.h 2012-02-07 00:26:21 +0000
3786@@ -22,7 +22,7 @@
3787
3788 #include "common/shared_types.h"
3789
3790-#include "compiler/parsetree/parsenodes.h"
3791+//#include "compiler/parsetree/parsenodes.h"
3792
3793 #include "zorbautils/hashmap_itemh.h"
3794
3795
3796=== modified file 'src/api/collectionimpl.cpp'
3797--- src/api/collectionimpl.cpp 2011-11-02 06:14:25 +0000
3798+++ src/api/collectionimpl.cpp 2012-02-07 00:26:21 +0000
3799@@ -429,12 +429,17 @@
3800
3801 store::Store* lStore = & GENV_STORE;
3802
3803- store::Collection_t lColl = lStore->getCollection(lQName);
3804-
3805- if (!lColl)
3806- {
3807- lColl = lStore->getCollection(lQName, true);
3808- }
3809+ store::Collection_t lColl = lStore->getCollection(lQName, false, false);
3810+
3811+ if (!lColl)
3812+ lColl = lStore->getCollection(lQName, true, false);
3813+
3814+ if (!lColl)
3815+ lColl = lStore->getCollection(lQName, false, true);
3816+
3817+ if (!lColl)
3818+ lColl = lStore->getCollection(lQName, true, true);
3819+
3820 // must exist because otherwise we wouldn't have an instance of this class
3821 ZORBA_ASSERT(lColl);
3822
3823
3824=== modified file 'src/api/dynamiccontextimpl.cpp'
3825--- src/api/dynamiccontextimpl.cpp 2012-01-11 17:30:25 +0000
3826+++ src/api/dynamiccontextimpl.cpp 2012-02-07 00:26:21 +0000
3827@@ -429,7 +429,8 @@
3828 TypeManager* tm = theStaticContext->get_typemanager();
3829
3830 xqtref_t lItemType = tm->create_named_type(lItem->getType(),
3831- TypeConstants::QUANT_ONE);
3832+ TypeConstants::QUANT_ONE,
3833+ QueryLoc::null);
3834
3835 if (!TypeOps::is_subtype(tm,
3836 *lItemType,
3837
3838=== modified file 'src/api/item.cpp'
3839--- src/api/item.cpp 2012-02-02 09:56:52 +0000
3840+++ src/api/item.cpp 2012-02-07 00:26:21 +0000
3841@@ -170,6 +170,18 @@
3842 return Item();
3843 }
3844
3845+#ifdef ZORBA_WITH_JSON
3846+
3847+bool
3848+Item::isJSONItem() const
3849+{
3850+ ITEM_TRY
3851+ return m_item->isJSONItem();
3852+ ITEM_CATCH
3853+ return false;
3854+}
3855+
3856+#endif /* ZORBA_WITH_JSON */
3857
3858 Iterator_t Item::getAtomizationValue() const
3859 {
3860@@ -448,6 +460,102 @@
3861 return -1;
3862 }
3863
3864+#ifdef ZORBA_WITH_JSON
3865+
3866+store::StoreConsts::JSONItemKind
3867+Item::getJSONItemKind() const
3868+{
3869+ ITEM_TRY
3870+ SYNC_CODE(AutoLock lock(GENV_STORE.getGlobalLock(), Lock::READ);)
3871+
3872+ return m_item->getJSONItemKind();
3873+ ITEM_CATCH
3874+ return store::StoreConsts::jsonItem;
3875+}
3876+
3877+Iterator_t
3878+Item::getObjectPairs() const
3879+{
3880+ ITEM_TRY
3881+ SYNC_CODE(AutoLock lock(GENV_STORE.getGlobalLock(), Lock::READ);)
3882+
3883+ // TODO, we should have an error handler here
3884+ return new StoreIteratorImpl(m_item->getPairs(), nullptr);
3885+
3886+ ITEM_CATCH
3887+ return NULL;
3888+}
3889+
3890+Iterator_t
3891+Item::getArrayMembers() const
3892+{
3893+ ITEM_TRY
3894+ SYNC_CODE(AutoLock lock(GENV_STORE.getGlobalLock(), Lock::READ);)
3895+
3896+ // TODO, we should have an error handler here
3897+ return new StoreIteratorImpl(m_item->getMembers(), nullptr);
3898+
3899+ ITEM_CATCH
3900+ return NULL;
3901+}
3902+
3903+Item
3904+Item::getObjectValue(String aName) const
3905+{
3906+ zstring& lName = Unmarshaller::getInternalString(aName);
3907+ store::Item_t lIndex;
3908+ if (!GENV_ITEMFACTORY->createString(lIndex, lName)) {
3909+ // QQQ probably should throw exception here
3910+ return Item();
3911+ }
3912+ ITEM_TRY
3913+ SYNC_CODE(AutoLock lock(GENV_STORE.getGlobalLock(), Lock::READ););
3914+ store::Item_t lPair = m_item->getPair(lIndex);
3915+ if (lPair.isNull()) {
3916+ return Item();
3917+ }
3918+ return &*lPair->getValue();
3919+ ITEM_CATCH
3920+ return Item();
3921+}
3922+
3923+Item
3924+Item::getArrayMember(uint32_t aIndex) const
3925+{
3926+ store::Item_t lIndex;
3927+ if (!GENV_ITEMFACTORY->createInteger(lIndex, Integer(aIndex))) {
3928+ // QQQ probably should throw exception here
3929+ return Item();
3930+ }
3931+ ITEM_TRY
3932+ SYNC_CODE(AutoLock lock(GENV_STORE.getGlobalLock(), Lock::READ);)
3933+ return &*m_item->getMember(lIndex);
3934+ ITEM_CATCH
3935+ return Item();
3936+}
3937+
3938+Item
3939+Item::getPairName() const
3940+{
3941+ ITEM_TRY
3942+ SYNC_CODE(AutoLock lock(GENV_STORE.getGlobalLock(), Lock::READ);)
3943+ return &*m_item->getName();
3944+ ITEM_CATCH
3945+ return Item();
3946+}
3947+
3948+Item
3949+Item::getPairValue() const
3950+{
3951+ ITEM_TRY
3952+ SYNC_CODE(AutoLock lock(GENV_STORE.getGlobalLock(), Lock::READ);)
3953+ return &*m_item->getValue();
3954+ ITEM_CATCH
3955+ return Item();
3956+}
3957+
3958+#endif /* ZORBA_WITH_JSON */
3959+
3960 bool
3961 Item::isStreamable() const
3962 {
3963
3964=== modified file 'src/api/options.cpp'
3965--- src/api/options.cpp 2012-01-11 17:30:25 +0000
3966+++ src/api/options.cpp 2012-02-07 00:26:21 +0000
3967@@ -17,6 +17,7 @@
3968
3969 #include <string.h>
3970 #include <zorba/options.h>
3971+#include "diagnostics/xquery_diagnostics.h"
3972
3973 Zorba_CompilerHints::Zorba_CompilerHints()
3974 :
3975@@ -36,7 +37,11 @@
3976
3977 Zorba_SerializerOptions::Zorba_SerializerOptions()
3978 :
3979+#ifdef ZORBA_WITH_JSON
3980+ ser_method(ZORBA_SERIALIZATION_METHOD_JSONIQ),
3981+#else
3982 ser_method(ZORBA_SERIALIZATION_METHOD_XML),
3983+#endif
3984 byte_order_mark(ZORBA_BYTE_ORDER_MARK_NO),
3985 escape_uri_attributes(ZORBA_ESCAPE_URI_ATTRIBUTES_NO),
3986 include_content_type(ZORBA_INCLUDE_CONTENT_TYPE_NO),
3987@@ -63,9 +68,15 @@
3988 else if (strcmp(value, "html") == 0) ser_method = ZORBA_SERIALIZATION_METHOD_HTML;
3989 else if (strcmp(value, "xhtml") == 0) ser_method = ZORBA_SERIALIZATION_METHOD_XHTML;
3990 else if (strcmp(value, "text") == 0) ser_method = ZORBA_SERIALIZATION_METHOD_TEXT;
3991+ else if (strcmp(value, "binary") == 0) ser_method = ZORBA_SERIALIZATION_METHOD_BINARY;
3992+#ifdef ZORBA_WITH_JSON
3993+ else if (strcmp(value, "json") == 0) ser_method = ZORBA_SERIALIZATION_METHOD_JSON;
3994+ else if (strcmp(value, "jsoniq") == 0) ser_method = ZORBA_SERIALIZATION_METHOD_JSONIQ;
3995+#endif
3996 else
3997 {
3998- ; // TODO signal errors for incorrect values?
3999+ throw XQUERY_EXCEPTION
4000+ (err::SEPM0016, ERROR_PARAMS( value, "method", ZED( GoodValuesAreXMLEtc ) ));
4001 }
4002 }
4003 else if (strcmp(parameter, "byte-order-mark") == 0)
4004
4005=== modified file 'src/api/serialization/serializer.cpp'
4006--- src/api/serialization/serializer.cpp 2012-01-11 17:30:25 +0000
4007+++ src/api/serialization/serializer.cpp 2012-02-07 00:26:21 +0000
4008@@ -18,7 +18,7 @@
4009 #include <sstream>
4010
4011 #include <zorba/zorba_string.h>
4012-
4013+#include <zorbamisc/ns_consts.h>
4014 #include "zorbatypes/numconversions.h"
4015 #include "diagnostics/xquery_diagnostics.h"
4016 #include "diagnostics/assert.h"
4017@@ -39,7 +39,8 @@
4018 #include "store/api/iterator.h"
4019 #include "store/api/iterator_factory.h"
4020 #include "store/api/item.h"
4021-
4022+#include <store/api/item_factory.h>
4023+#include <store/api/copymode.h>
4024
4025 namespace zorba {
4026
4027@@ -194,9 +195,15 @@
4028 const unsigned char* temp = chars;
4029 unicode::code_point cp = utf8::next_char(temp);
4030
4031- // raise an error iff (1) the serialization format is XML 1.0 and (2) the given character is an invalid XML 1.0 character
4032- if (ser && ser->method == PARAMETER_VALUE_XML && ser->version == "1.0" && !xml::is_valid(cp))
4033+ // raise an error iff (1) the serialization format is XML 1.0 and
4034+ // (2) the given character is an invalid XML 1.0 character
4035+ if (ser &&
4036+ ser->method == PARAMETER_VALUE_XML &&
4037+ ser->version == "1.0" &&
4038+ !xml::is_valid(cp))
4039+ {
4040 throw XQUERY_EXCEPTION( err::FOCH0001, ERROR_PARAMS( cp ) );
4041+ }
4042
4043 if (cp >= 0x10000 && cp <= 0x10FFFF)
4044 {
4045@@ -347,7 +354,7 @@
4046 /*******************************************************************************
4047
4048 ********************************************************************************/
4049-void serializer::emitter::emit_declaration_end()
4050+void serializer::emitter::emit_end()
4051 {
4052 // Do nothing in the default emitter
4053 }
4054@@ -393,6 +400,12 @@
4055 ********************************************************************************/
4056 void serializer::emitter::emit_item(store::Item* item)
4057 {
4058+#ifdef ZORBA_WITH_JSON
4059+ if (item->isJSONItem())
4060+ {
4061+ throw XQUERY_EXCEPTION(zerr::ZAPI0043_CANNOT_SERIALIZE_JSON_ITEM);
4062+ }
4063+#endif
4064 if (item->isAtomic())
4065 {
4066 if (previous_item == PREVIOUS_ITEM_WAS_TEXT)
4067@@ -764,7 +777,6 @@
4068 return false;
4069 }
4070
4071-
4072 /*******************************************************************************
4073
4074 ********************************************************************************/
4075@@ -809,7 +821,7 @@
4076
4077 ////////////////////////////////////////////////////////////////////////////////
4078 // //
4079-// XML Emitter //
4080+// XML emitter //
4081 // //
4082 ////////////////////////////////////////////////////////////////////////////////
4083
4084@@ -889,6 +901,325 @@
4085 }
4086
4087
4088+#ifdef ZORBA_WITH_JSON
4089+
4090+////////////////////////////////////////////////////////////////////////////////
4091+// //
4092+// JSON emitter //
4093+// //
4094+////////////////////////////////////////////////////////////////////////////////
4095+
4096+serializer::json_emitter::json_emitter(
4097+ serializer* the_serializer,
4098+ transcoder& the_transcoder)
4099+ : emitter(the_serializer, the_transcoder),
4100+ theXMLStringStream(nullptr)
4101+{
4102+}
4103+
4104+serializer::json_emitter::~json_emitter()
4105+{
4106+ delete theXMLStringStream;
4107+}
4108+
4109+void serializer::json_emitter::emit_item(store::Item *item)
4110+{
4111+ if (!item->isJSONItem())
4112+ {
4113+ throw XQUERY_EXCEPTION(zerr::ZAPI0044_CANNOT_SERIALIZE_XML_ITEM);
4114+ }
4115+ emit_json_item(item, 0);
4116+}
4117+
4118+void serializer::json_emitter::emit_declaration()
4119+{
4120+}
4121+
4122+void serializer::json_emitter::emit_end()
4123+{
4124+}
4125+
4126+void serializer::json_emitter::emit_json_item(store::Item* item, int depth)
4127+{
4128+ // This is called for any item within a JSON array or object, or for a
4129+ // top-level JSON array or object. So JSON rules for simple types may
4130+ // apply here.
4131+ if (item->isJSONObject()) {
4132+ emit_json_object(item, depth);
4133+ }
4134+ else if (item->isJSONArray()) {
4135+ emit_json_array(item, depth);
4136+ }
4137+ else if (item->isJSONPair()) {
4138+ emit_json_pair(item, depth);
4139+ }
4140+ else if (item->isAtomic()) {
4141+ store::SchemaTypeCode type = item->getTypeCode();
4142+ switch (type) {
4143+ case store::XS_STRING:
4144+ emit_json_string(item->getStringValue());
4145+ break;
4146+
4147+ case store::XS_DOUBLE:
4148+ case store::XS_FLOAT:
4149+ if (item->isNaN()) {
4150+ emit_jsoniq_value("number", "NaN", depth);
4151+ break;
4152+ }
4153+ else if (item->isPosOrNegInf()) {
4154+ emit_jsoniq_value("number", "Infinity", depth);
4155+ break;
4156+ }
4157+ // else fall through
4158+ case store::XS_INTEGER:
4159+ case store::XS_DECIMAL:
4160+ case store::XS_NON_POSITIVE_INTEGER:
4161+ case store::XS_NEGATIVE_INTEGER:
4162+ case store::XS_LONG:
4163+ case store::XS_INT:
4164+ case store::XS_SHORT:
4165+ case store::XS_BYTE:
4166+ case store::XS_NON_NEGATIVE_INTEGER:
4167+ case store::XS_UNSIGNED_LONG:
4168+ case store::XS_UNSIGNED_INT:
4169+ case store::XS_UNSIGNED_SHORT:
4170+ case store::XS_UNSIGNED_BYTE:
4171+ case store::XS_POSITIVE_INTEGER:
4172+ // All numerics get serialized the same way
4173+ tr << item->getStringValue();
4174+ break;
4175+
4176+ case store::XS_BOOLEAN:
4177+ tr << (item->getBooleanValue() ? "true" : "false");
4178+ break;
4179+
4180+ case store::JDM_NULL:
4181+ tr << "null";
4182+ break;
4183+
4184+ default: {
4185+ emit_jsoniq_value(item->getType()->getStringValue(),
4186+ item->getStringValue(), depth);
4187+ break;
4188+ }
4189+ }
4190+ }
4191+ else {
4192+ // OK, we've got a non-atomic non-JDM Item here, so serialize it as XML
4193+ // and output it as a "JSONiq value".
4194+ if (!theXMLEmitter) {
4195+ theXMLStringStream = new std::stringstream();
4196+ theXMLTranscoder = ser->create_transcoder(*theXMLStringStream);
4197+ theXMLEmitter = new serializer::xml_emitter(ser, *theXMLTranscoder);
4198+ }
4199+ theXMLEmitter->emit_item(item);
4200+ std::string xml = theXMLStringStream->str();
4201+ emit_jsoniq_value("XML", xml, depth);
4202+ theXMLStringStream->str("");
4203+ }
4204+}
4205+
4206+/*******************************************************************************
4207+
4208+********************************************************************************/
4209+void serializer::json_emitter::emit_json_object(store::Item* obj, int depth)
4210+{
4211+ store::Item_t pair;
4212+ store::Iterator_t it = obj->getPairs();
4213+ it->open();
4214+ bool first = true;
4215+ if (ser->indent) {
4216+ tr << "{" <<ser->END_OF_LINE;
4217+ }
4218+ else {
4219+ tr << "{ ";
4220+ }
4221+ depth++;
4222+ while (it->next(pair)) {
4223+ if (first) {
4224+ first = false;
4225+ }
4226+ else {
4227+ tr << ", ";
4228+ if (ser->indent) {
4229+ tr << ser->END_OF_LINE;
4230+ }
4231+ }
4232+ if (ser->indent) {
4233+ emit_indentation(depth);
4234+ }
4235+ emit_json_pair(pair, depth);
4236+ }
4237+ if (ser->indent) {
4238+ tr << ser->END_OF_LINE;
4239+ emit_indentation(depth-1);
4240+ tr << "}";
4241+ }
4242+ else {
4243+ tr << " }";
4244+ }
4245+}
4246+
4247+/*******************************************************************************
4248+
4249+********************************************************************************/
4250+void serializer::json_emitter::emit_json_array(store::Item* array, int depth)
4251+{
4252+ store::Item_t member;
4253+ store::Iterator_t it = array->getMembers();
4254+ it->open();
4255+ bool first = true;
4256+ tr << "[ ";
4257+ while (it->next(member)) {
4258+ if (first) {
4259+ first = false;
4260+ }
4261+ else {
4262+ tr << ", ";
4263+ }
4264+ emit_json_item(member, depth);
4265+ }
4266+ tr << " ]";
4267+}
4268+
4269+/*******************************************************************************
4270+
4271+********************************************************************************/
4272+void serializer::json_emitter::emit_json_pair(store::Item* pair, int depth)
4273+{
4274+ emit_json_item(pair->getName(), depth);
4275+ tr << " : ";
4276+ emit_json_item(pair->getValue(), depth);
4277+}
4278+
4279+/*******************************************************************************
4280+
4281+********************************************************************************/
4282+void serializer::json_emitter::emit_jsoniq_value
4283+ (zstring type, zstring value, int depth)
4284+{
4285+ // Create items for constant strings, if not already done
4286+ if (!theJsoniqValueName) {
4287+ zstring jsoniqvaluestring("JSONiq value");
4288+ zstring typestring("type");
4289+ zstring valuestring("value");
4290+ GENV_ITEMFACTORY->createString(theJsoniqValueName, jsoniqvaluestring);
4291+ GENV_ITEMFACTORY->createString(theTypeName, typestring);
4292+ GENV_ITEMFACTORY->createString(theValueName, valuestring);
4293+ }
4294+
4295+ // Create the inner JSON object
4296+ store::Item_t inner;
4297+ GENV_ITEMFACTORY->createJSONObject(inner);
4298+ // Inner object contains two pairs
4299+ store::Item_t typeitem, valueitem;
4300+ store::Item_t typepair, valuepair;
4301+ GENV_ITEMFACTORY->createString(typeitem, type);
4302+ GENV_ITEMFACTORY->createString(valueitem, value);
4303+ GENV_ITEMFACTORY->createJSONObjectPair(typepair, theTypeName, typeitem);
4304+ GENV_ITEMFACTORY->createJSONObjectPair(valuepair, theValueName, valueitem);
4305+
4306+ // "Copy" pairs into object
4307+ store::CopyMode noCopy;
4308+ noCopy.theDoCopy = false;
4309+ typepair->copy(inner.getp(), noCopy);
4310+ valuepair->copy(inner.getp(), noCopy);
4311+
4312+ // Create the outer JSON object with one pair
4313+ store::Item_t outer;
4314+ GENV_ITEMFACTORY->createJSONObject(outer);
4315+ store::Item_t outerpair;
4316+ GENV_ITEMFACTORY->createJSONObjectPair(outerpair, theJsoniqValueName, inner);
4317+ outerpair->copy(outer, noCopy);
4318+
4319+ emit_json_object(outer, depth);
4320+}
4321+
4322+void serializer::json_emitter::emit_json_string(zstring string)
4323+{
4324+ tr << '"';
4325+ zstring::const_iterator i = string.begin();
4326+ zstring::const_iterator end = string.end();
4327+ for (; i < end; i++) {
4328+ if (*i == '\\' || *i == '"' || (*i < 0x20)) {
4329+ tr << '\\';
4330+ }
4331+ tr << *i;
4332+ }
4333+ tr << '"';
4334+}
4335+
4336+
4337+////////////////////////////////////////////////////////////////////////////////
4338+// //
4339+// JSONiq emitter (auto-detects JSON or XML) //
4340+// //
4341+////////////////////////////////////////////////////////////////////////////////
4342+
4343+serializer::jsoniq_emitter::jsoniq_emitter(
4344+ serializer* the_serializer,
4345+ transcoder& the_transcoder)
4346+ :
4347+ emitter(the_serializer, the_transcoder),
4348+ theEmitterState(JESTATE_UNDETERMINED),
4349+ theEmitter(nullptr)
4350+{
4351+}
4352+
4353+serializer::jsoniq_emitter::~jsoniq_emitter()
4354+{
4355+ delete theEmitter;
4356+}
4357+
4358+void serializer::jsoniq_emitter::emit_declaration()
4359+{
4360+ // Probably I should set a flag here to note whether emit_declaration() has
4361+ // been called or not. However, I know that all serializer::serialize()
4362+ // methods DO call emit_declaration() and call it first, so there's no need.
4363+}
4364+
4365+void serializer::jsoniq_emitter::emit_item(store::Item *item)
4366+{
4367+ bool isJson = item->isJSONItem();
4368+
4369+ if (theEmitterState == JESTATE_UNDETERMINED) {
4370+ // Initialize theEmitter based on item type, passing through our serializer
4371+ // and transcoder.
4372+ if (isJson) {
4373+ theEmitterState = JESTATE_JDM;
4374+ theEmitter = new json_emitter(ser, tr);
4375+ }
4376+ else {
4377+ theEmitterState = JESTATE_XDM;
4378+ theEmitter = new xml_emitter(ser, tr);
4379+ }
4380+ // Since this was the first item, call emit_declaration().
4381+ theEmitter->emit_declaration();
4382+ }
4383+ else {
4384+ // Error checking
4385+ if ( (isJson && theEmitterState == JESTATE_XDM) ||
4386+ (!isJson && theEmitterState == JESTATE_JDM) ) {
4387+ throw XQUERY_EXCEPTION(zerr::ZAPI0045_CANNOT_SERIALIZE_MIXED_XDM_JDM);
4388+ }
4389+ }
4390+
4391+ // Pass through
4392+ theEmitter->emit_item(item);
4393+}
4394+
4395+void serializer::jsoniq_emitter::emit_end()
4396+{
4397+ // Not really clear what to do if we serialized no items and hence have
4398+ // no emitter yet, but doing nothing at all seems reasonable.
4399+ if (theEmitter) {
4400+ theEmitter->emit_end();
4401+ }
4402+}
4403+
4404+
4405+#endif /* ZORBA_WITH_JSON */
4406+
4407 ////////////////////////////////////////////////////////////////////////////////
4408 // //
4409 // HTML Emitter //
4410@@ -1043,7 +1374,7 @@
4411 /*******************************************************************************
4412
4413 ********************************************************************************/
4414-void serializer::html_emitter::emit_declaration_end()
4415+void serializer::html_emitter::emit_end()
4416 {
4417 }
4418
4419@@ -1439,7 +1770,7 @@
4420 /*******************************************************************************
4421
4422 ********************************************************************************/
4423-void serializer::sax2_emitter::emit_declaration_end()
4424+void serializer::sax2_emitter::emit_end()
4425 {
4426 theSAX2ContentHandler->endDocument();
4427 }
4428@@ -1893,7 +2224,6 @@
4429 }
4430 }
4431
4432-
4433 ////////////////////////////////////////////////////////////////////////////////
4434 // //
4435 // Serializer //
4436@@ -1940,7 +2270,12 @@
4437
4438 media_type.clear();
4439
4440+ // This default should match the default for ser_method in Zorba_SerializerOptions
4441+#ifdef ZORBA_WITH_JSON
4442+ method = PARAMETER_VALUE_JSONIQ;
4443+#else
4444 method = PARAMETER_VALUE_XML;
4445+#endif
4446
4447 normalization_form.clear();
4448
4449@@ -2032,6 +2367,12 @@
4450 method = PARAMETER_VALUE_TEXT;
4451 else if (!strcmp(aValue, "binary"))
4452 method = PARAMETER_VALUE_BINARY;
4453+#ifdef ZORBA_WITH_JSON
4454+ else if (!strcmp(aValue, "json"))
4455+ method = PARAMETER_VALUE_JSON;
4456+ else if (!strcmp(aValue, "jsoniq"))
4457+ method = PARAMETER_VALUE_JSONIQ;
4458+#endif
4459 else
4460 throw XQUERY_EXCEPTION(
4461 err::SEPM0016, ERROR_PARAMS( aValue, aName, ZED( GoodValuesAreXMLEtc ) )
4462@@ -2160,22 +2501,10 @@
4463 ********************************************************************************/
4464 bool serializer::setup(std::ostream& os)
4465 {
4466- if (encoding == PARAMETER_VALUE_UTF_8)
4467- {
4468- tr = new transcoder(os, false);
4469- }
4470-#ifndef ZORBA_NO_UNICODE
4471- else if (encoding == PARAMETER_VALUE_UTF_16)
4472- {
4473- tr = new transcoder(os, true);
4474- }
4475-#endif
4476- else
4477- {
4478- ZORBA_ASSERT(0);
4479+ tr = create_transcoder(os);
4480+ if (!tr) {
4481 return false;
4482 }
4483-
4484 if (method == PARAMETER_VALUE_XML)
4485 e = new xml_emitter(this, *tr);
4486 else if (method == PARAMETER_VALUE_HTML)
4487@@ -2186,6 +2515,12 @@
4488 e = new text_emitter(this, *tr);
4489 else if (method == PARAMETER_VALUE_BINARY)
4490 e = new binary_emitter(this, *tr);
4491+#ifdef ZORBA_WITH_JSON
4492+ else if (method == PARAMETER_VALUE_JSON)
4493+ e = new json_emitter(this, *tr);
4494+ else if (method == PARAMETER_VALUE_JSONIQ)
4495+ e = new jsoniq_emitter(this, *tr);
4496+#endif
4497 else
4498 {
4499 ZORBA_ASSERT(0);
4500@@ -2204,6 +2539,24 @@
4501 return true;
4502 }
4503
4504+transcoder* serializer::create_transcoder(std::ostream &os)
4505+{
4506+ if (encoding == PARAMETER_VALUE_UTF_8)
4507+ {
4508+ return new transcoder(os, false);
4509+ }
4510+#ifndef ZORBA_NO_UNICODE
4511+ else if (encoding == PARAMETER_VALUE_UTF_16)
4512+ {
4513+ return new transcoder(os, true);
4514+ }
4515+#endif
4516+ else
4517+ {
4518+ ZORBA_ASSERT(0);
4519+ return nullptr;
4520+ }
4521+}
4522
4523 /*******************************************************************************
4524
4525@@ -2265,7 +2618,7 @@
4526 e->emit_item(&*lItem);
4527 }
4528 //+ aObject->close();
4529- e->emit_declaration_end();
4530+ e->emit_end();
4531 }
4532
4533
4534@@ -2311,7 +2664,7 @@
4535 }
4536
4537 //object->close();
4538- e->emit_declaration_end();
4539+ e->emit_end();
4540 }
4541
4542 } // namespace zorba
4543
4544=== modified file 'src/api/serialization/serializer.h'
4545--- src/api/serialization/serializer.h 2011-11-11 07:44:01 +0000
4546+++ src/api/serialization/serializer.h 2012-02-07 00:26:21 +0000
4547@@ -69,6 +69,10 @@
4548 PARAMETER_VALUE_XHTML,
4549 PARAMETER_VALUE_TEXT,
4550 PARAMETER_VALUE_BINARY,
4551+#ifdef ZORBA_WITH_JSON
4552+ PARAMETER_VALUE_JSON,
4553+ PARAMETER_VALUE_JSONIQ,
4554+#endif
4555
4556 PARAMETER_VALUE_UTF_8
4557 #ifndef ZORBA_NO_UNICODE
4558@@ -168,6 +172,7 @@
4559
4560 bool setup(std::ostream& os);
4561
4562+ transcoder* create_transcoder(std::ostream& os);
4563
4564 ///////////////////////////////////////////////////////////
4565 // //
4566@@ -198,8 +203,20 @@
4567 /**
4568 * Outputs the end of the serialized document.
4569 */
4570- virtual void emit_declaration_end();
4571-
4572+ virtual void emit_end();
4573+
4574+ /**
4575+ * Serializes the given item, depending on its type, and its children. This
4576+ * will be called by serializer for each top-level item in the sequence.
4577+ *
4578+ * @param item the item to serialize
4579+ */
4580+ virtual void emit_item(store::Item* item);
4581+
4582+ // End of the "public" emitter API. All remaining methods are implementation
4583+ // details and will not be called from outside.
4584+
4585+ protected:
4586 /**
4587 * Outputs the doctype declaration. This function is not used by the
4588 * default emitter, it is intended to be defined by the XML, HTML and XHTML
4589@@ -208,13 +225,6 @@
4590 virtual void emit_doctype(const zstring& elementName);
4591
4592 /**
4593- * Serializes the given item, depending on its type, and its children.
4594- *
4595- * @param item the item to serialize
4596- */
4597- virtual void emit_item(store::Item* item);
4598-
4599- /**
4600 * Serializes the given streamable item.
4601 *
4602 * @param item the item to serialize
4603@@ -270,7 +280,6 @@
4604 */
4605 void emit_indentation(int depth);
4606
4607- protected:
4608 bool haveBinding(std::pair<zstring, zstring>& nsBinding) const;
4609
4610 bool havePrefix(const zstring& pre) const;
4611@@ -316,9 +325,94 @@
4612
4613 virtual void emit_declaration();
4614
4615+ protected:
4616 virtual void emit_doctype(const zstring& elementName);
4617 };
4618
4619+ ///////////////////////////////////////////////////////////
4620+ // //
4621+ // class json_emitter //
4622+ // //
4623+ ///////////////////////////////////////////////////////////
4624+
4625+#ifdef ZORBA_WITH_JSON
4626+
4627+ class json_emitter : public emitter
4628+ {
4629+ public:
4630+ json_emitter(serializer* the_serializer, transcoder& the_transcoder);
4631+
4632+ virtual ~json_emitter();
4633+
4634+ virtual void emit_declaration();
4635+
4636+ virtual void emit_item(store::Item *item);
4637+
4638+ virtual void emit_end();
4639+
4640+ private:
4641+
4642+ /**
4643+ * Outputs a JSON item. This method is called both for top-level JSON
4644+ * items as well as any items within a JSON object or array, so it may
4645+ * output simple typed values differently than standard XML serialization.
4646+ */
4647+ void emit_json_item(store::Item* item, int depth);
4648+
4649+ void emit_json_object(store::Item* object, int depth);
4650+
4651+ void emit_json_array(store::Item* array, int depth);
4652+
4653+ void emit_json_pair(store::Item* pair, int depth);
4654+
4655+ void emit_json_value(store::Item* value, int depth);
4656+
4657+ void emit_jsoniq_value(zstring type, zstring value, int depth);
4658+
4659+ void emit_json_string(zstring string);
4660+
4661+ store::Item_t theJsoniqValueName;
4662+ store::Item_t theTypeName;
4663+ store::Item_t theValueName;
4664+
4665+ rchandle<emitter> theXMLEmitter;
4666+ rchandle<transcoder> theXMLTranscoder;
4667+ std::stringstream* theXMLStringStream;
4668+ };
4669+
4670+
4671+ ///////////////////////////////////////////////////////////
4672+ // //
4673+ // class jsoniq_emitter (auto-detects JSON or XML) //
4674+ // //
4675+ ///////////////////////////////////////////////////////////
4676+
4677+ class jsoniq_emitter : public emitter
4678+ {
4679+ public:
4680+ jsoniq_emitter(serializer* the_serializer, transcoder& the_transcoder);
4681+
4682+ virtual ~jsoniq_emitter();
4683+
4684+ virtual void emit_declaration();
4685+
4686+ virtual void emit_item(store::Item *item);
4687+
4688+ virtual void emit_end();
4689+
4690+ private:
4691+ enum JSONiqEmitterState {
4692+ JESTATE_UNDETERMINED,
4693+ JESTATE_JDM,
4694+ JESTATE_XDM
4695+ } theEmitterState;
4696+
4697+ serializer::emitter* theEmitter;
4698+ };
4699+
4700+#endif /* ZORBA_WITH_JSON */
4701+
4702+
4703
4704 ///////////////////////////////////////////////////////////
4705 // //
4706@@ -331,6 +425,7 @@
4707 public:
4708 xhtml_emitter(serializer* the_serializer, transcoder& the_transcoder);
4709
4710+ protected:
4711 virtual void emit_node(const store::Item* item, int depth);
4712 };
4713
4714@@ -347,7 +442,9 @@
4715 html_emitter(serializer* the_serializer, transcoder& the_transcoder);
4716
4717 virtual void emit_declaration();
4718- virtual void emit_declaration_end();
4719+ virtual void emit_end();
4720+
4721+ protected:
4722 virtual void emit_doctype(const zstring& elementName);
4723 virtual void emit_node(const store::Item* item, int depth);
4724 };
4725@@ -366,6 +463,9 @@
4726
4727 virtual void emit_declaration();
4728
4729+ virtual void emit_item(store::Item* item);
4730+
4731+ protected:
4732 virtual void emit_node(const store::Item* item, int depth);
4733
4734 virtual int emit_node_children(
4735@@ -373,8 +473,6 @@
4736 int depth,
4737 bool perform_escaping = true);
4738
4739- virtual void emit_item(store::Item* item);
4740-
4741 virtual void emit_streamable_item(store::Item* item);
4742 };
4743
4744@@ -400,16 +498,17 @@
4745 std::stringstream& aSStream,
4746 SAX2_ContentHandler* aSAX2ContentHandler);
4747
4748+ void emit_declaration();
4749+ void emit_item(store::Item* item );
4750+ void emit_end();
4751+
4752+ protected:
4753 void emit_startPrefixMapping(
4754 const store::Item* item,
4755 store::NsBindings& nsBindings );
4756
4757 void emit_endPrefixMapping(store::NsBindings& nsBindings );
4758
4759- void emit_declaration();
4760-
4761- void emit_declaration_end();
4762-
4763 void emit_node(const store::Item* item, int depth);
4764
4765 void emit_node(const store::Item* item);
4766@@ -427,8 +526,6 @@
4767 void emit_node_children(const store::Item* item);
4768
4769 bool emit_bindings(const store::Item* item, int depth);
4770-
4771- void emit_item(store::Item* item );
4772 };
4773
4774
4775
4776=== modified file 'src/api/serializerimpl.cpp'
4777--- src/api/serializerimpl.cpp 2011-06-14 17:26:33 +0000
4778+++ src/api/serializerimpl.cpp 2012-02-07 00:26:21 +0000
4779@@ -20,8 +20,9 @@
4780 #include <zorba/singleton_item_sequence.h>
4781 #include <zorba/diagnostic_handler.h>
4782
4783-#include "api/zorbaimpl.h"
4784-#include "api/unmarshaller.h"
4785+#include <diagnostics/assert.h>
4786+#include <api/zorbaimpl.h>
4787+#include <api/unmarshaller.h>
4788
4789 #include "serializerimpl.h"
4790
4791@@ -88,6 +89,8 @@
4792 {
4793 switch (theInternalSerializer.getSerializationMethod())
4794 {
4795+ case serializer::PARAMETER_VALUE_XML:
4796+ return ZORBA_SERIALIZATION_METHOD_XML;
4797 case serializer::PARAMETER_VALUE_HTML:
4798 return ZORBA_SERIALIZATION_METHOD_HTML;
4799 case serializer::PARAMETER_VALUE_XHTML:
4800@@ -96,8 +99,14 @@
4801 return ZORBA_SERIALIZATION_METHOD_TEXT;
4802 case serializer::PARAMETER_VALUE_BINARY:
4803 return ZORBA_SERIALIZATION_METHOD_BINARY;
4804+#ifdef ZORBA_WITH_JSON
4805+ case serializer::PARAMETER_VALUE_JSON:
4806+ return ZORBA_SERIALIZATION_METHOD_JSON;
4807+ case serializer::PARAMETER_VALUE_JSONIQ:
4808+ return ZORBA_SERIALIZATION_METHOD_JSONIQ;
4809+#endif
4810 default:
4811- return ZORBA_SERIALIZATION_METHOD_XML;
4812+ ZORBA_ASSERT(0);
4813 }
4814 }
4815
4816@@ -119,6 +128,12 @@
4817 aInternalSerializer.setParameter("method", "text"); break;
4818 case ZORBA_SERIALIZATION_METHOD_BINARY:
4819 aInternalSerializer.setParameter("method", "binary"); break;
4820+#ifdef ZORBA_WITH_JSON
4821+ case ZORBA_SERIALIZATION_METHOD_JSON:
4822+ aInternalSerializer.setParameter("method", "json"); break;
4823+ case ZORBA_SERIALIZATION_METHOD_JSONIQ:
4824+ aInternalSerializer.setParameter("method", "jsoniq"); break;
4825+#endif
4826 }
4827
4828 switch (aSerializerOptions.byte_order_mark)
4829
4830=== modified file 'src/api/typeidentimpl.cpp'
4831--- src/api/typeidentimpl.cpp 2011-09-15 11:46:01 +0000
4832+++ src/api/typeidentimpl.cpp 2012-02-07 00:26:21 +0000
4833@@ -23,13 +23,14 @@
4834 namespace zorba {
4835
4836 TypeIdentifier::TypeIdentifier()
4837- : m_kind(IdentTypes::INVALID_TYPE),
4838- m_quantifier(IdentTypes::QUANT_ONE),
4839- m_uri(""),
4840- m_uriWildcard(false),
4841- m_localName(""),
4842- m_localNameWildcard(false),
4843- m_contentType()
4844+ :
4845+ m_kind(IdentTypes::INVALID_TYPE),
4846+ m_quantifier(IdentTypes::QUANT_ONE),
4847+ m_uri(""),
4848+ m_uriWildcard(false),
4849+ m_localName(""),
4850+ m_localNameWildcard(false),
4851+ m_contentType()
4852 {
4853 }
4854
4855@@ -188,6 +189,59 @@
4856 }
4857
4858
4859+#ifdef ZORBA_WITH_JSON
4860+
4861+TypeIdentifier_t TypeIdentifier::createStructuredItemType(IdentTypes::quantifier_t q)
4862+{
4863+ TypeIdentifier_t ti(new TypeIdentifier());
4864+ ti->m_kind = IdentTypes::STRUCTURED_ITEM_TYPE;
4865+ ti->m_quantifier = q;
4866+
4867+ return ti;
4868+}
4869+
4870+
4871+TypeIdentifier_t TypeIdentifier::createJSONItemType(IdentTypes::quantifier_t q)
4872+{
4873+ TypeIdentifier_t ti(new TypeIdentifier());
4874+ ti->m_kind = IdentTypes::JSON_ITEM_TYPE;
4875+ ti->m_quantifier = q;
4876+
4877+ return ti;
4878+}
4879+
4880+
4881+TypeIdentifier_t TypeIdentifier::createJSONObjectType(IdentTypes::quantifier_t q)
4882+{
4883+ TypeIdentifier_t ti(new TypeIdentifier());
4884+ ti->m_kind = IdentTypes::JSON_OBJECT_TYPE;
4885+ ti->m_quantifier = q;
4886+
4887+ return ti;
4888+}
4889+
4890+
4891+TypeIdentifier_t TypeIdentifier::createJSONArrayType(IdentTypes::quantifier_t q)
4892+{
4893+ TypeIdentifier_t ti(new TypeIdentifier());
4894+ ti->m_kind = IdentTypes::JSON_ARRAY_TYPE;
4895+ ti->m_quantifier = q;
4896+
4897+ return ti;
4898+}
4899+
4900+
4901+TypeIdentifier_t TypeIdentifier::createJSONPairType(IdentTypes::quantifier_t q)
4902+{
4903+ TypeIdentifier_t ti(new TypeIdentifier());
4904+ ti->m_kind = IdentTypes::JSON_PAIR_TYPE;
4905+ ti->m_quantifier = q;
4906+
4907+ return ti;
4908+}
4909+#endif
4910+
4911+
4912 TypeIdentifier_t TypeIdentifier::createItemType(IdentTypes::quantifier_t quantifier)
4913 {
4914 TypeIdentifier_t ti(new TypeIdentifier());
4915
4916=== modified file 'src/compiler/codegen/plan_visitor.cpp'
4917--- src/compiler/codegen/plan_visitor.cpp 2012-01-11 17:30:25 +0000
4918+++ src/compiler/codegen/plan_visitor.cpp 2012-02-07 00:26:21 +0000
4919@@ -38,6 +38,7 @@
4920 #include "compiler/expression/flwor_expr.h"
4921 #include "compiler/expression/fo_expr.h"
4922 #include "compiler/expression/script_exprs.h"
4923+#include "compiler/expression/json_exprs.h"
4924 #include "compiler/expression/update_exprs.h"
4925 #ifndef ZORBA_NO_FULL_TEXT
4926 #include "compiler/expression/ft_expr.h"
4927@@ -57,10 +58,12 @@
4928 #include "runtime/visitors/printer_visitor_api.h"
4929 #include "runtime/visitors/iterprinter.h"
4930 #include "runtime/sequences/SequencesImpl.h"
4931+#include "runtime/sequences/sequences.h"
4932 #include "runtime/core/sequencetypes.h"
4933 #include "runtime/core/item_iterator.h"
4934 #include "runtime/core/var_iterators.h"
4935 #include "runtime/core/constructors.h"
4936+#include "runtime/json/json_constructors.h"
4937 #include "runtime/core/apply_updates.h"
4938 #include "runtime/core/path_iterators.h"
4939 #include "runtime/core/nodeid_iterators.h"
4940@@ -2781,10 +2784,13 @@
4941 axisItep->setDocTestKind(v.getDocTestKind());
4942 axisItep->setNodeKind(v.getNodeKind());
4943 axisItep->setQName(v.getQName());
4944- store::Item *typeName = v.getTypeName();
4945+ store::Item* typeName = v.getTypeName();
4946 if (typeName != NULL)
4947 {
4948- axisItep->setType(sctx->get_typemanager()->create_named_type(typeName));
4949+ axisItep->setType(sctx->get_typemanager()->
4950+ create_named_type(typeName,
4951+ TypeConstants::QUANT_ONE,
4952+ qloc));
4953 }
4954 axisItep->setNilledAllowed(v.getNilledAllowed());
4955 }
4956@@ -2985,25 +2991,26 @@
4957 {
4958 CODEGEN_TRACE_OUT("");
4959
4960- PlanIter_t content = pop_itstack ();
4961+ PlanIter_t content = pop_itstack();
4962
4963 bool isRoot = false;
4964 theEnclosedContextStack.pop();
4965 expr* e = plan_visitor_ns::pop_stack(theConstructorsStack);
4966 ZORBA_ASSERT(e = &v);
4967+
4968 if (theConstructorsStack.empty() || is_enclosed_expr(theConstructorsStack.top()))
4969 {
4970 isRoot = true;
4971 }
4972
4973- switch (v.get_type ())
4974+ switch (v.get_type())
4975 {
4976 case text_expr::text_constructor:
4977- push_itstack (new TextIterator(sctx, qloc, content, isRoot));
4978+ push_itstack(new TextIterator(sctx, qloc, content, isRoot));
4979 break;
4980
4981 case text_expr::comment_constructor:
4982- push_itstack (new CommentIterator (sctx, qloc, content, isRoot));
4983+ push_itstack(new CommentIterator(sctx, qloc, content, isRoot));
4984 break;
4985
4986 default:
4987@@ -3042,6 +3049,103 @@
4988 }
4989
4990
4991+#ifdef ZORBA_WITH_JSON
4992+
4993+/*******************************************************************************
4994+
4995+ JSON Constructors
4996+
4997+********************************************************************************/
4998+bool begin_visit(json_pair_expr& v)
4999+{
5000+ CODEGEN_TRACE_IN("");
The diff has been truncated for viewing.

Subscribers

People subscribed via source and target branches