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

Proposed by Matthias Brantner
Status: Merged
Merged at revision: 10692
Proposed branch: lp:~zorba-coders/zorba/jsoniq-plan_serialization
Merge into: lp:~zorba-coders/zorba/jsoniq
Diff against target: 55003 lines (+21705/-11550)
514 files modified
CMakeCompiler.txt (+3/-0)
CMakeConfiguration.txt (+5/-5)
CMakeLists.txt (+6/-2)
ChangeLog (+21/-0)
KNOWN_ISSUES.txt (+1/-1)
NOTICE.txt (+18/-0)
NOTICE.xml (+16/-0)
bin/path_util.cpp (+19/-2)
bin/path_util.h (+6/-0)
bin/zorbacmd.cpp (+8/-0)
bin/zorbacmdproperties.cpp (+5/-0)
bin/zorbacmdproperties.h (+3/-0)
bin/zorbacmdproperties.txt (+1/-0)
bin/zorbacmdproperties_base.h (+133/-72)
cmake_modules/ZorbaModule.cmake (+213/-65)
config/ExternalModuleConfig.cmake.in (+26/-9)
config/ZorbaUse.cmake (+0/-4)
doc/cxx/examples/context.cpp (+4/-0)
include/zorba/config.h.cmake (+3/-1)
include/zorba/pregenerated/diagnostic_list.h (+11/-5)
include/zorba/properties_base.h (+37/-1)
include/zorba/static_context.h (+36/-0)
include/zorba/util/file.h (+2/-0)
include/zorba/util/time.h (+1/-1)
include/zorba/xmldatamanager.h (+2/-0)
include/zorba/zorba.h (+15/-5)
modules/CMakeLists.txt (+113/-30)
modules/ExternalModules.conf (+3/-1)
modules/com/zorba-xquery/www/modules/converters/json.xq (+2/-2)
modules/com/zorba-xquery/www/modules/datetime.xq (+5/-5)
modules/com/zorba-xquery/www/modules/fetch.xq (+5/-5)
modules/com/zorba-xquery/www/modules/http-client.xq (+15/-15)
modules/com/zorba-xquery/www/modules/pregenerated/errors.xq (+12/-8)
modules/com/zorba-xquery/www/modules/project_xqdoc.xq (+5/-5)
modules/com/zorba-xquery/www/modules/random.xq (+6/-6)
modules/com/zorba-xquery/www/modules/reflection.xq (+9/-9)
modules/com/zorba-xquery/www/modules/store/data-structures/unordered-map.xq (+6/-6)
modules/com/zorba-xquery/www/modules/store/dynamic/collections/dml.xq (+36/-10)
modules/com/zorba-xquery/www/modules/store/dynamic/collections/w3c/dml.xq (+5/-5)
modules/com/zorba-xquery/www/modules/store/static/collections/dml.xq (+48/-17)
modules/com/zorba-xquery/www/modules/store/static/indexes/dml.xq (+3/-3)
modules/com/zorba-xquery/www/modules/xqdoc.xq (+2/-2)
modules/com/zorba-xquery/www/modules/xqdoc.xsd (+1/-0)
modules/com/zorba-xquery/www/modules/xqdoc2xhtml/index.xq (+35/-35)
modules/org/expath/ns/file.xq (+32/-36)
modules/org/expath/ns/file.xq.src/file.cpp (+118/-0)
modules/org/expath/ns/file.xq.src/file.h (+64/-0)
modules/org/expath/ns/file.xq.src/file_module.cpp (+2/-0)
modules/org/jsoniq/www/functions.xq (+22/-1)
modules/org/jsoniq/www/pregenerated/errors.xq (+1/-0)
modules/w3c/pregenerated/xqt-errors.xq (+18/-0)
modules/w3c/xpath_functions.xq (+46/-1)
schemas/CMakeLists.txt (+12/-0)
schemas/XQueryX.xsd (+1962/-0)
schemas/complete-pul.xsd (+136/-0)
schemas/pul.xsd (+237/-0)
schemas/xdm.xsd (+283/-0)
scripts/CMakeLists.txt (+4/-2)
src/CMakeLists.txt (+4/-0)
src/annotations/annotations.h (+1/-1)
src/api/serialization/serializer.cpp (+40/-31)
src/api/serialization/serializer.h (+2/-4)
src/api/staticcollectionmanagerimpl.cpp (+1/-0)
src/api/staticcontextimpl.cpp (+46/-0)
src/api/staticcontextimpl.h (+6/-0)
src/api/zorbaimpl.cpp (+10/-0)
src/api/zorbaimpl.h (+2/-0)
src/compiler/expression/expr.cpp (+0/-10)
src/compiler/expression/expr_utils.h (+1/-1)
src/compiler/expression/flwor_expr.cpp (+0/-4)
src/compiler/expression/ftnode.cpp (+0/-10)
src/compiler/expression/update_exprs.cpp (+0/-2)
src/compiler/parser/xquery_parser.cpp (+3897/-3845)
src/compiler/parser/xquery_parser.hpp (+8/-8)
src/compiler/parser/xquery_scanner.cpp (+3121/-3106)
src/compiler/parsetree/parsenode_print_xqdoc_visitor.cpp (+11/-1)
src/compiler/rewriter/rules/flwor_rules.cpp (+1/-1)
src/compiler/rewriter/rules/fold_rules.cpp (+3/-3)
src/compiler/rewriter/tools/dataflow_annotations.cpp (+7/-4)
src/compiler/translator/translator.cpp (+3/-3)
src/context/dynamic_context.cpp (+153/-3)
src/context/dynamic_context.h (+11/-0)
src/context/dynamic_loader.cpp (+41/-26)
src/context/dynamic_loader.h (+10/-5)
src/diagnostics/assert.cpp (+8/-2)
src/diagnostics/assert.h (+23/-1)
src/diagnostics/diagnostic_en.xml (+148/-39)
src/diagnostics/pregenerated/diagnostic_list.cpp (+16/-7)
src/diagnostics/pregenerated/dict_en.cpp (+108/-21)
src/functions/func_collections_impl.cpp (+41/-124)
src/functions/func_strings_impl.cpp (+38/-0)
src/functions/func_strings_impl.h (+38/-0)
src/functions/function.cpp (+0/-2)
src/functions/library.cpp (+2/-0)
src/functions/pregenerated/func_access.cpp (+111/-0)
src/functions/pregenerated/func_access.h (+79/-0)
src/functions/pregenerated/func_collections.cpp (+33/-0)
src/functions/pregenerated/func_collections.h (+15/-0)
src/functions/pregenerated/func_sequences.cpp (+148/-0)
src/functions/pregenerated/func_sequences.h (+75/-0)
src/functions/pregenerated/func_strings.cpp (+0/-27)
src/functions/pregenerated/function_enum.h (+10/-0)
src/precompiled/stdafx.h (+74/-356)
src/runtime/api/plan_wrapper.cpp (+2/-1)
src/runtime/base/binarybase.h (+1/-1)
src/runtime/base/narybase.h (+4/-4)
src/runtime/base/noarybase.h (+1/-1)
src/runtime/base/plan_iterator.cpp (+0/-3)
src/runtime/base/plan_iterator.h (+1/-1)
src/runtime/base/unarybase.h (+1/-1)
src/runtime/booleans/BooleanImpl.cpp (+2/-0)
src/runtime/collections/collections_base.cpp (+41/-29)
src/runtime/collections/collections_impl.cpp (+137/-9)
src/runtime/collections/pregenerated/collections.cpp (+24/-0)
src/runtime/collections/pregenerated/collections.h (+51/-0)
src/runtime/core/gflwor/window_iterator.cpp (+21/-15)
src/runtime/core/internal_operators.cpp (+8/-2)
src/runtime/core/internal_operators.h (+9/-5)
src/runtime/core/path_iterators.cpp (+63/-16)
src/runtime/core/trycatch.cpp (+13/-7)
src/runtime/eval/eval.cpp (+7/-0)
src/runtime/eval/eval.h (+1/-0)
src/runtime/full_text/CMakeLists.txt (+3/-3)
src/runtime/full_text/default_tokenizer.cpp (+4/-4)
src/runtime/full_text/latin_tokenizer.cpp (+3/-2)
src/runtime/full_text/latin_tokenizer.h (+9/-8)
src/runtime/json/json_constructors.cpp (+3/-3)
src/runtime/json/jsoniq_functions_impl.cpp (+1/-1)
src/runtime/maths/maths_impl.cpp (+1/-1)
src/runtime/numerics/format_integer_impl.cpp (+10/-10)
src/runtime/numerics/numerics_impl.cpp (+1/-1)
src/runtime/random/random_impl.cpp (+2/-2)
src/runtime/sequences/pregenerated/sequences.cpp (+116/-0)
src/runtime/sequences/pregenerated/sequences.h (+219/-0)
src/runtime/sequences/sequences_impl.cpp (+275/-3)
src/runtime/spec/collections/collections.xml (+33/-0)
src/runtime/spec/sequences/sequences.xml (+171/-0)
src/runtime/spec/strings/strings.xml (+1/-1)
src/runtime/store/maps_impl.cpp (+1/-1)
src/runtime/strings/strings_impl.cpp (+58/-20)
src/runtime/visitors/pregenerated/planiter_visitor.h (+30/-0)
src/runtime/visitors/pregenerated/printer_visitor.cpp (+84/-0)
src/runtime/visitors/pregenerated/printer_visitor.h (+18/-0)
src/store/api/store.h (+1/-1)
src/store/naive/atomic_items.cpp (+2/-2)
src/store/naive/collection.h (+1/-1)
src/store/naive/json_items.cpp (+2/-2)
src/store/naive/json_items.h (+6/-6)
src/store/naive/node_items.cpp (+1/-1)
src/store/naive/ordpath.cpp (+16/-2)
src/store/naive/pul_primitives.cpp (+18/-14)
src/store/naive/simple_collection.cpp (+29/-21)
src/store/naive/simple_collection.h (+2/-2)
src/store/naive/simple_index_general.cpp (+9/-9)
src/store/naive/simple_lazy_temp_seq.cpp (+4/-4)
src/store/naive/simple_pul.cpp (+3/-1)
src/store/naive/simple_store.h (+7/-3)
src/store/naive/simple_temp_seq.cpp (+1/-1)
src/store/naive/store.h (+12/-11)
src/system/globalenv.cpp (+7/-9)
src/system/properties.h (+21/-0)
src/system/zorba_properties.h (+67/-17)
src/system/zorba_properties.txt (+1/-0)
src/types/root_typemanager.h (+2/-0)
src/types/typeimpl.cpp (+0/-2)
src/types/typemanagerimpl.cpp (+0/-2)
src/unit_tests/CMakeLists.txt (+2/-2)
src/unit_tests/string.cpp (+8/-0)
src/unit_tests/unit_test_list.h (+2/-2)
src/unit_tests/unit_tests.cpp (+2/-2)
src/util/CMakeLists.txt (+4/-4)
src/util/file.cpp (+12/-0)
src/util/fs_util.cpp (+24/-0)
src/util/fs_util.h (+28/-0)
src/util/icu_streambuf.h (+1/-0)
src/util/passthru_streambuf.cpp (+2/-2)
src/util/passthru_streambuf.h (+10/-2)
src/util/regex.cpp (+96/-82)
src/util/regex.h (+22/-34)
src/util/regex_xquery.cpp (+1860/-489)
src/util/regex_xquery.h (+359/-123)
src/util/transcode_streambuf.h (+5/-5)
src/util/unicode_categories.cpp (+3/-3)
src/util/unicode_categories.h (+44/-37)
src/util/unicode_util.cpp (+20/-2)
src/util/unicode_util.h (+47/-15)
src/util/utf8_util.cpp (+6/-6)
src/util/utf8_util.h (+29/-13)
src/util/utf8_util.tcc (+10/-2)
src/util/win32/dirent.h (+372/-0)
src/zorbaserialization/archiver.cpp (+293/-482)
src/zorbaserialization/archiver.h (+178/-131)
src/zorbaserialization/bin_archiver.cpp (+33/-21)
src/zorbaserialization/class_serializer.h (+74/-98)
src/zorbaserialization/serialize_basic_types.cpp (+3/-2)
src/zorbaserialization/serialize_basic_types.h (+29/-1)
src/zorbaserialization/serialize_template_types.h (+483/-306)
src/zorbaserialization/serialize_zorba_types.cpp (+248/-65)
src/zorbaserialization/serialize_zorba_types.h (+87/-131)
src/zorbaserialization/xml_archiver.cpp (+2/-2)
src/zorbaserialization/xml_archiver.h (+45/-36)
src/zorbaserialization/zorba_class_versions.cpp (+0/-6)
src/zorbatypes/collation_manager.cpp (+17/-17)
src/zorbatypes/collation_manager.h (+3/-3)
src/zorbatypes/decimal.cpp (+22/-22)
src/zorbatypes/decimal.h (+121/-169)
src/zorbatypes/floatimpl.cpp (+57/-15)
src/zorbatypes/floatimpl.h (+672/-468)
src/zorbatypes/integer.cpp (+121/-9)
src/zorbatypes/integer.h (+738/-259)
src/zorbatypes/libicu.h (+0/-32)
src/zorbatypes/transcoder.cpp (+8/-4)
src/zorbatypes/transcoder.h (+9/-9)
src/zorbautils/hashmap.h (+9/-0)
src/zorbautils/hashmap_itemh.h (+36/-12)
src/zorbautils/string_util.cpp (+19/-18)
src/zorbautils/string_util.h (+15/-1)
swig/DiagnosticHandler.i (+5/-3)
swig/Exceptions.i (+3/-3)
swig/Zorba.h (+50/-0)
swig/Zorba.i (+48/-76)
swig/java/CMakeLists.txt (+2/-0)
swig/php/CMakeLists.txt (+1/-0)
swig/php/zorba_api.i (+7/-0)
swig/python/CMakeLists.txt (+1/-0)
swig/python/tests/CMakeLists.txt (+3/-3)
swig/python/tests/test03.py.in (+1/-0)
swig/ruby/CMakeLists.txt (+1/-0)
swig/various.i (+184/-0)
swig/zorba_api.i (+12/-4)
test/rbkt/ExpQueryResults/zorba/collections/uri-collection_1.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/eval/eval_reset.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/file/file_read_text_lines.xml.res (+32/-0)
test/rbkt/ExpQueryResults/zorba/introspection/introsp-fn-7.xml.res (+1/-1)
test/rbkt/ExpQueryResults/zorba/paths/path28.xml.res (+2/-0)
test/rbkt/ExpQueryResults/zorba/pul-schema/create-collection.xml.res (+14/-0)
test/rbkt/ExpQueryResults/zorba/pul-schema/empty-pul.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/pul-schema/insert-into-collection.xml.res (+8/-0)
test/rbkt/ExpQueryResults/zorba/sequences/available-environment-variables.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/sequences/environment-variable_1.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/sequences/environment-variable_2.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/sequences/unparsed-text-available.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/sequences/unparsed-text-lines_1.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/sequences/unparsed-text-lines_2.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/sequences/unparsed-text_1.xml.res (+3/-0)
test/rbkt/ExpQueryResults/zorba/sequences/unparsed-text_2.xml.res (+3/-0)
test/rbkt/ExpQueryResults/zorba/string/Regex/regex_a1.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/string/Regex/regex_a10.xml.res (+242/-0)
test/rbkt/ExpQueryResults/zorba/string/Regex/regex_a11.xml.res (+6/-0)
test/rbkt/ExpQueryResults/zorba/string/Regex/regex_a2.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/string/Regex/regex_a3.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/string/Regex/regex_a5.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/string/Regex/regex_a6.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/string/Regex/regex_a7.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/string/Regex/regex_a8.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/string/Regex/regex_a9.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/string/Regex/regex_m1.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/string/Regex/regex_m10.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/string/Regex/regex_m11.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/string/Regex/regex_m12.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/string/Regex/regex_m13.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/string/Regex/regex_m14.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/string/Regex/regex_m15.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/string/Regex/regex_m16.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/string/Regex/regex_m17.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/string/Regex/regex_m18.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/string/Regex/regex_m19.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/string/Regex/regex_m2.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/string/Regex/regex_m20.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/string/Regex/regex_m21.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/string/Regex/regex_m22.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/string/Regex/regex_m23.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/string/Regex/regex_m24.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/string/Regex/regex_m25.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/string/Regex/regex_m26.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/string/Regex/regex_m27.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/string/Regex/regex_m28.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/string/Regex/regex_m29.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/string/Regex/regex_m3.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/string/Regex/regex_m30.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/string/Regex/regex_m31.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/string/Regex/regex_m32.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/string/Regex/regex_m33.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/string/Regex/regex_m34.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/string/Regex/regex_m35.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/string/Regex/regex_m36.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/string/Regex/regex_m37.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/string/Regex/regex_m38.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/string/Regex/regex_m39.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/string/Regex/regex_m4.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/string/Regex/regex_m40.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/string/Regex/regex_m41.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/string/Regex/regex_m42.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/string/Regex/regex_m43.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/string/Regex/regex_m44.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/string/Regex/regex_m45.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/string/Regex/regex_m46.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/string/Regex/regex_m47.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/string/Regex/regex_m48.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/string/Regex/regex_m49.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/string/Regex/regex_m5.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/string/Regex/regex_m50.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/string/Regex/regex_m51.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/string/Regex/regex_m52.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/string/Regex/regex_m53.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/string/Regex/regex_m6.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/string/Regex/regex_m7.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/string/Regex/regex_m8.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/string/Regex/regex_m9.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/string/Regex/regex_prime1.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/string/Regex/regex_r1.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/string/Regex/regex_r10.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/string/Regex/regex_r11.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/string/Regex/regex_r12.xml.res (+5/-0)
test/rbkt/ExpQueryResults/zorba/string/Regex/regex_r2.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/string/Regex/regex_r3.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/string/Regex/regex_r4.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/string/Regex/regex_r5.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/string/Regex/regex_r6.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/string/Regex/regex_r9.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/string/Regex/regex_t1.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/string/Regex/regex_t4.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/string/Regex/regex_t5.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/testdriver/bom_bug.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/xdm-schema/1-to-5.xml.res (+7/-0)
test/rbkt/ExpQueryResults/zorba/xdm-schema/empty-sequence.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/xdm-schema/nodes.xml.res (+7/-0)
test/rbkt/ExpQueryResults/zorba/xqddf/daniel/ric6.xml.res (+2/-2)
test/rbkt/ExpQueryResults/zorba/xqddf/ic-foreignKey.xml.res (+1/-1)
test/rbkt/ExpQueryResults/zorba/xqdoc/local.xml.res (+1/-1)
test/rbkt/ExpQueryResults/zorba/xqdoc/no_global_var.xml.res (+1/-1)
test/rbkt/Queries/CMakeLists.txt (+16/-1)
test/rbkt/Queries/zorba/collections/modifier_3.xq (+1/-1)
test/rbkt/Queries/zorba/collections/uri-collection.xml (+6/-0)
test/rbkt/Queries/zorba/collections/uri-collection_1.xq (+16/-0)
test/rbkt/Queries/zorba/collections/uri-collection_2.spec (+1/-0)
test/rbkt/Queries/zorba/collections/uri-collection_2.xq (+16/-0)
test/rbkt/Queries/zorba/eval/eval_reset.xq (+15/-0)
test/rbkt/Queries/zorba/file/file_read_text_lines.xq (+4/-0)
test/rbkt/Queries/zorba/no-copy/q21.xq (+86/-0)
test/rbkt/Queries/zorba/paths/path28.xq (+2/-0)
test/rbkt/Queries/zorba/pul-schema/create-collection.xq (+18/-0)
test/rbkt/Queries/zorba/pul-schema/empty-pul.xq (+5/-0)
test/rbkt/Queries/zorba/pul-schema/insert-into-collection.xq (+12/-0)
test/rbkt/Queries/zorba/sequences/available-environment-variables.xq (+3/-0)
test/rbkt/Queries/zorba/sequences/environment-variable_1.xq (+4/-0)
test/rbkt/Queries/zorba/sequences/environment-variable_2.xq (+2/-0)
test/rbkt/Queries/zorba/sequences/unparsed-text-available.xq (+1/-0)
test/rbkt/Queries/zorba/sequences/unparsed-text-lines_1.xq (+1/-0)
test/rbkt/Queries/zorba/sequences/unparsed-text-lines_2.xq (+1/-0)
test/rbkt/Queries/zorba/sequences/unparsed-text-lines_3.spec (+1/-0)
test/rbkt/Queries/zorba/sequences/unparsed-text-lines_3.xq (+1/-0)
test/rbkt/Queries/zorba/sequences/unparsed-text-lines_4.spec (+1/-0)
test/rbkt/Queries/zorba/sequences/unparsed-text-lines_4.xq (+1/-0)
test/rbkt/Queries/zorba/sequences/unparsed-text_1.xq (+1/-0)
test/rbkt/Queries/zorba/sequences/unparsed-text_2.xq (+1/-0)
test/rbkt/Queries/zorba/sequences/unparsed-text_3.spec (+1/-0)
test/rbkt/Queries/zorba/sequences/unparsed-text_3.xq (+1/-0)
test/rbkt/Queries/zorba/sequences/unparsed-text_4.spec (+1/-0)
test/rbkt/Queries/zorba/sequences/unparsed-text_4.xq (+1/-0)
test/rbkt/Queries/zorba/string/Regex/regex_a1.xq (+1/-0)
test/rbkt/Queries/zorba/string/Regex/regex_a10.xq (+11/-0)
test/rbkt/Queries/zorba/string/Regex/regex_a11.xq (+9/-0)
test/rbkt/Queries/zorba/string/Regex/regex_a2.xq (+1/-0)
test/rbkt/Queries/zorba/string/Regex/regex_a3.xq (+1/-0)
test/rbkt/Queries/zorba/string/Regex/regex_a5.xq (+1/-0)
test/rbkt/Queries/zorba/string/Regex/regex_a6.xq (+1/-0)
test/rbkt/Queries/zorba/string/Regex/regex_a7.xq (+1/-0)
test/rbkt/Queries/zorba/string/Regex/regex_a8.xq (+1/-0)
test/rbkt/Queries/zorba/string/Regex/regex_a9.xq (+1/-0)
test/rbkt/Queries/zorba/string/Regex/regex_err1.spec (+1/-0)
test/rbkt/Queries/zorba/string/Regex/regex_err1.xq (+1/-0)
test/rbkt/Queries/zorba/string/Regex/regex_err10.spec (+1/-0)
test/rbkt/Queries/zorba/string/Regex/regex_err10.xq (+1/-0)
test/rbkt/Queries/zorba/string/Regex/regex_err11.spec (+1/-0)
test/rbkt/Queries/zorba/string/Regex/regex_err11.xq (+1/-0)
test/rbkt/Queries/zorba/string/Regex/regex_err12.spec (+1/-0)
test/rbkt/Queries/zorba/string/Regex/regex_err12.xq (+1/-0)
test/rbkt/Queries/zorba/string/Regex/regex_err13.spec (+1/-0)
test/rbkt/Queries/zorba/string/Regex/regex_err13.xq (+1/-0)
test/rbkt/Queries/zorba/string/Regex/regex_err14.spec (+1/-0)
test/rbkt/Queries/zorba/string/Regex/regex_err14.xq (+1/-0)
test/rbkt/Queries/zorba/string/Regex/regex_err15.spec (+1/-0)
test/rbkt/Queries/zorba/string/Regex/regex_err15.xq (+1/-0)
test/rbkt/Queries/zorba/string/Regex/regex_err16.spec (+1/-0)
test/rbkt/Queries/zorba/string/Regex/regex_err16.xq (+1/-0)
test/rbkt/Queries/zorba/string/Regex/regex_err17.spec (+1/-0)
test/rbkt/Queries/zorba/string/Regex/regex_err17.xq (+1/-0)
test/rbkt/Queries/zorba/string/Regex/regex_err18.spec (+1/-0)
test/rbkt/Queries/zorba/string/Regex/regex_err18.xq (+1/-0)
test/rbkt/Queries/zorba/string/Regex/regex_err19.spec (+1/-0)
test/rbkt/Queries/zorba/string/Regex/regex_err19.xq (+3/-0)
test/rbkt/Queries/zorba/string/Regex/regex_err2.spec (+1/-0)
test/rbkt/Queries/zorba/string/Regex/regex_err2.xq (+1/-0)
test/rbkt/Queries/zorba/string/Regex/regex_err20.spec (+1/-0)
test/rbkt/Queries/zorba/string/Regex/regex_err20.xq (+3/-0)
test/rbkt/Queries/zorba/string/Regex/regex_err21.spec (+1/-0)
test/rbkt/Queries/zorba/string/Regex/regex_err21.xq (+3/-0)
test/rbkt/Queries/zorba/string/Regex/regex_err22.spec (+1/-0)
test/rbkt/Queries/zorba/string/Regex/regex_err22.xq (+3/-0)
test/rbkt/Queries/zorba/string/Regex/regex_err23.spec (+1/-0)
test/rbkt/Queries/zorba/string/Regex/regex_err23.xq (+3/-0)
test/rbkt/Queries/zorba/string/Regex/regex_err24.spec (+1/-0)
test/rbkt/Queries/zorba/string/Regex/regex_err24.xq (+3/-0)
test/rbkt/Queries/zorba/string/Regex/regex_err25.spec (+1/-0)
test/rbkt/Queries/zorba/string/Regex/regex_err25.xq (+1/-0)
test/rbkt/Queries/zorba/string/Regex/regex_err3.spec (+1/-0)
test/rbkt/Queries/zorba/string/Regex/regex_err3.xq (+1/-0)
test/rbkt/Queries/zorba/string/Regex/regex_err4.spec (+1/-0)
test/rbkt/Queries/zorba/string/Regex/regex_err4.xq (+1/-0)
test/rbkt/Queries/zorba/string/Regex/regex_err5.spec (+1/-0)
test/rbkt/Queries/zorba/string/Regex/regex_err5.xq (+1/-0)
test/rbkt/Queries/zorba/string/Regex/regex_err7.spec (+1/-0)
test/rbkt/Queries/zorba/string/Regex/regex_err7.xq (+1/-0)
test/rbkt/Queries/zorba/string/Regex/regex_err8.spec (+1/-0)
test/rbkt/Queries/zorba/string/Regex/regex_err8.xq (+1/-0)
test/rbkt/Queries/zorba/string/Regex/regex_err9.spec (+1/-0)
test/rbkt/Queries/zorba/string/Regex/regex_err9.xq (+1/-0)
test/rbkt/Queries/zorba/string/Regex/regex_m1.xq (+1/-0)
test/rbkt/Queries/zorba/string/Regex/regex_m10.xq (+1/-0)
test/rbkt/Queries/zorba/string/Regex/regex_m11.xq (+1/-0)
test/rbkt/Queries/zorba/string/Regex/regex_m12.xq (+1/-0)
test/rbkt/Queries/zorba/string/Regex/regex_m13.xq (+1/-0)
test/rbkt/Queries/zorba/string/Regex/regex_m14.xq (+1/-0)
test/rbkt/Queries/zorba/string/Regex/regex_m15.xq (+1/-0)
test/rbkt/Queries/zorba/string/Regex/regex_m16.xq (+1/-0)
test/rbkt/Queries/zorba/string/Regex/regex_m17.xq (+1/-0)
test/rbkt/Queries/zorba/string/Regex/regex_m18.xq (+3/-0)
test/rbkt/Queries/zorba/string/Regex/regex_m19.xq (+1/-0)
test/rbkt/Queries/zorba/string/Regex/regex_m2.xq (+1/-0)
test/rbkt/Queries/zorba/string/Regex/regex_m20.xq (+1/-0)
test/rbkt/Queries/zorba/string/Regex/regex_m21.xq (+1/-0)
test/rbkt/Queries/zorba/string/Regex/regex_m22.xq (+1/-0)
test/rbkt/Queries/zorba/string/Regex/regex_m23.xq (+1/-0)
test/rbkt/Queries/zorba/string/Regex/regex_m24.xq (+1/-0)
test/rbkt/Queries/zorba/string/Regex/regex_m25.xq (+1/-0)
test/rbkt/Queries/zorba/string/Regex/regex_m26.xq (+1/-0)
test/rbkt/Queries/zorba/string/Regex/regex_m27.xq (+1/-0)
test/rbkt/Queries/zorba/string/Regex/regex_m28.xq (+1/-0)
test/rbkt/Queries/zorba/string/Regex/regex_m29.xq (+1/-0)
test/rbkt/Queries/zorba/string/Regex/regex_m3.xq (+1/-0)
test/rbkt/Queries/zorba/string/Regex/regex_m30.xq (+1/-0)
test/rbkt/Queries/zorba/string/Regex/regex_m31.xq (+1/-0)
test/rbkt/Queries/zorba/string/Regex/regex_m32.xq (+1/-0)
test/rbkt/Queries/zorba/string/Regex/regex_m33.xq (+1/-0)
test/rbkt/Queries/zorba/string/Regex/regex_m34.xq (+1/-0)
test/rbkt/Queries/zorba/string/Regex/regex_m35.xq (+4/-0)
test/rbkt/Queries/zorba/string/Regex/regex_m36.xq (+1/-0)
test/rbkt/Queries/zorba/string/Regex/regex_m37.xq (+4/-0)
test/rbkt/Queries/zorba/string/Regex/regex_m38.xq (+4/-0)
test/rbkt/Queries/zorba/string/Regex/regex_m39.xq (+1/-0)
test/rbkt/Queries/zorba/string/Regex/regex_m4.xq (+6/-0)
test/rbkt/Queries/zorba/string/Regex/regex_m40.xq (+1/-0)
test/rbkt/Queries/zorba/string/Regex/regex_m41.xq (+1/-0)
test/rbkt/Queries/zorba/string/Regex/regex_m42.xq (+1/-0)
test/rbkt/Queries/zorba/string/Regex/regex_m43.xq (+1/-0)
test/rbkt/Queries/zorba/string/Regex/regex_m44.xq (+1/-0)
test/rbkt/Queries/zorba/string/Regex/regex_m45.xq (+1/-0)
test/rbkt/Queries/zorba/string/Regex/regex_m46.xq (+1/-0)
test/rbkt/Queries/zorba/string/Regex/regex_m47.xq (+1/-0)
test/rbkt/Queries/zorba/string/Regex/regex_m48.xq (+1/-0)
test/rbkt/Queries/zorba/string/Regex/regex_m49.xq (+1/-0)
test/rbkt/Queries/zorba/string/Regex/regex_m5.xq (+6/-0)
test/rbkt/Queries/zorba/string/Regex/regex_m50.xq (+2/-0)
test/rbkt/Queries/zorba/string/Regex/regex_m51.xq (+2/-0)
test/rbkt/Queries/zorba/string/Regex/regex_m52.xq (+1/-0)
test/rbkt/Queries/zorba/string/Regex/regex_m53.xq (+1/-0)
test/rbkt/Queries/zorba/string/Regex/regex_m6.xq (+6/-0)
test/rbkt/Queries/zorba/string/Regex/regex_m7.xq (+6/-0)
test/rbkt/Queries/zorba/string/Regex/regex_m8.xq (+7/-0)
test/rbkt/Queries/zorba/string/Regex/regex_m9.xq (+7/-0)
test/rbkt/Queries/zorba/string/Regex/regex_prime1.xq (+17/-0)
test/rbkt/Queries/zorba/string/Regex/regex_r1.xq (+1/-0)
test/rbkt/Queries/zorba/string/Regex/regex_r10.xq (+1/-0)
test/rbkt/Queries/zorba/string/Regex/regex_r11.xq (+1/-0)
test/rbkt/Queries/zorba/string/Regex/regex_r12.xq (+7/-0)
test/rbkt/Queries/zorba/string/Regex/regex_r2.xq (+1/-0)
test/rbkt/Queries/zorba/string/Regex/regex_r3.xq (+1/-0)
test/rbkt/Queries/zorba/string/Regex/regex_r4.xq (+1/-0)
test/rbkt/Queries/zorba/string/Regex/regex_r5.xq (+1/-0)
test/rbkt/Queries/zorba/string/Regex/regex_r6.xq (+1/-0)
test/rbkt/Queries/zorba/string/Regex/regex_r7_err.spec (+1/-0)
test/rbkt/Queries/zorba/string/Regex/regex_r7_err.xq (+1/-0)
test/rbkt/Queries/zorba/string/Regex/regex_r8_err.spec (+1/-0)
test/rbkt/Queries/zorba/string/Regex/regex_r8_err.xq (+1/-0)
test/rbkt/Queries/zorba/string/Regex/regex_r9.xq (+1/-0)
test/rbkt/Queries/zorba/string/Regex/regex_t1.xq (+1/-0)
test/rbkt/Queries/zorba/string/Regex/regex_t2.xq (+1/-0)
test/rbkt/Queries/zorba/string/Regex/regex_t3_err.spec (+1/-0)
test/rbkt/Queries/zorba/string/Regex/regex_t3_err.xq (+1/-0)
test/rbkt/Queries/zorba/string/Regex/regex_t4.xq (+2/-0)
test/rbkt/Queries/zorba/string/Regex/regex_t5.xq (+1/-0)
test/rbkt/Queries/zorba/string/Regex/zorba.html (+242/-0)
test/rbkt/Queries/zorba/string/Regex/zorba2.html (+5/-0)
test/rbkt/Queries/zorba/testdriver/bom_bug.xq (+1/-0)
test/rbkt/Queries/zorba/xdm-schema/1-to-5.xq (+11/-0)
test/rbkt/Queries/zorba/xdm-schema/empty-sequence.xq (+5/-0)
test/rbkt/Queries/zorba/xdm-schema/nodes.xq (+11/-0)
test/rbkt/Queries/zorba/xqddf/daniel/i1.xq (+1/-1)
test/rbkt/Queries/zorba/xqddf/daniel/i2.xq (+1/-1)
test/rbkt/Queries/zorba/xqddf/daniel/i3.xq (+1/-1)
test/rbkt/Queries/zorba/xqddf/daniel/i4.xq (+1/-1)
test/rbkt/Queries/zorba/xqddf/daniel/i5.xq (+2/-2)
test/rbkt/Queries/zorba/xqddf/daniel/i6.xq (+4/-4)
test/rbkt/Queries/zorba/xqddf/daniel/ric6.xq (+8/-4)
test/rbkt/Queries/zorba/xqddf/daniel/undo1.xq (+7/-3)
test/rbkt/Queries/zorba/xqddf/ic-foreignKey.xq (+10/-2)
test/rbkt/Queries/zorba/xqdoc/moduleDocumentation.xq (+1/-0)
test/rbkt/modules/CMakeLists.txt (+2/-0)
test/rbkt/modules/java/CMakeLists.txt (+40/-0)
test/rbkt/modules/java/Test.java (+7/-0)
test/rbkt/testdriver.cpp (+2/-0)
test/unit/static_context.cpp (+25/-0)
test/update/CMakeLists.txt (+9/-0)
To merge this branch: bzr merge lp:~zorba-coders/zorba/jsoniq-plan_serialization
Reviewer Review Type Date Requested Status
Markos Zaharioudakis Approve
Matthias Brantner Pending
Review via email: mp+103872@code.launchpad.net

This proposal supersedes a proposal from 2012-04-17.

Commit message

- plan serializer for jsoniq items and iterators
- some fixes for the build without json (still not compiling because of problems with the collection functions)
- marked all -nodes dml functions as deprecated
- fixed documentation of the dml and jsoniq modules
- fixed collections/dynamic5/6 tests
- ignore jsoniq.org/errors module in the moduleDocumentation test

Description of the change

- plan serializer for jsoniq items and iterators
- some fixes for the build without json (still not compiling because of problems with the collection functions)
- marked all -nodes dml functions as deprecated
- fixed documentation of the dml and jsoniq modules
- fixed collections/dynamic5/6 tests
- ignore jsoniq.org/errors module in the moduleDocumentation test

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

The attempt to merge lp:~zorba-coders/zorba/jsoniq-plan_serialization into lp:~zorba-coders/zorba/jsoniq failed. Below is the output from the failed tests.

CMake Error at /home/ceej/zo/testing/zorbatest/tester/TarmacLander.cmake:274 (message):
  Validation queue job jsoniq-plan_serialization-2012-04-17T10-36-14.691Z is
  finished. The final status was:

  No tests were run - build or configure step must have failed.

  Not commiting changes.

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

Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote : Posted in a previous version of this proposal
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote : Posted in a previous version of this proposal

The attempt to merge lp:~zorba-coders/zorba/jsoniq-plan_serialization into lp:~zorba-coders/zorba/jsoniq failed. Below is the output from the failed tests.

CMake Error at /home/ceej/zo/testing/zorbatest/tester/TarmacLander.cmake:274 (message):
  Validation queue job jsoniq-plan_serialization-2012-04-17T10-49-05.531Z is
  finished. The final status was:

  No tests were run - build or configure step must have failed.

  Not commiting changes.

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

Revision history for this message
Markos Zaharioudakis (markos-za) : Posted in a previous version of this proposal
review: Approve
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote : Posted in a previous version of this proposal
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote : Posted in a previous version of this proposal

The attempt to merge lp:~zorba-coders/zorba/jsoniq-plan_serialization into lp:~zorba-coders/zorba/jsoniq failed. Below is the output from the failed tests.

CMake Error at /home/ceej/zo/testing/zorbatest/tester/TarmacLander.cmake:274 (message):
  Validation queue job jsoniq-plan_serialization-2012-04-18T09-10-21.413Z is
  finished. The final status was:

  No tests were run - build or configure step must have failed.

  Not commiting changes.

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

Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote : Posted in a previous version of this proposal
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote : Posted in a previous version of this proposal

The attempt to merge lp:~zorba-coders/zorba/jsoniq-plan_serialization into lp:~zorba-coders/zorba/jsoniq failed. Below is the output from the failed tests.

CMake Error at /home/ceej/zo/testing/zorbatest/tester/TarmacLander.cmake:274 (message):
  Validation queue job jsoniq-plan_serialization-2012-04-19T08-56-09.968Z is
  finished. The final status was:

  122 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 :
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

The attempt to merge lp:~zorba-coders/zorba/jsoniq-plan_serialization into lp:~zorba-coders/zorba/jsoniq failed. Below is the output from the failed tests.

CMake Error at /home/ceej/zo/testing/zorbatest/tester/TarmacLander.cmake:274 (message):
  Validation queue job jsoniq-plan_serialization-2012-04-27T14-52-02.942Z is
  finished. The final status was:

  6 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 :
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

The attempt to merge lp:~zorba-coders/zorba/jsoniq-plan_serialization into lp:~zorba-coders/zorba/jsoniq failed. Below is the output from the failed tests.

CMake Error at /home/ceej/zo/testing/zorbatest/tester/TarmacLander.cmake:274 (message):
  Validation queue job jsoniq-plan_serialization-2012-05-07T20-50-54.25Z is
  finished. The final status was:

  6 tests did not succeed - changes not commited.

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

Revision history for this message
Markos Zaharioudakis (markos-za) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'CMakeCompiler.txt'
--- CMakeCompiler.txt 2012-04-11 20:22:52 +0000
+++ CMakeCompiler.txt 2012-04-27 13:22:48 +0000
@@ -108,6 +108,9 @@
108 IF(NOT CMAKE_CXX_FLAGS MATCHES "-Wextra")108 IF(NOT CMAKE_CXX_FLAGS MATCHES "-Wextra")
109 SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wextra")109 SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wextra")
110 ENDIF(NOT CMAKE_CXX_FLAGS MATCHES "-Wextra")110 ENDIF(NOT CMAKE_CXX_FLAGS MATCHES "-Wextra")
111 IF(NOT CMAKE_CXX_FLAGS MATCHES "-D_FILE_OFFSET_BITS")
112 SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_FILE_OFFSET_BITS=64")
113 ENDIF(NOT CMAKE_CXX_FLAGS MATCHES "-D_FILE_OFFSET_BITS")
111 IF (UNIX AND NOT APPLE)114 IF (UNIX AND NOT APPLE)
112 IF (NOT CMAKE_SHARED_LINKER_FLAGS MATCHES "as-needed")115 IF (NOT CMAKE_SHARED_LINKER_FLAGS MATCHES "as-needed")
113 SET (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--as-needed")116 SET (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--as-needed")
114117
=== modified file 'CMakeConfiguration.txt'
--- CMakeConfiguration.txt 2012-04-11 20:22:52 +0000
+++ CMakeConfiguration.txt 2012-04-27 13:22:48 +0000
@@ -135,14 +135,14 @@
135SET (ZORBA_DEBUG_STRING ${ZORBA_DEBUG_STRING} CACHE BOOL "debug strings")135SET (ZORBA_DEBUG_STRING ${ZORBA_DEBUG_STRING} CACHE BOOL "debug strings")
136MESSAGE (STATUS "ZORBA_DEBUG_STRING: " ${ZORBA_DEBUG_STRING})136MESSAGE (STATUS "ZORBA_DEBUG_STRING: " ${ZORBA_DEBUG_STRING})
137137
138SET(ZORBA_NO_UNICODE OFF CACHE BOOL "disable ICU")138SET(ZORBA_NO_ICU OFF CACHE BOOL "disable ICU")
139MESSAGE(STATUS "ZORBA_NO_UNICODE: " ${ZORBA_NO_UNICODE})139MESSAGE(STATUS "ZORBA_NO_ICU: " ${ZORBA_NO_ICU})
140140
141IF (ZORBA_NO_UNICODE)141IF (ZORBA_NO_ICU)
142 SET (no_full_text ON)142 SET (no_full_text ON)
143ELSE (ZORBA_NO_UNICODE)143ELSE (ZORBA_NO_ICU)
144 SET (no_full_text OFF)144 SET (no_full_text OFF)
145ENDIF (ZORBA_NO_UNICODE)145ENDIF (ZORBA_NO_ICU)
146SET (ZORBA_NO_FULL_TEXT ${no_full_text} CACHE BOOL "disable XQuery Full-Text support")146SET (ZORBA_NO_FULL_TEXT ${no_full_text} CACHE BOOL "disable XQuery Full-Text support")
147MESSAGE(STATUS "ZORBA_NO_FULL_TEXT: " ${ZORBA_NO_FULL_TEXT})147MESSAGE(STATUS "ZORBA_NO_FULL_TEXT: " ${ZORBA_NO_FULL_TEXT})
148148
149149
=== modified file 'CMakeLists.txt'
--- CMakeLists.txt 2012-04-11 20:22:52 +0000
+++ CMakeLists.txt 2012-04-27 13:22:48 +0000
@@ -123,10 +123,14 @@
123CHECK_TYPE_SIZE("int64_t" ZORBA_HAVE_INT64_T) 123CHECK_TYPE_SIZE("int64_t" ZORBA_HAVE_INT64_T)
124124
125CHECK_CXX_SOURCE_COMPILES ("#include <type_traits>\nint main() { std::enable_if<true,int> x; }" ZORBA_CXX_ENABLE_IF)125CHECK_CXX_SOURCE_COMPILES ("#include <type_traits>\nint main() { std::enable_if<true,int> x; }" ZORBA_CXX_ENABLE_IF)
126CHECK_CXX_SOURCE_COMPILES ("int main() { int *p = nullptr; }" ZORBA_CXX_NULLPTR)126SET(CMAKE_EXTRA_INCLUDE_FILES wchar.h)
127CHECK_CXX_SOURCE_COMPILES ("int main() { static_assert(1,\"\"); }" ZORBA_CXX_STATIC_ASSERT)127CHECK_TYPE_SIZE("wchar_t" ZORBA_SIZEOF_WCHAR_T)
128SET(CMAKE_EXTRA_INCLUDE_FILES)
128CHECK_CXX_SOURCE_COMPILES ("#include <memory>\nint main() { std::unique_ptr<int> p; }" ZORBA_CXX_UNIQUE_PTR)129CHECK_CXX_SOURCE_COMPILES ("#include <memory>\nint main() { std::unique_ptr<int> p; }" ZORBA_CXX_UNIQUE_PTR)
129130
131CHECK_CXX_SOURCE_COMPILES("int main() { int *p = nullptr; }" ZORBA_CXX_NULLPTR)
132CHECK_CXX_SOURCE_COMPILES("int main() { static_assert(1,\"\"); }" ZORBA_CXX_STATIC_ASSERT)
133
130################################################################################134################################################################################
131# Various cmake macros135# Various cmake macros
132136
133137
=== modified file 'ChangeLog'
--- ChangeLog 2012-04-12 09:18:43 +0000
+++ ChangeLog 2012-04-27 13:22:48 +0000
@@ -3,7 +3,14 @@
3version 2.53version 2.5
44
5New Features:5New Features:
6 * fn:available-environment-variables
7 * fn:environment-variables
8 * fn:uri-collection
9 * fn:unparsed-text
10 * fn:unparsed-text-available
6 * Extended API for Python, Java, PHP and Ruby.11 * Extended API for Python, Java, PHP and Ruby.
12 * Add jvm classpath to zorbacmd and to Zorba API. Tracked by #931816
13 * Added support for NO_ICU (to not use ICU for unicode processing)
714
8Optimization:15Optimization:
916
@@ -11,13 +18,21 @@
11 * Fixed bug 955170 (Catch clause with URILiteral-based wilcard NameTest)18 * Fixed bug 955170 (Catch clause with URILiteral-based wilcard NameTest)
12 * Fixed bug 955135 (err:XQDY0044 not caught by try-catch expressions)19 * Fixed bug 955135 (err:XQDY0044 not caught by try-catch expressions)
13 * Fixed bug #967864 (var substitution did not update theFreeVars property)20 * Fixed bug #967864 (var substitution did not update theFreeVars property)
21 * Fixed buf #891650 (context size var not always declared within path expr)
22 * Fixed bug #948879 (--uri-path doesn't work with fetch:content())
14 * Fixed bug in window iterator (binding the end vars in the output tuple stream)23 * Fixed bug in window iterator (binding the end vars in the output tuple stream)
15 * Fixed bug #866547 (protect index-join rule from general flwor)24 * Fixed bug #866547 (protect index-join rule from general flwor)
25 * Fixed bug #867253 (cdml:delete-nodes should only remove root nodes)
16 * Fixed bug #967428 (do not hoist index creation outside a try-catch)26 * Fixed bug #967428 (do not hoist index creation outside a try-catch)
17 * Fixed performance problem with the findNodeSources function of the no-copy rule27 * Fixed performance problem with the findNodeSources function of the no-copy rule
18 * Fixed bug #872234 (prevent a rewritting to take place in case of sequential expr)28 * Fixed bug #872234 (prevent a rewritting to take place in case of sequential expr)
29 * Fixed bug #906494 (default compile with D_FILE_OFFSET_BITS=64)
19 * Fixed bug #912586, #912593 and #912722 (assertion failures with lax validation)30 * Fixed bug #912586, #912593 and #912722 (assertion failures with lax validation)
31 * Fixed bug #921458 (file:read-text-lines() blocking)
32 * Fixed bug #980526 (no-copy rule bug due to global var being set in "distant" udf)
20 * Fixed bug #949910 (has-children may be invoked on all nodes). Internally, zorba::store::Item::getChildren() now returns NULL on node classes without offspring (instead of raising an error).33 * Fixed bug #949910 (has-children may be invoked on all nodes). Internally, zorba::store::Item::getChildren() now returns NULL on node classes without offspring (instead of raising an error).
34 * Fixed Bug #933490: Error ItemFactoryImpl::createBase64Binary with istream
35 * Fixed bug #867112 (Diagnostic Handler was not working on external APIs)
2136
2237
23version 2.238version 2.2
@@ -153,7 +168,9 @@
153 * Fixed bug when parsing a document with a base-uri attribute.168 * Fixed bug when parsing a document with a base-uri attribute.
154 * Fixed bug #863320 (Sentence is incorrectly incremented when token characters end without sentence terminator)169 * Fixed bug #863320 (Sentence is incorrectly incremented when token characters end without sentence terminator)
155 * Fixed bug #863730 (static delete-node* functions don't raise ZDDY0012)170 * Fixed bug #863730 (static delete-node* functions don't raise ZDDY0012)
171 * Implemented the probe-index-range-value for general indexes
156 * Removed ZSTR0005 and ZSTR0006 error codes172 * Removed ZSTR0005 and ZSTR0006 error codes
173 * Fixed bug #867662 ("nullptr" warning)
157 * Fixed bug #868258 (Assertion failure with two delete collection)174 * Fixed bug #868258 (Assertion failure with two delete collection)
158 * Fixed bug #871623 and #871629 (assertion failures with insertions in dynamic collections)175 * Fixed bug #871623 and #871629 (assertion failures with insertions in dynamic collections)
159 * Fixed bug #867262 (allow reuse of iterator over ExtFuncArgItemSequence)176 * Fixed bug #867262 (allow reuse of iterator over ExtFuncArgItemSequence)
@@ -162,6 +179,8 @@
162 * New node-reference module. References can be obtained for any node, and179 * New node-reference module. References can be obtained for any node, and
163 different nodes cannot have the same identifier.180 different nodes cannot have the same identifier.
164 * Fixed bug #872697 (segmentation fault with validation of NMTOKENS)181 * Fixed bug #872697 (segmentation fault with validation of NMTOKENS)
182 * General index cannot be declared as unique if the type of its key is
183 xs:anyAtomicType or xs:untypedAtomic.
165 * Added undo for node revalidation184 * Added undo for node revalidation
166 * Optimization for count(collection()) expressions185 * Optimization for count(collection()) expressions
167 * Fixed bug #872796 (validate-in-place can interfere with other update primitives)186 * Fixed bug #872796 (validate-in-place can interfere with other update primitives)
@@ -180,6 +199,8 @@
180 * Fixed bug #855715 (Invalid escaped characters in regex not caught)199 * Fixed bug #855715 (Invalid escaped characters in regex not caught)
181 * Fixed bug #862089 (Split binary/xq install directories for modules) by200 * Fixed bug #862089 (Split binary/xq install directories for modules) by
182 splitting "module path" into separate URI and Library paths201 splitting "module path" into separate URI and Library paths
202 * New node-position module. This module allows to obtain a representation of a node position, which
203 can be used to assess structural relationships with other nodes.
183 * Fixed bug #872502 (validation of the JSON module xqdoc fails)204 * Fixed bug #872502 (validation of the JSON module xqdoc fails)
184 * Fixed bug #897619 (testdriver_mt can not run the XQueryX tests)205 * Fixed bug #897619 (testdriver_mt can not run the XQueryX tests)
185 * Fixed bug #867107 (xqdoc dependency to zorba is wrong)206 * Fixed bug #867107 (xqdoc dependency to zorba is wrong)
186207
=== modified file 'KNOWN_ISSUES.txt'
--- KNOWN_ISSUES.txt 2012-04-11 20:22:52 +0000
+++ KNOWN_ISSUES.txt 2012-04-27 13:22:48 +0000
@@ -37,7 +37,7 @@
37* The serializer currently doesn't implement character maps as specified37* The serializer currently doesn't implement character maps as specified
38 (http://www.w3.org/TR/xslt-xquery-serialization/#character-maps)38 (http://www.w3.org/TR/xslt-xquery-serialization/#character-maps)
3939
40* In the 2.0 release, setting the CMake variables ZORBA_NO_UNICODE to40* In the 2.0 release, setting the CMake variables ZORBA_NO_ICU to
41 ON is not supported.41 ON is not supported.
4242
43* The PHP language binding is not supported on Mac OS X. For details,43* The PHP language binding is not supported on Mac OS X. For details,
4444
=== modified file 'NOTICE.txt'
--- NOTICE.txt 2012-04-11 20:22:52 +0000
+++ NOTICE.txt 2012-04-27 13:22:48 +0000
@@ -459,6 +459,24 @@
459 suitability of this software for any purpose. It is provided "as is"459 suitability of this software for any purpose. It is provided "as is"
460 without express or implied warranty.460 without express or implied warranty.
461 461
462----------------------------------------------------
463
464src/util/win32/dirent.h
465
466Copyright: 2006 Toni Ronkko
467
468
469 Permission is hereby granted, free of charge, to any person obtaining
470 a copy of this software and associated documentation files (the
471 ``Software''), to deal in the Software without restriction, including
472 without limitation the rights to use, copy, modify, merge, publish,
473 distribute, sublicense, and/or sell copies of the Software, and to
474 permit persons to whom the Software is furnished to do so, subject to
475 the following conditions:
476
477 The above copyright notice and this permission notice shall be included
478 in all copies or substantial portions of the Software.
479
462480
463External libraries used by this project:481External libraries used by this project:
464----------------------------------------------------482----------------------------------------------------
465483
=== modified file 'NOTICE.xml'
--- NOTICE.xml 2012-04-11 20:22:52 +0000
+++ NOTICE.xml 2012-04-27 13:22:48 +0000
@@ -423,6 +423,22 @@
423 without express or implied warranty.423 without express or implied warranty.
424 </foreign-notice>424 </foreign-notice>
425 </foreign-files>425 </foreign-files>
426 <foreign-files>
427 <file>src/util/win32/dirent.h</file>
428 <copyright>2006 Toni Ronkko</copyright>
429 <foreign-notice>
430 Permission is hereby granted, free of charge, to any person obtaining
431 a copy of this software and associated documentation files (the
432 ``Software''), to deal in the Software without restriction, including
433 without limitation the rights to use, copy, modify, merge, publish,
434 distribute, sublicense, and/or sell copies of the Software, and to
435 permit persons to whom the Software is furnished to do so, subject to
436 the following conditions:
437
438 The above copyright notice and this permission notice shall be included
439 in all copies or substantial portions of the Software.
440 </foreign-notice>
441 </foreign-files>
426442
427 <external-lib mandatory="true">443 <external-lib mandatory="true">
428 <name>LIBXML2</name>444 <name>LIBXML2</name>
429445
=== modified file 'bin/path_util.cpp'
--- bin/path_util.cpp 2012-04-11 20:22:52 +0000
+++ bin/path_util.cpp 2012-04-27 13:22:48 +0000
@@ -49,7 +49,7 @@
49}49}
5050
5151
52static void52void
53tokenizePath(53tokenizePath(
54 const std::string& aPathStr,54 const std::string& aPathStr,
55 std::vector<String>& aResult)55 std::vector<String>& aResult)
@@ -66,6 +66,23 @@
66 }66 }
67}67}
6868
69
70String
71concatenatePaths( const std::vector<String>& aPathList)
72{
73 String delimiter(filesystem_path::get_path_separator());
74
75 String lResult;
76 for (std::vector<String>::const_iterator lIter = aPathList.begin();
77 lIter != aPathList.end(); ++lIter)
78 {
79 lResult += delimiter + *lIter;
80 }
81
82 return lResult;
83}
84
85
69void86void
70setPathsOnContext(87setPathsOnContext(
71 const ZorbaCMDProperties& aProperties,88 const ZorbaCMDProperties& aProperties,
@@ -101,8 +118,8 @@
101 // Compute and set lib path118 // Compute and set lib path
102 aProperties.getLibPath(lPathStr);119 aProperties.getLibPath(lPathStr);
103 tokenizePath(lPathStr, lPath);120 tokenizePath(lPathStr, lPath);
121 lPath.push_back(lCWD.get_path());
104 lEnvStr = getPathFromEnvironment("ZORBA_LIB_PATH");122 lEnvStr = getPathFromEnvironment("ZORBA_LIB_PATH");
105 lPath.push_back(lCWD.get_path());
106 tokenizePath(lEnvStr, lPath);123 tokenizePath(lEnvStr, lPath);
107 aStaticCtx->setLibPath(lPath);124 aStaticCtx->setLibPath(lPath);
108 }125 }
109126
=== modified file 'bin/path_util.h'
--- bin/path_util.h 2012-04-11 20:22:52 +0000
+++ bin/path_util.h 2012-04-27 13:22:48 +0000
@@ -32,6 +32,12 @@
32 setPathsOnContext(const ZorbaCMDProperties& aProperties,32 setPathsOnContext(const ZorbaCMDProperties& aProperties,
33 zorba::StaticContext_t& aStaticCtx);33 zorba::StaticContext_t& aStaticCtx);
3434
35 void
36 tokenizePath(const std::string& aPathStr, std::vector<String>& aResult);
37
38
39 String
40 concatenatePaths( const std::vector<String>& aPathList);
3541
36 }42 }
37} /* namespace zorba */43} /* namespace zorba */
3844
=== modified file 'bin/zorbacmd.cpp'
--- bin/zorbacmd.cpp 2012-04-11 20:22:52 +0000
+++ bin/zorbacmd.cpp 2012-04-27 13:22:48 +0000
@@ -787,6 +787,14 @@
787 return 3;787 return 3;
788 }788 }
789789
790 // Add command line --classpath option in front of config/env CLASSPATH
791 Properties* globalProperties = Properties::instance();
792 std::string cmdJvmClassPath;
793 lProperties.getJVMClassPath(cmdJvmClassPath);
794 std::string configJvmClassPath;
795 globalProperties->getJVMClassPath(configJvmClassPath);
796 globalProperties->setJVMClassPath(cmdJvmClassPath +
797 filesystem_path::get_path_separator() + configJvmClassPath);
790798
791 // Start the engine799 // Start the engine
792800
793801
=== modified file 'bin/zorbacmdproperties.cpp'
--- bin/zorbacmdproperties.cpp 2012-04-11 20:22:52 +0000
+++ bin/zorbacmdproperties.cpp 2012-04-27 13:22:48 +0000
@@ -181,6 +181,11 @@
181 aPath = theLibPath;181 aPath = theLibPath;
182}182}
183183
184void ZorbaCMDProperties::getJVMClassPath(std::string& aPath) const
185{
186 aPath = theClasspath;
187}
188
184std::vector<std::pair<std::string,std::string> > ZorbaCMDProperties::getSerializerParameters() const189std::vector<std::pair<std::string,std::string> > ZorbaCMDProperties::getSerializerParameters() const
185{190{
186 std::vector<std::pair<std::string,std::string> > lResult;191 std::vector<std::pair<std::string,std::string> > lResult;
187192
=== modified file 'bin/zorbacmdproperties.h'
--- bin/zorbacmdproperties.h 2012-04-11 20:22:52 +0000
+++ bin/zorbacmdproperties.h 2012-04-27 13:22:48 +0000
@@ -92,6 +92,9 @@
92 void92 void
93 getLibPath(std::string&) const;93 getLibPath(std::string&) const;
9494
95 void
96 getJVMClassPath(std::string&) const;
97
95 bool isDebug(){ return theDebug; }98 bool isDebug(){ return theDebug; }
9699
97 bool hasNoLogo(){ return theNoLogo; }100 bool hasNoLogo(){ return theNoLogo; }
98101
=== modified file 'bin/zorbacmdproperties.txt'
--- bin/zorbacmdproperties.txt 2012-04-11 20:22:52 +0000
+++ bin/zorbacmdproperties.txt 2012-04-27 13:22:48 +0000
@@ -31,6 +31,7 @@
31("uri-path", po::value<std::string>(), "URI path (list of directories) added to the built-in URI resolver, i.e. where to find modules/schemas to import.")31("uri-path", po::value<std::string>(), "URI path (list of directories) added to the built-in URI resolver, i.e. where to find modules/schemas to import.")
32("lib-path", po::value<std::string>(), "Library path (list of directories) where Zorba will look for dynamic libraries (e.g., module external function implementations.")32("lib-path", po::value<std::string>(), "Library path (list of directories) where Zorba will look for dynamic libraries (e.g., module external function implementations.")
33("module-path", po::value<std::string>(), "Path (list of directories) to add to both the URI and Library paths.")33("module-path", po::value<std::string>(), "Path (list of directories) to add to both the URI and Library paths.")
34("classpath", po::value<std::string>(), "JVM classpath to be used by modules using Java implementations")
34("option", po::value<std::vector<std::string> >(), "Set an XQuery option in the static context. The QName of the option is passed as a string in the notation by James Clark (i.e. {namespace}localname). For example, --option {http://www.zorba-xquery.com}option=value").35("option", po::value<std::vector<std::string> >(), "Set an XQuery option in the static context. The QName of the option is passed as a string in the notation by James Clark (i.e. {namespace}localname). For example, --option {http://www.zorba-xquery.com}option=value").
35("trailing-nl", "Output a trailing newline after the result of the query.")36("trailing-nl", "Output a trailing newline after the result of the query.")
36("stop-words", po::value<std::vector<std::string> >(), "Mapping specifying a stop-words URI to another.")37("stop-words", po::value<std::vector<std::string> >(), "Mapping specifying a stop-words URI to another.")
3738
=== modified file 'bin/zorbacmdproperties_base.h'
--- bin/zorbacmdproperties_base.h 2012-04-11 20:22:52 +0000
+++ bin/zorbacmdproperties_base.h 2012-04-27 13:22:48 +0000
@@ -15,13 +15,6 @@
15 */15 */
16/* vim:set et sw=2 ts=2: */16/* vim:set et sw=2 ts=2: */
1717
18// ******************************************
19// * *
20// * THIS IS A GENERATED FILE. DO NOT EDIT! *
21// * SEE .txt FILE WITH SAME NAME *
22// * *
23// ******************************************
24
25#include <string>18#include <string>
26#include <sstream>19#include <sstream>
27#include <zorba/config.h>20#include <zorba/config.h>
@@ -30,13 +23,29 @@
3023
31#ifndef ZORBACMD_ZORBACMDPROPERTIESBASE24#ifndef ZORBACMD_ZORBACMDPROPERTIESBASE
32#define ZORBACMD_ZORBACMDPROPERTIESBASE25#define ZORBACMD_ZORBACMDPROPERTIESBASE
33namespace zorbacmd { 26namespace zorbacmd
34class ZorbaCMDPropertiesBase : public ::zorba::PropertiesBase {27{
28
29class ZorbaCMDPropertiesBase : public ::zorba::PropertiesBase
30{
35protected:31protected:
36 const char **get_all_options () const {32 const char **get_all_options () const
37 static const char *result [] = { "--timing", "--output-file", "--serialization-parameter", "--serialize-html", "--serialize-text", "--indent", "--print-query", "--print-errors-as-xml", "--byte-order-mark", "--omit-xml-declaration", "--base-uri", "--boundary-space", "--default-collation", "--construction-mode", "--ordering-mode", "--multiple", "--query", "--as-files", "--external-variable", "--context-item", "--optimization-level", "--lib-module", "--parse-only", "--compile-only", "--no-serializer", "--debug", "--debug-host", "--debug-port", "--no-logo", "--timeout", "--uri-path", "--lib-path", "--module-path", "--option", "--trailing-nl", "--stop-words", "--thesaurus", "--compile-plan", "--execute-plan", NULL };33 {
34 static const char *result [] = {
35 "--timing", "--output-file", "--serialization-parameter",
36 "--serialize-html", "--serialize-text", "--indent", "--print-query",
37 "--print-errors-as-xml", "--byte-order-mark", "--omit-xml-declaration",
38 "--base-uri", "--boundary-space", "--default-collation",
39 "--construction-mode", "--ordering-mode", "--multiple", "--query",
40 "--as-files", "--external-variable", "--context-item",
41 "--optimization-level", "--lib-module", "--parse-only", "--compile-only",
42 "--no-serializer", "--debug", "--debug-host", "--debug-port", "--no-logo",
43 "--timeout", "--uri-path", "--lib-path", "--module-path", "--classpath",
44 "--option", "--trailing-nl", "--stop-words", "--thesaurus",
45 "--compile-plan", "--execute-plan", NULL };
38 return result;46 return result;
39 }47 }
48
40 bool theTiming;49 bool theTiming;
41 std::string theOutputFile;50 std::string theOutputFile;
42 std::vector<std::string> theSerializationParameter;51 std::vector<std::string> theSerializationParameter;
@@ -70,6 +79,7 @@
70 std::string theUriPath;79 std::string theUriPath;
71 std::string theLibPath;80 std::string theLibPath;
72 std::string theModulePath;81 std::string theModulePath;
82 std::string theClasspath;
73 std::vector<std::string> theOption;83 std::vector<std::string> theOption;
74 bool theTrailingNl;84 bool theTrailingNl;
75 std::vector<std::string> theStopWords;85 std::vector<std::string> theStopWords;
@@ -136,6 +146,7 @@
136 const std::string &uriPath () const { return theUriPath; }146 const std::string &uriPath () const { return theUriPath; }
137 const std::string &libPath () const { return theLibPath; }147 const std::string &libPath () const { return theLibPath; }
138 const std::string &modulePath () const { return theModulePath; }148 const std::string &modulePath () const { return theModulePath; }
149 const std::string &classpath () const { return theClasspath; }
139 const std::vector<std::string> &option () const { return theOption; }150 const std::vector<std::string> &option () const { return theOption; }
140 const bool &trailingNl () const { return theTrailingNl; }151 const bool &trailingNl () const { return theTrailingNl; }
141 const std::vector<std::string> &stopWords () const { return theStopWords; }152 const std::vector<std::string> &stopWords () const { return theStopWords; }
@@ -158,12 +169,16 @@
158 else if (strcmp (*argv, "--output-file") == 0 || strncmp (*argv, "-o", 2) == 0) {169 else if (strcmp (*argv, "--output-file") == 0 || strncmp (*argv, "-o", 2) == 0) {
159 int d = 2;170 int d = 2;
160 if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; }171 if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; }
161 if (*argv == NULL) { result = "No value given for --output-file option"; break; } init_val (*argv, theOutputFile, d);172 if (*argv == NULL) { result = "No value given for --output-file option"; break; }
173
174 init_val (*argv, theOutputFile, d);
162 }175 }
163 else if (strcmp (*argv, "--serialization-parameter") == 0 || strncmp (*argv, "-z", 2) == 0) {176 else if (strcmp (*argv, "--serialization-parameter") == 0 || strncmp (*argv, "-z", 2) == 0) {
164 int d = 2;177 int d = 2;
165 if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; }178 if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; }
166 if (*argv == NULL) { result = "No value given for --serialization-parameter option"; break; } init_val (*argv, theSerializationParameter, d);179 if (*argv == NULL) { result = "No value given for --serialization-parameter option"; break; }
180
181 init_val (*argv, theSerializationParameter, d);
167 }182 }
168 else if (strcmp (*argv, "--serialize-html") == 0) {183 else if (strcmp (*argv, "--serialize-html") == 0) {
169 theSerializeHtml = true;184 theSerializeHtml = true;
@@ -189,37 +204,51 @@
189 else if (strcmp (*argv, "--base-uri") == 0) {204 else if (strcmp (*argv, "--base-uri") == 0) {
190 int d = 2;205 int d = 2;
191 if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; }206 if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; }
192 if (*argv == NULL) { result = "No value given for --base-uri option"; break; } init_val (*argv, theBaseUri, d);207 if (*argv == NULL) { result = "No value given for --base-uri option"; break; }
208
209 init_val (*argv, theBaseUri, d);
193 }210 }
194 else if (strcmp (*argv, "--boundary-space") == 0) {211 else if (strcmp (*argv, "--boundary-space") == 0) {
195 int d = 2;212 int d = 2;
196 if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; }213 if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; }
197 if (*argv == NULL) { result = "No value given for --boundary-space option"; break; } init_val (*argv, theBoundarySpace, d);214 if (*argv == NULL) { result = "No value given for --boundary-space option"; break; }
215
216 init_val (*argv, theBoundarySpace, d);
198 }217 }
199 else if (strcmp (*argv, "--default-collation") == 0) {218 else if (strcmp (*argv, "--default-collation") == 0) {
200 int d = 2;219 int d = 2;
201 if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; }220 if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; }
202 if (*argv == NULL) { result = "No value given for --default-collation option"; break; } init_val (*argv, theDefaultCollation, d);221 if (*argv == NULL) { result = "No value given for --default-collation option"; break; }
222
223 init_val (*argv, theDefaultCollation, d);
203 }224 }
204 else if (strcmp (*argv, "--construction-mode") == 0) {225 else if (strcmp (*argv, "--construction-mode") == 0) {
205 int d = 2;226 int d = 2;
206 if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; }227 if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; }
207 if (*argv == NULL) { result = "No value given for --construction-mode option"; break; } init_val (*argv, theConstructionMode, d);228 if (*argv == NULL) { result = "No value given for --construction-mode option"; break; }
229
230 init_val (*argv, theConstructionMode, d);
208 }231 }
209 else if (strcmp (*argv, "--ordering-mode") == 0) {232 else if (strcmp (*argv, "--ordering-mode") == 0) {
210 int d = 2;233 int d = 2;
211 if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; }234 if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; }
212 if (*argv == NULL) { result = "No value given for --ordering-mode option"; break; } init_val (*argv, theOrderingMode, d);235 if (*argv == NULL) { result = "No value given for --ordering-mode option"; break; }
236
237 init_val (*argv, theOrderingMode, d);
213 }238 }
214 else if (strcmp (*argv, "--multiple") == 0 || strncmp (*argv, "-m", 2) == 0) {239 else if (strcmp (*argv, "--multiple") == 0 || strncmp (*argv, "-m", 2) == 0) {
215 int d = 2;240 int d = 2;
216 if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; }241 if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; }
217 if (*argv == NULL) { result = "No value given for --multiple option"; break; } init_val (*argv, theMultiple, d);242 if (*argv == NULL) { result = "No value given for --multiple option"; break; }
243
244 init_val (*argv, theMultiple, d);
218 }245 }
219 else if (strcmp (*argv, "--query") == 0 || strncmp (*argv, "-q", 2) == 0) {246 else if (strcmp (*argv, "--query") == 0 || strncmp (*argv, "-q", 2) == 0) {
220 int d = 2;247 int d = 2;
221 if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; }248 if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; }
222 if (*argv == NULL) { result = "No value given for --query option"; break; } init_val (*argv, theQueriesOrFiles, d);249 if (*argv == NULL) { result = "No value given for --query option"; break; }
250
251 init_val (*argv, theQueriesOrFiles, d);
223 }252 }
224 else if (strcmp (*argv, "--as-files") == 0 || strncmp (*argv, "-f", 2) == 0) {253 else if (strcmp (*argv, "--as-files") == 0 || strncmp (*argv, "-f", 2) == 0) {
225 theAsFiles = true;254 theAsFiles = true;
@@ -227,17 +256,23 @@
227 else if (strcmp (*argv, "--external-variable") == 0 || strncmp (*argv, "-e", 2) == 0) {256 else if (strcmp (*argv, "--external-variable") == 0 || strncmp (*argv, "-e", 2) == 0) {
228 int d = 2;257 int d = 2;
229 if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; }258 if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; }
230 if (*argv == NULL) { result = "No value given for --external-variable option"; break; } init_val (*argv, theExternalVariable, d);259 if (*argv == NULL) { result = "No value given for --external-variable option"; break; }
260
261 init_val (*argv, theExternalVariable, d);
231 }262 }
232 else if (strcmp (*argv, "--context-item") == 0) {263 else if (strcmp (*argv, "--context-item") == 0) {
233 int d = 2;264 int d = 2;
234 if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; }265 if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; }
235 if (*argv == NULL) { result = "No value given for --context-item option"; break; } init_val (*argv, theContextItem, d);266 if (*argv == NULL) { result = "No value given for --context-item option"; break; }
267
268 init_val (*argv, theContextItem, d);
236 }269 }
237 else if (strcmp (*argv, "--optimization-level") == 0) {270 else if (strcmp (*argv, "--optimization-level") == 0) {
238 int d = 2;271 int d = 2;
239 if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; }272 if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; }
240 if (*argv == NULL) { result = "No value given for --optimization-level option"; break; } init_val (*argv, theOptimizationLevel, d);273 if (*argv == NULL) { result = "No value given for --optimization-level option"; break; }
274
275 init_val (*argv, theOptimizationLevel, d);
241 }276 }
242 else if (strcmp (*argv, "--lib-module") == 0 || strncmp (*argv, "-l", 2) == 0) {277 else if (strcmp (*argv, "--lib-module") == 0 || strncmp (*argv, "-l", 2) == 0) {
243 theLibModule = true;278 theLibModule = true;
@@ -257,12 +292,16 @@
257 else if (strcmp (*argv, "--debug-host") == 0 || strncmp (*argv, "-h", 2) == 0) {292 else if (strcmp (*argv, "--debug-host") == 0 || strncmp (*argv, "-h", 2) == 0) {
258 int d = 2;293 int d = 2;
259 if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; }294 if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; }
260 if (*argv == NULL) { result = "No value given for --debug-host option"; break; } init_val (*argv, theDebugHost, d);295 if (*argv == NULL) { result = "No value given for --debug-host option"; break; }
296
297 init_val (*argv, theDebugHost, d);
261 }298 }
262 else if (strcmp (*argv, "--debug-port") == 0 || strncmp (*argv, "-p", 2) == 0) {299 else if (strcmp (*argv, "--debug-port") == 0 || strncmp (*argv, "-p", 2) == 0) {
263 int d = 2;300 int d = 2;
264 if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; }301 if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; }
265 if (*argv == NULL) { result = "No value given for --debug-port option"; break; } init_val (*argv, theDebugPort, d);302 if (*argv == NULL) { result = "No value given for --debug-port option"; break; }
303
304 init_val (*argv, theDebugPort, d);
266 }305 }
267 else if (strcmp (*argv, "--no-logo") == 0) {306 else if (strcmp (*argv, "--no-logo") == 0) {
268 theNoLogo = true;307 theNoLogo = true;
@@ -270,27 +309,44 @@
270 else if (strcmp (*argv, "--timeout") == 0) {309 else if (strcmp (*argv, "--timeout") == 0) {
271 int d = 2;310 int d = 2;
272 if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; }311 if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; }
273 if (*argv == NULL) { result = "No value given for --timeout option"; break; } init_val (*argv, theTimeout, d);312 if (*argv == NULL) { result = "No value given for --timeout option"; break; }
313
314 init_val (*argv, theTimeout, d);
274 }315 }
275 else if (strcmp (*argv, "--uri-path") == 0) {316 else if (strcmp (*argv, "--uri-path") == 0) {
276 int d = 2;317 int d = 2;
277 if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; }318 if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; }
278 if (*argv == NULL) { result = "No value given for --uri-path option"; break; } init_val (*argv, theUriPath, d);319 if (*argv == NULL) { result = "No value given for --uri-path option"; break; }
320
321 init_val (*argv, theUriPath, d);
279 }322 }
280 else if (strcmp (*argv, "--lib-path") == 0) {323 else if (strcmp (*argv, "--lib-path") == 0) {
281 int d = 2;324 int d = 2;
282 if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; }325 if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; }
283 if (*argv == NULL) { result = "No value given for --lib-path option"; break; } init_val (*argv, theLibPath, d);326 if (*argv == NULL) { result = "No value given for --lib-path option"; break; }
327
328 init_val (*argv, theLibPath, d);
284 }329 }
285 else if (strcmp (*argv, "--module-path") == 0) {330 else if (strcmp (*argv, "--module-path") == 0) {
286 int d = 2;331 int d = 2;
287 if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; }332 if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; }
288 if (*argv == NULL) { result = "No value given for --module-path option"; break; } init_val (*argv, theModulePath, d);333 if (*argv == NULL) { result = "No value given for --module-path option"; break; }
334
335 init_val (*argv, theModulePath, d);
336 }
337 else if (strcmp (*argv, "--classpath") == 0) {
338 int d = 2;
339 if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; }
340 if (*argv == NULL) { result = "No value given for --classpath option"; break; }
341
342 init_val (*argv, theClasspath, d);
289 }343 }
290 else if (strcmp (*argv, "--option") == 0) {344 else if (strcmp (*argv, "--option") == 0) {
291 int d = 2;345 int d = 2;
292 if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; }346 if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; }
293 if (*argv == NULL) { result = "No value given for --option option"; break; } init_val (*argv, theOption, d);347 if (*argv == NULL) { result = "No value given for --option option"; break; }
348
349 init_val (*argv, theOption, d);
294 }350 }
295 else if (strcmp (*argv, "--trailing-nl") == 0) {351 else if (strcmp (*argv, "--trailing-nl") == 0) {
296 theTrailingNl = true;352 theTrailingNl = true;
@@ -298,12 +354,16 @@
298 else if (strcmp (*argv, "--stop-words") == 0) {354 else if (strcmp (*argv, "--stop-words") == 0) {
299 int d = 2;355 int d = 2;
300 if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; }356 if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; }
301 if (*argv == NULL) { result = "No value given for --stop-words option"; break; } init_val (*argv, theStopWords, d);357 if (*argv == NULL) { result = "No value given for --stop-words option"; break; }
358
359 init_val (*argv, theStopWords, d);
302 }360 }
303 else if (strcmp (*argv, "--thesaurus") == 0) {361 else if (strcmp (*argv, "--thesaurus") == 0) {
304 int d = 2;362 int d = 2;
305 if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; }363 if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; }
306 if (*argv == NULL) { result = "No value given for --thesaurus option"; break; } init_val (*argv, theThesaurus, d);364 if (*argv == NULL) { result = "No value given for --thesaurus option"; break; }
365
366 init_val (*argv, theThesaurus, d);
307 }367 }
308 else if (strcmp (*argv, "--compile-plan") == 0 || strncmp (*argv, "-c", 2) == 0) {368 else if (strcmp (*argv, "--compile-plan") == 0 || strncmp (*argv, "-c", 2) == 0) {
309 theCompilePlan = true;369 theCompilePlan = true;
@@ -327,46 +387,47 @@
327387
328 const char *get_help_msg () const {388 const char *get_help_msg () const {
329 return389 return
330"--timing, -t\nPrint timing information. In case of multiple queries the timing information is provided per each query. Both wallclock time and user time (which excludes I/O, network delays and other kernel waits) are shown.\n\n"390 "--timing, -t\nPrint timing information. In case of multiple queries the timing information is provided per each query. Both wallclock time and user time (which excludes I/O, network delays and other kernel waits) are shown.\n\n"
331"--output-file, -o\nWrite the result to the given file.\n\n"391 "--output-file, -o\nWrite the result to the given file.\n\n"
332"--serialization-parameter, -z\nSet serialization parameter in the form of a parameter=value pair (see http://www.w3.org/TR/xslt-xquery-serialization/#serparam, e.g.: -z method=xhtml -z doctype-system=DTD/xhtml1-strict.dtd -z indent=yes).\n\n"392 "--serialization-parameter, -z\nSet serialization parameter in the form of a parameter=value pair (see http://www.w3.org/TR/xslt-xquery-serialization/#serparam, e.g.: -z method=xhtml -z doctype-system=DTD/xhtml1-strict.dtd -z indent=yes).\n\n"
333"--serialize-html\nSerialize the result as HTML.\n\n"393 "--serialize-html\nSerialize the result as HTML.\n\n"
334"--serialize-text\nSerialize the result as Text.\n\n"394 "--serialize-text\nSerialize the result as Text.\n\n"
335"--indent, -i\nIndent output.\n\n"395 "--indent, -i\nIndent output.\n\n"
336"--print-query\nPrint the queries.\n\n"396 "--print-query\nPrint the queries.\n\n"
337"--print-errors-as-xml, -x\nPrint the errors as XML.\n\n"397 "--print-errors-as-xml, -x\nPrint the errors as XML.\n\n"
338"--byte-order-mark\nSet the byte-order-mark for the serializer.\n\n"398 "--byte-order-mark\nSet the byte-order-mark for the serializer.\n\n"
339"--omit-xml-declaration, -r\nOmit the XML declaration from the result.\n\n"399 "--omit-xml-declaration, -r\nOmit the XML declaration from the result.\n\n"
340"--base-uri\nSet the base URI property of the static context.\n\n"400 "--base-uri\nSet the base URI property of the static context.\n\n"
341"--boundary-space\nSet the boundary-space policy ('strip' or 'preserve') in the static context.\n\n"401 "--boundary-space\nSet the boundary-space policy ('strip' or 'preserve') in the static context.\n\n"
342"--default-collation\nAdd the given collation and set the value of the default collation in the static context to the given collation.\n\n"402 "--default-collation\nAdd the given collation and set the value of the default collation in the static context to the given collation.\n\n"
343"--construction-mode\nSet the construction mode ('strip' or 'preserve') in the static context.\n\n"403 "--construction-mode\nSet the construction mode ('strip' or 'preserve') in the static context.\n\n"
344"--ordering-mode\nSet the ordering mode ('ordered' or 'unordered') in the static context.\n\n"404 "--ordering-mode\nSet the ordering mode ('ordered' or 'unordered') in the static context.\n\n"
345"--multiple, -m\nExecute the given queries multiple times.\n\n"405 "--multiple, -m\nExecute the given queries multiple times.\n\n"
346"--query, -q\nQuery test or file URI (file://...)\n\n"406 "--query, -q\nQuery test or file URI (file://...)\n\n"
347"--as-files, -f\nTreat all -q arguments as file paths instead of URIs or inline queries.\n\n"407 "--as-files, -f\nTreat all -q arguments as file paths instead of URIs or inline queries.\n\n"
348"--external-variable, -e\nProvide the value for a variable given a file (name=file) or a value (name:=value)\n\n"408 "--external-variable, -e\nProvide the value for a variable given a file (name=file) or a value (name:=value)\n\n"
349"--context-item\nSet the context item to the XML document in a given file.\n\n"409 "--context-item\nSet the context item to the XML document in a given file.\n\n"
350"--optimization-level\nOptimization level for the query compiler (O0, O1 or O2 - default: O1)\n\n"410 "--optimization-level\nOptimization level for the query compiler (O0, O1 or O2 - default: O1)\n\n"
351"--lib-module, -l\nQuery compiler option to treat the query as a library module. If this is set --compile-only option is also set to true.\n\n"411 "--lib-module, -l\nQuery compiler option to treat the query as a library module. If this is set --compile-only option is also set to true.\n\n"
352"--parse-only\nStop after parsing the query.\n\n"412 "--parse-only\nStop after parsing the query.\n\n"
353"--compile-only\nOnly compile (don't execute)\n\n"413 "--compile-only\nOnly compile (don't execute)\n\n"
354"--no-serializer\nDo not serialize (discard) result.\n\n"414 "--no-serializer\nDo not serialize (discard) result.\n\n"
355"--debug, -d\nLaunch the Zorba debugger server and connect to a DBGP-enabled debugger client.\n\n"415 "--debug, -d\nLaunch the Zorba debugger server and connect to a DBGP-enabled debugger client.\n\n"
356"--debug-host, -h\nThe host where the DBGP-enabled debugger client listens for connections. Defaults to: 127.0.0.1\n\n"416 "--debug-host, -h\nThe host where the DBGP-enabled debugger client listens for connections. Defaults to: 127.0.0.1\n\n"
357"--debug-port, -p\nThe port on which the DBGP-enabled debugger client listens for connections. Defaults to: 28028\n\n"417 "--debug-port, -p\nThe port on which the DBGP-enabled debugger client listens for connections. Defaults to: 28028\n\n"
358"--no-logo\nPrint no logo when starting.\n\n"418 "--no-logo\nPrint no logo when starting.\n\n"
359"--timeout\nSpecify a timeout in seconds. After the specified time, the execution of the query will be aborted.\n\n"419 "--timeout\nSpecify a timeout in seconds. After the specified time, the execution of the query will be aborted.\n\n"
360"--uri-path\nURI path (list of directories) added to the built-in URI resolver, i.e. where to find modules/schemas to import.\n\n"420 "--uri-path\nURI path (list of directories) added to the built-in URI resolver, i.e. where to find modules/schemas to import.\n\n"
361"--lib-path\nLibrary path (list of directories) where Zorba will look for dynamic libraries (e.g., module external function implementations.\n\n"421 "--lib-path\nLibrary path (list of directories) where Zorba will look for dynamic libraries (e.g., module external function implementations.\n\n"
362"--module-path\nPath (list of directories) to add to both the URI and Library paths.\n\n"422 "--module-path\nPath (list of directories) to add to both the URI and Library paths.\n\n"
363"--option\nSet an XQuery option in the static context. The QName of the option is passed as a string in the notation by James Clark (i.e. {namespace}localname). For example, --option {http://www.zorba-xquery.com}option=value\n\n"423 "--classpath\nJVM classpath to be used by modules using Java implementations\n\n"
364"--trailing-nl\nOutput a trailing newline after the result of the query.\n\n"424 "--option\nSet an XQuery option in the static context. The QName of the option is passed as a string in the notation by James Clark (i.e. {namespace}localname). For example, --option {http://www.zorba-xquery.com}option=value\n\n"
365"--stop-words\nMapping specifying a stop-words URI to another.\n\n"425 "--trailing-nl\nOutput a trailing newline after the result of the query.\n\n"
366"--thesaurus\nMapping specifying a thesaurus URI to another.\n\n"426 "--stop-words\nMapping specifying a stop-words URI to another.\n\n"
367"--compile-plan, -c\nOutput the query plan as binary.\n\n"427 "--thesaurus\nMapping specifying a thesaurus URI to another.\n\n"
368"--execute-plan\nTake a query plan as binary and execute it. Binary query plans can be generated using the --compile-plan option.\n\n"428 "--compile-plan, -c\nOutput the query plan as binary.\n\n"
369;429 "--execute-plan\nTake a query plan as binary and execute it. Binary query plans can be generated using the --compile-plan option.\n\n"
430 ;
370 }431 }
371432
372 static const ZorbaCMDPropertiesBase *instance () {433 static const ZorbaCMDPropertiesBase *instance () {
373434
=== modified file 'cmake_modules/ZorbaModule.cmake'
--- cmake_modules/ZorbaModule.cmake 2012-04-11 20:22:52 +0000
+++ cmake_modules/ZorbaModule.cmake 2012-04-27 13:22:48 +0000
@@ -140,7 +140,6 @@
140 ENDIF (NOT IS_ABSOLUTE "${MODULE_FILE}")140 ENDIF (NOT IS_ABSOLUTE "${MODULE_FILE}")
141 GET_FILENAME_COMPONENT (module_name "${MODULE_FILE}" NAME)141 GET_FILENAME_COMPONENT (module_name "${MODULE_FILE}" NAME)
142142
143
144 MANGLE_URI (${MODULE_URI} ".xq" module_path module_filename)143 MANGLE_URI (${MODULE_URI} ".xq" module_path module_filename)
145144
146 # Compute a CMake-symbol-safe version of the target URI, for storing145 # Compute a CMake-symbol-safe version of the target URI, for storing
@@ -267,6 +266,14 @@
267 SET (module_filewe "${module_filewe}_${MODULE_VERSION}")266 SET (module_filewe "${module_filewe}_${MODULE_VERSION}")
268 ENDIF (MODULE_VERSION)267 ENDIF (MODULE_VERSION)
269268
269 # Compute the output path for the library. Note: This is copied
270 # from ADD_COPY_RULE(); probably should refactor this logic.
271 IF (${MODULE_TEST_ONLY} EQUAL 1)
272 SET (_output_basedir "${CMAKE_BINARY_DIR}/TEST_LIB_PATH")
273 ELSE (${MODULE_TEST_ONLY} EQUAL 1)
274 SET (_output_basedir "${CMAKE_BINARY_DIR}/LIB_PATH")
275 ENDIF (${MODULE_TEST_ONLY} EQUAL 1)
276
270 # It seems like it would be nice to set the VERSION and/or277 # It seems like it would be nice to set the VERSION and/or
271 # SOVERSION target properties here. However: On Windows, it278 # SOVERSION target properties here. However: On Windows, it
272 # doesn't seem to do anything (the .rc file configured above279 # doesn't seem to do anything (the .rc file configured above
@@ -278,12 +285,44 @@
278 # FOLDER is to group IDE projects into folders.285 # FOLDER is to group IDE projects into folders.
279 SET_TARGET_PROPERTIES (${module_lib_target} PROPERTIES286 SET_TARGET_PROPERTIES (${module_lib_target} PROPERTIES
280 OUTPUT_NAME "${module_filewe}${SUFFIX}"287 OUTPUT_NAME "${module_filewe}${SUFFIX}"
281 ${target_type}_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/${module_name}.src"288 ${target_type}_OUTPUT_DIRECTORY "${_output_basedir}/${module_path}"
282 FOLDER "Modules"289 FOLDER "Modules"
283 )290 )
284 TARGET_LINK_LIBRARIES(${module_lib_target}291 TARGET_LINK_LIBRARIES(${module_lib_target} zorba_${ZORBA_STORE_NAME})
285 zorba_${ZORBA_STORE_NAME} ${MODULE_LINK_LIBRARIES})292
286293 # Ridiculous hack: CMake doesn't seem to (reliably) set up
294 # dependencies if you specify a library to TARGET_LINK_LIBRARIES()
295 # which is the output of some other ADD_LIBRARY(). We can't solve
296 # this problem in the general case. We can work around it,
297 # however, in the specific case where the target library was
298 # generated by an earlier call to DECLARE_ZORBA_MODULE() - by
299 # remembering that output library's path and its corresponding
300 # target in a global property.
301 FOREACH (_lib ${MODULE_LINK_LIBRARIES})
302 GET_PROPERTY (_targetname GLOBAL PROPERTY "${_lib}_TARGET")
303 IF ("${_targetname}" STREQUAL "")
304 TARGET_LINK_LIBRARIES(${module_lib_target} "${_lib}")
305 ELSE ("${_targetname}" STREQUAL "")
306 TARGET_LINK_LIBRARIES(${module_lib_target} "${_targetname}")
307 ENDIF ("${_targetname}" STREQUAL "")
308 ENDFOREACH (_lib)
309
310 # Remember this library for the auto-generated module Config.cmake
311 # file. Also remember the target name for the hack mentioned
312 # above. QQQ and what about the installed version?
313 GET_TARGET_PROPERTY (_lib_location "${module_lib_target}" LOCATION)
314 SET_PROPERTY (GLOBAL APPEND PROPERTY "${PROJECT_NAME}_LIBRARIES"
315 "${_lib_location}")
316 SET_PROPERTY (GLOBAL PROPERTY "${_lib_location}_TARGET"
317 "${module_lib_target}")
318
319 # If this is a core module, remember the target that builds the
320 # library so zorbacmd can depend on it.
321 IF (${PROJECT_NAME} STREQUAL "zorba")
322 SET_PROPERTY (GLOBAL APPEND PROPERTY ZORBA_CORE_MODULE_LIB_TARGETS
323 "${module_lib_target}")
324 ENDIF (${PROJECT_NAME} STREQUAL "zorba")
325
287 # Install the library, if it's not a TEST_ONLY module326 # Install the library, if it's not a TEST_ONLY module
288 IF (NOT MODULE_TEST_ONLY)327 IF (NOT MODULE_TEST_ONLY)
289 IF(NOT ${PROJECT_NAME} STREQUAL "zorba")328 IF(NOT ${PROJECT_NAME} STREQUAL "zorba")
@@ -314,17 +353,9 @@
314 ENDIF (MODULE_VERSION)353 ENDIF (MODULE_VERSION)
315 FOREACH (version_infix "" ${version_infixes})354 FOREACH (version_infix "" ${version_infixes})
316 ADD_COPY_RULE ("URI" "${SOURCE_FILE}" "${module_path}/${module_filename}"355 ADD_COPY_RULE ("URI" "${SOURCE_FILE}" "${module_path}/${module_filename}"
317 "${version_infix}" "" "${MODULE_TEST_ONLY}")356 "${version_infix}" "" 1 "${MODULE_TEST_ONLY}")
318 ENDFOREACH (version_infix)357 ENDFOREACH (version_infix)
319358
320 # Also copy the dynamic library from the location it was built.
321 IF (module_lib_target)
322 GET_TARGET_PROPERTY (lib_location "${module_lib_target}" LOCATION)
323 GET_FILENAME_COMPONENT (lib_filename "${lib_location}" NAME)
324 ADD_COPY_RULE ("LIB" "${lib_location}" "${module_path}/${lib_filename}"
325 "" "${module_lib_target}" "${MODULE_TEST_ONLY}")
326 ENDIF (module_lib_target)
327
328 # Last but not least, whip up a test case that ensures the module359 # Last but not least, whip up a test case that ensures the module
329 # can at least be compiled. Don't bother for test-only modules360 # can at least be compiled. Don't bother for test-only modules
330 # (presumably they're there to be tested!).361 # (presumably they're there to be tested!).
@@ -375,7 +406,7 @@
375 ENDIF (NOT SCHEMA_TEST_ONLY)406 ENDIF (NOT SCHEMA_TEST_ONLY)
376407
377 ADD_COPY_RULE ("URI" "${SOURCE_FILE}" "${schema_path}/${schema_filename}"408 ADD_COPY_RULE ("URI" "${SOURCE_FILE}" "${schema_path}/${schema_filename}"
378 "" "" "${SCHEMA_TEST_ONLY}")409 "" "" 1 "${SCHEMA_TEST_ONLY}")
379410
380ENDMACRO (DECLARE_ZORBA_SCHEMA)411ENDMACRO (DECLARE_ZORBA_SCHEMA)
381412
@@ -407,25 +438,74 @@
407 MANGLE_URI (${URI_FILE_URI} "" uri_file_path uri_file_filename)438 MANGLE_URI (${URI_FILE_URI} "" uri_file_path uri_file_filename)
408439
409 ADD_COPY_RULE ("URI" "${SOURCE_FILE}" "${uri_file_path}/${uri_file_filename}"440 ADD_COPY_RULE ("URI" "${SOURCE_FILE}" "${uri_file_path}/${uri_file_filename}"
410 "" "" "${URI_FILE_TEST_ONLY}")441 "" "" 1 "${URI_FILE_TEST_ONLY}")
411442
412ENDMACRO (DECLARE_ZORBA_URI_FILE)443ENDMACRO (DECLARE_ZORBA_URI_FILE)
413444
445
446# Inform Zorba of a .jar file that should be made available on the CLASSPATH
447# of the JVM, should the JVM be started. QQQ more doc needed
448#
449# Args: FILE - path to file(s) (must be absolute)
450# TARGET - (optional) a CMake target that must be executed in order
451# for FILEs to be generated
452# EXTERNAL - (optional) FILE specifies a path that should be added
453# to CLASSPATH as-is
454# TEST_ONLY - (optional) Jar file is for testcases only and should not
455# be installed
456#
457# Must supply at least one value to FILE or TARGET.
458MACRO (DECLARE_ZORBA_JAR)
459 PARSE_ARGUMENTS (JAR "FILE;TARGET" "TARGET" "TEST_ONLY;EXTERNAL" ${ARGN})
460 IF (NOT JAR_FILE)
461 MESSAGE (FATAL_ERROR "'FILE' argument is required for DECLARE_ZORBA_JAR")
462 ENDIF (NOT JAR_FILE)
463
464 # Initialize classpath file and set up copy rule (once per project)
465 SET (_CP_FILE "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-classpath.txt")
466 GET_PROPERTY (_known_project GLOBAL PROPERTY "${PROJECT_NAME}-jars")
467 IF (NOT _known_project)
468 FILE (REMOVE "${_CP_FILE}")
469 SET_PROPERTY (GLOBAL PROPERTY "${PROJECT_NAME}-jars" 1)
470 ADD_COPY_RULE ("LIB" "${_CP_FILE}" "jars/${PROJECT_NAME}-classpath.txt"
471 "" "" 1 "${JAR_TEST_ONLY}")
472 ENDIF (NOT _known_project)
473
474 # Iterate over all supplied jar files
475 FOREACH (_jar_file ${JAR_FILE})
476
477 IF (JAR_EXTERNAL)
478 # Put absolute path into classpath file
479 FILE (APPEND "${_CP_FILE}" "${_jar_file}\n")
480 ELSE (JAR_EXTERNAL)
481 # Copy jar to jars/ directory and add relative path to classpath file
482 GET_FILENAME_COMPONENT (_output_filename "${_jar_file}" NAME)
483 ADD_COPY_RULE ("LIB" "${_jar_file}" "jars/${_output_filename}" ""
484 "${JAR_TARGET}" 1 "${JAR_TEST_ONLY}")
485 FILE (APPEND "${_CP_FILE}" "${_output_filename}\n")
486 ENDIF (JAR_EXTERNAL)
487
488 ENDFOREACH (_jar_file)
489ENDMACRO (DECLARE_ZORBA_JAR)
490
491
414# Utility macro for setting up a build rule to copy a file to a492# Utility macro for setting up a build rule to copy a file to a
415# particular (possibly versioned) file in a shared directory if such a file has493# particular (possibly versioned) file in a shared directory if such a
416# not already been output.494# file has not already been output.
495#
417# FILE_TYPE: Either "URI" or "LIB"; will be used to determine which shared496# FILE_TYPE: Either "URI" or "LIB"; will be used to determine which shared
418# directory to place output in (URI_PATH or LIB_PATH). Also, "URI" files497# directory to place output in (URI_PATH or LIB_PATH).
419# will have an INSTALL() directive to put them in the install image.
420# INPUT_FILE: Absolute path to file to copy.498# INPUT_FILE: Absolute path to file to copy.
421# OUTPUT_FILE: Relative path to output file (relative to URI_PATH).499# OUTPUT_FILE: Relative path to output file (relative to URI_PATH).
422# VERSION_ARG: Version; may be "" for non-versioned files.500# VERSION_ARG: Version; may be "" for non-versioned files.
423# DEPEND_TARGET: A CMake target name upon which the copy rule should depend;501# DEPEND_TARGET: A CMake target name upon which the copy rule should depend;
424# may be "".502# may be "".
503# INSTALL: If 1, an INSTALL() directive will be executed to put the
504# file into the install image.
425# TEST_ONLY: If 1, file is for testcases only; will be copied into505# TEST_ONLY: If 1, file is for testcases only; will be copied into
426# TEST_URI_PATH/TEST_LIB_PATH and will not be installed506# TEST_URI_PATH/TEST_LIB_PATH and will not be installed.
427MACRO (ADD_COPY_RULE FILE_TYPE INPUT_FILE OUTPUT_FILE VERSION_ARG507MACRO (ADD_COPY_RULE FILE_TYPE INPUT_FILE OUTPUT_FILE VERSION_ARG
428 DEPEND_TARGET TEST_ONLY)508 DEPEND_TARGET INSTALL TEST_ONLY)
429 # Choose output base directory509 # Choose output base directory
430 IF (${TEST_ONLY} EQUAL 1)510 IF (${TEST_ONLY} EQUAL 1)
431 SET (_output_basedir "${CMAKE_BINARY_DIR}/TEST_${FILE_TYPE}_PATH")511 SET (_output_basedir "${CMAKE_BINARY_DIR}/TEST_${FILE_TYPE}_PATH")
@@ -470,13 +550,13 @@
470 SET_PROPERTY (GLOBAL APPEND PROPERTY ZORBA_URI_FILES550 SET_PROPERTY (GLOBAL APPEND PROPERTY ZORBA_URI_FILES
471 "${INPUT_FILE}" "${_output_file}" "${DEPEND_TARGET}" "${_is_core}")551 "${INPUT_FILE}" "${_output_file}" "${DEPEND_TARGET}" "${_is_core}")
472552
473 # Also set up an INSTALL rule (unless TEST_ONLY or LIB).553 # Also set up an INSTALL rule (unless TEST_ONLY).
474 IF ( (NOT "${FILE_TYPE}" STREQUAL "LIB") AND (NOT ${TEST_ONLY} EQUAL 1) )554 IF ( (${INSTALL} EQUAL 1) AND (NOT ${TEST_ONLY} EQUAL 1) )
475 555
476 IF(NOT _is_core)556 IF(NOT _is_core)
477 STRING(REPLACE "-" "_" component_name ${PROJECT_NAME}) 557 STRING(REPLACE "-" "_" component_name ${PROJECT_NAME})
478 INSTALL (FILES "${INPUT_FILE}"558 INSTALL (FILES "${INPUT_FILE}"
479 DESTINATION "${ZORBA_NONCORE_URI_DIR}/${_output_path}"559 DESTINATION "${ZORBA_NONCORE_${FILE_TYPE}_DIR}/${_output_path}"
480 RENAME "${_output_filename}"560 RENAME "${_output_filename}"
481 COMPONENT "${component_name}")561 COMPONENT "${component_name}")
482 562
@@ -496,11 +576,11 @@
496 576
497 ELSE(NOT _is_core)577 ELSE(NOT _is_core)
498 INSTALL (FILES "${INPUT_FILE}"578 INSTALL (FILES "${INPUT_FILE}"
499 DESTINATION "${ZORBA_CORE_URI_DIR}/${_output_path}"579 DESTINATION "${ZORBA_CORE_${FILE_TYPE}_DIR}/${_output_path}"
500 RENAME "${_output_filename}")580 RENAME "${_output_filename}")
501 ENDIF(NOT _is_core)581 ENDIF(NOT _is_core)
502 582
503 ENDIF ( (NOT "${FILE_TYPE}" STREQUAL "LIB") AND (NOT ${TEST_ONLY} EQUAL 1) )583 ENDIF ( (${INSTALL} EQUAL 1) AND (NOT ${TEST_ONLY} EQUAL 1) )
504 ENDIF (file_found EQUAL -1)584 ENDIF (file_found EQUAL -1)
505ENDMACRO (ADD_COPY_RULE)585ENDMACRO (ADD_COPY_RULE)
506586
@@ -535,6 +615,8 @@
535# files to their corresponding output directories, with appropriate615# files to their corresponding output directories, with appropriate
536# dependencies. This macro will only have any effect when called by616# dependencies. This macro will only have any effect when called by
537# the top-level project in a build.617# the top-level project in a build.
618# Also, this function automatically generates a CMake projectConfig.cmake
619# file for the project, based on config/ExternalModuleConfig.cmake.in.
538MACRO (DONE_DECLARING_ZORBA_URIS)620MACRO (DONE_DECLARING_ZORBA_URIS)
539 IF (PROJECT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)621 IF (PROJECT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
540 # Close out the zorba modules and schemas manifests622 # Close out the zorba modules and schemas manifests
@@ -553,9 +635,10 @@
553 LIST (GET copy_rules 2 _depend_target)635 LIST (GET copy_rules 2 _depend_target)
554 LIST (GET copy_rules 3 _is_core)636 LIST (GET copy_rules 3 _is_core)
555 LIST (REMOVE_AT copy_rules 0 1 2 3)637 LIST (REMOVE_AT copy_rules 0 1 2 3)
556 SET (_depends "${_input_file}")
557 IF (_depend_target)638 IF (_depend_target)
558 LIST (APPEND _depends "${_depend_target}")639 SET (_depends "${_depend_target}")
640 ELSE (_depend_target)
641 SET (_depends "${_input_file}")
559 ENDIF (_depend_target)642 ENDIF (_depend_target)
560 ADD_CUSTOM_COMMAND (OUTPUT "${_output_file}"643 ADD_CUSTOM_COMMAND (OUTPUT "${_output_file}"
561 COMMAND "${CMAKE_COMMAND}" -E copy644 COMMAND "${CMAKE_COMMAND}" -E copy
@@ -571,7 +654,8 @@
571654
572 # Targets and dependencies:655 # Targets and dependencies:
573 # ALL depends on check_uris; check_uris depends on check_core_uris;656 # ALL depends on check_uris; check_uris depends on check_core_uris;
574 # zorbacmd depends on check_core_uris.657 # zorbacmd depends on check_core_uris as well as all core module
658 # library targets.
575 ADD_CUSTOM_TARGET (check_uris ALL659 ADD_CUSTOM_TARGET (check_uris ALL
576 DEPENDS ${_noncore_output_files} VERBATIM)660 DEPENDS ${_noncore_output_files} VERBATIM)
577 SET_TARGET_PROPERTIES(check_uris PROPERTIES FOLDER "Modules")661 SET_TARGET_PROPERTIES(check_uris PROPERTIES FOLDER "Modules")
@@ -584,6 +668,8 @@
584 DEPENDS ${_core_output_files} VERBATIM)668 DEPENDS ${_core_output_files} VERBATIM)
585 ADD_DEPENDENCIES(check_uris check_core_uris)669 ADD_DEPENDENCIES(check_uris check_core_uris)
586 ADD_DEPENDENCIES(zorbacmd check_core_uris)670 ADD_DEPENDENCIES(zorbacmd check_core_uris)
671 GET_PROPERTY (_corelibs GLOBAL PROPERTY ZORBA_CORE_MODULE_LIB_TARGETS)
672 ADD_DEPENDENCIES(zorbacmd ${_corelibs})
587 SET_TARGET_PROPERTIES(check_core_uris PROPERTIES FOLDER "Modules")673 SET_TARGET_PROPERTIES(check_core_uris PROPERTIES FOLDER "Modules")
588 ENDIF (_num_core GREATER 0)674 ENDIF (_num_core GREATER 0)
589 SET_PROPERTY (GLOBAL PROPERTY ZORBA_URI_FILES)675 SET_PROPERTY (GLOBAL PROPERTY ZORBA_URI_FILES)
@@ -591,6 +677,18 @@
591 #add 'xqdoc' and 'xqdoc-xml' targets677 #add 'xqdoc' and 'xqdoc-xml' targets
592 ADD_XQDOC_TARGETS()678 ADD_XQDOC_TARGETS()
593 ENDIF (PROJECT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)679 ENDIF (PROJECT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
680
681 # Now, do things that should be done at the end of *any* project, not
682 # just the top-level project.
683
684 # Generate project's projectConfig.cmake file.
685 # QQQ need to create an installable version of this too, once we know
686 # how installing a module package should work.
687 GET_PROPERTY (ZORBA_PROJECT_LIBRARIES
688 GLOBAL PROPERTY "${PROJECT_NAME}_LIBRARIES")
689 CONFIGURE_FILE("${Zorba_EXTERNALMODULECONFIG_FILE}"
690 "${PROJECT_BINARY_DIR}/${PROJECT_NAME}Config.cmake" @ONLY)
691
594ENDMACRO (DONE_DECLARING_ZORBA_URIS)692ENDMACRO (DONE_DECLARING_ZORBA_URIS)
595693
596# Initialize expected failures and zorba modules output files when694# Initialize expected failures and zorba modules output files when
@@ -629,56 +727,106 @@
629727
630ENDMACRO(expected_failure)728ENDMACRO(expected_failure)
631729
632# Convenience macro for adding tests in a standard format.730# Convenience macro for adding tests in a standard format. All test
731# cases (.xq files) in "Queries" subdirectory of the named directory
732# will be automatically added for CTest. Each test will be named
733# ${PROJECT_NAME}/<filename>, where <filename> is the path relative to
734# the Queries/ subdirectory.
735#
736# The optional second argument exists for Windows. Normally,
737# EXPECTED_FAILURE() can be used even for tests that crash
738# (segfault). However, on Windows, when a test crashes, it pops up a
739# dialog box. This prevents tests running unattended. Since it is not
740# possible with CMake to remove a test once added,
741# ADD_TEST_DIRECTORY() needs to be told not to add the test at all on
742# Windows platforms. Therefore, after the directory name, you may
743# additional arguments in the form (testname bugnumber testname
744# bugnumber ...) to ADD_TEST_DIRECTORY(). On Windows, the named tests
745# will be skipped entirely. On other platforms, they will be passed to
746# EXPECTED_FAILURE() with the corresponding bug number.
747#
748# This second argument should only be used for test cases that are
749# currently *crashing* on Windows. If the test is simply failing, then
750# you should use EXPECTED_FAILURE() after calling ADD_TEST_DIRECTORY().
751#
633# Parameters:752# Parameters:
634# TEST_DIR - all the .xq files in this directory will be added as tests753# TEST_DIR - all the .xq files in this directory will be added as tests
635# ARGV1 - if this is present, it will be interpreted as a list of754# (additional args) - expected crashing tests, as discussed above.
636# exceptions. The list items will be removed from the list of
637# files found in TEST_DIR.
638MACRO (ADD_TEST_DIRECTORY TEST_DIR)755MACRO (ADD_TEST_DIRECTORY TEST_DIR)
639 # QQQ error-check: Queries directory exists, some tests found...756 # QQQ error-check: Queries directory exists, some tests found...
640 FILE(GLOB_RECURSE TESTFILES FOLLOW_SYMLINKS757 FILE(GLOB_RECURSE TESTFILES FOLLOW_SYMLINKS
641 RELATIVE "${TEST_DIR}/Queries" "${TEST_DIR}/Queries/*.xq")758 RELATIVE "${TEST_DIR}/Queries" "${TEST_DIR}/Queries/*.xq")
642759
643 FOREACH (EXCEPTION ${ARGV1})760 # Convert extra arguments to two lists: test names and bug IDs
644 LIST (REMOVE_ITEM TESTFILES ${EXCEPTION})761 SET (crash_tests)
645 ENDFOREACH (EXCEPTION)762 SET (crash_bugids)
763 SET (known_crashes ${ARGN})
764 LIST (LENGTH known_crashes num_crashes)
765 WHILE (num_crashes GREATER 0)
766 LIST (GET known_crashes 0 _testcase)
767 LIST (APPEND crash_tests ${_testcase})
768 LIST (GET known_crashes 1 _bugid)
769 LIST (APPEND crash_bugids ${_bugid})
770 LIST (REMOVE_AT known_crashes 0 1)
771 MATH (EXPR num_crashes "${num_crashes} - 2")
772 ENDWHILE (num_crashes GREATER 0)
646773
774 IF(WIN32)
775 SET(PATH_SEP ",")
776 ELSE(WIN32)
777 SET(PATH_SEP ":")
778 ENDIF(WIN32)
647 SET(TESTCOUNTER 0)779 SET(TESTCOUNTER 0)
648 FOREACH(TESTFILE ${TESTFILES})780 FOREACH(TESTFILE ${TESTFILES})
649 SET(TESTNAME "${PROJECT_NAME}/${TESTFILE}")781 SET(TESTNAME "${PROJECT_NAME}/${TESTFILE}")
650782
651 IF(WIN32)783 # See if this test is in the known-crashing list
652 SET(PATH_SEP ",")784 SET (_crash_bugid)
653 ELSE(WIN32)785 LIST (FIND crash_tests ${TESTNAME} _crash_idx)
654 SET(PATH_SEP ":")786 IF (${_crash_idx} GREATER -1)
655 ENDIF(WIN32)787 # Get corresponding bug ID
656 ADD_TEST(${TESTNAME} "${Zorba_TESTDRIVER}"788 LIST (GET crash_bugids ${_crash_idx} _crash_bugid)
657 "--rbkt-src" "${TEST_DIR}"789 # Remove from known-crashing list
658 "--module-path" "${CMAKE_BINARY_DIR}/URI_PATH/${PATH_SEP}${SECONDARY_MODULE_PATHS}"790 LIST (REMOVE_AT crash_tests ${_crash_idx})
659 "${TESTFILE}")791 ENDIF (${_crash_idx} GREATER -1)
660792
661 MATH(EXPR TESTCOUNTER ${TESTCOUNTER}+1)793 # On Windows, skip calling ADD_TEST() for any known crashing tests
662 MATH(EXPR TESTMOD "${TESTCOUNTER}%100")794 IF (WIN32 AND (${_crash_idx} GREATER -1) )
663 IF (${TESTMOD} EQUAL 0)795 MESSAGE (STATUS "WARNING: Skipping test case ${TESTNAME} which is expected to crash - bug ${_crash_bugid}")
664 MESSAGE(STATUS "Adding another 100 Tests")796 ELSE (WIN32 AND (${_crash_idx} GREATER -1) )
665 ENDIF (${TESTMOD} EQUAL 0)797 # DEPENDENCY_MODULE_PATH will always start with an appropriate
798 # path separator
799 ADD_TEST(${TESTNAME} "${Zorba_TESTDRIVER}"
800 "--rbkt-src" "${TEST_DIR}"
801 "--module-path"
802 "${CMAKE_BINARY_DIR}/URI_PATH/${PATH_SEP}${DEPENDENCY_MODULE_PATH}"
803 "${TESTFILE}")
804
805 # On non-Windows, call EXPECTED_FAILURE() for known crashes
806 IF (${_crash_idx} GREATER -1)
807 MESSAGE (STATUS "Marking test case ${TESTNAME} as expected to crash - bug ${bugid}")
808 EXPECTED_FAILURE (${TESTNAME} ${_bugid})
809 ENDIF (${_crash_idx} GREATER -1)
810
811 MATH(EXPR TESTCOUNTER ${TESTCOUNTER}+1)
812 MATH(EXPR TESTMOD "${TESTCOUNTER}%100")
813 IF (${TESTMOD} EQUAL 0)
814 MESSAGE(STATUS "Adding another 100 Tests")
815 ENDIF (${TESTMOD} EQUAL 0)
816
817 ENDIF (WIN32 AND (${_crash_idx} GREATER -1) )
818
666 ENDFOREACH(TESTFILE)819 ENDFOREACH(TESTFILE)
820
821 # Ensure that known-crashes list is empty - otherwise some tests were
822 # named that didn't exist
823 IF (NOT "${crash_tests}" STREQUAL "")
824 MESSAGE (FATAL_ERROR "The following non-existing test cases were passed to ADD_TEST_DIRECTORY(): ${crash_tests}")
825 ENDIF (NOT "${crash_tests}" STREQUAL "")
826
667 MESSAGE(STATUS "Added ${TESTCOUNTER} tests in ${TEST_DIR}")827 MESSAGE(STATUS "Added ${TESTCOUNTER} tests in ${TEST_DIR}")
668ENDMACRO (ADD_TEST_DIRECTORY)828ENDMACRO (ADD_TEST_DIRECTORY)
669829
670# Macro to install a basic CMake config file for a module. Provide a
671# source and binary directory. Result will be installed in binary
672# directory. This is a macro because it is called from two different
673# places: ZorbaUse.cmake, and Zorba's modules/CMakeLists.txt.
674MACRO(CREATE_MODULE_CONFIG name src_dir bin_dir)
675 # Set variables referenced in ExternalModuleConfig.cmake.in
676 SET(MODULE_SOURCE_DIR ${src_dir})
677 SET(MODULE_BINARY_DIR ${bin_dir})
678 CONFIGURE_FILE("${Zorba_EXTERNALMODULECONFIG_FILE}"
679 "${MODULE_BINARY_DIR}/${name}Config.cmake" @ONLY)
680ENDMACRO(CREATE_MODULE_CONFIG)
681
682# This macro easies the process of adding test for store dependent830# This macro easies the process of adding test for store dependent
683# executables. It has the same naming convection for the target as the831# executables. It has the same naming convection for the target as the
684# macro that is used to generated store dependent executables (thus,832# macro that is used to generated store dependent executables (thus,
685833
=== modified file 'config/ExternalModuleConfig.cmake.in'
--- config/ExternalModuleConfig.cmake.in 2012-04-11 20:22:52 +0000
+++ config/ExternalModuleConfig.cmake.in 2012-04-27 13:22:48 +0000
@@ -12,12 +12,29 @@
12# See the License for the specific language governing permissions and12# See the License for the specific language governing permissions and
13# limitations under the License.13# limitations under the License.
1414
15IF(WIN32)15IF (WIN32)
16 SET(PATH_SEP ",")16 SET (PATH_SEP ",")
17ELSE(WIN32)17ELSE (WIN32)
18 SET(PATH_SEP ":")18 SET (PATH_SEP ":")
19ENDIF(WIN32)19ENDIF (WIN32)
2020
21# QQQ When all the module versioning and external-module work is21# Probably should have separate URI and LIB paths here someday; will
22# complete, this should contain ONLY MODULE_BINARY_DIR/modules.22# require testdriver to accept --uri-path and --lib-path args
23SET(SECONDARY_MODULE_PATHS "${SECONDARY_MODULE_PATHS}${PATH_SEP}@MODULE_SOURCE_DIR@/src/${PATH_SEP}@MODULE_BINARY_DIR@/src/${PATH_SEP}@MODULE_BINARY_DIR@/modules/")23# Note that this path is meaningless if the module is installed; see
24# bug 966999.
25SET (DEPENDENCY_MODULE_PATH
26 "${DEPENDENCY_MODULE_PATH}${PATH_SEP}@PROJECT_BINARY_DIR@/URI_PATH/${PATH_SEP}${DEPENDENCY_LIB_PATH}${PATH_SEP}@PROJECT_BINARY_DIR@/LIB_PATH/")
27
28# Dynamic libraries created by this project to link against
29SET (@PROJECT_NAME@_LIBRARIES @ZORBA_PROJECT_LIBRARIES@)
30
31# Include directories exported by this project
32SET (@PROJECT_NAME@_INCLUDE_DIRS @ZORBA_PROJECT_INCLUDE_DIRS@)
33
34# Offer a "use file" to the user of this module. For most module
35# packages, this is unnecessary. However it can be utilized by
36# advanced packages which wish to, for example, export a C++ header
37# file to dependent packages. As above, note that this currently is
38# non-functional if this module package is installed; this will only
39# work from a project build directory.
40SET (@PROJECT_NAME@_USE_FILE "@ZORBA_PROJECT_USE_FILE@")
2441
=== modified file 'config/ZorbaUse.cmake'
--- config/ZorbaUse.cmake 2012-04-11 20:22:52 +0000
+++ config/ZorbaUse.cmake 2012-04-27 13:22:48 +0000
@@ -31,7 +31,3 @@
31 # Load Zorba module support macros.31 # Load Zorba module support macros.
32 INCLUDE("${Zorba_CMAKE_MODULES_DIR}/Windows/ProxyFindModule.cmake")32 INCLUDE("${Zorba_CMAKE_MODULES_DIR}/Windows/ProxyFindModule.cmake")
33ENDIF(WIN32)33ENDIF(WIN32)
34
35# Generate project's projectConfig.cmake file.
36CREATE_MODULE_CONFIG(${PROJECT_NAME} "${PROJECT_SOURCE_DIR}"
37 "${PROJECT_BINARY_DIR}")
3834
=== modified file 'doc/cxx/examples/context.cpp'
--- doc/cxx/examples/context.cpp 2012-04-11 20:22:52 +0000
+++ doc/cxx/examples/context.cpp 2012-04-27 13:22:48 +0000
@@ -149,7 +149,11 @@
149 outStream2 << lQuery << std::endl;149 outStream2 << lQuery << std::endl;
150 std::cout << outStream2.str() << std::endl;150 std::cout << outStream2.str() << std::endl;
151151
152#ifndef ZORBA_NO_ICU
152 if (outStream2.str() != "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\nBook 1.1\n")153 if (outStream2.str() != "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\nBook 1.1\n")
154#else
155 if (outStream2.str() != "<?xml version=\"1.0\"?>\nBook 1.1\n")
156#endif /* ZORBA_NO_ICU */
153 {157 {
154 std::cerr << "Test 4 failed with a wrong result : " << std::endl158 std::cerr << "Test 4 failed with a wrong result : " << std::endl
155 << outStream2.str() << std::endl;159 << outStream2.str() << std::endl;
156160
=== modified file 'include/zorba/config.h.cmake'
--- include/zorba/config.h.cmake 2012-04-11 20:22:52 +0000
+++ include/zorba/config.h.cmake 2012-04-27 13:22:48 +0000
@@ -96,6 +96,8 @@
96typedef __int64 int64_t;96typedef __int64 int64_t;
97#endif /* ZORBA_HAVE_INT64_T */97#endif /* ZORBA_HAVE_INT64_T */
9898
99#cmakedefine ZORBA_SIZEOF_WCHAR_T @ZORBA_SIZEOF_WCHAR_T@
100
99// Compiler101// Compiler
100#cmakedefine CLANG102#cmakedefine CLANG
101#cmakedefine MSVC103#cmakedefine MSVC
@@ -148,7 +150,7 @@
148150
149// Zorba features151// Zorba features
150#cmakedefine ZORBA_NO_FULL_TEXT152#cmakedefine ZORBA_NO_FULL_TEXT
151#cmakedefine ZORBA_NO_UNICODE153#cmakedefine ZORBA_NO_ICU
152#cmakedefine ZORBA_NO_XMLSCHEMA154#cmakedefine ZORBA_NO_XMLSCHEMA
153#cmakedefine ZORBA_NUMERIC_OPTIMIZATION155#cmakedefine ZORBA_NUMERIC_OPTIMIZATION
154#cmakedefine ZORBA_VERIFY_PEER_SSL_CERTIFICATE156#cmakedefine ZORBA_VERIFY_PEER_SSL_CERTIFICATE
155157
=== modified file 'include/zorba/pregenerated/diagnostic_list.h'
--- include/zorba/pregenerated/diagnostic_list.h 2012-04-11 20:22:52 +0000
+++ include/zorba/pregenerated/diagnostic_list.h 2012-04-27 13:22:48 +0000
@@ -286,6 +286,10 @@
286286
287extern ZORBA_DLL_PUBLIC XQueryErrorCode FOTY0015;287extern ZORBA_DLL_PUBLIC XQueryErrorCode FOTY0015;
288288
289extern ZORBA_DLL_PUBLIC XQueryErrorCode FOUT1170;
290
291extern ZORBA_DLL_PUBLIC XQueryErrorCode FOUT1190;
292
289extern ZORBA_DLL_PUBLIC XQueryErrorCode XUST0001;293extern ZORBA_DLL_PUBLIC XQueryErrorCode XUST0001;
290294
291extern ZORBA_DLL_PUBLIC XQueryErrorCode XUST0002;295extern ZORBA_DLL_PUBLIC XQueryErrorCode XUST0002;
@@ -610,16 +614,18 @@
610614
611extern ZORBA_DLL_PUBLIC ZorbaErrorCode ZDDY0030_INDEX_RANGE_GENERAL_PROBE_NOT_ALLOWED;615extern ZORBA_DLL_PUBLIC ZorbaErrorCode ZDDY0030_INDEX_RANGE_GENERAL_PROBE_NOT_ALLOWED;
612616
613extern ZORBA_DLL_PUBLIC ZorbaErrorCode ZDDY0034_INDEX_RANGE_VALUE_PROBE_BAD_KEY_TYPES;
614
615extern ZORBA_DLL_PUBLIC ZorbaErrorCode ZDDY0035_INDEX_GENERAL_INSERT;
616
617extern ZORBA_DLL_PUBLIC ZorbaErrorCode ZDDY0031_IC_NOT_DECLARED;617extern ZORBA_DLL_PUBLIC ZorbaErrorCode ZDDY0031_IC_NOT_DECLARED;
618618
619extern ZORBA_DLL_PUBLIC ZorbaErrorCode ZDDY0032_IC_NOT_ACTIVATED;619extern ZORBA_DLL_PUBLIC ZorbaErrorCode ZDDY0032_IC_NOT_ACTIVATED;
620620
621extern ZORBA_DLL_PUBLIC ZorbaErrorCode ZDDY0033_IC_NOT_MET;621extern ZORBA_DLL_PUBLIC ZorbaErrorCode ZDDY0033_IC_NOT_MET;
622622
623extern ZORBA_DLL_PUBLIC ZorbaErrorCode ZDDY0034_INDEX_RANGE_VALUE_PROBE_BAD_KEY_TYPES;
624
625extern ZORBA_DLL_PUBLIC ZorbaErrorCode ZDDY0035_INDEX_GENERAL_INSERT;
626
627extern ZORBA_DLL_PUBLIC ZorbaErrorCode ZDDY0036_NON_ROOT_NODE_DELETION;
628
623extern ZORBA_DLL_PUBLIC ZorbaErrorCode ZDST0001_COLLECTION_ALREADY_DECLARED;629extern ZORBA_DLL_PUBLIC ZorbaErrorCode ZDST0001_COLLECTION_ALREADY_DECLARED;
624630
625extern ZORBA_DLL_PUBLIC ZorbaErrorCode ZDST0002_COLLECTION_ALREADY_IMPORTED;631extern ZORBA_DLL_PUBLIC ZorbaErrorCode ZDST0002_COLLECTION_ALREADY_IMPORTED;
@@ -800,13 +806,13 @@
800806
801namespace jerr {807namespace jerr {
802808
809#if defined(ZORBA_WITH_JSON)
803extern ZORBA_DLL_PUBLIC JSONiqErrorCode JNSE0012;810extern ZORBA_DLL_PUBLIC JSONiqErrorCode JNSE0012;
804811
805extern ZORBA_DLL_PUBLIC JSONiqErrorCode JNSE0013;812extern ZORBA_DLL_PUBLIC JSONiqErrorCode JNSE0013;
806813
807extern ZORBA_DLL_PUBLIC JSONiqErrorCode JNSE0014;814extern ZORBA_DLL_PUBLIC JSONiqErrorCode JNSE0014;
808815
809#if defined(ZORBA_WITH_JSON)
810extern ZORBA_DLL_PUBLIC JSONiqErrorCode JNTY0002;816extern ZORBA_DLL_PUBLIC JSONiqErrorCode JNTY0002;
811817
812extern ZORBA_DLL_PUBLIC JSONiqErrorCode JNTY0003;818extern ZORBA_DLL_PUBLIC JSONiqErrorCode JNTY0003;
813819
=== modified file 'include/zorba/properties_base.h'
--- include/zorba/properties_base.h 2012-04-11 20:22:52 +0000
+++ include/zorba/properties_base.h 2012-04-27 13:22:48 +0000
@@ -101,8 +101,44 @@
101 std::vector<std::string>& val,101 std::vector<std::string>& val,
102 unsigned delta);102 unsigned delta);
103103
104/**
105 * \brief This class provides access to global properties.
106 *
107 * This class provides access to global properties set for Zorba in environment
108 * and configuration file.
109 * It is available using Zorba.getProperties() method.
110 * \see { Zorba::getProperties() }
111 */
112class ZORBA_DLL_PUBLIC PropertiesGlobal : public PropertiesBase
113{
114public:
115 virtual ~PropertiesGlobal() {}
116
117 /**
118 * \brief Get global JVM classpath property.
119 *
120 * Before the JVM is started this will return the classpath set by
121 * command line option, the CLASSPATH environment variable and in Zorba
122 * config file.
123 *
124 * After the JVM is started this will contain in addition the paths to jars
125 * used by modules that make use of the JVM.
126 */
127 virtual void getJVMClassPath(std::string & jvmClasspath) {}
128
129 /**
130 * \brief Set global JVM classpath property.
131 *
132 * This method should be used to set additional JVM classpath for modules
133 * that make use of JVM. This will overide the classpath set by CLASSPATH
134 * environment variable or Zorba config file.
135 *
136 * Once the JVM is started this method doesn't have any effect.
137 */
138 virtual void setJVMClassPath(const std::string & jvmClasspath) {}
139};
140
104}141}
105
106#endif // ZORBA_PROPERTIES_BASE_H142#endif // ZORBA_PROPERTIES_BASE_H
107/*143/*
108 * Local variables:144 * Local variables:
109145
=== modified file 'include/zorba/static_context.h'
--- include/zorba/static_context.h 2012-04-11 20:22:52 +0000
+++ include/zorba/static_context.h 2012-04-27 13:22:48 +0000
@@ -26,9 +26,13 @@
26#include <zorba/function.h>26#include <zorba/function.h>
27#include <zorba/annotation.h>27#include <zorba/annotation.h>
28#include <zorba/smart_ptr.h>28#include <zorba/smart_ptr.h>
29#include <zorba/smart_ptr.h>
29#ifndef ZORBA_NO_FULL_TEXT30#ifndef ZORBA_NO_FULL_TEXT
30#include <zorba/thesaurus.h>31#include <zorba/thesaurus.h>
31#endif /* ZORBA_NO_FULL_TEXT */32#endif /* ZORBA_NO_FULL_TEXT */
33#include <zorba/zorba.h>
34#include <zorba/store_manager.h>
35#include <zorba/zorba_exception.h>
3236
33namespace zorba {37namespace zorba {
3438
@@ -685,6 +689,38 @@
685 */689 */
686 virtual void690 virtual void
687 getFullLibPath(std::vector<String>& aLibPath) const = 0;691 getFullLibPath(std::vector<String>& aLibPath) const = 0;
692
693 /** \brief Fetches an resource refered to by the given URI.
694 *
695 * Resolution is done using the URI mappers and resolvers registered
696 * in this static context. If no such mappers or resolvers have been
697 * registered, the built-in ones are used.
698 *
699 * The default EntityKind for resources fetched by this function
700 * is "SOME_CONTENT".
701 *
702 * @param aURI the name of the resource to fetch
703 *
704 * @return the fetched resource
705 */
706 virtual Item
707 fetch(const String& aURI) const = 0;
708
709 /** \brief Fetches an resource refered to by the given URI.
710 *
711 * Resolution is done using the URI mappers and resolvers registered
712 * in this static context. If no such mappers or resolvers have been
713 * registered, the built-in ones are used.
714 *
715 * @param aURI the name of the resource to fetch
716 *
717 * @param aEntityKind the kind of the entity to fetch (i.e.
718 * SOME_CONTENT, SCHEMA, MODULE, THESAURUS, or STOP_WORDS)
719 *
720 * @return the fetched resource
721 */
722 virtual Item
723 fetch(const String& aURI, const String& aEntityKind) const = 0;
688};724};
689725
690} /* namespace zorba */726} /* namespace zorba */
691727
=== modified file 'include/zorba/util/file.h'
--- include/zorba/util/file.h 2012-04-11 20:22:52 +0000
+++ include/zorba/util/file.h 2012-04-27 13:22:48 +0000
@@ -24,6 +24,7 @@
24#include <cstdio>24#include <cstdio>
25#include <string>25#include <string>
26#include <time.h>26#include <time.h>
27#include <vector>
2728
28#include <zorba/config.h>29#include <zorba/config.h>
29#include <zorba/file.h>30#include <zorba/file.h>
@@ -84,6 +85,7 @@
84 void mkdir();85 void mkdir();
85 void deep_mkdir();86 void deep_mkdir();
86 void rmdir(bool ignore = true);87 void rmdir(bool ignore = true);
88 void lsdir(std::vector<std::string> &list);
87#ifndef _WIN32_WCE89#ifndef _WIN32_WCE
88 void chdir();90 void chdir();
89#endif91#endif
9092
=== modified file 'include/zorba/util/time.h'
--- include/zorba/util/time.h 2012-04-11 20:22:52 +0000
+++ include/zorba/util/time.h 2012-04-27 13:22:48 +0000
@@ -178,7 +178,7 @@
178 178
179 inline long get_walltime_in_millis(const walltime& t)179 inline long get_walltime_in_millis(const walltime& t)
180 {180 {
181 return t.time * 1000 + t.millitm;181 return (long)(t.time * 1000 + t.millitm);
182 }182 }
183183
184#else /* not Windows, and no clock_gettime() */184#else /* not Windows, and no clock_gettime() */
185185
=== modified file 'include/zorba/xmldatamanager.h'
--- include/zorba/xmldatamanager.h 2012-04-11 20:22:52 +0000
+++ include/zorba/xmldatamanager.h 2012-04-27 13:22:48 +0000
@@ -187,6 +187,8 @@
187 ParseOptions& aOptions) const = 0;187 ParseOptions& aOptions) const = 0;
188188
189 /** \brief Fetches an resource refered to by the given URI.189 /** \brief Fetches an resource refered to by the given URI.
190 *
191 * @deprecated this function has been replaced by StaticContext::fetch.
190 */192 */
191 virtual Item193 virtual Item
192 fetch(const String& aURI) const = 0;194 fetch(const String& aURI) const = 0;
193195
=== modified file 'include/zorba/zorba.h'
--- include/zorba/zorba.h 2012-04-11 20:22:52 +0000
+++ include/zorba/zorba.h 2012-04-27 13:22:48 +0000
@@ -34,14 +34,18 @@
34#include <zorba/xquery.h>34#include <zorba/xquery.h>
35#include <zorba/zorba_string.h>35#include <zorba/zorba_string.h>
36#include <zorba/iterator.h>36#include <zorba/iterator.h>
37#include <zorba/properties_base.h>
3738
38namespace zorba {39namespace zorba {
3940
40/**41/**
41 * The Zorba class is the single point of access to the %Zorba engine.42 * The Zorba class is the single point of access to the %Zorba engine.
42 * There exists one instance of the Zorba class per process.43 * There exists one instance of the Zorba class per process.
43 * It can be used to (1) create and compile queries, (2) create static contexts,44 * It can be used to (1) create and compile queries,
44 * (3) provides access to the XmlDataManager, and (4) provides access to the ItemFactory.45 * (2) create static contexts,
46 * (3) provides access to the XmlDataManager,
47 * (4) provides access to the ItemFactory, and
48 * (5) provides access to the PropertiesGlobal.
45 */49 */
46class ZORBA_DLL_PUBLIC Zorba50class ZORBA_DLL_PUBLIC Zorba
47{51{
@@ -301,7 +305,7 @@
301 virtual StaticContext_t305 virtual StaticContext_t
302 createStaticContext(DiagnosticHandler* aDiagnosticHandler = 0) = 0;306 createStaticContext(DiagnosticHandler* aDiagnosticHandler = 0) = 0;
303307
304 /** \brief Gets the singelton instance of the ItemFactory.308 /** \brief Gets the singleton instance of the ItemFactory.
305 *309 *
306 * @return ItemFactory the singleton instance of the ItemFactory.310 * @return ItemFactory the singleton instance of the ItemFactory.
307 */311 */
@@ -310,18 +314,24 @@
310314
311 /** \brief Gets the singleton instance of the XmlDataManager object.315 /** \brief Gets the singleton instance of the XmlDataManager object.
312 *316 *
313 * @return XmlDataManager the singelton instance of the XmlDataManager.317 * @return XmlDataManager the singleton instance of the XmlDataManager.
314 */318 */
315 virtual XmlDataManager*319 virtual XmlDataManager*
316 getXmlDataManager() = 0;320 getXmlDataManager() = 0;
317321
318 /** \brief Gets the singleton instance of Zorba's audit provider object.322 /** \brief Gets the singleton instance of Zorba's audit provider object.
319 *323 *
320 * @return audit::Provider the singelton instance of Zorba's audit provider.324 * @return audit::Provider the singeleton instance of Zorba's audit provider.
321 */325 */
322 virtual audit::Provider*326 virtual audit::Provider*
323 getAuditProvider() = 0;327 getAuditProvider() = 0;
324328
329 /** \brief Gets the singleton instance of Zorba's properties object.
330 *
331 * @return zorba::Properties the singleton instance of Zorba's properties object.
332 */
333 virtual PropertiesGlobal* getPropertiesGlobal() = 0;
334
325}; /* class Zorba */335}; /* class Zorba */
326336
327337
328338
=== modified file 'modules/CMakeLists.txt'
--- modules/CMakeLists.txt 2012-04-11 20:22:52 +0000
+++ modules/CMakeLists.txt 2012-04-27 13:22:48 +0000
@@ -21,13 +21,19 @@
21# named "zorba_modules" as a sibling to the main Zorba source21# named "zorba_modules" as a sibling to the main Zorba source
22# directory.22# directory.
2323
24# First, configure the moduleConfig.cmake file for each module24# This is complicated and more than a little hacky. We need to add all
25# project. We must do this "manually" before doing any25# the module subdirectories, but some may depend on others so we can't
26# ADD_SUBDIRECTORY()s, so that all the config files are built and26# simply add them alphabetically. Here we determine their project
27# ready for other modules' FIND_PACKAGE() calls. We also add all27# names and dependencies by manually reading their CMakeLists.txt
28# module build dirs to CMAKE_PREFIX_PATH for the same reason.28# files (as text files). We form a directed graph (which isn't easy in
29SET (project_regex "[Pp][Rr][Oo][Jj][Ee][Cc][Tt]")29# CMake) then produce a topological sort to load the modules in
30FILE (GLOB modules_dir_items RELATIVE "${ZORBA_MODULES_DIR}" "${ZORBA_MODULES_DIR}/[a-zA-Z0-9]*")30# order. Note that this will not work if there are cyclical
31# dependencies between modules; if we ever need that ability, this
32# will get more complicated.
33
34FILE (GLOB modules_dir_items
35 RELATIVE "${ZORBA_MODULES_DIR}"
36 "${ZORBA_MODULES_DIR}/[a-zA-Z0-9]*")
3137
32# Filter out non-directories38# Filter out non-directories
33SET (module_dirs)39SET (module_dirs)
@@ -37,19 +43,27 @@
37 ENDIF (IS_DIRECTORY "${ZORBA_MODULES_DIR}/${module_dir}")43 ENDIF (IS_DIRECTORY "${ZORBA_MODULES_DIR}/${module_dir}")
38ENDFOREACH (module_dir)44ENDFOREACH (module_dir)
3945
46# First, form a simple list of all known module projects in the
47# variable "module_projects". Also, for each project, set a variable
48# named eg. "zorba-email-module_DIR" with the path to that project's
49# directory, relative to ZORBA_MODULES_DIR.
50SET (project_regex "[Pp][Rr][Oo][Jj][Ee][Cc][Tt] *\\( *([^ )]*)")
51SET (module_projects)
40FOREACH (module_dir ${module_dirs})52FOREACH (module_dir ${module_dirs})
41 # This is really kind of hacky, but I don't know a better solution without
42 # introducing some sort of inter-module dependency tracking and requiring
43 # consistent directory naming for external modules. What we do here is
44 # read the module's CMakeLists.txt (as a text file), searching for the
45 # PROJECT() declaration, so we can extract the name of the CMake project.
46 SET (module_project)53 SET (module_project)
47 SET (cmakelists)54 SET (cmakelists_file "${ZORBA_MODULES_DIR}/${module_dir}/CMakeLists.txt")
48 FILE (STRINGS "${ZORBA_MODULES_DIR}/${module_dir}/CMakeLists.txt" cmakelists55 FILE (STRINGS "${cmakelists_file}" cmakelists REGEX "${project_regex}")
49 REGEX ${project_regex})
50 FOREACH (line ${cmakelists})56 FOREACH (line ${cmakelists})
51 IF (line MATCHES "${project_regex} *\\(([^)]*)\\)")57
52 SET (module_project ${CMAKE_MATCH_1})58 IF (line MATCHES "${project_regex}")
59 IF (NOT "${module_project}" STREQUAL "")
60 MESSAGE (FATAL_ERROR
61 "${cmakelists_file} contains duplicate PROJECT() statements - "
62 "cannot parse!")
63 ENDIF (NOT "${module_project}" STREQUAL "")
64 SET (module_project "${CMAKE_MATCH_1}")
65 LIST (APPEND module_projects "${module_project}")
66 SET ("${module_project}_DIR" "${module_dir}")
5367
54 # Print the found module name68 # Print the found module name
55 SET (status "Found module project ${module_project}")69 SET (status "Found module project ${module_project}")
@@ -63,8 +77,7 @@
63 MESSAGE (STATUS "${status}")77 MESSAGE (STATUS "${status}")
64 MESSAGE (STATUS "${border}")78 MESSAGE (STATUS "${border}")
6579
66 BREAK ()80 ENDIF (line MATCHES "${project_regex}")
67 ENDIF (line MATCHES "${project_regex} *\\(([^)]*)\\)")
68 ENDFOREACH (line)81 ENDFOREACH (line)
6982
70 IF (NOT module_project)83 IF (NOT module_project)
@@ -72,14 +85,77 @@
72 "does not contain a recognizable CMake project.")85 "does not contain a recognizable CMake project.")
73 ENDIF (NOT module_project)86 ENDIF (NOT module_project)
7487
75 SET (module_builddir "${CMAKE_BINARY_DIR}/zorba_modules/${module_project}")88ENDFOREACH (module_dir)
76 FILE (MAKE_DIRECTORY "${module_builddir}")89
77 CREATE_MODULE_CONFIG (${module_project} "${ZORBA_MODULES_DIR}/${module_dir}"90# Next, form the DAG. This comprises one list containing only those
78 "${module_builddir}")91# module projects that some other module project depends on
79 LIST (APPEND CMAKE_PREFIX_PATH "${module_builddir}")92# (dep_module_projects), and a series of CMake variables named
80 #SET (ZORBA_EXTERNAL_MODULES_SRCS ${ZORBA_EXTERNAL_MODULES_SRCS} ${ZORBA_MODULES_DIR}/${module_dir}/src)93# eg. "zorba-email-module_DEPS" containing the module projects that
81ENDFOREACH (module_dir)94# the named project depends on. Doing this unfortunately requires us
82#SET (ZORBA_EXTERNAL_MODULES_SRCS ${ZORBA_EXTERNAL_MODULES_SRCS} PARENT_SCOPE)95# to read through all CMakeLists.txt files again.
96SET (find_package_regex
97 "[Ff][Ii][Nn][Dd]_[Pp][Aa][Cc][Kk][Aa][Gg][Ee] *\\( *([^ )]*)")
98SET (dep_module_projects)
99FOREACH (module_dir ${module_dirs})
100 SET (module_project)
101 SET (cmakelists_file "${ZORBA_MODULES_DIR}/${module_dir}/CMakeLists.txt")
102 FILE (STRINGS "${cmakelists_file}" cmakelists
103 REGEX "${project_regex}|${find_package_regex}")
104 FOREACH (line ${cmakelists})
105 IF (line MATCHES "${project_regex}")
106 # Don't have to do error checking here; was done in last pass.
107 SET (module_project "${CMAKE_MATCH_1}")
108 ELSEIF (line MATCHES "${find_package_regex}")
109 SET (dependee ${CMAKE_MATCH_1})
110 # Ensure this dependency is a known module project, and not some
111 # other dependency like "Zorba" - don't want those in the DAG.
112 LIST (FIND module_projects "${dependee}" is_known)
113 IF (is_known GREATER -1)
114 message (STATUS "${module_project} depends on ${dependee}")
115 # Save the dependency in a variable based on the current project
116 LIST (APPEND "${module_project}_DEPS" ${dependee})
117 # Also add this dependee to dep_module_projects
118 LIST (APPEND dep_module_projects ${dependee})
119 ENDIF (is_known GREATER -1)
120 ENDIF (line MATCHES "${project_regex}")
121 ENDFOREACH (line)
122
123ENDFOREACH (module_dir)
124
125
126# Now, transform the DAG into a dependency-ordered list. See
127# http://en.wikipedia.org/wiki/Topological_sorting .
128SET (no_deps)
129SET (visited)
130SET (ordered_modules)
131MACRO (VISIT mod_name)
132 LIST (FIND visited "${mod_name}" is_visited)
133 IF (is_visited EQUAL -1)
134 # Haven't seen this module before; iterate through modules that depend on it
135 LIST (APPEND visited "${mod_name}")
136 FOREACH (depender ${${mod_name}_DEPS})
137 VISIT ("${depender}")
138 ENDFOREACH (depender)
139 # Now that all modules that depend on it have been added, add this one
140 LIST (APPEND ordered_modules "${mod_name}")
141 ELSE (is_visited EQUAL -1)
142 ENDIF (is_visited EQUAL -1)
143ENDMACRO (VISIT)
144# Annoying - LIST(REMOVE_DUPLICATES) dies if the list is empty.
145LIST (LENGTH dep_module_projects num_deps)
146IF (num_deps GREATER 0)
147 LIST (REMOVE_DUPLICATES dep_module_projects)
148ENDIF (num_deps GREATER 0)
149FOREACH (module_project ${module_projects})
150 # Only initially visit those modules projects that do NOT have any
151 # module projects depending on them; that is, only visit those module
152 # projects that are NOT in dep_module_projects.
153 LIST (FIND dep_module_projects "${module_project}" is_dep)
154 IF (is_dep EQUAL -1)
155 VISIT (${module_project})
156 ENDIF (is_dep EQUAL -1)
157
158ENDFOREACH (module_project)
83159
84# Each of these projects will also want to be able to160# Each of these projects will also want to be able to
85# FIND_PACKAGE(Zorba), so add our own build dir to the CMake module161# FIND_PACKAGE(Zorba), so add our own build dir to the CMake module
@@ -89,9 +165,16 @@
89# Now, iterate through all the module projects again and actually add165# Now, iterate through all the module projects again and actually add
90# them to this Zorba project. Create a binary directory for them166# them to this Zorba project. Create a binary directory for them
91# inside our own.167# inside our own.
92FOREACH (module_dir ${module_dirs})168FOREACH (module_project ${ordered_modules})
169 # Create the module binary directory and add it to CMAKE_PREFIX_PATH
170 # so other modules can find it. Then, add the module project
171 # directory.
172 SET (module_dir "${${module_project}_DIR}")
173 SET (module_builddir "${CMAKE_BINARY_DIR}/zorba_modules/${module_project}")
174 FILE (MAKE_DIRECTORY "${module_builddir}")
175 LIST (APPEND CMAKE_PREFIX_PATH "${module_builddir}")
93 ADD_SUBDIRECTORY("${ZORBA_MODULES_DIR}/${module_dir}"176 ADD_SUBDIRECTORY("${ZORBA_MODULES_DIR}/${module_dir}"
94 "${CMAKE_BINARY_DIR}/zorba_modules/zorba_${module_dir}_module")177 "${CMAKE_BINARY_DIR}/zorba_modules/${module_project}")
95ENDFOREACH (module_dir)178ENDFOREACH (module_project)
96179
97MESSAGE(STATUS "End modules")180MESSAGE(STATUS "End modules")
98181
=== modified file 'modules/ExternalModules.conf'
--- modules/ExternalModules.conf 2012-04-11 20:22:52 +0000
+++ modules/ExternalModules.conf 2012-04-27 13:22:48 +0000
@@ -32,7 +32,7 @@
32excel bzr lp:zorba/excel-module zorba-2.2 32excel bzr lp:zorba/excel-module zorba-2.2
33geo bzr lp:zorba/geo-module zorba-2.2 33geo bzr lp:zorba/geo-module zorba-2.2
34http-client bzr lp:zorba/http-client-module zorba-2.2 34http-client bzr lp:zorba/http-client-module zorba-2.2
35image bzr lp:zorba/image-module zorba-2.2 35image bzr lp:zorba/image-module 1.0
36languages bzr lp:zorba/languages-module zorba-2.2 36languages bzr lp:zorba/languages-module zorba-2.2
37oauth bzr lp:zorba/oauth-module zorba-2.2 37oauth bzr lp:zorba/oauth-module zorba-2.2
38process bzr lp:zorba/process-module zorba-2.2 38process bzr lp:zorba/process-module zorba-2.2
@@ -40,3 +40,5 @@
40system bzr lp:zorba/system-module zorba-2.2 40system bzr lp:zorba/system-module zorba-2.2
41xqxq bzr lp:zorba/xqxq-module zorba-2.2 41xqxq bzr lp:zorba/xqxq-module zorba-2.2
42email bzr lp:zorba/email-module zorba-2.2 42email bzr lp:zorba/email-module zorba-2.2
43util-jvm bzr lp:zorba/util-jvm-module
44schema-tools bzr lp:zorba/schema-tools-module
4345
=== modified file 'modules/com/zorba-xquery/www/modules/converters/json.xq'
--- modules/com/zorba-xquery/www/modules/converters/json.xq 2012-03-08 23:31:02 +0000
+++ modules/com/zorba-xquery/www/modules/converters/json.xq 2012-04-27 13:22:48 +0000
@@ -100,7 +100,7 @@
100import schema namespace json-options =100import schema namespace json-options =
101 "http://www.zorba-xquery.com/modules/converters/json-options";101 "http://www.zorba-xquery.com/modules/converters/json-options";
102102
103declare namespace ann = "http://www.zorba-xquery.com/annotations";103declare namespace an = "http://www.zorba-xquery.com/annotations";
104declare namespace err = "http://www.w3.org/2005/xqt-errors";104declare namespace err = "http://www.w3.org/2005/xqt-errors";
105declare namespace zerr = "http://www.zorba-xquery.com/errors";105declare namespace zerr = "http://www.zorba-xquery.com/errors";
106106
@@ -252,7 +252,7 @@
252 $options as item()?252 $options as item()?
253) as element()* external;253) as element()* external;
254254
255declare %ann:streamable %private function json:serialize-internal(255declare %an:streamable %private function json:serialize-internal(
256 $xml as item()*,256 $xml as item()*,
257 $options as item()?257 $options as item()?
258) as xs:string external;258) as xs:string external;
259259
=== modified file 'modules/com/zorba-xquery/www/modules/datetime.xq'
--- modules/com/zorba-xquery/www/modules/datetime.xq 2012-04-11 20:22:52 +0000
+++ modules/com/zorba-xquery/www/modules/datetime.xq 2012-04-27 13:22:48 +0000
@@ -28,7 +28,7 @@
28 :28 :
29 :)29 :)
30module namespace datetime = "http://www.zorba-xquery.com/modules/datetime";30module namespace datetime = "http://www.zorba-xquery.com/modules/datetime";
31declare namespace ann = "http://www.zorba-xquery.com/annotations";31declare namespace an = "http://www.zorba-xquery.com/annotations";
32declare namespace ver = "http://www.zorba-xquery.com/options/versioning";32declare namespace ver = "http://www.zorba-xquery.com/options/versioning";
33declare option ver:module-version "2.0";33declare option ver:module-version "2.0";
3434
@@ -39,7 +39,7 @@
39 :39 :
40 : @return the non-stable datetime value40 : @return the non-stable datetime value
41 :)41 :)
42declare %ann:nondeterministic function datetime:current-dateTime ( ) as xs:dateTime external;42declare %an:nondeterministic function datetime:current-dateTime ( ) as xs:dateTime external;
4343
44(:~44(:~
45 : Return the current time value.45 : Return the current time value.
@@ -48,7 +48,7 @@
48 :48 :
49 : @return the non-stable time value49 : @return the non-stable time value
50 :)50 :)
51declare %ann:nondeterministic function datetime:current-time ( ) as xs:time external;51declare %an:nondeterministic function datetime:current-time ( ) as xs:time external;
5252
53(:~53(:~
54 : Return the current date value.54 : Return the current date value.
@@ -57,11 +57,11 @@
57 :57 :
58 : @return the non-stable date value58 : @return the non-stable date value
59 :)59 :)
60declare %ann:nondeterministic function datetime:current-date ( ) as xs:date external;60declare %an:nondeterministic function datetime:current-date ( ) as xs:date external;
6161
62(:~62(:~
63 : Return the the number of milliseconds since the Epoch.63 : Return the the number of milliseconds since the Epoch.
64 :64 :
65 : @return the said number of milliseconds.65 : @return the said number of milliseconds.
66 :)66 :)
67declare %ann:nondeterministic function datetime:timestamp ( ) as xs:long external;67declare %an:nondeterministic function datetime:timestamp ( ) as xs:long external;
6868
=== modified file 'modules/com/zorba-xquery/www/modules/fetch.xq'
--- modules/com/zorba-xquery/www/modules/fetch.xq 2012-04-11 20:22:52 +0000
+++ modules/com/zorba-xquery/www/modules/fetch.xq 2012-04-27 13:22:48 +0000
@@ -33,7 +33,7 @@
33 :)33 :)
34module namespace fetch = "http://www.zorba-xquery.com/modules/fetch";34module namespace fetch = "http://www.zorba-xquery.com/modules/fetch";
3535
36declare namespace ann = "http://www.zorba-xquery.com/annotations";36declare namespace an = "http://www.zorba-xquery.com/annotations";
3737
38declare namespace zerr = "http://www.zorba-xquery.com/errors";38declare namespace zerr = "http://www.zorba-xquery.com/errors";
3939
@@ -49,7 +49,7 @@
49 : URI Resolvers</a>. Therefore, it queries all URI mappers49 : URI Resolvers</a>. Therefore, it queries all URI mappers
50 : and resolvers with kind <tt>EntityData::SOME_CONTENT</tt>.</p>50 : and resolvers with kind <tt>EntityData::SOME_CONTENT</tt>.</p>
51 :51 :
52 : <p>The function is annotated with the <tt>ann:streamable</tt>52 : <p>The function is annotated with the <tt>an:streamable</tt>
53 : annotation, that is it returns a streamable string. A streamable53 : annotation, that is it returns a streamable string. A streamable
54 : string can only be consumed once. Please see section "Streamable Strings"54 : string can only be consumed once. Please see section "Streamable Strings"
55 : in the <a href="../../html/options_and_annotations.html">55 : in the <a href="../../html/options_and_annotations.html">
@@ -65,7 +65,7 @@
65 : @see <a href="../../html/uriresolvers.html">URI Resolvers</a>.65 : @see <a href="../../html/uriresolvers.html">URI Resolvers</a>.
66 : @see <a href="../../html/options_and_annotations.html">Documentation of Zorba's annotations</a>.66 : @see <a href="../../html/options_and_annotations.html">Documentation of Zorba's annotations</a>.
67 :)67 :)
68declare %ann:streamable function fetch:content($uri as xs:string) as xs:string68declare %an:streamable function fetch:content($uri as xs:string) as xs:string
69{69{
70 fetch:content($uri, "SOME_CONTENT")70 fetch:content($uri, "SOME_CONTENT")
71};71};
@@ -79,7 +79,7 @@
79 : URI Resolvers</a>. Therefore, it queries all URI mappers79 : URI Resolvers</a>. Therefore, it queries all URI mappers
80 : and resolvers with the specified entity kind.</p>80 : and resolvers with the specified entity kind.</p>
81 :81 :
82 : <p>The function is annotated with the <tt>ann:streamable</tt>82 : <p>The function is annotated with the <tt>an:streamable</tt>
83 : annotation, that is it returns a streamable string. A streamable83 : annotation, that is it returns a streamable string. A streamable
84 : string can only be consumed once. Please see section "Streamable Strings"84 : string can only be consumed once. Please see section "Streamable Strings"
85 : in the <a href="../../html/options_and_annotations.html">85 : in the <a href="../../html/options_and_annotations.html">
@@ -97,4 +97,4 @@
97 : @see <a href="../../html/options_and_annotations.html">Documentation of Zorba's annotations</a>.97 : @see <a href="../../html/options_and_annotations.html">Documentation of Zorba's annotations</a>.
98 :)98 :)
9999
100declare %ann:streamable function fetch:content($uri as xs:string, $entityKind as xs:string) as xs:string external;100declare %an:streamable function fetch:content($uri as xs:string, $entityKind as xs:string) as xs:string external;
101101
=== modified file 'modules/com/zorba-xquery/www/modules/http-client.xq'
--- modules/com/zorba-xquery/www/modules/http-client.xq 2012-04-11 20:22:52 +0000
+++ modules/com/zorba-xquery/www/modules/http-client.xq 2012-04-27 13:22:48 +0000
@@ -248,7 +248,7 @@
248248
249import schema namespace http-schema = "http://expath.org/ns/http-client";249import schema namespace http-schema = "http://expath.org/ns/http-client";
250250
251declare namespace ann = "http://www.zorba-xquery.com/annotations";251declare namespace an = "http://www.zorba-xquery.com/annotations";
252declare namespace ver = "http://www.zorba-xquery.com/options/versioning";252declare namespace ver = "http://www.zorba-xquery.com/options/versioning";
253declare namespace err = "http://www.w3.org/2005/xqt-errors";253declare namespace err = "http://www.w3.org/2005/xqt-errors";
254254
@@ -291,7 +291,7 @@
291 : @example test/rbkt/Queries/zorba/http-client/send-request/send-request_href.xq291 : @example test/rbkt/Queries/zorba/http-client/send-request/send-request_href.xq
292 : @example test/rbkt/Queries/zorba/http-client/send-request/http3-post.xq292 : @example test/rbkt/Queries/zorba/http-client/send-request/http3-post.xq
293 :)293 :)
294declare %ann:sequential function http:send-request(294declare %an:sequential function http:send-request(
295 $request as element(http-schema:request)?,295 $request as element(http-schema:request)?,
296 $href as xs:string?,296 $href as xs:string?,
297 $bodies as item()*) as item()+ 297 $bodies as item()*) as item()+
@@ -334,7 +334,7 @@
334 :334 :
335 : @example test/rbkt/Queries/zorba/http-client/get/get_text.xq335 : @example test/rbkt/Queries/zorba/http-client/get/get_text.xq
336 :)336 :)
337declare %ann:nondeterministic function http:get($href as xs:string) as item()+337declare %an:nondeterministic function http:get($href as xs:string) as item()+
338{338{
339 http:http-nondeterministic-impl(validate {<http-schema:request method="GET" href="{$href}" follow-redirect="true"/>}, (), ())339 http:http-nondeterministic-impl(validate {<http-schema:request method="GET" href="{$href}" follow-redirect="true"/>}, (), ())
340};340};
@@ -353,7 +353,7 @@
353 :353 :
354 : @example test/rbkt/Queries/zorba/http-client/get-node/get-node_xml_query.xq354 : @example test/rbkt/Queries/zorba/http-client/get-node/get-node_xml_query.xq
355 :)355 :)
356declare %ann:nondeterministic function http:get-node($href as xs:string) as item()+356declare %an:nondeterministic function http:get-node($href as xs:string) as item()+
357{357{
358 http:http-nondeterministic-impl(validate {<http-schema:request method="GET" href="{$href}" follow-redirect="true" override-media-type="text/xml; charset=utf-8"/>}, (), ())358 http:http-nondeterministic-impl(validate {<http-schema:request method="GET" href="{$href}" follow-redirect="true" override-media-type="text/xml; charset=utf-8"/>}, (), ())
359};359};
@@ -373,7 +373,7 @@
373 :373 :
374 : @example test/rbkt/Queries/zorba/http-client/get-text/get-text_xml_query.xq 374 : @example test/rbkt/Queries/zorba/http-client/get-text/get-text_xml_query.xq
375 :)375 :)
376declare %ann:nondeterministic function http:get-text($href as xs:string) as item()+376declare %an:nondeterministic function http:get-text($href as xs:string) as item()+
377{377{
378 http:http-nondeterministic-impl(validate {<http-schema:request method="GET" href="{$href}" follow-redirect="true" override-media-type="text/plain; charset=utf-8"/>}, (), ())378 http:http-nondeterministic-impl(validate {<http-schema:request method="GET" href="{$href}" follow-redirect="true" override-media-type="text/plain; charset=utf-8"/>}, (), ())
379};379};
@@ -393,7 +393,7 @@
393 :393 :
394 : @example test/rbkt/Queries/zorba/http-client/get-binary/get-binary_xml_query.xq394 : @example test/rbkt/Queries/zorba/http-client/get-binary/get-binary_xml_query.xq
395 :)395 :)
396declare %ann:nondeterministic function http:get-binary($href as xs:string) as item()+396declare %an:nondeterministic function http:get-binary($href as xs:string) as item()+
397{397{
398 http:http-nondeterministic-impl(validate {<http-schema:request method="GET" href="{$href}" follow-redirect="true" override-media-type="binary"/>}, (), ())398 http:http-nondeterministic-impl(validate {<http-schema:request method="GET" href="{$href}" follow-redirect="true" override-media-type="binary"/>}, (), ())
399};399};
@@ -411,7 +411,7 @@
411 :411 :
412 : @example test/rbkt/Queries/zorba/http-client/head/head_status.xq412 : @example test/rbkt/Queries/zorba/http-client/head/head_status.xq
413 :)413 :)
414declare %ann:nondeterministic function http:head($href as xs:string) as item() {414declare %an:nondeterministic function http:head($href as xs:string) as item() {
415 http:http-nondeterministic-impl(415 http:http-nondeterministic-impl(
416 validate {416 validate {
417 <http-schema:request method="HEAD" href="{$href}">417 <http-schema:request method="HEAD" href="{$href}">
@@ -431,7 +431,7 @@
431 :431 :
432 : @example test/rbkt/Queries/zorba/http-client/options/options.xq432 : @example test/rbkt/Queries/zorba/http-client/options/options.xq
433 :)433 :)
434declare %ann:nondeterministic function http:options($href as xs:string) as xs:string* {434declare %an:nondeterministic function http:options($href as xs:string) as xs:string* {
435 let $resp := http:http-nondeterministic-impl(435 let $resp := http:http-nondeterministic-impl(
436 validate {436 validate {
437 <http-schema:request method="OPTIONS" href="{$href}">437 <http-schema:request method="OPTIONS" href="{$href}">
@@ -460,7 +460,7 @@
460 :460 :
461 : @example test/rbkt/Queries/zorba/http-client/put/put2_element.xq461 : @example test/rbkt/Queries/zorba/http-client/put/put2_element.xq
462 :)462 :)
463declare %ann:sequential function http:put($href as xs:string, $body as item()) as item()+463declare %an:sequential function http:put($href as xs:string, $body as item()) as item()+
464{464{
465 variable $media-type as xs:string+ :=465 variable $media-type as xs:string+ :=
466 typeswitch($body)466 typeswitch($body)
@@ -504,7 +504,7 @@
504 :504 :
505 : @example test/rbkt/Queries/zorba/http-client/put/put3_html_br.xq505 : @example test/rbkt/Queries/zorba/http-client/put/put3_html_br.xq
506 :)506 :)
507declare %ann:sequential function http:put($href as xs:string, $body as item(), $content-type as xs:string) as item()+507declare %an:sequential function http:put($href as xs:string, $body as item(), $content-type as xs:string) as item()+
508{508{
509 variable $method :=509 variable $method :=
510 typeswitch ($body)510 typeswitch ($body)
@@ -545,7 +545,7 @@
545 :545 :
546 : @example test/rbkt/Queries/zorba/http-client/delete/delete.xq546 : @example test/rbkt/Queries/zorba/http-client/delete/delete.xq
547 :)547 :)
548declare %ann:sequential function http:delete($href as xs:string) as item()+548declare %an:sequential function http:delete($href as xs:string) as item()+
549{549{
550 http:http-sequential-impl(550 http:http-sequential-impl(
551 validate {551 validate {
@@ -572,7 +572,7 @@
572 :572 :
573 : @example test/rbkt/Queries/zorba/http-client/post/post2_comment.xq573 : @example test/rbkt/Queries/zorba/http-client/post/post2_comment.xq
574 :)574 :)
575declare %ann:sequential function http:post($href as xs:string, $body as item()) as item()+575declare %an:sequential function http:post($href as xs:string, $body as item()) as item()+
576{576{
577 variable $media-type as xs:string :=577 variable $media-type as xs:string :=
578 typeswitch($body)578 typeswitch($body)
@@ -617,7 +617,7 @@
617 :617 :
618 : @example test/rbkt/Queries/zorba/http-client/post/post3_xml.xq618 : @example test/rbkt/Queries/zorba/http-client/post/post3_xml.xq
619 :)619 :)
620declare %ann:sequential function http:post($href as xs:string, $body as item(), $content-type as xs:string) as item()+620declare %an:sequential function http:post($href as xs:string, $body as item(), $content-type as xs:string) as item()+
621{621{
622 variable $method :=622 variable $method :=
623 typeswitch ($body)623 typeswitch ($body)
@@ -645,13 +645,13 @@
645 $result645 $result
646};646};
647647
648declare %private %ann:sequential function http:http-sequential-impl(648declare %private %an:sequential function http:http-sequential-impl(
649 $request as schema-element(http-schema:request)?,649 $request as schema-element(http-schema:request)?,
650 $href as xs:string?,650 $href as xs:string?,
651 $bodies as item()*) as item()+ external;651 $bodies as item()*) as item()+ external;
652652
653653
654declare %private %ann:nondeterministic function http:http-nondeterministic-impl(654declare %private %an:nondeterministic function http:http-nondeterministic-impl(
655 $request as schema-element(http-schema:request)?,655 $request as schema-element(http-schema:request)?,
656 $href as xs:string?,656 $href as xs:string?,
657 $bodies as item()*) as item()+ external;657 $bodies as item()*) as item()+ external;
658658
=== modified file 'modules/com/zorba-xquery/www/modules/pregenerated/errors.xq'
--- modules/com/zorba-xquery/www/modules/pregenerated/errors.xq 2012-04-11 20:22:52 +0000
+++ modules/com/zorba-xquery/www/modules/pregenerated/errors.xq 2012-04-27 13:22:48 +0000
@@ -521,14 +521,6 @@
521521
522(:~522(:~
523:)523:)
524declare variable $zerr:ZDDY0034 as xs:QName := fn:QName($zerr:NS, "zerr:ZDDY0034");
525
526(:~
527:)
528declare variable $zerr:ZDDY0035 as xs:QName := fn:QName($zerr:NS, "zerr:ZDDY0035");
529
530(:~
531:)
532declare variable $zerr:ZDDY0031 as xs:QName := fn:QName($zerr:NS, "zerr:ZDDY0031");524declare variable $zerr:ZDDY0031 as xs:QName := fn:QName($zerr:NS, "zerr:ZDDY0031");
533525
534(:~526(:~
@@ -541,6 +533,18 @@
541533
542(:~534(:~
543:)535:)
536declare variable $zerr:ZDDY0034 as xs:QName := fn:QName($zerr:NS, "zerr:ZDDY0034");
537
538(:~
539:)
540declare variable $zerr:ZDDY0035 as xs:QName := fn:QName($zerr:NS, "zerr:ZDDY0035");
541
542(:~
543:)
544declare variable $zerr:ZDDY0036 as xs:QName := fn:QName($zerr:NS, "zerr:ZDDY0036");
545
546(:~
547:)
544declare variable $zerr:ZDST0001 as xs:QName := fn:QName($zerr:NS, "zerr:ZDST0001");548declare variable $zerr:ZDST0001 as xs:QName := fn:QName($zerr:NS, "zerr:ZDST0001");
545549
546(:~550(:~
547551
=== modified file 'modules/com/zorba-xquery/www/modules/project_xqdoc.xq'
--- modules/com/zorba-xquery/www/modules/project_xqdoc.xq 2012-04-11 20:22:52 +0000
+++ modules/com/zorba-xquery/www/modules/project_xqdoc.xq 2012-04-27 13:22:48 +0000
@@ -33,7 +33,7 @@
33import schema namespace xqdoc = "http://www.xqdoc.org/1.0";33import schema namespace xqdoc = "http://www.xqdoc.org/1.0";
34import schema namespace output = "http://www.w3.org/2010/xslt-xquery-serialization";34import schema namespace output = "http://www.w3.org/2010/xslt-xquery-serialization";
3535
36declare namespace ann = "http://www.zorba-xquery.com/annotations";36declare namespace an = "http://www.zorba-xquery.com/annotations";
37declare namespace zm = "http://www.zorba-xquery.com/manifest";37declare namespace zm = "http://www.zorba-xquery.com/manifest";
38import module namespace fetch = "http://www.zorba-xquery.com/modules/fetch";38import module namespace fetch = "http://www.zorba-xquery.com/modules/fetch";
3939
@@ -58,7 +58,7 @@
58 : @param $xqdocPath where to generate the XQDoc XML documents.58 : @param $xqdocPath where to generate the XQDoc XML documents.
59 : @return empty sequence.59 : @return empty sequence.
60 :)60 :)
61declare %ann:sequential function pxqdoc:delete-XML-dir(61declare %an:sequential function pxqdoc:delete-XML-dir(
62 $xqdocPath as xs:string)62 $xqdocPath as xs:string)
63{63{
64 variable $xqdocXMLPath := fn:concat( $xqdocPath,64 variable $xqdocXMLPath := fn:concat( $xqdocPath,
@@ -70,7 +70,7 @@
70 else ();70 else ();
71};71};
7272
73declare %private %ann:nondeterministic function pxqdoc:load-manifest(73declare %private %an:nondeterministic function pxqdoc:load-manifest(
74 $zorbaManifestPath as xs:string)74 $zorbaManifestPath as xs:string)
75{75{
76 try 76 try
@@ -90,7 +90,7 @@
90 : @param $xqdocPath where to generate the XQDoc XML documents.90 : @param $xqdocPath where to generate the XQDoc XML documents.
91 : @return empty sequence.91 : @return empty sequence.
92 :)92 :)
93declare %ann:sequential function pxqdoc:generate-xqdoc-XML(93declare %an:sequential function pxqdoc:generate-xqdoc-XML(
94 $zorbaManifestPath as xs:string,94 $zorbaManifestPath as xs:string,
95 $xqdocPath as xs:string)95 $xqdocPath as xs:string)
96{96{
@@ -147,4 +147,4 @@
147 "http:__",147 "http:__",
148 ""148 ""
149 )149 )
150};
151\ No newline at end of file150\ No newline at end of file
151};
152152
=== modified file 'modules/com/zorba-xquery/www/modules/random.xq'
--- modules/com/zorba-xquery/www/modules/random.xq 2012-04-11 20:22:52 +0000
+++ modules/com/zorba-xquery/www/modules/random.xq 2012-04-27 13:22:48 +0000
@@ -26,7 +26,7 @@
26 :)26 :)
27module namespace r = "http://www.zorba-xquery.com/modules/random";27module namespace r = "http://www.zorba-xquery.com/modules/random";
2828
29declare namespace ann = "http://www.zorba-xquery.com/annotations";29declare namespace an = "http://www.zorba-xquery.com/annotations";
30declare namespace zerr = "http://www.zorba-xquery.com/errors";30declare namespace zerr = "http://www.zorba-xquery.com/errors";
3131
32declare namespace ver = "http://www.zorba-xquery.com/options/versioning";32declare namespace ver = "http://www.zorba-xquery.com/options/versioning";
@@ -75,7 +75,7 @@
75 : @return <tt>$num</tt> random integers, or the empty75 : @return <tt>$num</tt> random integers, or the empty
76 : sequence if <tt>$num</tt> is negative.76 : sequence if <tt>$num</tt> is negative.
77 :)77 :)
78declare %ann:nondeterministic function r:random(78declare %an:nondeterministic function r:random(
79 $num as xs:integer79 $num as xs:integer
80) as xs:integer* external;80) as xs:integer* external;
8181
@@ -88,7 +88,7 @@
88 :88 :
89 : @return a random integer89 : @return a random integer
90 :)90 :)
91declare %ann:nondeterministic function r:random() as xs:integer91declare %an:nondeterministic function r:random() as xs:integer
92{92{
93 r:random(1)93 r:random(1)
94};94};
@@ -157,7 +157,7 @@
157 :157 :
158 : @error r:invalid-arg if <tt>$lower</tt> is greater than <tt>$upper</tt>158 : @error r:invalid-arg if <tt>$lower</tt> is greater than <tt>$upper</tt>
159 :)159 :)
160declare %ann:nondeterministic function r:random-between(160declare %an:nondeterministic function r:random-between(
161 $lower as xs:integer,161 $lower as xs:integer,
162 $upper as xs:integer,162 $upper as xs:integer,
163 $num as xs:integer) as xs:integer*163 $num as xs:integer) as xs:integer*
@@ -192,7 +192,7 @@
192 : @param $upper the upper bound for the random number192 : @param $upper the upper bound for the random number
193 : @return a random integer within the given range193 : @return a random integer within the given range
194 :)194 :)
195declare %ann:nondeterministic function r:random-between(195declare %an:nondeterministic function r:random-between(
196 $lower as xs:integer,196 $lower as xs:integer,
197 $upper as xs:integer197 $upper as xs:integer
198) as xs:integer198) as xs:integer
@@ -206,5 +206,5 @@
206 :206 :
207 : @return the generated UUID as xs:string207 : @return the generated UUID as xs:string
208:)208:)
209declare %ann:nondeterministic function r:uuid() as xs:string external;209declare %an:nondeterministic function r:uuid() as xs:string external;
210210
211211
=== modified file 'modules/com/zorba-xquery/www/modules/reflection.xq'
--- modules/com/zorba-xquery/www/modules/reflection.xq 2012-04-11 20:22:52 +0000
+++ modules/com/zorba-xquery/www/modules/reflection.xq 2012-04-27 13:22:48 +0000
@@ -29,7 +29,7 @@
2929
30module namespace reflection = "http://www.zorba-xquery.com/modules/reflection";30module namespace reflection = "http://www.zorba-xquery.com/modules/reflection";
3131
32declare namespace ann = "http://www.zorba-xquery.com/annotations";32declare namespace an = "http://www.zorba-xquery.com/annotations";
3333
34declare namespace err = "http://www.w3.org/2005/xqt-errors";34declare namespace err = "http://www.w3.org/2005/xqt-errors";
3535
@@ -43,7 +43,7 @@
43 : variable, taken from a file, etc. The first parameter must always be a 43 : variable, taken from a file, etc. The first parameter must always be a
44 : QName identifying a known function.44 : QName identifying a known function.
45 :45 :
46 : The function is declared with the %ann:variadic annotation. Hence, it allows46 : The function is declared with the %an:variadic annotation. Hence, it allows
47 : for an arbitrary number of parameters. All of these parameters (except the47 : for an arbitrary number of parameters. All of these parameters (except the
48 : first one) will be passed to the function that is called.48 : first one) will be passed to the function that is called.
49 :49 :
@@ -61,7 +61,7 @@
61 : @example test/rbkt/Queries/zorba/reflection/reflection-invoke-01.xq61 : @example test/rbkt/Queries/zorba/reflection/reflection-invoke-01.xq
62 : @example test/rbkt/Queries/zorba/reflection/reflection-invoke-92.xq62 : @example test/rbkt/Queries/zorba/reflection/reflection-invoke-92.xq
63 :)63 :)
64declare %ann:variadic function reflection:invoke(64declare %an:variadic function reflection:invoke(
65 $name as xs:QName65 $name as xs:QName
66) as item()* external;66) as item()* external;
6767
@@ -77,7 +77,7 @@
77 :77 :
78 : @see reflection:invoke()78 : @see reflection:invoke()
79 :)79 :)
80declare %ann:nondeterministic %ann:variadic updating function reflection:invoke-n(80declare %an:nondeterministic %an:variadic updating function reflection:invoke-n(
81 $name as xs:QName81 $name as xs:QName
82) as item()* external;82) as item()* external;
8383
@@ -93,7 +93,7 @@
93 :93 :
94 : @see reflection:invoke-n()94 : @see reflection:invoke-n()
95 :)95 :)
96declare %ann:nondeterministic %ann:variadic updating function reflection:invoke-u(96declare %an:nondeterministic %an:variadic updating function reflection:invoke-u(
97 $name as xs:QName97 $name as xs:QName
98) external;98) external;
9999
@@ -109,7 +109,7 @@
109 :109 :
110 : @see reflection:invoke()110 : @see reflection:invoke()
111 :)111 :)
112declare %ann:variadic %ann:sequential function reflection:invoke-s(112declare %an:variadic %an:sequential function reflection:invoke-s(
113 $name as xs:QName113 $name as xs:QName
114) as item()* external;114) as item()* external;
115115
@@ -178,7 +178,7 @@
178 :178 :
179 : @return the result of evaluating the query179 : @return the result of evaluating the query
180 :)180 :)
181declare %ann:nondeterministic function reflection:eval-n(181declare %an:nondeterministic function reflection:eval-n(
182 $query as xs:string182 $query as xs:string
183) as item()* external;183) as item()* external;
184184
@@ -197,7 +197,7 @@
197 :197 :
198 : @see reflection:eval()198 : @see reflection:eval()
199 :)199 :)
200declare %ann:nondeterministic updating function reflection:eval-u(200declare %an:nondeterministic updating function reflection:eval-u(
201 $query as xs:string201 $query as xs:string
202) external;202) external;
203203
@@ -217,6 +217,6 @@
217 :217 :
218 : @see reflection:eval()218 : @see reflection:eval()
219 :)219 :)
220declare %ann:sequential function reflection:eval-s(220declare %an:sequential function reflection:eval-s(
221 $query as xs:string221 $query as xs:string
222) as item()* external;222) as item()* external;
223223
=== modified file 'modules/com/zorba-xquery/www/modules/store/data-structures/unordered-map.xq'
--- modules/com/zorba-xquery/www/modules/store/data-structures/unordered-map.xq 2012-04-11 20:22:52 +0000
+++ modules/com/zorba-xquery/www/modules/store/data-structures/unordered-map.xq 2012-04-27 13:22:48 +0000
@@ -40,7 +40,7 @@
4040
41declare namespace zerr = "http://www.zorba-xquery.com/errors";41declare namespace zerr = "http://www.zorba-xquery.com/errors";
42declare namespace err = "http://www.w3.org/2005/xqt-errors";42declare namespace err = "http://www.w3.org/2005/xqt-errors";
43declare namespace ann = "http://www.zorba-xquery.com/annotations";43declare namespace an = "http://www.zorba-xquery.com/annotations";
4444
45declare namespace ver = "http://www.zorba-xquery.com/options/versioning";45declare namespace ver = "http://www.zorba-xquery.com/options/versioning";
46declare option ver:module-version "2.0";46declare option ver:module-version "2.0";
@@ -63,7 +63,7 @@
63 : xs:anyAtomicType.63 : xs:anyAtomicType.
64 : @error zerr:ZSTR0001 if a map with the given name already exists.64 : @error zerr:ZSTR0001 if a map with the given name already exists.
65 :)65 :)
66declare %ann:variadic %ann:sequential function map:create(66declare %an:variadic %an:sequential function map:create(
67 $name as xs:QName,67 $name as xs:QName,
68 $key-type as xs:QName) as empty-sequence() external;68 $key-type as xs:QName) as empty-sequence() external;
6969
@@ -77,7 +77,7 @@
77 :77 :
78 : @error zerr:ZDDY0023 if a map with the given name does not exist.78 : @error zerr:ZDDY0023 if a map with the given name does not exist.
79 :)79 :)
80declare %ann:sequential function map:delete(80declare %an:sequential function map:delete(
81 $name as xs:QName) as empty-sequence() external;81 $name as xs:QName) as empty-sequence() external;
8282
83(:~83(:~
@@ -107,7 +107,7 @@
107 : @see map:create107 : @see map:create
108 :108 :
109 :)109 :)
110declare %ann:variadic %ann:sequential function map:insert(110declare %an:variadic %an:sequential function map:insert(
111 $name as xs:QName,111 $name as xs:QName,
112 $value as item()*,112 $value as item()*,
113 $key as xs:anyAtomicType?) as empty-sequence() external;113 $key as xs:anyAtomicType?) as empty-sequence() external;
@@ -133,7 +133,7 @@
133 :133 :
134 : @see map:create134 : @see map:create
135 :)135 :)
136declare %ann:variadic function map:get(136declare %an:variadic function map:get(
137 $name as xs:QName,137 $name as xs:QName,
138 $key as xs:anyAtomicType?) as item()* external;138 $key as xs:anyAtomicType?) as item()* external;
139139
@@ -158,7 +158,7 @@
158 : @see map:create158 : @see map:create
159 :159 :
160 :)160 :)
161declare %ann:variadic %ann:sequential function map:remove(161declare %an:variadic %an:sequential function map:remove(
162 $name as xs:QName,162 $name as xs:QName,
163 $key as xs:anyAtomicType?) as empty-sequence() external;163 $key as xs:anyAtomicType?) as empty-sequence() external;
164164
165165
=== modified file 'modules/com/zorba-xquery/www/modules/store/dynamic/collections/dml.xq'
--- modules/com/zorba-xquery/www/modules/store/dynamic/collections/dml.xq 2012-04-11 20:22:52 +0000
+++ modules/com/zorba-xquery/www/modules/store/dynamic/collections/dml.xq 2012-04-27 13:22:48 +0000
@@ -17,7 +17,7 @@
17:)17:)
1818
19(:~19(:~
20 : This modules provides a set of functions to modify a collection and retrieve the nodes20 : This modules provides a set of functions to modify a collection and retrieve the items
21 : contained in a particular collection.21 : contained in a particular collection.
22 :22 :
23 : <p>Please refer to our documentation for <a href="../../html/data_lifecycle.html">23 : <p>Please refer to our documentation for <a href="../../html/data_lifecycle.html">
@@ -35,7 +35,7 @@
35module namespace dml = "http://www.zorba-xquery.com/modules/store/dynamic/collections/dml";35module namespace dml = "http://www.zorba-xquery.com/modules/store/dynamic/collections/dml";
3636
37declare namespace zerr = "http://www.zorba-xquery.com/errors";37declare namespace zerr = "http://www.zorba-xquery.com/errors";
38declare namespace ann = "http://www.zorba-xquery.com/annotations";38declare namespace an = "http://www.zorba-xquery.com/annotations";
3939
40declare namespace ver = "http://www.zorba-xquery.com/options/versioning";40declare namespace ver = "http://www.zorba-xquery.com/options/versioning";
41declare option ver:module-version "2.0";41declare option ver:module-version "2.0";
@@ -53,6 +53,8 @@
53 :53 :
54 : @error zerr:ZDDY0003 if the collection identified by $name is not available.54 : @error zerr:ZDDY0003 if the collection identified by $name is not available.
55 :55 :
56 : @deprecated please use the cdml:insert-first#2 function
57 :
56 :)58 :)
57declare updating function 59declare updating function
58dml:insert-nodes-first($name as xs:QName, $content as node()*) external;60dml:insert-nodes-first($name as xs:QName, $content as node()*) external;
@@ -87,6 +89,8 @@
87 :89 :
88 : @error zerr:ZDDY0003 if the collection identified by $name is not available.90 : @error zerr:ZDDY0003 if the collection identified by $name is not available.
89 :91 :
92 : @deprecated please use the cdml:insert-last#2 function
93 :
90 :)94 :)
91declare updating function 95declare updating function
92dml:insert-nodes-last($name as xs:QName, $content as node()*) external;96dml:insert-nodes-last($name as xs:QName, $content as node()*) external;
@@ -125,6 +129,8 @@
125 : @error zerr:ZDDY0003 if the collection identified by $name is not available.129 : @error zerr:ZDDY0003 if the collection identified by $name is not available.
126 : @error zerr:ZDDY0011 if the target node is not contained in the collection.130 : @error zerr:ZDDY0011 if the target node is not contained in the collection.
127 :131 :
132 : @deprecated please use the cdml:insert-before#3 function
133 :
128 :)134 :)
129declare updating function 135declare updating function
130dml:insert-nodes-before(136dml:insert-nodes-before(
@@ -169,6 +175,8 @@
169 : @error zerr:ZDDY0003 if the collection identified by $name is not available.175 : @error zerr:ZDDY0003 if the collection identified by $name is not available.
170 : @error zerr:ZDDY0011 if the target node is not contained in the collection.176 : @error zerr:ZDDY0011 if the target node is not contained in the collection.
171 :177 :
178 : @deprecated please use the cdml:insert-after#3 function
179 :
172 :)180 :)
173declare updating function 181declare updating function
174dml:insert-nodes-after(182dml:insert-nodes-after(
@@ -213,8 +221,10 @@
213 :221 :
214 : @see dml:insert-nodes-first222 : @see dml:insert-nodes-first
215 :223 :
224 : @deprecated please use the cdml:apply-insert-first#2 function
225 :
216 :)226 :)
217declare %ann:sequential function 227declare %an:sequential function
218dml:apply-insert-nodes-first(228dml:apply-insert-nodes-first(
219 $name as xs:QName,229 $name as xs:QName,
220 $content as node()*) as node()* external;230 $content as node()*) as node()* external;
@@ -235,7 +245,7 @@
235 : @see dml:insert-first245 : @see dml:insert-first
236 :246 :
237 :)247 :)
238declare %ann:sequential function 248declare %an:sequential function
239dml:apply-insert-first($name as xs:QName, $content as item()*) as item()* external;249dml:apply-insert-first($name as xs:QName, $content as item()*) as item()* external;
240250
241251
@@ -254,8 +264,10 @@
254 :264 :
255 : @see dml:insert-nodes-last265 : @see dml:insert-nodes-last
256 :266 :
267 : @deprecated please use the cdml:apply-insert-last#2 function
268 :
257 :)269 :)
258declare %ann:sequential function dml:apply-insert-nodes-last(270declare %an:sequential function dml:apply-insert-nodes-last(
259 $name as xs:QName,271 $name as xs:QName,
260 $content as node()*) as node()* external;272 $content as node()*) as node()* external;
261273
@@ -276,7 +288,7 @@
276 : @see dml:insert-last288 : @see dml:insert-last
277 :289 :
278 :)290 :)
279declare %ann:sequential function dml:apply-insert-last(291declare %an:sequential function dml:apply-insert-last(
280 $name as xs:QName,292 $name as xs:QName,
281 $content as item()*) as item()* external;293 $content as item()*) as item()* external;
282294
@@ -298,8 +310,10 @@
298 :310 :
299 : @see dml:insert-nodes-before311 : @see dml:insert-nodes-before
300 :312 :
313 : @deprecated please use the cdml:apply-insert-before#3 function
314 :
301 :)315 :)
302declare %ann:sequential function 316declare %an:sequential function
303dml:apply-insert-nodes-before(317dml:apply-insert-nodes-before(
304 $name as xs:QName,318 $name as xs:QName,
305 $target as node(),319 $target as node(),
@@ -324,7 +338,7 @@
324 : @see dml:insert-before338 : @see dml:insert-before
325 :339 :
326 :)340 :)
327declare %ann:sequential function 341declare %an:sequential function
328dml:apply-insert-before(342dml:apply-insert-before(
329 $name as xs:QName,343 $name as xs:QName,
330 $target as item(),344 $target as item(),
@@ -348,8 +362,10 @@
348 :362 :
349 : @see dml:insert-nodes-after363 : @see dml:insert-nodes-after
350 :364 :
365 : @deprecated please use the cdml:apply-insert-after#3 function
366 :
351 :)367 :)
352declare %ann:sequential function 368declare %an:sequential function
353dml:apply-insert-nodes-after(369dml:apply-insert-nodes-after(
354 $name as xs:QName,370 $name as xs:QName,
355 $pos as node(),371 $pos as node(),
@@ -374,7 +390,7 @@
374 : @see dml:insert-after390 : @see dml:insert-after
375 :391 :
376 :)392 :)
377declare %ann:sequential function 393declare %an:sequential function
378dml:apply-insert-after(394dml:apply-insert-after(
379 $name as xs:QName,395 $name as xs:QName,
380 $pos as item(),396 $pos as item(),
@@ -394,6 +410,8 @@
394 : a collection or not all nodes of the $target sequence belong to the same410 : a collection or not all nodes of the $target sequence belong to the same
395 : collection.411 : collection.
396 :412 :
413 : @deprecated please use the cdml:delete#1 function
414 :
397 :)415 :)
398declare updating function 416declare updating function
399dml:delete-nodes($target as node()*) external;417dml:delete-nodes($target as node()*) external;
@@ -428,6 +446,8 @@
428 :446 :
429 : @error zerr:ZDDY0011 if the collection doesn't contain any node.447 : @error zerr:ZDDY0011 if the collection doesn't contain any node.
430 :448 :
449 : @deprecated please use the cdml:delete-first#1 function
450 :
431 :)451 :)
432declare updating function 452declare updating function
433dml:delete-node-first($name as xs:QName) external;453dml:delete-node-first($name as xs:QName) external;
@@ -462,6 +482,8 @@
462 :482 :
463 : @error zerr:ZDDY0011 if the collection doesn't contain the given number of nodes.483 : @error zerr:ZDDY0011 if the collection doesn't contain the given number of nodes.
464 :484 :
485 : @deprecated please use the cdml:delete-first#2 function
486 :
465 :)487 :)
466declare updating function 488declare updating function
467dml:delete-nodes-first($name as xs:QName, $number as xs:integer) external;489dml:delete-nodes-first($name as xs:QName, $number as xs:integer) external;
@@ -498,6 +520,8 @@
498 : for the expanded QName $name.520 : for the expanded QName $name.
499 : @error zerr:ZDDY0011 if the collection doesn't contain any node.521 : @error zerr:ZDDY0011 if the collection doesn't contain any node.
500 :522 :
523 : @deprecated please use the cdml:delete-last#1 function
524 :
501 :)525 :)
502declare updating function 526declare updating function
503dml:delete-node-last($name as xs:QName) external;527dml:delete-node-last($name as xs:QName) external;
@@ -535,6 +559,8 @@
535 : for the expanded QName $name.559 : for the expanded QName $name.
536 : @error zerr:ZDDY0011 if the collection doesn't contain the given number of nodes.560 : @error zerr:ZDDY0011 if the collection doesn't contain the given number of nodes.
537 :561 :
562 : @deprecated please use the cdml:delete-last#2 function
563 :
538 :)564 :)
539declare updating function 565declare updating function
540dml:delete-nodes-last($name as xs:QName, $number as xs:integer) external;566dml:delete-nodes-last($name as xs:QName, $number as xs:integer) external;
541567
=== modified file 'modules/com/zorba-xquery/www/modules/store/dynamic/collections/w3c/dml.xq'
--- modules/com/zorba-xquery/www/modules/store/dynamic/collections/w3c/dml.xq 2012-04-11 20:22:52 +0000
+++ modules/com/zorba-xquery/www/modules/store/dynamic/collections/w3c/dml.xq 2012-04-27 13:22:48 +0000
@@ -43,7 +43,7 @@
43import module namespace qdml = "http://www.zorba-xquery.com/modules/store/dynamic/collections/dml";43import module namespace qdml = "http://www.zorba-xquery.com/modules/store/dynamic/collections/dml";
4444
45declare namespace zerr = "http://www.zorba-xquery.com/errors";45declare namespace zerr = "http://www.zorba-xquery.com/errors";
46declare namespace ann = "http://www.zorba-xquery.com/annotations";46declare namespace an = "http://www.zorba-xquery.com/annotations";
4747
48declare namespace ver = "http://www.zorba-xquery.com/options/versioning";48declare namespace ver = "http://www.zorba-xquery.com/options/versioning";
49declare option ver:module-version "2.0";49declare option ver:module-version "2.0";
@@ -153,7 +153,7 @@
153 : @see dml:insert-nodes-first153 : @see dml:insert-nodes-first
154 :154 :
155 :)155 :)
156declare %ann:sequential function dml:apply-insert-nodes-first(156declare %an:sequential function dml:apply-insert-nodes-first(
157 $name as xs:string,157 $name as xs:string,
158 $content as node()*) as node()*158 $content as node()*) as node()*
159{159{
@@ -176,7 +176,7 @@
176 : @see dml:insert-nodes-last176 : @see dml:insert-nodes-last
177 :177 :
178 :)178 :)
179declare %ann:sequential function dml:apply-insert-nodes-last(179declare %an:sequential function dml:apply-insert-nodes-last(
180 $name as xs:string,180 $name as xs:string,
181 $content as node()*) as node()*181 $content as node()*) as node()*
182{182{
@@ -201,7 +201,7 @@
201 : @see dml:insert-nodes-before201 : @see dml:insert-nodes-before
202 :202 :
203 :)203 :)
204declare %ann:sequential function dml:apply-insert-nodes-before(204declare %an:sequential function dml:apply-insert-nodes-before(
205 $name as xs:string,205 $name as xs:string,
206 $target as node(),206 $target as node(),
207 $content as node()*) as node()*207 $content as node()*) as node()*
@@ -227,7 +227,7 @@
227 : @see dml:insert-nodes-after227 : @see dml:insert-nodes-after
228 :228 :
229 :)229 :)
230declare %ann:sequential function dml:apply-insert-nodes-after(230declare %an:sequential function dml:apply-insert-nodes-after(
231 $name as xs:string,231 $name as xs:string,
232 $pos as node(),232 $pos as node(),
233 $content as node()*) as node()*233 $content as node()*) as node()*
234234
=== modified file 'modules/com/zorba-xquery/www/modules/store/static/collections/dml.xq'
--- modules/com/zorba-xquery/www/modules/store/static/collections/dml.xq 2012-04-11 20:22:52 +0000
+++ modules/com/zorba-xquery/www/modules/store/static/collections/dml.xq 2012-04-27 13:22:48 +0000
@@ -17,7 +17,7 @@
17:)17:)
1818
19(:~19(:~
20 : This modules provides a set of functions to modify a collection and retrieve the nodes20 : This modules provides a set of functions to modify a collection and retrieve the items
21 : contained in a particular collection.21 : contained in a particular collection.
22 :22 :
23 : <p>This module is part of <a href="../../html/xqddf.html">Zorba's XQuery Data23 : <p>This module is part of <a href="../../html/xqddf.html">Zorba's XQuery Data
@@ -42,7 +42,7 @@
42 :)42 :)
43module namespace cdml = "http://www.zorba-xquery.com/modules/store/static/collections/dml";43module namespace cdml = "http://www.zorba-xquery.com/modules/store/static/collections/dml";
4444
45declare namespace ann = "http://www.zorba-xquery.com/annotations";45declare namespace an = "http://www.zorba-xquery.com/annotations";
46declare namespace zerr = "http://www.zorba-xquery.com/errors";46declare namespace zerr = "http://www.zorba-xquery.com/errors";
4747
48declare namespace ver = "http://www.zorba-xquery.com/options/versioning";48declare namespace ver = "http://www.zorba-xquery.com/options/versioning";
@@ -68,6 +68,8 @@
68 : @error zerr:ZDTY0001 if $content does not match the expected type (as specified68 : @error zerr:ZDTY0001 if $content does not match the expected type (as specified
69 : in the collection declaration) according to the rules for SequenceType Matching.69 : in the collection declaration) according to the rules for SequenceType Matching.
70 :70 :
71 : @deprecated please use the cdml:insert#2 function
72 :
71 :)73 :)
72declare updating function 74declare updating function
73cdml:insert-nodes($name as xs:QName, $content as node()*) external;75cdml:insert-nodes($name as xs:QName, $content as node()*) external;
@@ -115,6 +117,8 @@
115 : @error zerr:ZDTY0001 if $content does not match the expected type (as specified117 : @error zerr:ZDTY0001 if $content does not match the expected type (as specified
116 : in the collection declaration) according to the rules for SequenceType Matching.118 : in the collection declaration) according to the rules for SequenceType Matching.
117 :119 :
120 : @deprecated please use the cdml:insert-first#2 function
121 :
118 :)122 :)
119declare updating function 123declare updating function
120cdml:insert-nodes-first($name as xs:QName, $content as node()*) external;124cdml:insert-nodes-first($name as xs:QName, $content as node()*) external;
@@ -160,6 +164,8 @@
160 : @error zerr:ZDTY0001 if $content does not match the expected type (as specified164 : @error zerr:ZDTY0001 if $content does not match the expected type (as specified
161 : in the collection declaration) according to the rules for SequenceType Matching.165 : in the collection declaration) according to the rules for SequenceType Matching.
162 :166 :
167 : @deprecated please use the cdml:insert-last#2 function
168 :
163 :)169 :)
164declare updating function 170declare updating function
165cdml:insert-nodes-last($name as xs:QName, $content as node()*) external;171cdml:insert-nodes-last($name as xs:QName, $content as node()*) external;
@@ -210,6 +216,8 @@
210 : @error zerr:ZDDY0011 if the $target node is not a node that is contained in216 : @error zerr:ZDDY0011 if the $target node is not a node that is contained in
211 : the collection $name.217 : the collection $name.
212 :218 :
219 : @deprecated please use the cdml:insert-before#3 function
220 :
213 :)221 :)
214declare updating function 222declare updating function
215cdml:insert-nodes-before(223cdml:insert-nodes-before(
@@ -269,6 +277,8 @@
269 : @error zerr:ZDDY0011 if the $target node is not a node that is contained in277 : @error zerr:ZDDY0011 if the $target node is not a node that is contained in
270 : the collection $name.278 : the collection $name.
271 :279 :
280 : @deprecated please use the cdml:insert-after#3 function
281 :
272 :)282 :)
273declare updating function 283declare updating function
274cdml:insert-nodes-after(284cdml:insert-nodes-after(
@@ -302,7 +312,7 @@
302 :312 :
303 :)313 :)
304declare updating function 314declare updating function
305cdml:insert-after($name as xs:QName, $target as node(), $content as item()*) external;315cdml:insert-after($name as xs:QName, $target as item(), $content as item()*) external;
306316
307317
308(:~318(:~
@@ -325,8 +335,10 @@
325 :335 :
326 : @see cdml:insert-nodes336 : @see cdml:insert-nodes
327 :337 :
338 : @deprecated please use the cdml:apply-insert#2 function
339 :
328 :)340 :)
329declare %ann:sequential function 341declare %an:sequential function
330cdml:apply-insert-nodes($name as xs:QName, $content as node()*) as node()* external;342cdml:apply-insert-nodes($name as xs:QName, $content as node()*) as node()* external;
331343
332344
@@ -350,10 +362,9 @@
350 : @see cdml:insert362 : @see cdml:insert
351 :363 :
352 :)364 :)
353declare %ann:sequential function 365declare %an:sequential function
354cdml:apply-insert($name as xs:QName, $content as item()*) as item()* external;366cdml:apply-insert($name as xs:QName, $content as item()*) as item()* external;
355367
356
357(:~368(:~
358 : This function does the same as the insert-nodes-first function except369 : This function does the same as the insert-nodes-first function except
359 : it immediately applies the resulting pending updates and returns the370 : it immediately applies the resulting pending updates and returns the
@@ -375,8 +386,10 @@
375 :386 :
376 : @see cdml:insert-nodes-first387 : @see cdml:insert-nodes-first
377 :388 :
389 : @deprecated please use the cdml:apply-insert-first#2 function
390 :
378 :)391 :)
379declare %ann:sequential function 392declare %an:sequential function
380cdml:apply-insert-nodes-first(393cdml:apply-insert-nodes-first(
381 $name as xs:QName, 394 $name as xs:QName,
382 $content as node()*) as node()* external;395 $content as node()*) as node()* external;
@@ -404,10 +417,9 @@
404 : @see cdml:insert-first417 : @see cdml:insert-first
405 :418 :
406 :)419 :)
407declare %ann:sequential function 420declare %an:sequential function
408cdml:apply-insert-first($name as xs:QName, $content as item()*) as item()* external;421cdml:apply-insert-first($name as xs:QName, $content as item()*) as item()* external;
409422
410
411(:~423(:~
412 : This function does the same as the insert-nodes-last function except424 : This function does the same as the insert-nodes-last function except
413 : it immediately applies the resulting pending updates and returns the425 : it immediately applies the resulting pending updates and returns the
@@ -428,8 +440,10 @@
428 :440 :
429 : @see cdml:insert-nodes-last441 : @see cdml:insert-nodes-last
430 :442 :
443 : @deprecated please use the cdml:apply-insert-last#2 function
444 :
431 :)445 :)
432declare %ann:sequential function 446declare %an:sequential function
433cdml:apply-insert-nodes-last(447cdml:apply-insert-nodes-last(
434 $name as xs:QName,448 $name as xs:QName,
435 $content as node()*) as node()* external;449 $content as node()*) as node()* external;
@@ -456,7 +470,7 @@
456 : @see cdml:insert-last470 : @see cdml:insert-last
457 :471 :
458 :)472 :)
459declare %ann:sequential function 473declare %an:sequential function
460cdml:apply-insert-last($name as xs:QName, $content as item()*) as item()* external;474cdml:apply-insert-last($name as xs:QName, $content as item()*) as item()* external;
461475
462476
@@ -485,8 +499,10 @@
485 :499 :
486 : @see cdml:insert-nodes-before500 : @see cdml:insert-nodes-before
487 :501 :
502 : @deprecated please use the cdml:apply-insert-before#3 function
503 :
488 :)504 :)
489declare %ann:sequential function 505declare %an:sequential function
490cdml:apply-insert-nodes-before(506cdml:apply-insert-nodes-before(
491 $name as xs:QName,507 $name as xs:QName,
492 $target as node(),508 $target as node(),
@@ -519,7 +535,7 @@
519 : @see cdml:insert-before535 : @see cdml:insert-before
520 :536 :
521 :)537 :)
522declare %ann:sequential function 538declare %an:sequential function
523cdml:apply-insert-before(539cdml:apply-insert-before(
524 $name as xs:QName,540 $name as xs:QName,
525 $target as item(),541 $target as item(),
@@ -551,8 +567,10 @@
551 :567 :
552 : @see cdml:insert-nodes-after568 : @see cdml:insert-nodes-after
553 :569 :
570 : @deprecated please use the cdml:apply-insert-after#3 function
571 :
554 :)572 :)
555declare %ann:sequential function 573declare %an:sequential function
556cdml:apply-insert-nodes-after(574cdml:apply-insert-nodes-after(
557 $name as xs:QName,575 $name as xs:QName,
558 $pos as node(),576 $pos as node(),
@@ -585,7 +603,7 @@
585 : @see cdml:insert-after603 : @see cdml:insert-after
586 :604 :
587 :)605 :)
588declare %ann:sequential function 606declare %an:sequential function
589cdml:apply-insert-after(607cdml:apply-insert-after(
590 $name as xs:QName,608 $name as xs:QName,
591 $pos as item(),609 $pos as item(),
@@ -609,6 +627,8 @@
609 : collection or not all nodes of the $target sequence belong to the same627 : collection or not all nodes of the $target sequence belong to the same
610 : collection.628 : collection.
611 :629 :
630 : @deprecated please use the cdml:delete#1 function
631 :
612 :)632 :)
613declare updating function 633declare updating function
614cdml:delete-nodes($target as node()*) external;634cdml:delete-nodes($target as node()*) external;
@@ -651,6 +671,8 @@
651 : @error zerr:ZDDY0012 if the order property of the collection $name is unordered.671 : @error zerr:ZDDY0012 if the order property of the collection $name is unordered.
652 : @error zerr:ZDDY0011 If the collection is empty.672 : @error zerr:ZDDY0011 If the collection is empty.
653 :673 :
674 : @deprecated please use the cdml:delete-first#1 function
675 :
654 :)676 :)
655declare updating function 677declare updating function
656cdml:delete-node-first($name as xs:QName) external;678cdml:delete-node-first($name as xs:QName) external;
@@ -694,6 +716,8 @@
694 : @error zerr:ZDDY0012 if the order property of the collection $name is unordered.716 : @error zerr:ZDDY0012 if the order property of the collection $name is unordered.
695 : @error zerr:ZDDY0011 If the collection contains less than $number nodes.717 : @error zerr:ZDDY0011 If the collection contains less than $number nodes.
696 :718 :
719 : @deprecated please use the cdml:delete-first#2 function
720 :
697 :)721 :)
698declare updating function 722declare updating function
699cdml:delete-nodes-first($name as xs:QName, $number as xs:integer) external;723cdml:delete-nodes-first($name as xs:QName, $number as xs:integer) external;
@@ -737,6 +761,8 @@
737 : append-only, or queue.761 : append-only, or queue.
738 : @error zerr:ZDDY0012 if the order property of the collection $name is unordered.762 : @error zerr:ZDDY0012 if the order property of the collection $name is unordered.
739 : @error zerr:ZDDY0011 If the collection is empty.763 : @error zerr:ZDDY0011 If the collection is empty.
764 :
765 : @deprecated please use the cdml:delete-last#1 function
740 :)766 :)
741declare updating function 767declare updating function
742cdml:delete-node-last($name as xs:QName) external;768cdml:delete-node-last($name as xs:QName) external;
@@ -777,6 +803,8 @@
777 : @error zerr:ZDDY0012 if the order property of the collection $name is unordered.803 : @error zerr:ZDDY0012 if the order property of the collection $name is unordered.
778 : @error zerr:ZDDY0011 If the collection contains less than $number nodes.804 : @error zerr:ZDDY0011 If the collection contains less than $number nodes.
779 :805 :
806 : @deprecated please use the cdml:delete-last#2 function
807 :
780 :)808 :)
781declare updating function 809declare updating function
782cdml:delete-nodes-last($name as xs:QName, $number as xs:integer) external;810cdml:delete-nodes-last($name as xs:QName, $number as xs:integer) external;
@@ -806,6 +834,9 @@
806 : The truncate function is an updating function that deletes the834 : The truncate function is an updating function that deletes the
807 : entire contents of collection.835 : entire contents of collection.
808 :836 :
837 : Please note that applying this function can not be undone in case
838 : an error happens during the application of the containing PUL.
839 :
809 : @param $name The name of the collection whose content to delete840 : @param $name The name of the collection whose content to delete
810 :841 :
811 : @return The result of this function is an empty XDM instance and a pending update842 : @return The result of this function is an empty XDM instance and a pending update
@@ -852,7 +883,7 @@
852883
853(:~884(:~
854 : The index-of function returns the position of the given item (node or 885 : The index-of function returns the position of the given item (node or
855 : json item) within its containing the collection.886 : json item) within its containing collection.
856 :887 :
857 : @param $node The item to retrieve the index for.888 : @param $node The item to retrieve the index for.
858 :889 :
@@ -863,4 +894,4 @@
863 :894 :
864 :)895 :)
865declare function 896declare function
866cdml:index-of($item as item()) as xs:integer external;897cdml:index-of($item as item()) as xs:integer external;
867898
=== modified file 'modules/com/zorba-xquery/www/modules/store/static/indexes/dml.xq'
--- modules/com/zorba-xquery/www/modules/store/static/indexes/dml.xq 2012-04-11 20:22:52 +0000
+++ modules/com/zorba-xquery/www/modules/store/static/indexes/dml.xq 2012-04-27 13:22:48 +0000
@@ -43,7 +43,7 @@
43module namespace idml = "http://www.zorba-xquery.com/modules/store/static/indexes/dml";43module namespace idml = "http://www.zorba-xquery.com/modules/store/static/indexes/dml";
4444
45declare namespace zerr = "http://www.zorba-xquery.com/errors";45declare namespace zerr = "http://www.zorba-xquery.com/errors";
46declare namespace ann = "http://www.zorba-xquery.com/annotations";46declare namespace an = "http://www.zorba-xquery.com/annotations";
4747
48declare namespace ver = "http://www.zorba-xquery.com/options/versioning";48declare namespace ver = "http://www.zorba-xquery.com/options/versioning";
4949
@@ -80,7 +80,7 @@
80 : the sequence type specified in the corresponding keyspec.80 : the sequence type specified in the corresponding keyspec.
81 :81 :
82 :)82 :)
83declare %ann:variadic function idml:probe-index-point-value(83declare %an:variadic function idml:probe-index-point-value(
84 $name as xs:QName, 84 $name as xs:QName,
85 $key_i as xs:anyAtomicType?) as node()* external; 85 $key_i as xs:anyAtomicType?) as node()* external;
8686
@@ -187,7 +187,7 @@
187 : lower and upper bound, neither T1 is a subtype of T2 nor T2 is a 187 : lower and upper bound, neither T1 is a subtype of T2 nor T2 is a
188 : subtype of T1. 188 : subtype of T1.
189 :)189 :)
190declare %ann:variadic function idml:probe-index-range-value(190declare %an:variadic function idml:probe-index-range-value(
191 $name as xs:QName, 191 $name as xs:QName,
192 $lowerBound-i as xs:anyAtomicType?,192 $lowerBound-i as xs:anyAtomicType?,
193 $upperBound-i as xs:anyAtomicType?,193 $upperBound-i as xs:anyAtomicType?,
194194
=== modified file 'modules/com/zorba-xquery/www/modules/xqdoc.xq'
--- modules/com/zorba-xquery/www/modules/xqdoc.xq 2012-04-11 20:22:52 +0000
+++ modules/com/zorba-xquery/www/modules/xqdoc.xq 2012-04-27 13:22:48 +0000
@@ -61,7 +61,7 @@
61 :)61 :)
62module namespace xqd = "http://www.zorba-xquery.com/modules/xqdoc";62module namespace xqd = "http://www.zorba-xquery.com/modules/xqdoc";
6363
64declare namespace ann = "http://www.zorba-xquery.com/annotations";64declare namespace an = "http://www.zorba-xquery.com/annotations";
65declare namespace ver = "http://www.zorba-xquery.com/options/versioning";65declare namespace ver = "http://www.zorba-xquery.com/options/versioning";
6666
67declare namespace err = "http://www.w3.org/2005/xqt-errors";67declare namespace err = "http://www.w3.org/2005/xqt-errors";
@@ -80,7 +80,7 @@
80 : @error zerr::ZXQD0002 if the xqdoc comments in the80 : @error zerr::ZXQD0002 if the xqdoc comments in the
81 : module contain invalid XML81 : module contain invalid XML
82 :)82 :)
83declare %ann:nondeterministic function xqd:xqdoc(83declare %an:nondeterministic function xqd:xqdoc(
84 $module-uri as xs:string84 $module-uri as xs:string
85) as element() external;85) as element() external;
8686
8787
=== modified file 'modules/com/zorba-xquery/www/modules/xqdoc.xsd'
--- modules/com/zorba-xquery/www/modules/xqdoc.xsd 2012-04-11 20:22:52 +0000
+++ modules/com/zorba-xquery/www/modules/xqdoc.xsd 2012-04-27 13:22:48 +0000
@@ -141,6 +141,7 @@
141 </xsd:complexType>141 </xsd:complexType>
142142
143 <xsd:complexType name="annotation">143 <xsd:complexType name="annotation">
144 <xsd:attribute name="prefix" type="xsd:string" use="optional"/>
144 <xsd:attribute name="namespace" type="xsd:string" use="optional"/>145 <xsd:attribute name="namespace" type="xsd:string" use="optional"/>
145 <xsd:attribute name="localname" type="xsd:string" use="optional"/>146 <xsd:attribute name="localname" type="xsd:string" use="optional"/>
146 <xsd:attribute name="value" type="xsd:string" use="optional"/>147 <xsd:attribute name="value" type="xsd:string" use="optional"/>
147148
=== modified file 'modules/com/zorba-xquery/www/modules/xqdoc2xhtml/index.xq'
--- modules/com/zorba-xquery/www/modules/xqdoc2xhtml/index.xq 2012-04-11 20:22:52 +0000
+++ modules/com/zorba-xquery/www/modules/xqdoc2xhtml/index.xq 2012-04-27 13:22:48 +0000
@@ -38,7 +38,7 @@
38import schema namespace xqdoc = "http://www.xqdoc.org/1.0";38import schema namespace xqdoc = "http://www.xqdoc.org/1.0";
39import schema namespace output = "http://www.w3.org/2010/xslt-xquery-serialization";39import schema namespace output = "http://www.w3.org/2010/xslt-xquery-serialization";
4040
41declare namespace ann = "http://www.zorba-xquery.com/annotations";41declare namespace an = "http://www.zorba-xquery.com/annotations";
42declare namespace werr = "http://www.w3.org/2005/xqt-errors";42declare namespace werr = "http://www.w3.org/2005/xqt-errors";
43declare namespace z = "http://www.zorba-xquery.com/manifest";43declare namespace z = "http://www.zorba-xquery.com/manifest";
4444
@@ -125,7 +125,7 @@
125 : @param $collector the name of the collector.125 : @param $collector the name of the collector.
126 : @return empty sequence.126 : @return empty sequence.
127 :)127 :)
128declare %private %ann:sequential function xqdoc2html:collect-schema (128declare %private %an:sequential function xqdoc2html:collect-schema (
129 $schemaURI as xs:string,129 $schemaURI as xs:string,
130 $fileName as xs:string,130 $fileName as xs:string,
131 $collector)131 $collector)
@@ -174,7 +174,7 @@
174 : E.g. ("cpp", "h", "xml")174 : E.g. ("cpp", "h", "xml")
175 : @return The empty sequence.175 : @return The empty sequence.
176 :)176 :)
177declare %private %ann:sequential function xqdoc2html:gather-and-copy(177declare %private %an:sequential function xqdoc2html:gather-and-copy(
178 $sourcePath as xs:string,178 $sourcePath as xs:string,
179 $destinationPath as xs:string,179 $destinationPath as xs:string,
180 $extensions as xs:string+)180 $extensions as xs:string+)
@@ -239,7 +239,7 @@
239 : @param $extensions The sequence of file types to copy (e.g. ("cpp", "h", "xml")).239 : @param $extensions The sequence of file types to copy (e.g. ("cpp", "h", "xml")).
240 : @return The empty sequence.240 : @return The empty sequence.
241 :)241 :)
242declare %private %ann:sequential function xqdoc2html:copy-files(242declare %private %an:sequential function xqdoc2html:copy-files(
243 $sourcePath as xs:string,243 $sourcePath as xs:string,
244 $destinationPath as xs:string,244 $destinationPath as xs:string,
245 $extensions as xs:string+)245 $extensions as xs:string+)
@@ -266,7 +266,7 @@
266 : @param $xqdocBuildPath where to generate the XQDoc XML documents.266 : @param $xqdocBuildPath where to generate the XQDoc XML documents.
267 : @return Empty sequence.267 : @return Empty sequence.
268 :)268 :)
269declare %ann:sequential function xqdoc2html:copy-xhtml-requisites(269declare %an:sequential function xqdoc2html:copy-xhtml-requisites(
270 $xhtmlRequisitesPath as xs:string,270 $xhtmlRequisitesPath as xs:string,
271 $xqdocBuildPath as xs:string)271 $xqdocBuildPath as xs:string)
272{272{
@@ -300,7 +300,7 @@
300300
301(:_____________________________________________________________________________________________________:)301(:_____________________________________________________________________________________________________:)
302302
303declare %private %ann:sequential function xqdoc2html:create-general-menu()303declare %private %an:sequential function xqdoc2html:create-general-menu()
304{304{
305 {305 {
306 variable $allStructures := for $entry in $xqdoc2html:menuEntries/entry return $entry/@structure;306 variable $allStructures := for $entry in $xqdoc2html:menuEntries/entry return $entry/@structure;
@@ -313,7 +313,7 @@
313 }313 }
314};314};
315315
316declare %private %ann:sequential function xqdoc2html:create-collection-categories (316declare %private %an:sequential function xqdoc2html:create-collection-categories (
317$collectionName as xs:QName,317$collectionName as xs:QName,
318$xqdocXmlPath as xs:string)318$xqdocXmlPath as xs:string)
319{319{
@@ -326,7 +326,7 @@
326 return dml:apply-insert-nodes($collectionName, $xqdoc);326 return dml:apply-insert-nodes($collectionName, $xqdoc);
327};327};
328328
329declare %private %ann:sequential function xqdoc2html:collectZorbaManifestEntries(329declare %private %an:sequential function xqdoc2html:collectZorbaManifestEntries(
330 $zorbaManifestPath as xs:string,330 $zorbaManifestPath as xs:string,
331 $xqdocBuildPath as xs:string)331 $xqdocBuildPath as xs:string)
332{332{
@@ -365,7 +365,7 @@
365 : @param $xhtmlRequisitesPath the path where the XHTML requisites are stored.365 : @param $xhtmlRequisitesPath the path where the XHTML requisites are stored.
366 : @return Empty sequence.366 : @return Empty sequence.
367 :)367 :)
368declare %ann:sequential function xqdoc2html:main(368declare %an:sequential function xqdoc2html:main(
369 $zorbaManifestPath as xs:string,369 $zorbaManifestPath as xs:string,
370 $xqdocBuildPath as xs:string,370 $xqdocBuildPath as xs:string,
371 $indexHtmlPath as xs:string,371 $indexHtmlPath as xs:string,
@@ -474,7 +474,7 @@
474 </html>474 </html>
475};475};
476476
477declare %private %ann:sequential function xqdoc2html:copy-schemas(477declare %private %an:sequential function xqdoc2html:copy-schemas(
478 $schemas,478 $schemas,
479 $xqdocXhtmlPath as xs:string479 $xqdocXhtmlPath as xs:string
480)480)
@@ -510,7 +510,7 @@
510 : @param $zorbaPath path to zorba source dir510 : @param $zorbaPath path to zorba source dir
511 : @return A string sequence with a status message for each processed module.511 : @return A string sequence with a status message for each processed module.
512 :)512 :)
513declare %private %ann:sequential function xqdoc2html:generate-xqdoc-xhtml(513declare %private %an:sequential function xqdoc2html:generate-xqdoc-xhtml(
514 $generalLeftMenu,514 $generalLeftMenu,
515 $xhtmlRequisitesPath as xs:string,515 $xhtmlRequisitesPath as xs:string,
516 $xqdocXhtmlPath as xs:string516 $xqdocXhtmlPath as xs:string
@@ -598,7 +598,7 @@
598 : @param $xqdocXhtmlPath where to generate the XQDoc XHTML documents.598 : @param $xqdocXhtmlPath where to generate the XQDoc XHTML documents.
599 : @return the processed $xhtml.599 : @return the processed $xhtml.
600 :)600 :)
601declare %private %ann:sequential function xqdoc2html:configure-xml (601declare %private %an:sequential function xqdoc2html:configure-xml (
602 $xqdoc,602 $xqdoc,
603 $examplePath as xs:string,603 $examplePath as xs:string,
604 $xqdocXhtmlPath as xs:string)604 $xqdocXhtmlPath as xs:string)
@@ -624,7 +624,7 @@
624 : @param $examplePath string with the paths where the examples are kept separated by ; .624 : @param $examplePath string with the paths where the examples are kept separated by ; .
625 : @return The created XHTML page.625 : @return The created XHTML page.
626 :)626 :)
627declare %private %ann:sequential function xqdoc2html:copy-examples(627declare %private %an:sequential function xqdoc2html:copy-examples(
628 $xqdoc,628 $xqdoc,
629 $examplesFolderDestination as xs:string,629 $examplesFolderDestination as xs:string,
630 $examplePath as xs:string)630 $examplePath as xs:string)
@@ -665,7 +665,7 @@
665 : separated by <pre>;</pre>.665 : separated by <pre>;</pre>.
666 : @return The full path of the file to be resolved.666 : @return The full path of the file to be resolved.
667 :)667 :)
668declare %private %ann:nondeterministic function xqdoc2html:resolve-file-path(668declare %private %an:nondeterministic function xqdoc2html:resolve-file-path(
669 $relativeFilePath as xs:string,669 $relativeFilePath as xs:string,
670 $directoryPath as xs:string670 $directoryPath as xs:string
671) as xs:string671) as xs:string
@@ -683,7 +683,7 @@
683 fn:error($err:UE010, fn:concat("The path <", $directoryPath, "> must point to an existing directory:"))683 fn:error($err:UE010, fn:concat("The path <", $directoryPath, "> must point to an existing directory:"))
684};684};
685685
686declare %private %ann:sequential function xqdoc2html:copy-example(686declare %private %an:sequential function xqdoc2html:copy-example(
687 $exampleSource as xs:string,687 $exampleSource as xs:string,
688 $exampleDestination as xs:string,688 $exampleDestination as xs:string,
689 $examplePath as xs:string)689 $examplePath as xs:string)
@@ -827,7 +827,7 @@
827 }827 }
828};828};
829829
830declare %private %ann:sequential function xqdoc2html:parse-spec-args(830declare %private %an:sequential function xqdoc2html:parse-spec-args(
831 $exampleSource as xs:string,831 $exampleSource as xs:string,
832 $specLines as xs:string*) as xs:string832 $specLines as xs:string*) as xs:string
833{833{
@@ -868,7 +868,7 @@
868868
869};869};
870870
871declare %private %ann:sequential function xqdoc2html:load-expected-results(871declare %private %an:sequential function xqdoc2html:load-expected-results(
872 $result_split as xs:string*) as xs:string872 $result_split as xs:string*) as xs:string
873{873{
874 if(fn:empty($result_split)) then874 if(fn:empty($result_split)) then
@@ -889,7 +889,7 @@
889 xqdoc2html:load-expected-results(fn:subsequence($result_split, 2)))889 xqdoc2html:load-expected-results(fn:subsequence($result_split, 2)))
890};890};
891891
892declare %private %ann:sequential function xqdoc2html:parse-spec-results(892declare %private %an:sequential function xqdoc2html:parse-spec-results(
893 $exampleSource as xs:string,893 $exampleSource as xs:string,
894 $specLines as xs:string*) as xs:string894 $specLines as xs:string*) as xs:string
895{895{
@@ -966,7 +966,7 @@
966 else ()}966 else ()}
967 {if(contains($type, "nondeterministic ")) then967 {if(contains($type, "nondeterministic ")) then
968 <a href="{$ZorbaOptAndAnn}"968 <a href="{$ZorbaOptAndAnn}"
969 title="%ann:nondeterministic"969 title="%an:nondeterministic"
970 target="_blank"><img src="{concat($imagesPath, "Nondeterministic.gif")}" alt="Nondeterministic"/></a>970 target="_blank"><img src="{concat($imagesPath, "Nondeterministic.gif")}" alt="Nondeterministic"/></a>
971 else ()}971 else ()}
972 {if(contains($type, "variadic")) then972 {if(contains($type, "variadic")) then
@@ -1001,7 +1001,7 @@
1001 : @param $examplePath string with the paths where the examples are kept separated by ; .1001 : @param $examplePath string with the paths where the examples are kept separated by ; .
1002 : @return The created XHTML page.1002 : @return The created XHTML page.
1003 :)1003 :)
1004declare %private %ann:sequential function xqdoc2html:add-left-menu(1004declare %private %an:sequential function xqdoc2html:add-left-menu(
1005 $menu,1005 $menu,
1006 $templatePath as xs:string) {1006 $templatePath as xs:string) {
1007 let $doc := fn:parse-xml(file:read-text($templatePath))1007 let $doc := fn:parse-xml(file:read-text($templatePath))
@@ -1023,7 +1023,7 @@
1023 : @param $examplePath string with the paths where the examples are kept separated by ; .1023 : @param $examplePath string with the paths where the examples are kept separated by ; .
1024 : @return The created XHTML page.1024 : @return The created XHTML page.
1025 :)1025 :)
1026declare %private %ann:sequential function xqdoc2html:doc(1026declare %private %an:sequential function xqdoc2html:doc(
1027 $xqdoc,1027 $xqdoc,
1028 $menu,1028 $menu,
1029 $templatePath as xs:string,1029 $templatePath as xs:string,
@@ -1068,7 +1068,7 @@
1068 : @param $xqdocXhtmlPath location where the resulting Xhtml will be saved on disk.1068 : @param $xqdocXhtmlPath location where the resulting Xhtml will be saved on disk.
1069 : @return The 'body' of the XHTML.1069 : @return The 'body' of the XHTML.
1070 :)1070 :)
1071declare %private %ann:nondeterministic function xqdoc2html:body(1071declare %private %an:nondeterministic function xqdoc2html:body(
1072 $xqdoc,1072 $xqdoc,
1073 $xqdocXhtmlPath as xs:string)1073 $xqdocXhtmlPath as xs:string)
1074{1074{
@@ -1181,7 +1181,7 @@
1181 : @param $indexCollector the modules names part of the left menu.1181 : @param $indexCollector the modules names part of the left menu.
1182 : @return the XHTML for the 'Module Resources'.1182 : @return the XHTML for the 'Module Resources'.
1183 :)1183 :)
1184declare %private %ann:nondeterministic function xqdoc2html:module-resources(1184declare %private %an:nondeterministic function xqdoc2html:module-resources(
1185 $xqdocXhtmlPath as xs:string,1185 $xqdocXhtmlPath as xs:string,
1186 $moduleUri as xs:string)1186 $moduleUri as xs:string)
1187{1187{
@@ -1321,14 +1321,14 @@
1321 let $name := $variable/xqdoc:uri/text()1321 let $name := $variable/xqdoc:uri/text()
1322 let $type := $variable/xqdoc:comment/xqdoc:custom[@tag="type"]/text()1322 let $type := $variable/xqdoc:comment/xqdoc:custom[@tag="type"]/text()
1323 let $isExternal := $variable/xqdoc:comment/xqdoc:custom[@tag="isExternal"]/text()1323 let $isExternal := $variable/xqdoc:comment/xqdoc:custom[@tag="isExternal"]/text()
1324 let $ann := string-join((for $annotation in $variable/xqdoc:annotations/xqdoc:annotation1324 let $an := string-join((for $annotation in $variable/xqdoc:annotations/xqdoc:annotation
1325 return data($annotation/@localname),1325 return data($annotation/@localname),
1326 if($isExternal) then "external" else ""," ")," ")1326 if($isExternal) then "external" else ""," ")," ")
13271327
1328 where (count($variable/xqdoc:annotations/xqdoc:annotation[@localname="private"]) = 0)1328 where (count($variable/xqdoc:annotations/xqdoc:annotation[@localname="private"]) = 0)
1329 order by $name1329 order by $name
1330 return (<tr>1330 return (<tr>
1331 <td>{xqdoc2html:add-images($ann)}</td>1331 <td>{xqdoc2html:add-images($an)}</td>
1332 <td>${$name}1332 <td>${$name}
1333 {if(exists($type)) then concat(" as ",$type) else ""}1333 {if(exists($type)) then concat(" as ",$type) else ""}
1334 {if(exists($isExternal)) then " external" else ()}<br/>1334 {if(exists($isExternal)) then " external" else ()}<br/>
@@ -1464,7 +1464,7 @@
1464 : @param $xqdocXhtmlPath location where the resulting Xhtml will be saved on disk.1464 : @param $xqdocXhtmlPath location where the resulting Xhtml will be saved on disk.
1465 : @return the XHTML for the function details.1465 : @return the XHTML for the function details.
1466 :)1466 :)
1467declare %private %ann:nondeterministic function xqdoc2html:functions($functions, $xqdocXhtmlPath) {1467declare %private %an:nondeterministic function xqdoc2html:functions($functions, $xqdocXhtmlPath) {
1468 if(count($functions)) then (1468 if(count($functions)) then (
1469 <div class="section"><span id="functions">Functions</span></div>,1469 <div class="section"><span id="functions">Functions</span></div>,
1470 for $function in $functions1470 for $function in $functions
@@ -1682,7 +1682,7 @@
1682 : @param $xqdocXhtmlPath location where the resulting Xhtml will be saved on disk.1682 : @param $xqdocXhtmlPath location where the resulting Xhtml will be saved on disk.
1683 : @return the XHTML for the function 'example' annotations.1683 : @return the XHTML for the function 'example' annotations.
1684 :)1684 :)
1685declare %private %ann:nondeterministic function xqdoc2html:annotations-example($comment, $xqdocXhtmlPath) {1685declare %private %an:nondeterministic function xqdoc2html:annotations-example($comment, $xqdocXhtmlPath) {
1686 let $example := $comment//xqdoc:custom[@tag="example"]1686 let $example := $comment//xqdoc:custom[@tag="example"]
1687 return1687 return
1688 if (count($example) = 0) then ()1688 if (count($example) = 0) then ()
@@ -1784,7 +1784,7 @@
1784 : @param $templatePath the path to the main.html template.1784 : @param $templatePath the path to the main.html template.
1785 : @return The content of the function index page.1785 : @return The content of the function index page.
1786 :)1786 :)
1787declare %private %ann:sequential function xqdoc2html:generate-function-index-xhtml(1787declare %private %an:sequential function xqdoc2html:generate-function-index-xhtml(
1788 $indexFunctionLeft,1788 $indexFunctionLeft,
1789 $templatePath as xs:string,1789 $templatePath as xs:string,
1790 $functionIndexPath as xs:string1790 $functionIndexPath as xs:string
@@ -1815,7 +1815,7 @@
1815 }1815 }
1816};1816};
18171817
1818declare %private %ann:sequential function xqdoc2html:collect-entry (1818declare %private %an:sequential function xqdoc2html:collect-entry (
1819 $href as xs:string,1819 $href as xs:string,
1820 $name as xs:string,1820 $name as xs:string,
1821 $structure as xs:string,1821 $structure as xs:string,
@@ -1829,7 +1829,7 @@
1829 moduleURI="{$moduleURI}" /> as last into $xqdoc2html:menuEntries;1829 moduleURI="{$moduleURI}" /> as last into $xqdoc2html:menuEntries;
1830};1830};
18311831
1832declare %private %ann:sequential function xqdoc2html:collect-menu-entries()1832declare %private %an:sequential function xqdoc2html:collect-menu-entries()
1833{1833{
1834 for $docNode in dml:collection(xs:QName("xqdoc2html:collection"))1834 for $docNode in dml:collection(xs:QName("xqdoc2html:collection"))
1835 let $module := $docNode/xqdoc:xqdoc/xqdoc:module,1835 let $module := $docNode/xqdoc:xqdoc/xqdoc:module,
@@ -1859,7 +1859,7 @@
1859 : @param $moduleUri module URI.1859 : @param $moduleUri module URI.
1860 : @return $table after the subcategory together with the modules were added to it.1860 : @return $table after the subcategory together with the modules were added to it.
1861 :)1861 :)
1862declare %private %ann:sequential function xqdoc2html:create-module-helper(1862declare %private %an:sequential function xqdoc2html:create-module-helper(
1863 $table,1863 $table,
1864 $category as xs:string,1864 $category as xs:string,
1865 $currentCategory as xs:string1865 $currentCategory as xs:string
@@ -1910,7 +1910,7 @@
1910(:~1910(:~
1911 : Recursive helper1911 : Recursive helper
1912 :)1912 :)
1913declare %private %ann:sequential function xqdoc2html:create-module-table-rec(1913declare %private %an:sequential function xqdoc2html:create-module-table-rec(
1914 $level1 as xs:string*,1914 $level1 as xs:string*,
1915 $leveln as xs:string*,1915 $leveln as xs:string*,
1916 $curentCat as xs:string,1916 $curentCat as xs:string,
@@ -1956,7 +1956,7 @@
1956 : @param $moduleUri module URI.1956 : @param $moduleUri module URI.
1957 : @return $root after the subcategories were added to it.1957 : @return $root after the subcategories were added to it.
1958 :)1958 :)
1959declare %private %ann:sequential function xqdoc2html:create-module-table(1959declare %private %an:sequential function xqdoc2html:create-module-table(
1960 $level1 as xs:string*,1960 $level1 as xs:string*,
1961 $root)1961 $root)
1962{1962{
@@ -1986,7 +1986,7 @@
1986};1986};
19871987
1988(:1988(:
1989declare %private %ann:sequential function xqdoc2html:create-specialized-left-menu(1989declare %private %an:sequential function xqdoc2html:create-specialized-left-menu(
1990 $generalLeftMenu,1990 $generalLeftMenu,
1991 $moduleUri as xs:string)1991 $moduleUri as xs:string)
1992{1992{
@@ -2030,7 +2030,7 @@
2030 : @param $zorbaVersion Zorba version.2030 : @param $zorbaVersion Zorba version.
2031 : @return The content of the new index.html.2031 : @return The content of the new index.html.
2032 :)2032 :)
2033declare %private %ann:sequential function xqdoc2html:generate-index-html(2033declare %private %an:sequential function xqdoc2html:generate-index-html(
2034 $templatePath as xs:string,2034 $templatePath as xs:string,
2035 $menu,2035 $menu,
2036 $modules,2036 $modules,
20372037
=== modified file 'modules/org/expath/ns/file.xq'
--- modules/org/expath/ns/file.xq 2012-04-11 20:22:52 +0000
+++ modules/org/expath/ns/file.xq 2012-04-27 13:22:48 +0000
@@ -24,7 +24,7 @@
24module namespace file = "http://expath.org/ns/file";24module namespace file = "http://expath.org/ns/file";
2525
26import schema namespace output = "http://www.w3.org/2010/xslt-xquery-serialization";26import schema namespace output = "http://www.w3.org/2010/xslt-xquery-serialization";
27declare namespace ann = "http://www.zorba-xquery.com/annotations";27declare namespace an = "http://www.zorba-xquery.com/annotations";
28declare namespace ver = "http://www.zorba-xquery.com/options/versioning";28declare namespace ver = "http://www.zorba-xquery.com/options/versioning";
29declare option ver:module-version "2.0";29declare option ver:module-version "2.0";
3030
@@ -46,7 +46,7 @@
46 : @error file:FOFL0004 If <pre>$file</pre> points to a directory.46 : @error file:FOFL0004 If <pre>$file</pre> points to a directory.
47 : @error file:FOFL9999 If any other error occurs.47 : @error file:FOFL9999 If any other error occurs.
48 :)48 :)
49declare %ann:sequential function file:append(49declare %an:sequential function file:append(
50 $file as xs:string,50 $file as xs:string,
51 $content as item()*,51 $content as item()*,
52 $serializer-params as element(output:serialization-parameters)?52 $serializer-params as element(output:serialization-parameters)?
@@ -67,7 +67,7 @@
67 : @error file:FOFL0004 If <pre>$file</pre> points to a directory.67 : @error file:FOFL0004 If <pre>$file</pre> points to a directory.
68 : @error file:FOFL9999 If any other error occurs.68 : @error file:FOFL9999 If any other error occurs.
69 :)69 :)
70declare %ann:sequential function file:append-binary(70declare %an:sequential function file:append-binary(
71 $file as xs:string,71 $file as xs:string,
72 $content as xs:base64Binary*72 $content as xs:base64Binary*
73) as empty-sequence() external;73) as empty-sequence() external;
@@ -81,7 +81,7 @@
81 : @error file:FOFL0004 If <pre>$file</pre> points to a directory.81 : @error file:FOFL0004 If <pre>$file</pre> points to a directory.
82 : @error file:FOFL9999 If any other error occurs.82 : @error file:FOFL9999 If any other error occurs.
83 :)83 :)
84declare %private %ann:sequential function file:append-text(84declare %private %an:sequential function file:append-text(
85 $file as xs:string,85 $file as xs:string,
86 $content as xs:string*86 $content as xs:string*
87) as empty-sequence() external;87) as empty-sequence() external;
@@ -99,7 +99,7 @@
99 : parent directory does not exist either.99 : parent directory does not exist either.
100 : @error file:FOFL9999 If any other error occurs.100 : @error file:FOFL9999 If any other error occurs.
101 :)101 :)
102declare %ann:nondeterministic %ann:sequential function file:copy(102declare %an:nondeterministic %an:sequential function file:copy(
103 $source as xs:string,103 $source as xs:string,
104 $destination as xs:string104 $destination as xs:string
105) as empty-sequence()105) as empty-sequence()
@@ -126,7 +126,7 @@
126 : @error file:FOFL0004 If <pre>$sourceFile</pre> points to a directory.126 : @error file:FOFL0004 If <pre>$sourceFile</pre> points to a directory.
127 : @error file:FOFL9999 If any other error occurs.127 : @error file:FOFL9999 If any other error occurs.
128 :)128 :)
129declare %private %ann:sequential function file:copy-file-impl(129declare %private %an:sequential function file:copy-file-impl(
130 $sourceFile as xs:string,130 $sourceFile as xs:string,
131 $destination as xs:string131 $destination as xs:string
132) as empty-sequence() external;132) as empty-sequence() external;
@@ -143,7 +143,7 @@
143 : parent directory does not exist either.143 : parent directory does not exist either.
144 : @error file:FOFL9999 If any other error occurs.144 : @error file:FOFL9999 If any other error occurs.
145 :)145 :)
146declare %private %ann:nondeterministic %ann:sequential function file:copy-directory-impl(146declare %private %an:nondeterministic %an:sequential function file:copy-directory-impl(
147 $sourceDir as xs:string,147 $sourceDir as xs:string,
148 $destination as xs:string148 $destination as xs:string
149) as empty-sequence()149) as empty-sequence()
@@ -182,7 +182,7 @@
182 : @error file:FOFL0003 If <pre>$destination</pre> directory does not exist.182 : @error file:FOFL0003 If <pre>$destination</pre> directory does not exist.
183 : @error file:FOFL9999 If any other error occurs.183 : @error file:FOFL9999 If any other error occurs.
184 :)184 :)
185declare %private %ann:nondeterministic %ann:sequential function file:copy-directory-content(185declare %private %an:nondeterministic %an:sequential function file:copy-directory-content(
186 $sourceDir as xs:string,186 $sourceDir as xs:string,
187 $destination as xs:string187 $destination as xs:string
188) as empty-sequence()188) as empty-sequence()
@@ -208,7 +208,7 @@
208 : existing file.208 : existing file.
209 : @error file:FOFL9999 If any other error occurs.209 : @error file:FOFL9999 If any other error occurs.
210 :)210 :)
211declare %ann:sequential function file:create-directory(211declare %an:sequential function file:create-directory(
212 $dir as xs:string212 $dir as xs:string
213) as empty-sequence() external;213) as empty-sequence() external;
214214
@@ -223,7 +223,7 @@
223 : @error file:FOFL0001 If the <pre>$path</pre> path does not exist.223 : @error file:FOFL0001 If the <pre>$path</pre> path does not exist.
224 : @error file:FOFL9999 If any other error occurs.224 : @error file:FOFL9999 If any other error occurs.
225 :)225 :)
226declare %ann:nondeterministic %ann:sequential function file:delete(226declare %an:nondeterministic %an:sequential function file:delete(
227 $path as xs:string227 $path as xs:string
228) as empty-sequence()228) as empty-sequence()
229{229{
@@ -244,7 +244,7 @@
244 : @error file:FOFL0001 If the <pre>$file</pre> path does not exist.244 : @error file:FOFL0001 If the <pre>$file</pre> path does not exist.
245 : @error file:FOFL9999 If any other error occurs.245 : @error file:FOFL9999 If any other error occurs.
246 :)246 :)
247declare %private %ann:sequential function file:delete-file-impl(247declare %private %an:sequential function file:delete-file-impl(
248 $file as xs:string248 $file as xs:string
249) as empty-sequence() external;249) as empty-sequence() external;
250250
@@ -257,7 +257,7 @@
257 : @error file:FOFL0003 If <pre>$dir</pre> does not point to a directory.257 : @error file:FOFL0003 If <pre>$dir</pre> does not point to a directory.
258 : @error file:FOFL9999 If any other error occurs.258 : @error file:FOFL9999 If any other error occurs.
259 :)259 :)
260declare %private %ann:nondeterministic %ann:sequential function file:delete-directory-impl(260declare %private %an:nondeterministic %an:sequential function file:delete-directory-impl(
261 $dir as xs:string261 $dir as xs:string
262) as empty-sequence()262) as empty-sequence()
263{263{
@@ -278,7 +278,7 @@
278 : @param $path The path/URI to test for existence.278 : @param $path The path/URI to test for existence.
279 : @return true if the path/URI points to an existing file system item.279 : @return true if the path/URI points to an existing file system item.
280 :)280 :)
281declare %ann:nondeterministic function file:exists(281declare %an:nondeterministic function file:exists(
282 $path as xs:string282 $path as xs:string
283) as xs:boolean external;283) as xs:boolean external;
284284
@@ -289,7 +289,7 @@
289 : @param $dir The path/URI to test.289 : @param $dir The path/URI to test.
290 : @return true if the path/URI points to a directory.290 : @return true if the path/URI points to a directory.
291 :)291 :)
292declare %ann:nondeterministic function file:is-directory(292declare %an:nondeterministic function file:is-directory(
293 $dir as xs:string293 $dir as xs:string
294) as xs:boolean external;294) as xs:boolean external;
295295
@@ -299,7 +299,7 @@
299 : @param $dir The path/URI to test.299 : @param $dir The path/URI to test.
300 : @return true if the path/URI points to a file.300 : @return true if the path/URI points to a file.
301 :)301 :)
302declare %ann:nondeterministic function file:is-file(302declare %an:nondeterministic function file:is-file(
303 $file as xs:string303 $file as xs:string
304) as xs:boolean external;304) as xs:boolean external;
305305
@@ -316,7 +316,7 @@
316 : directory does not exist either.316 : directory does not exist either.
317 : @error file:FOFL9999 If any other error occurs.317 : @error file:FOFL9999 If any other error occurs.
318 :)318 :)
319declare %ann:sequential function file:move(319declare %an:sequential function file:move(
320 $source as xs:string,320 $source as xs:string,
321 $destination as xs:string321 $destination as xs:string
322) as empty-sequence()322) as empty-sequence()
@@ -335,7 +335,7 @@
335 : @error file:FOFL0004 If <pre>$source</pre> points to a directory.335 : @error file:FOFL0004 If <pre>$source</pre> points to a directory.
336 : @error file:FOFL9999 If any other error occurs.336 : @error file:FOFL9999 If any other error occurs.
337 :)337 :)
338declare %ann:nondeterministic function file:read-binary(338declare %an:nondeterministic function file:read-binary(
339 $file as xs:string339 $file as xs:string
340) as xs:base64Binary external;340) as xs:base64Binary external;
341341
@@ -352,7 +352,7 @@
352 : @error file:FOFL0004 If <pre>$source</pre> points to a directory.352 : @error file:FOFL0004 If <pre>$source</pre> points to a directory.
353 : @error file:FOFL9999 If any other error occurs.353 : @error file:FOFL9999 If any other error occurs.
354 :)354 :)
355declare %ann:nondeterministic function file:read-text(355declare %an:nondeterministic function file:read-text(
356 $file as xs:string356 $file as xs:string
357) as xs:string357) as xs:string
358{358{
@@ -374,7 +374,7 @@
374 : @error file:FOFL0006 If <pre>$encoding</pre> is not supported.374 : @error file:FOFL0006 If <pre>$encoding</pre> is not supported.
375 : @error file:FOFL9999 If any other error occurs.375 : @error file:FOFL9999 If any other error occurs.
376 :)376 :)
377declare %ann:nondeterministic function file:read-text(377declare %an:nondeterministic function file:read-text(
378 $file as xs:string,378 $file as xs:string,
379 $encoding as xs:string379 $encoding as xs:string
380) as xs:string external;380) as xs:string external;
@@ -392,7 +392,7 @@
392 : @error file:FOFL0004 If <pre>$source</pre> points to a directory.392 : @error file:FOFL0004 If <pre>$source</pre> points to a directory.
393 : @error file:FOFL9999 If any other error occurs.393 : @error file:FOFL9999 If any other error occurs.
394 :)394 :)
395declare %ann:nondeterministic function file:read-text-lines(395declare %an:nondeterministic function file:read-text-lines(
396 $file as xs:string396 $file as xs:string
397) as xs:string*397) as xs:string*
398{398{
@@ -419,14 +419,10 @@
419 : @error file:FOFL0006 If <pre>$encoding</pre> is not supported.419 : @error file:FOFL0006 If <pre>$encoding</pre> is not supported.
420 : @error file:FOFL9999 If any other error occurs.420 : @error file:FOFL9999 If any other error occurs.
421 :)421 :)
422declare %ann:nondeterministic function file:read-text-lines(422declare %an:nondeterministic function file:read-text-lines(
423 $file as xs:string,423 $file as xs:string,
424 $encoding as xs:string424 $encoding as xs:string
425) as xs:string*425) as xs:string* external;
426{
427 let $content := file:read-text($file, $encoding)
428 return fn:tokenize($content, "\n")
429};
430426
431(:~427(:~
432 : This is an internal function that copies an entire source directory to an428 : This is an internal function that copies an entire source directory to an
@@ -437,7 +433,7 @@
437 : @param $destinationDir The existing destination directory.433 : @param $destinationDir The existing destination directory.
438 : @return The empty sequence.434 : @return The empty sequence.
439 :)435 :)
440declare %private %ann:nondeterministic %ann:sequential function file:copy-directory(436declare %private %an:nondeterministic %an:sequential function file:copy-directory(
441 $sourceDir as xs:string,437 $sourceDir as xs:string,
442 $destinationDir as xs:string438 $destinationDir as xs:string
443) as empty-sequence()439) as empty-sequence()
@@ -476,7 +472,7 @@
476 : @error file:FOFL0004 If <pre>$file</pre> points to a directory.472 : @error file:FOFL0004 If <pre>$file</pre> points to a directory.
477 : @error file:FOFL9999 If any other error occurs.473 : @error file:FOFL9999 If any other error occurs.
478 :)474 :)
479declare %ann:sequential function file:write(475declare %an:sequential function file:write(
480 $file as xs:string,476 $file as xs:string,
481 $content as item()*,477 $content as item()*,
482 $serializer-params as element(output:serialization-parameters)?478 $serializer-params as element(output:serialization-parameters)?
@@ -497,7 +493,7 @@
497 : @error file:FOFL0004 If <pre>$file</pre> points to a directory.493 : @error file:FOFL0004 If <pre>$file</pre> points to a directory.
498 : @error file:FOFL9999 If any other error occurs.494 : @error file:FOFL9999 If any other error occurs.
499 :)495 :)
500declare %ann:sequential function file:write-binary(496declare %an:sequential function file:write-binary(
501 $file as xs:string,497 $file as xs:string,
502 $content as xs:base64Binary*498 $content as xs:base64Binary*
503) as empty-sequence() external;499) as empty-sequence() external;
@@ -511,7 +507,7 @@
511 : @error file:FOFL0004 If <pre>$file</pre> points to a directory.507 : @error file:FOFL0004 If <pre>$file</pre> points to a directory.
512 : @error file:FOFL9999 If any other error occurs.508 : @error file:FOFL9999 If any other error occurs.
513 :)509 :)
514declare %ann:sequential function file:write-binary(510declare %an:sequential function file:write-binary(
515 $file as xs:string,511 $file as xs:string,
516 $content as xs:base64Binary*512 $content as xs:base64Binary*
517) as empty-sequence() external;513) as empty-sequence() external;
@@ -528,7 +524,7 @@
528 : @error file:FOFL0004 If <pre>$file</pre> points to a directory.524 : @error file:FOFL0004 If <pre>$file</pre> points to a directory.
529 : @error file:FOFL9999 If any other error occurs.525 : @error file:FOFL9999 If any other error occurs.
530 :)526 :)
531declare %private %ann:sequential function file:write-text(527declare %private %an:sequential function file:write-text(
532 $file as xs:string,528 $file as xs:string,
533 $content as xs:string*529 $content as xs:string*
534) as empty-sequence() external;530) as empty-sequence() external;
@@ -544,7 +540,7 @@
544 : @error file:FOFL0003 If <pre>$dir</pre> does not point to an existing directory.540 : @error file:FOFL0003 If <pre>$dir</pre> does not point to an existing directory.
545 : @error file:FOFL9999 If any other error occurs.541 : @error file:FOFL9999 If any other error occurs.
546 :)542 :)
547declare %ann:nondeterministic function file:list(543declare %an:nondeterministic function file:list(
548 $dir as xs:string544 $dir as xs:string
549) as xs:string* external;545) as xs:string* external;
550546
@@ -563,7 +559,7 @@
563 : @error file:FOFL0003 If <pre>$dir</pre> does not point to an existing directory.559 : @error file:FOFL0003 If <pre>$dir</pre> does not point to an existing directory.
564 : @error file:FOFL9999 If any other error occurs.560 : @error file:FOFL9999 If any other error occurs.
565 :)561 :)
566declare %ann:nondeterministic function file:list(562declare %an:nondeterministic function file:list(
567 $path as xs:string,563 $path as xs:string,
568 $recursive as xs:boolean564 $recursive as xs:boolean
569) as xs:string*565) as xs:string*
@@ -600,7 +596,7 @@
600 : @error file:FOFL0003 If <pre>$dir</pre> does not point to an existing directory.596 : @error file:FOFL0003 If <pre>$dir</pre> does not point to an existing directory.
601 : @error file:FOFL9999 If any other error occurs.597 : @error file:FOFL9999 If any other error occurs.
602 :)598 :)
603declare %ann:nondeterministic function file:list(599declare %an:nondeterministic function file:list(
604 $path as xs:string,600 $path as xs:string,
605 $recursive as xs:boolean,601 $recursive as xs:boolean,
606 $pattern as xs:string602 $pattern as xs:string
@@ -641,7 +637,7 @@
641 : @error file:FOFL0001 If the <pre>$path</pre> does not exist.637 : @error file:FOFL0001 If the <pre>$path</pre> does not exist.
642 : @error file:FOFL9999 If any other error occurs.638 : @error file:FOFL9999 If any other error occurs.
643 :)639 :)
644declare %ann:nondeterministic function file:last-modified(640declare %an:nondeterministic function file:last-modified(
645 $path as xs:string641 $path as xs:string
646) as xs:dateTime external;642) as xs:dateTime external;
647643
@@ -654,7 +650,7 @@
654 : @error file:FOFL0004 If the <pre>$file</pre> points to a directory.650 : @error file:FOFL0004 If the <pre>$file</pre> points to a directory.
655 : @error file:FOFL9999 If any other error occurs.651 : @error file:FOFL9999 If any other error occurs.
656 :)652 :)
657declare %ann:nondeterministic function file:size(653declare %an:nondeterministic function file:size(
658 $file as xs:string654 $file as xs:string
659) as xs:integer external;655) as xs:integer external;
660656
661657
=== modified file 'modules/org/expath/ns/file.xq.src/file.cpp'
--- modules/org/expath/ns/file.xq.src/file.cpp 2012-04-11 20:22:52 +0000
+++ modules/org/expath/ns/file.xq.src/file.cpp 2012-04-27 13:22:48 +0000
@@ -223,6 +223,124 @@
223223
224//*****************************************************************************224//*****************************************************************************
225225
226ReadTextLinesFunction::ReadTextLinesFunction(const FileModule* aModule)
227 : FileFunction(aModule)
228{
229}
230
231ItemSequence_t
232ReadTextLinesFunction::evaluate(
233 const ExternalFunction::Arguments_t& aArgs,
234 const StaticContext* aSctxCtx,
235 const DynamicContext* aDynCtx) const
236{
237 String lFileStr = getFilePathString(aArgs, 0);
238 File_t lFile = File::createFile(lFileStr.c_str());
239 String lEncoding("UTF-8");
240
241 // preconditions
242 if (!lFile->exists()) {
243 raiseFileError("FOFL0001", "A file does not exist at this path", lFile->getFilePath());
244 }
245 if (lFile->isDirectory()) {
246 raiseFileError("FOFL0004", "The given path points to a directory", lFile->getFilePath());
247 }
248
249 lEncoding = getEncodingArg(aArgs, 1);
250
251 return ItemSequence_t(new LinesItemSequence(lFile, lEncoding, this));
252}
253
254ReadTextLinesFunction::LinesItemSequence::LinesItemSequence(
255 const File_t& aFile,
256 const String& aEncoding,
257 const ReadTextLinesFunction* aFunc)
258 : theFile(aFile),
259 theEncoding(aEncoding),
260 theFunc(aFunc)
261{
262}
263
264Iterator_t
265ReadTextLinesFunction::LinesItemSequence::getIterator()
266{
267 return new ReadTextLinesFunction::LinesItemSequence::LinesIterator(
268 theFile, theEncoding, theFunc
269 );
270}
271
272ReadTextLinesFunction::LinesItemSequence::LinesIterator::LinesIterator(
273 const File_t& aFile,
274 const String& aEncoding,
275 const ReadTextLinesFunction* aFunc)
276 : theFile(aFile),
277 theEncoding(aEncoding),
278 theFunc(aFunc),
279 theStream(0)
280{
281}
282
283ReadTextLinesFunction::LinesItemSequence::LinesIterator::~LinesIterator()
284{
285 delete theStream;
286}
287
288void
289ReadTextLinesFunction::LinesItemSequence::LinesIterator::open()
290{
291 if ( transcode::is_necessary( theEncoding.c_str() ) )
292 {
293 try
294 {
295 theStream = new transcode::stream<std::ifstream>(theEncoding.c_str());
296 }
297 catch (std::invalid_argument const& e)
298 {
299 theFunc->raiseFileError("FOFL0006", "Unsupported encoding", theEncoding.c_str());
300 }
301 }
302 else
303 {
304 theStream = new std::ifstream();
305 }
306 theFile->openInputStream(*theStream, false, true);
307}
308
309bool
310ReadTextLinesFunction::LinesItemSequence::LinesIterator::next(Item& aRes)
311{
312 if (!theStream || !theStream->good())
313 return false;
314
315 std::string lStr;
316 getline(*theStream, lStr);
317
318 if (theStream->bad())
319 {
320 return false;
321 }
322 else
323 {
324 aRes = theFunc->theModule->getItemFactory()->createString(lStr);
325 return true;
326 }
327}
328
329void
330ReadTextLinesFunction::LinesItemSequence::LinesIterator::close()
331{
332 delete theStream;
333 theStream = 0;
334}
335
336bool
337ReadTextLinesFunction::LinesItemSequence::LinesIterator::isOpen() const
338{
339 return theStream != 0;
340}
341
342//*****************************************************************************
343
226ExistsFunction::ExistsFunction(const FileModule* aModule)344ExistsFunction::ExistsFunction(const FileModule* aModule)
227 : FileFunction(aModule)345 : FileFunction(aModule)
228{346{
229347
=== modified file 'modules/org/expath/ns/file.xq.src/file.h'
--- modules/org/expath/ns/file.xq.src/file.h 2012-04-11 20:22:52 +0000
+++ modules/org/expath/ns/file.xq.src/file.h 2012-04-27 13:22:48 +0000
@@ -316,6 +316,70 @@
316316
317//*****************************************************************************317//*****************************************************************************
318318
319 class ReadTextLinesFunction : public FileFunction
320 {
321 public:
322 ReadTextLinesFunction(const FileModule* aModule);
323
324 virtual String
325 getLocalName() const { return "read-text-lines"; }
326
327 virtual ItemSequence_t
328 evaluate(const ExternalFunction::Arguments_t& args,
329 const StaticContext* aSctxCtx,
330 const DynamicContext* aDynCtx) const;
331
332 protected:
333 class LinesItemSequence : public ItemSequence
334 {
335 protected:
336 File_t theFile;
337 String theEncoding;
338 const ReadTextLinesFunction* theFunc;
339
340 class LinesIterator : public Iterator
341 {
342 protected:
343 const File_t& theFile;
344 const String& theEncoding;
345 const ReadTextLinesFunction* theFunc;
346
347 std::ifstream* theStream;
348
349 public:
350 LinesIterator(
351 const File_t&,
352 const String&,
353 const ReadTextLinesFunction*);
354
355 virtual ~LinesIterator();
356
357 virtual void
358 open();
359
360 virtual bool
361 next(Item&);
362
363 virtual void
364 close();
365
366 virtual bool
367 isOpen() const;
368 };
369
370 public:
371 LinesItemSequence(
372 const File_t& aFile,
373 const String& aEncoding,
374 const ReadTextLinesFunction*);
375
376 Iterator_t
377 getIterator();
378 };
379 };
380
381//*****************************************************************************
382
319 class WriteTextFunction : public WriterFileFunction383 class WriteTextFunction : public WriterFileFunction
320 {384 {
321 public:385 public:
322386
=== modified file 'modules/org/expath/ns/file.xq.src/file_module.cpp'
--- modules/org/expath/ns/file.xq.src/file_module.cpp 2012-04-11 20:22:52 +0000
+++ modules/org/expath/ns/file.xq.src/file_module.cpp 2012-04-27 13:22:48 +0000
@@ -46,6 +46,8 @@
46 lFunc = new ReadBinaryFunction(this);46 lFunc = new ReadBinaryFunction(this);
47 } else if (aLocalname == "read-text") {47 } else if (aLocalname == "read-text") {
48 lFunc = new ReadTextFunction(this);48 lFunc = new ReadTextFunction(this);
49 } else if (aLocalname == "read-text-lines") {
50 lFunc = new ReadTextLinesFunction(this);
49 } else if (aLocalname == "exists") {51 } else if (aLocalname == "exists") {
50 lFunc = new ExistsFunction(this);52 lFunc = new ExistsFunction(this);
51 } else if (aLocalname == "is-directory") {53 } else if (aLocalname == "is-directory") {
5254
=== modified file 'modules/org/jsoniq/www/functions.xq'
--- modules/org/jsoniq/www/functions.xq 2012-03-23 21:17:48 +0000
+++ modules/org/jsoniq/www/functions.xq 2012-04-27 13:22:48 +0000
@@ -1,3 +1,22 @@
1xquery version "1.0";
2
3(:
4 : Copyright 2006-2012 The FLWOR Foundation.
5 :
6 : Licensed under the Apache License, Version 2.0 (the "License");
7 : you may not use this file except in compliance with the License.
8 : You may obtain a copy of the License at
9 :
10 : http://www.apache.org/licenses/LICENSE-2.0
11 :
12 : Unless required by applicable law or agreed to in writing, software
13 : distributed under the License is distributed on an "AS IS" BASIS,
14 : WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 : See the License for the specific language governing permissions and
16 : limitations under the License.
17:)
18
19
1(:~20(:~
2 : This module provides the functions defined by the JSONiq specification,21 : This module provides the functions defined by the JSONiq specification,
3 : sections 1.7 (Functions) and 1.10 (Update Primitives). JSONiq extends22 : sections 1.7 (Functions) and 1.10 (Update Primitives). JSONiq extends
@@ -8,7 +27,9 @@
8 : for details.27 : for details.
9 :28 :
10 : This module depends on having the JSONiq feature enabled in Zorba,29 : This module depends on having the JSONiq feature enabled in Zorba,
11 : ie, Zorba must be compiled with ZORBA_WITH_JSON.30 : i.e., Zorba must be compiled with ZORBA_WITH_JSON.
31 :
32 : @author Markos Zaharioudakis, Matthias Brantner
12 :)33 :)
13module namespace jn = "http://www.jsoniq.org/functions";34module namespace jn = "http://www.jsoniq.org/functions";
1435
1536
=== modified file 'modules/org/jsoniq/www/pregenerated/errors.xq'
--- modules/org/jsoniq/www/pregenerated/errors.xq 2012-04-03 04:05:17 +0000
+++ modules/org/jsoniq/www/pregenerated/errors.xq 2012-04-27 13:22:48 +0000
@@ -81,6 +81,7 @@
81declare variable $jerr:JNTY0007 as xs:QName := fn:QName($jerr:NS, "jerr:JNTY0007");81declare variable $jerr:JNTY0007 as xs:QName := fn:QName($jerr:NS, "jerr:JNTY0007");
8282
83(:~83(:~
84 :error raised by node constructor or updating expression indicating that a JSON item cannot appear in the corresponding content sequence
84:)85:)
85declare variable $jerr:JNTY0011 as xs:QName := fn:QName($jerr:NS, "jerr:JNTY0011");86declare variable $jerr:JNTY0011 as xs:QName := fn:QName($jerr:NS, "jerr:JNTY0011");
8687
8788
=== modified file 'modules/w3c/pregenerated/xqt-errors.xq'
--- modules/w3c/pregenerated/xqt-errors.xq 2012-04-11 20:22:52 +0000
+++ modules/w3c/pregenerated/xqt-errors.xq 2012-04-27 13:22:48 +0000
@@ -1240,6 +1240,24 @@
12401240
1241(:~1241(:~
1242 :1242 :
1243 : Identifier cannot be used to retrive a resource containing text
1244 :
1245 : @see http://www.w3.org/2005/xqt-errors
1246:)
1247declare variable $err:FOUT1170 as xs:QName := fn:QName($err:NS, "err:FOUT1170");
1248
1249(:~
1250 :
1251 : Retrieved resource contains octets that cannot be decoded into Unicode
1252 : using the specified encoding, the resulting characters are not
1253 : permitted XML characters or requested encoding not supported
1254 :
1255 : @see http://www.w3.org/2005/xqt-errors
1256:)
1257declare variable $err:FOUT1190 as xs:QName := fn:QName($err:NS, "err:FOUT1190");
1258
1259(:~
1260 :
1243 : It is a static error if an updating expression is used in any position1261 : It is a static error if an updating expression is used in any position
1244 : other than one of the following:1262 : other than one of the following:
1245 : - The topmost expression in the body of a query.1263 : - The topmost expression in the body of a query.
12461264
=== modified file 'modules/w3c/xpath_functions.xq'
--- modules/w3c/xpath_functions.xq 2012-04-11 20:22:52 +0000
+++ modules/w3c/xpath_functions.xq 2012-04-27 13:22:48 +0000
@@ -994,4 +994,49 @@
994(:~994(:~
995 : @see for semantics please check <a href="http://www.w3.org/TR/xpath-functions-30/#func-string">fn:string</a>995 : @see for semantics please check <a href="http://www.w3.org/TR/xpath-functions-30/#func-string">fn:string</a>
996 :)996 :)
997declare function fn:string($arg as item()?) as xs:string external;
998\ No newline at end of file997\ No newline at end of file
998declare function fn:string($arg as item()?) as xs:string external;
999
1000(:~
1001 : @see for semantics please check <a href="http://www.w3.org/TR/xpath-functions-30/#func-available-environment-variables">fn:available-environment-variables</a>
1002 :)
1003declare function fn:available-environment-variables() as xs:string* external;
1004
1005(:~
1006 : @see for semantics please check <a href="http://www.w3.org/TR/xpath-functions-30/#func-environment-variable">fn:environment-variable</a>
1007 :)
1008declare function fn:environment-variable($arg as xs:string) as xs:string? external;
1009
1010(:~
1011 : @see for semantics please check <a href="http://www.w3.org/TR/xpath-functions-30/#func-unparsed-text">fn:unparsed-text</a>
1012 :)
1013declare function fn:unparsed-text($href as xs:string?) as xs:string? external;
1014
1015(:~
1016 : @see for semantics please check <a href="http://www.w3.org/TR/xpath-functions-30/#func-unparsed-text">fn:unparsed-text</a>
1017 :)
1018declare function fn:unparsed-text($href as xs:string?, $encoding as xs:string) as xs:string? external;
1019
1020(:~
1021 : @see for semantics please check <a href="http://www.w3.org/TR/xpath-functions-30/#func-unparsed-text-available">fn:unparsed-text-available</a>
1022 :)
1023declare function fn:unparsed-text-available($href as xs:string?) as xs:boolean external;
1024
1025(:~
1026 : @see for semantics please check <a href="http://www.w3.org/TR/xpath-functions-30/#func-unparsed-text-lines">fn:unparsed-text-lines</a>
1027 :)
1028declare function fn:unparsed-text-lines( $href as xs:string?, $encoding as xs:string) as xs:string* external;
1029
1030(:~
1031 : @see for semantics please check <a href="http://www.w3.org/TR/xpath-functions-30/#func-unparsed-text-available">fn:unparsed-text-available</a>
1032 :)
1033declare function fn:unparsed-text-available( $href as xs:string?, $encoding as xs:string) as xs:boolean external;
1034
1035(:~
1036 : @see for semantics please check <a href="http://www.w3.org/TR/xpath-functions-30/#func-uri-collection">fn:uri-collection</a>
1037 :)
1038declare function fn:uri-collection() as xs:anyURI* external;
1039
1040(:~
1041 : @see for semantics please check <a href="http://www.w3.org/TR/xpath-functions-30/#func-uri-collection">fn:uri-collection</a>
1042 :)
1043declare function fn:uri-collection($arg as xs:string?) as xs:anyURI* external;
9991044
=== modified file 'schemas/CMakeLists.txt'
--- schemas/CMakeLists.txt 2012-04-11 20:22:52 +0000
+++ schemas/CMakeLists.txt 2012-04-27 13:22:48 +0000
@@ -19,6 +19,18 @@
19DECLARE_ZORBA_SCHEMA(URI "http://www.w3.org/2010/xslt-xquery-serialization"19DECLARE_ZORBA_SCHEMA(URI "http://www.w3.org/2010/xslt-xquery-serialization"
20 FILE xslt-xquery-serialization.xsd)20 FILE xslt-xquery-serialization.xsd)
2121
22# XDM and PUL
23DECLARE_ZORBA_SCHEMA(URI "http://www.zorba-xquery.com/schemas/pul"
24 FILE pul.xsd)
25DECLARE_ZORBA_SCHEMA(URI "http://www.zorba-xquery.com/schemas/complete-pul"
26 FILE complete-pul.xsd)
27DECLARE_ZORBA_SCHEMA(URI "http://www.zorba-xquery.com/schemas/xdm"
28 FILE xdm.xsd)
29
30# XQueryX
31DECLARE_ZORBA_SCHEMA(URI "http://www.w3.org/2005/XQueryX"
32FILE XQueryX.xsd)
33
22# The following are DTDs, not schemas, but (currently at least) we34# The following are DTDs, not schemas, but (currently at least) we
23# only ever load them when an imported schema file references them35# only ever load them when an imported schema file references them
24# (which, in turn, only happens in error cases - see bug 921624). So,36# (which, in turn, only happens in error cases - see bug 921624). So,
2537
=== added file 'schemas/XQueryX.xsd'
--- schemas/XQueryX.xsd 1970-01-01 00:00:00 +0000
+++ schemas/XQueryX.xsd 2012-04-27 13:22:48 +0000
@@ -0,0 +1,1962 @@
1<?xml version="1.0"?>
2<!-- ================================================================================ -->
3<!-- NOTES TO READERS OF THIS SCHEMA: -->
4<!-- The default value for both minOccurs and maxOccurs is "1". -->
5<!-- The XQueryX schema has been designed to provide the ability to extend definitions -->
6<!-- of top-level elements in extensions such as Full-Text and the Update Facility. -->
7<!-- The nature of the modification is to define named complex types and redefine -->
8<!-- those top-level elements in terms of the named complex types. -->
9<!-- ================================================================================ -->
10<!-- Changes from Recommendation (edition 1): -->
11<!-- * Element defs using anon complex types changed to use named types (bug #4924) -->
12<!-- * In Example 4, replaced xqx:parentheziedExpr with xqx:sequenceExpr (bug #4963) -->
13<!-- * In XSLT stylesheet, deleted template for xqx:parenthesizedExpr (bug #4963) -->
14<!-- * Replaced link to grammar applet with correct link (bug #5323) -->
15<!-- * In XSLT stylesheet, corrected template for xqx:namespaceDeclaration (bug #5343) -->
16<!-- Changes from Recommendation (edition 2): -->
17<!-- * Added support for new Windowing clause in FLWOR expression -->
18<!-- * Added support for new Group By Clause in FLWOR expression -->
19<!-- * Added support for new Count Clause in FLWOR expression -->
20<!-- * Added support for keyword "outer" on for expression -->
21<!-- * Modified structure of FLWOR clause per "simplified FLWOR expressions" -->
22<!-- * Modified validation syntax per Bugzilla Bug 5472 -->
23<!-- * Modified function declaration so that external functions can be nondeterminstic -->
24<!-- * Modified variable declaration so external variables can have an initial value -->
25<!-- * Added support for new try-catch expression -->
26<!-- * Added support for new decimal formatting declaration -->
27<!-- * Added support for encoding in the version declaration -->
28<!-- * Added support for new context item declaration -->
29<!-- * Added support for computed namespace constructor -->
30<!-- * Made changes triggered by Bugzilla Bugs 6309, 6310, and 6311 -->
31<!-- * Modified errlist syntax per Bugzilla Bug 7053 -->
32<!-- * Added support for public/private functions -->
33<!-- * Replaced "outer for" support with support for "allowing empty" -->
34<!-- * Added support for higher-order functions -->
35<!-- * Added support for value-based "switch" expression -->
36<!-- * Use pattern to prohibit "#)" in pragma contents per Bugzilla Bug 2711 -->
37<!-- * Changed functionItemExpr child element QName to be functionName for consistency -->
38<!-- * Replaced "public", "private", and "[non]deterministic" with %-annotations -->
39<!-- * Added EQName to permit "URI-literal":NCNAME as alternative to NCName:NCName -->
40<!-- * Changed type of atomicType to EQName, so it's really atomicOrUnionType -->
41<!-- ================================================================================ -->
42<!-- Errata applied: -->
43<!-- XQX.E1 - Editorial (Bugzilla Bug 4924) -->
44<!-- XQX.E7 - Substantive (Bugzilla Bug 2711) -->
45<!-- ================================================================================ -->
46<!-- Modifications: -->
47<!-- 2008-07-30 - Add XQuery 1.1 grouping and windowing support -->
48<!-- 2008-09-18 - Add XQuery 1.1 count and outer-for support, simplified FLWOR -->
49<!-- 2008-09-27 - Add validation type, nondeterministic function declarations, -->
50<!-- initial values for external variables, try-catch expression -->
51<!-- 2008-11-25 - Add support for number formatting, Snelson's version declaration -->
52<!-- proposal, context item declaration, computed namespace constructor,-->
53<!-- fixes for validate expression, and change to allow the count -->
54<!-- clause to only be an intermediate expression -->
55<!-- 2009-01-13 - Bugs 6309 and 6310 (fixes to details of certain windowing clauses -->
56<!-- 2009-03-03 - tumblingWindowClause syntax now matches slidingWindowClause syntax -->
57<!-- 2009-09-06 - Modified errlist syntax per Bugzilla Bug 7053 -->
58<!-- 2009-10-09 - Added support for private/public functions -->
59<!-- Replace "outer for" with "allowing empty" -->
60<!-- 2009-10-22 - Add support for higher-order functions & switch expression -->
61<!-- 2010-04-06 - Changed functionItemExpr child QName -> functionName (consistency) -->
62<!-- 2010-05-10 - Added %-annotation support for varDecl and functionDecl -->
63<!-- 2010-06-23 - Added support for partial function application -->
64<!-- 2011-02-02 - Added support for EQNames and atomicOrUnionType -->
65<!-- 2011-05-04 - Updated structure of catch component of try-catch expression -->
66<!-- 2011-05-04 - Updated validationexpr, mode/type alternatives, type is EQName -->
67<!-- ================================================================================ -->
68
69<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
70 xmlns="http://www.w3.org/2005/XQueryX"
71 targetNamespace="http://www.w3.org/2005/XQueryX"
72 elementFormDefault="qualified" attributeFormDefault="qualified">
73
74
75<!-- A few helper declarations -->
76 <xsd:complexType name="emptyContent"/>
77
78 <xsd:element name="NCName" type="xsd:NCName"/>
79
80 <xsd:complexType name="QName">
81 <xsd:simpleContent>
82 <xsd:extension base="xsd:NCName">
83 <xsd:attribute name="prefix" type="xsd:NCName" use="optional"/>
84 </xsd:extension>
85 </xsd:simpleContent>
86 </xsd:complexType>
87
88 <xsd:complexType name="EQName">
89 <xsd:simpleContent>
90 <xsd:extension base="xsd:NCName">
91 <xsd:attribute name="prefix" type="xsd:NCName" use="optional"/>
92 <xsd:attribute name="URI" type="xsd:string" use="optional"/>
93 </xsd:extension>
94 </xsd:simpleContent>
95 </xsd:complexType>
96
97<!-- The base expression class -->
98 <xsd:complexType name="expr"/>
99
100 <xsd:element name="expr" type="expr" abstract="true"/>
101
102
103<!-- A list of expressions -->
104 <xsd:complexType name="exprList">
105 <xsd:sequence>
106 <xsd:element ref="expr" minOccurs="0" maxOccurs="unbounded"/>
107 </xsd:sequence>
108 </xsd:complexType>
109
110<!-- A list of expressions or placeholders -->
111<!-- 2010-06-23 - Added support for partial function application -->
112 <xsd:complexType name="exprOrPlaceholderList">
113 <xsd:sequence>
114 <xsd:choice minOccurs="0" maxOccurs="unbounded">
115 <xsd:element ref="expr"/>
116 <xsd:element name="argumentPlaceholder" type="emptyContent"/>
117 </xsd:choice>
118 </xsd:sequence>
119 </xsd:complexType>
120
121<!-- A type to be used by elements that comprise an optional expr -->
122 <xsd:complexType name="exprWrapperOptional">
123 <xsd:sequence>
124 <xsd:element ref="expr" minOccurs="0"/>
125 </xsd:sequence>
126 </xsd:complexType>
127
128<!-- Simple wrapper class -->
129 <xsd:complexType name="exprWrapper">
130 <xsd:sequence>
131 <xsd:element ref="expr"/>
132 </xsd:sequence>
133 </xsd:complexType>
134
135<!-- constant expressions. We have 4 different subclasses for this -->
136 <xsd:complexType name="constantExpr">
137 <xsd:complexContent>
138 <xsd:extension base="expr">
139 <xsd:sequence>
140 <xsd:element name="value" type="xsd:anyType"/>
141 </xsd:sequence>
142 </xsd:extension>
143 </xsd:complexContent>
144 </xsd:complexType>
145
146 <xsd:element name="constantExpr" type="constantExpr" abstract="true"
147 substitutionGroup="expr"/>
148
149
150 <xsd:complexType name="integerConstantExpr">
151 <xsd:complexContent>
152 <xsd:restriction base="constantExpr">
153 <xsd:sequence>
154 <xsd:element name="value" type="xsd:integer"/>
155 </xsd:sequence>
156 </xsd:restriction>
157 </xsd:complexContent>
158 </xsd:complexType>
159
160 <xsd:element name="integerConstantExpr" type="integerConstantExpr"
161 substitutionGroup="constantExpr"/>
162
163
164 <xsd:complexType name="decimalConstantExpr">
165 <xsd:complexContent>
166 <xsd:restriction base="constantExpr">
167 <xsd:sequence>
168 <xsd:element name="value" type="xsd:decimal"/>
169 </xsd:sequence>
170 </xsd:restriction>
171 </xsd:complexContent>
172 </xsd:complexType>
173
174 <xsd:element name="decimalConstantExpr" type="decimalConstantExpr"
175 substitutionGroup="constantExpr"/>
176
177
178 <xsd:complexType name="doubleConstantExpr">
179 <xsd:complexContent>
180 <xsd:restriction base="constantExpr">
181 <xsd:sequence>
182 <xsd:element name="value" type="xsd:double"/>
183 </xsd:sequence>
184 </xsd:restriction>
185 </xsd:complexContent>
186 </xsd:complexType>
187
188 <xsd:element name="doubleConstantExpr" type="doubleConstantExpr"
189 substitutionGroup="constantExpr"/>
190
191
192 <xsd:complexType name="stringConstantExpr">
193 <xsd:complexContent>
194 <xsd:restriction base="constantExpr">
195 <xsd:sequence>
196 <xsd:element name="value" type="xsd:string"/>
197 </xsd:sequence>
198 </xsd:restriction>
199 </xsd:complexContent>
200 </xsd:complexType>
201
202 <xsd:element name="stringConstantExpr" type="stringConstantExpr"
203 substitutionGroup="constantExpr"/>
204
205
206<!-- Variables -->
207 <xsd:complexType name="varRef">
208 <xsd:complexContent>
209 <xsd:extension base="expr">
210 <xsd:sequence>
211 <xsd:element name="name" type="EQName"/>
212 </xsd:sequence>
213 </xsd:extension>
214 </xsd:complexContent>
215 </xsd:complexType>
216
217 <xsd:element name="varRef" type="varRef" substitutionGroup="expr"/>
218
219
220<!-- root and context-item expressions -->
221<!-- rootExpr deleted per Bugzilla Bug #2523 -->
222 <xsd:complexType name="contextItemExpr">
223 <xsd:complexContent>
224 <xsd:extension base="expr"/>
225 </xsd:complexContent>
226 </xsd:complexType>
227
228 <xsd:element name="contextItemExpr" type="contextItemExpr"
229 substitutionGroup="expr"/>
230
231
232<!-- Pragmas and extension expressions -->
233<!-- 2010-01-01, JM replaced pragmaContents elem def'n with one that has a pattern -->
234 <xsd:complexType name="pragma">
235 <xsd:sequence>
236 <xsd:element name="pragmaName" type="EQName"/>
237 <xsd:element name="pragmaContents">
238 <xsd:simpleType>
239 <xsd:restriction base="xsd:string">
240 <xsd:pattern value="(([^#]|#+[^\)#])*#*)"/>
241 </xsd:restriction>
242 </xsd:simpleType>
243 </xsd:element>
244 </xsd:sequence>
245 </xsd:complexType>
246
247 <xsd:element name="pragma" type="pragma"/>
248
249
250 <xsd:complexType name="extensionExpr">
251 <xsd:complexContent>
252 <xsd:extension base="expr">
253 <xsd:sequence>
254 <xsd:element ref="pragma" maxOccurs="unbounded"/>
255 <xsd:element name="argExpr" type="exprWrapper" minOccurs="0"/>
256 </xsd:sequence>
257 </xsd:extension>
258 </xsd:complexContent>
259 </xsd:complexType>
260
261 <xsd:element name="extensionExpr" type="extensionExpr"
262 substitutionGroup="expr"/>
263
264
265<!-- Function call expressions -->
266<!-- 2010-06-23 - Added support for partial function application -->
267 <xsd:complexType name="functionCallExpr">
268 <xsd:complexContent>
269 <xsd:extension base="expr">
270 <xsd:sequence>
271 <xsd:element name="functionName" type="EQName"/>
272 <xsd:element name="arguments" type="exprOrPlaceholderList" minOccurs="0"/>
273 </xsd:sequence>
274 </xsd:extension>
275 </xsd:complexContent>
276 </xsd:complexType>
277
278 <xsd:element name="functionCallExpr" type="functionCallExpr"
279 substitutionGroup="expr"/>
280
281
282<!-- Constructor functions -->
283 <xsd:complexType name="constructorFunctionExpr">
284 <xsd:complexContent>
285 <xsd:extension base="expr">
286 <xsd:sequence>
287 <xsd:element name="typeName" type="EQName"/>
288 <xsd:element name="argExpr" type="exprWrapper"/>
289 </xsd:sequence>
290 </xsd:extension>
291 </xsd:complexContent>
292 </xsd:complexType>
293
294 <xsd:element name="constructorFunctionExpr" type="constructorFunctionExpr"
295 substitutionGroup="expr"/>
296
297
298<!-- Sequence expressions -->
299 <xsd:complexType name="sequenceExpr">
300 <xsd:complexContent>
301 <xsd:extension base="expr">
302 <xsd:sequence>
303 <xsd:element ref="expr" minOccurs="0" maxOccurs="unbounded"/>
304 </xsd:sequence>
305 </xsd:extension>
306 </xsd:complexContent>
307 </xsd:complexType>
308
309 <xsd:element name="sequenceExpr" type="sequenceExpr" substitutionGroup="expr"/>
310
311
312 <xsd:complexType name="rangeSequenceExpr">
313 <xsd:complexContent>
314 <xsd:extension base="expr">
315 <xsd:sequence>
316 <xsd:element name="startExpr" type="exprWrapper"/>
317 <xsd:element name="endExpr" type="exprWrapper"/>
318 </xsd:sequence>
319 </xsd:extension>
320 </xsd:complexContent>
321 </xsd:complexType>
322
323 <xsd:element name="rangeSequenceExpr" type="rangeSequenceExpr"
324 substitutionGroup="expr"/>
325
326
327<!-- Builtin operator expressions -->
328 <xsd:complexType name="operatorExpr">
329 <xsd:complexContent>
330 <xsd:extension base="expr"/>
331 </xsd:complexContent>
332 </xsd:complexType>
333
334
335 <xsd:complexType name="unaryOperatorExpr">
336 <xsd:complexContent>
337 <xsd:extension base="operatorExpr">
338 <xsd:sequence>
339 <xsd:element name="operand" type="exprWrapper"/>
340 </xsd:sequence>
341 </xsd:extension>
342 </xsd:complexContent>
343 </xsd:complexType>
344
345
346 <xsd:complexType name="binaryOperatorExpr">
347 <xsd:complexContent>
348 <xsd:extension base="operatorExpr">
349 <xsd:sequence>
350 <xsd:element name="firstOperand" type="exprWrapper"/>
351 <xsd:element name="secondOperand" type="exprWrapper"/>
352 </xsd:sequence>
353 </xsd:extension>
354 </xsd:complexContent>
355 </xsd:complexType>
356
357
358 <xsd:element name="operatorExpr" type="operatorExpr"
359 abstract="true" substitutionGroup="expr"/>
360
361 <xsd:element name="arithmeticOp" type="operatorExpr"
362 abstract="true" substitutionGroup="operatorExpr"/>
363
364 <xsd:element name="addOp" type="binaryOperatorExpr"
365 substitutionGroup="arithmeticOp"/>
366
367 <xsd:element name="subtractOp" type="binaryOperatorExpr"
368 substitutionGroup="arithmeticOp"/>
369
370 <xsd:element name="multiplyOp" type="binaryOperatorExpr"
371 substitutionGroup="arithmeticOp"/>
372
373 <xsd:element name="divOp" type="binaryOperatorExpr"
374 substitutionGroup="arithmeticOp"/>
375
376 <xsd:element name="idivOp" type="binaryOperatorExpr"
377 substitutionGroup="arithmeticOp"/>
378
379 <xsd:element name="modOp" type="binaryOperatorExpr"
380 substitutionGroup="arithmeticOp"/>
381
382 <xsd:element name="unaryMinusOp" type="unaryOperatorExpr"
383 substitutionGroup="arithmeticOp"/>
384
385 <xsd:element name="unaryPlusOp" type="unaryOperatorExpr"
386 substitutionGroup="arithmeticOp"/>
387
388 <xsd:element name="comparisonOp" type="binaryOperatorExpr" abstract="true"
389 substitutionGroup="operatorExpr"/>
390
391 <xsd:element name="valueComparisonOp" type="binaryOperatorExpr" abstract="true"
392 substitutionGroup="operatorExpr"/>
393
394 <xsd:element name="eqOp" type="binaryOperatorExpr"
395 substitutionGroup="valueComparisonOp"/>
396
397 <xsd:element name="neOp" type="binaryOperatorExpr"
398 substitutionGroup="valueComparisonOp"/>
399
400 <xsd:element name="gtOp" type="binaryOperatorExpr"
401 substitutionGroup="valueComparisonOp"/>
402
403 <xsd:element name="geOp" type="binaryOperatorExpr"
404 substitutionGroup="valueComparisonOp"/>
405
406 <xsd:element name="ltOp" type="binaryOperatorExpr"
407 substitutionGroup="valueComparisonOp"/>
408
409 <xsd:element name="leOp" type="binaryOperatorExpr"
410 substitutionGroup="valueComparisonOp"/>
411
412 <xsd:element name="generalComparisonOp" type="binaryOperatorExpr" abstract="true"
413 substitutionGroup="operatorExpr"/>
414
415 <xsd:element name="equalOp" type="binaryOperatorExpr"
416 substitutionGroup="generalComparisonOp"/>
417
418 <xsd:element name="notEqualOp" type="binaryOperatorExpr"
419 substitutionGroup="generalComparisonOp"/>
420
421 <xsd:element name="lessThanOp" type="binaryOperatorExpr"
422 substitutionGroup="generalComparisonOp"/>
423
424 <xsd:element name="lessThanOrEqualOp" type="binaryOperatorExpr"
425 substitutionGroup="generalComparisonOp"/>
426
427 <xsd:element name="greaterThanOp" type="binaryOperatorExpr"
428 substitutionGroup="generalComparisonOp"/>
429
430 <xsd:element name="greaterThanOrEqualOp" type="binaryOperatorExpr"
431 substitutionGroup="generalComparisonOp"/>
432
433 <xsd:element name="nodeComparisonOp" type="binaryOperatorExpr" abstract="true"
434 substitutionGroup="operatorExpr"/>
435
436 <xsd:element name="isOp" type="binaryOperatorExpr"
437 substitutionGroup="nodeComparisonOp"/>
438
439 <xsd:element name="orderComparisonOp" type="binaryOperatorExpr" abstract="true"
440 substitutionGroup="operatorExpr"/>
441
442 <xsd:element name="nodeBeforeOp" type="binaryOperatorExpr"
443 substitutionGroup="orderComparisonOp"/>
444
445 <xsd:element name="nodeAfterOp" type="binaryOperatorExpr"
446 substitutionGroup="orderComparisonOp"/>
447
448 <xsd:element name="logicalOp" type="binaryOperatorExpr" abstract="true"
449 substitutionGroup="operatorExpr"/>
450
451 <xsd:element name="andOp" type="binaryOperatorExpr"
452 substitutionGroup="logicalOp"/>
453
454 <xsd:element name="orOp" type="binaryOperatorExpr"
455 substitutionGroup="logicalOp"/>
456
457 <xsd:element name="setOp" type="binaryOperatorExpr"
458 abstract="true" substitutionGroup="operatorExpr"/>
459
460 <xsd:element name="unionOp" type="binaryOperatorExpr"
461 substitutionGroup="setOp"/>
462
463 <xsd:element name="intersectOp" type="binaryOperatorExpr"
464 substitutionGroup="setOp"/>
465
466 <xsd:element name="exceptOp" type="binaryOperatorExpr"
467 substitutionGroup="setOp"/>
468
469
470<!-- Basic typenames -->
471<!-- By changing the type attribute from QName to EQName, this is now atomicOrUnionType -->
472<!-- However, for backwards compatibility w/XQueryX 1.0, the name had to stay the same-->
473 <xsd:element name="atomicType" type="EQName" substitutionGroup="itemType"/>
474
475
476<!-- Used in castable expression and cast expression -->
477 <xsd:complexType name="singleType">
478 <xsd:sequence>
479 <xsd:element ref="atomicType"/>
480 <xsd:element name="optional" type="emptyContent" minOccurs="0"/>
481 </xsd:sequence>
482 </xsd:complexType>
483
484 <xsd:element name="singleType" type="singleType"/>
485
486
487<!-- Item type schema types and elements -->
488 <xsd:element name="itemType" abstract="true"/>
489
490
491 <xsd:complexType name="emptyItemTypeContent"/>
492
493 <xsd:element name="anyItemType" type="emptyItemTypeContent"
494 substitutionGroup="itemType"/>
495
496
497 <xsd:simpleType name="occurrenceIndicator">
498 <xsd:restriction base="xsd:string">
499 <xsd:enumeration value="?"/>
500 <xsd:enumeration value="*"/>
501 <xsd:enumeration value="+"/>
502 </xsd:restriction>
503 </xsd:simpleType>
504
505
506<!-- Sequence type -->
507 <xsd:complexType name="sequenceType">
508 <xsd:choice>
509 <xsd:element name="voidSequenceType" type="emptyContent"/>
510 <xsd:sequence>
511 <xsd:element ref="itemType"/>
512 <xsd:element name="occurrenceIndicator" type="occurrenceIndicator"
513 minOccurs="0"/>
514 </xsd:sequence>
515 </xsd:choice>
516 </xsd:complexType>
517
518 <xsd:element name="sequenceType" type="sequenceType"/>
519
520 <xsd:element name="typeDeclaration" type="sequenceType"/>
521
522
523<!-- Represents a "typed" variable (for clause, let clause etc) -->
524 <xsd:complexType name="typedVariableBinding">
525 <xsd:sequence>
526 <xsd:element name="varName" type="EQName"/>
527 <xsd:element ref="typeDeclaration" minOccurs="0"/>
528 </xsd:sequence>
529 </xsd:complexType>
530
531 <xsd:element name="typedVariableBinding" type="typedVariableBinding"/>
532
533
534<!-- Represents an untyped variable for the "at" clause in a for clause -->
535 <xsd:element name="positionalVariableBinding" type="EQName"/>
536
537 <xsd:element name="variableBinding" type="EQName"/>
538
539
540<!-- Represents all variable bindings in a for or let clause except typed and -->
541<!-- positional variable bindings -->
542 <xsd:element name="forLetClauseItemExtensions" abstract="true"/>
543
544
545<!-- Major syntax productions: FLWOR clause components -->
546<!-- for clause -->
547 <xsd:complexType name="forClauseItem">
548 <xsd:sequence>
549 <xsd:element ref="typedVariableBinding"/>
550 <xsd:element name="allowingEmpty" type="emptyContent"
551 minOccurs="0"/>
552 <xsd:element ref="positionalVariableBinding" minOccurs="0" maxOccurs="1"/>
553 <xsd:element ref="forLetClauseItemExtensions" minOccurs="0"
554 maxOccurs="unbounded"/>
555 <xsd:element name="forExpr" type="exprWrapper"/>
556 </xsd:sequence>
557 </xsd:complexType>
558
559 <xsd:element name="forClauseItem" type="forClauseItem"/>
560
561
562 <xsd:complexType name="forClause">
563 <xsd:sequence>
564 <xsd:element ref="forClauseItem" minOccurs="1" maxOccurs="unbounded"/>
565 </xsd:sequence>
566 </xsd:complexType>
567
568 <xsd:element name="forClause" type="forClause"/>
569
570
571<!-- let clause -->
572 <xsd:complexType name="letClauseItem">
573 <xsd:sequence>
574 <xsd:choice>
575 <xsd:sequence>
576 <xsd:element ref="typedVariableBinding"/>
577 <xsd:element ref="forLetClauseItemExtensions"
578 minOccurs="0" maxOccurs="unbounded"/>
579 </xsd:sequence>
580 <xsd:element ref="forLetClauseItemExtensions"
581 minOccurs="0" maxOccurs="unbounded"/>
582 </xsd:choice>
583 <xsd:element name="letExpr" type="exprWrapper"/>
584 </xsd:sequence>
585 </xsd:complexType>
586
587 <xsd:element name="letClauseItem" type="letClauseItem"/>
588
589
590 <xsd:complexType name="letClause">
591 <xsd:sequence>
592 <xsd:element ref="letClauseItem" maxOccurs="unbounded"/>
593 </xsd:sequence>
594 </xsd:complexType>
595
596 <xsd:element name="letClause" type="letClause"/>
597
598
599<!-- This is the windowClause (part of FLWOR expression) -->
600<!-- It corresponds to the following XQuery grammar -->
601<!-- WindowClause ::= "for" (TumblingWindowClause | SlidingWindowClause) -->
602 <xsd:complexType name="windowClause">
603 <xsd:choice>
604 <xsd:element ref="tumblingWindowClause"/>
605 <xsd:element ref="slidingWindowClause"/>
606 </xsd:choice>
607 </xsd:complexType>
608
609 <xsd:element name="windowClause" type="windowClause"/>
610
611
612<!-- This is the tumblingWindowClause -->
613<!-- It corresponds to the following XQuery grammar -->
614<!-- TumblingWindowClause ::= "tumbling" "window" "$" VarName TypeDeclaration? -->
615<!-- "in" ExprSingle WindowStartCondition WindowEndCondition? -->
616 <xsd:complexType name="tumblingWindowClause">
617 <xsd:sequence>
618 <xsd:element ref="typedVariableBinding"/>
619 <xsd:element name="bindingSequence" type="exprWrapper"/>
620 <xsd:element ref="windowStartCondition"/>
621 <xsd:element ref="windowEndCondition" minOccurs="0"/>
622 </xsd:sequence>
623 </xsd:complexType>
624
625 <xsd:element name="tumblingWindowClause" type="tumblingWindowClause"/>
626
627
628<!-- This is the slidingWindowClause -->
629<!-- It corresponds to the following XQuery grammar -->
630<!-- SlidingWindowClause ::= "sliding" "window" "$" VarName TypeDeclaration? -->
631<!-- "in" ExprSingle WindowStartCondition WindowEndCondition -->
632 <xsd:complexType name="slidingWindowClause">
633 <xsd:sequence>
634 <xsd:element ref="typedVariableBinding"/>
635 <xsd:element name="bindingSequence" type="exprWrapper"/>
636 <xsd:element ref="windowStartCondition"/>
637 <xsd:element ref="windowEndCondition"/>
638 </xsd:sequence>
639 </xsd:complexType>
640
641 <xsd:element name="slidingWindowClause" type="slidingWindowClause"/>
642
643
644<!-- windowStartCondition -->
645<!-- Corresponds to the following XQuery grammar -->
646<!-- WindowStartCondition ::= "start" WindowVars "when" ExprSingle -->
647 <xsd:complexType name="windowStartCondition">
648 <xsd:sequence>
649 <xsd:element ref="windowVars" minOccurs="0"/>
650 <xsd:element name="winStartExpr" type="exprWrapper"/>
651 </xsd:sequence>
652 </xsd:complexType>
653
654 <xsd:element name="windowStartCondition" type="windowStartCondition"/>
655
656
657<!-- windowEndCondition -->
658<!-- Corresponds to the following XQuery grammar -->
659<!-- WindowEndCondition ::= "only"? "end" WindowVars "when" ExprSingle -->
660 <xsd:complexType name="windowEndCondition">
661 <xsd:sequence>
662 <xsd:element ref="windowVars" minOccurs="0"/>
663 <xsd:element name="winEndExpr" type="exprWrapper"/>
664 </xsd:sequence>
665 <xsd:attribute name="onlyEnd" type="xsd:boolean" default="false"/>
666 </xsd:complexType>
667
668 <xsd:element name="windowEndCondition" type="windowEndCondition"/>
669
670
671<!-- windowVars -->
672<!-- Corresponds to the following XQuery grammar -->
673<!-- WindowVars ::= ("$" \)? PositionalVar? ("previous" "$" PreviousItem)? -->
674<!-- ("next" "$" NextItem)? -->
675 <xsd:complexType name="windowVars">
676 <xsd:sequence>
677 <xsd:element name="currentItem" type="EQName" minOccurs="0"/>
678 <xsd:element ref="positionalVariableBinding" minOccurs="0"/>
679 <xsd:element name="previousItem" type="EQName" minOccurs="0"/>
680 <xsd:element name="nextItem" type="EQName" minOccurs="0"/>
681 </xsd:sequence>
682 </xsd:complexType>
683
684 <xsd:element name="windowVars" type="windowVars"/>
685
686
687<!-- countClause (part of FLWOR expression) -->
688 <xsd:complexType name="countClause">
689 <xsd:sequence>
690 <xsd:element ref="varRef"/>
691 </xsd:sequence>
692 </xsd:complexType>
693
694 <xsd:element name="countClause" type="countClause"/>
695
696
697<!-- whereClause (part of FLWOR expression) -->
698 <xsd:element name="whereClause" type="exprWrapper"/>
699
700
701<!-- groupByClause (part of FLWOR expression) -->
702<!-- Corresponds to the following XQuery syntax -->
703<!-- GroupByClause ::= "group" "by" GroupingSpecList -->
704<!-- GroupingSpecList ::= GroupingSpec ("," GroupingSpec)* -->
705 <xsd:complexType name="groupByClause">
706 <xsd:sequence maxOccurs="unbounded">
707 <xsd:element ref="groupingSpec"/>
708 </xsd:sequence>
709 </xsd:complexType>
710
711 <xsd:element name="groupByClause" type="groupByClause"/>
712
713
714<!-- Corresponds to the following XQuery syntax -->
715<!-- GroupingSpec ::= "$" VarName ("collation" URILiteral)? -->
716 <xsd:complexType name="groupingSpec">
717 <xsd:sequence>
718 <xsd:element name="varName" type="EQName"/>
719 <xsd:element name="collation" type="xsd:string" minOccurs="0"/>
720 </xsd:sequence>
721 </xsd:complexType>
722
723 <xsd:element name="groupingSpec" type="groupingSpec"/>
724
725
726<!-- order by clause -->
727 <xsd:simpleType name="emptyOrderingMode">
728 <xsd:restriction base="xsd:string">
729 <xsd:enumeration value="empty greatest"/>
730 <xsd:enumeration value="empty least"/>
731 </xsd:restriction>
732 </xsd:simpleType>
733
734 <xsd:simpleType name="orderingKind">
735 <xsd:restriction base="xsd:string">
736 <xsd:enumeration value="ascending"/>
737 <xsd:enumeration value="descending"/>
738 </xsd:restriction>
739 </xsd:simpleType>
740
741
742 <xsd:complexType name="orderModifier">
743 <xsd:sequence>
744 <xsd:element name="orderingKind" type="orderingKind" minOccurs="0"/>
745 <xsd:element name="emptyOrderingMode" type="emptyOrderingMode" minOccurs="0"/>
746 <xsd:element name="collation" type="xsd:string" minOccurs="0"/>
747 </xsd:sequence>
748 </xsd:complexType>
749
750 <xsd:element name="orderModifier" type="orderModifier"/>
751
752
753 <xsd:complexType name="orderBySpec">
754 <xsd:sequence>
755 <xsd:element name="orderByExpr" type="exprWrapper"/>
756 <xsd:element ref="orderModifier" minOccurs="0"/>
757 </xsd:sequence>
758 </xsd:complexType>
759
760 <xsd:element name="orderBySpec" type="orderBySpec"/>
761
762
763 <xsd:complexType name="orderByClause">
764 <xsd:sequence>
765 <xsd:element name="stable" type="emptyContent" minOccurs="0"/>
766 <xsd:element ref="orderBySpec" maxOccurs="unbounded"/>
767 </xsd:sequence>
768 </xsd:complexType>
769
770 <xsd:element name="orderByClause" type="orderByClause"/>
771
772
773<!-- return clause -->
774 <xsd:element name="returnClause" type="exprWrapper"/>
775
776
777<!-- This is the XQuery 1.1 flwor expression -->
778<!-- Corresponds to the following XQuery syntax: -->
779<!-- 1.1 FLWORExpr ::= (ForClause | LetClause | WindowClause) -->
780<!-- (ForClause | LetClause | WindowClause | CountClause | -->
781<!-- WhereClause | GroupByClause | OrderByClause)* -->
782<!-- ReturnClause -->
783 <xsd:complexType name="flworExpr">
784 <xsd:complexContent>
785 <xsd:extension base="expr">
786 <xsd:sequence>
787 <xsd:choice>
788 <xsd:element ref="forClause"/>
789 <xsd:element ref="letClause"/>
790 <xsd:element ref="windowClause"/>
791 </xsd:choice>
792 <xsd:sequence>
793 <xsd:choice minOccurs="0" maxOccurs="unbounded">
794 <xsd:element ref="forClause"/>
795 <xsd:element ref="letClause"/>
796 <xsd:element ref="windowClause"/>
797 <xsd:element ref="countClause"/>
798 <xsd:element ref="whereClause"/>
799 <xsd:element ref="groupByClause"/>
800 <xsd:element ref="orderByClause"/>
801 </xsd:choice>
802 <xsd:element ref="returnClause"/>
803 </xsd:sequence>
804 </xsd:sequence>
805 </xsd:extension>
806 </xsd:complexContent>
807 </xsd:complexType>
808
809 <xsd:element name="flworExpr" type="flworExpr" substitutionGroup="expr"/>
810
811
812<!-- conditional expressions -->
813 <xsd:complexType name="ifThenElseExpr">
814 <xsd:complexContent>
815 <xsd:extension base="expr">
816 <xsd:sequence>
817 <xsd:element name="ifClause" type="exprWrapper"/>
818 <xsd:element name="thenClause" type="exprWrapper"/>
819 <xsd:element name="elseClause" type="exprWrapper"/>
820 </xsd:sequence>
821 </xsd:extension>
822 </xsd:complexContent>
823 </xsd:complexType>
824
825 <xsd:element name="ifThenElseExpr" type="ifThenElseExpr"
826 substitutionGroup="expr"/>
827
828
829<!-- The following clauses describe quantified expressions -->
830 <xsd:simpleType name="quantifier">
831 <xsd:restriction base="xsd:NMTOKEN">
832 <xsd:enumeration value="some"/>
833 <xsd:enumeration value="every"/>
834 </xsd:restriction>
835 </xsd:simpleType>
836
837
838 <xsd:complexType name="quantifiedExprInClause">
839 <xsd:sequence>
840 <xsd:element ref="typedVariableBinding"/>
841 <xsd:element name="sourceExpr" type="exprWrapper"/>
842 </xsd:sequence>
843 </xsd:complexType>
844
845 <xsd:element name="quantifiedExprInClause" type="quantifiedExprInClause"/>
846
847
848 <xsd:complexType name="quantifiedExpr">
849 <xsd:complexContent>
850 <xsd:extension base="expr">
851 <xsd:sequence>
852 <xsd:element name="quantifier" type="quantifier"/>
853 <xsd:element ref="quantifiedExprInClause" maxOccurs="unbounded"/>
854 <xsd:element name="predicateExpr" type="exprWrapper"/>
855 </xsd:sequence>
856 </xsd:extension>
857 </xsd:complexContent>
858 </xsd:complexType>
859
860 <xsd:element name="quantifiedExpr" type="quantifiedExpr"
861 substitutionGroup="expr"/>
862
863
864<!-- handle the switch expression -->
865<!-- Note: no substitutionGroup as we cannot use this anywhere except within switch -->
866 <xsd:complexType name="switchExprCaseClause">
867 <xsd:complexContent>
868 <xsd:extension base="expr">
869 <xsd:sequence>
870 <xsd:element name="switchCaseExpr" type="exprWrapper" maxOccurs="unbounded"/>
871 <xsd:element name="resultExpr" type="exprWrapper"/>
872 </xsd:sequence>
873 </xsd:extension>
874 </xsd:complexContent>
875 </xsd:complexType>
876
877 <xsd:element name="switchExprCaseClause"
878 type="switchExprCaseClause"/>
879
880
881<!-- Note: no substitutionGroup as we cannot use this anywhere except within switch -->
882 <xsd:complexType name="switchExprDefaultClause">
883 <xsd:complexContent>
884 <xsd:extension base="expr">
885 <xsd:sequence>
886 <xsd:element name="resultExpr" type="exprWrapper"/>
887 </xsd:sequence>
888 </xsd:extension>
889 </xsd:complexContent>
890 </xsd:complexType>
891
892 <xsd:element name="switchExprDefaultClause"
893 type="switchExprDefaultClause"/>
894
895
896 <xsd:complexType name="switchExpr">
897 <xsd:complexContent>
898 <xsd:extension base="expr">
899 <xsd:sequence>
900 <xsd:element name="argExpr" type="exprWrapper"/>
901 <xsd:element ref="switchExprCaseClause" maxOccurs="unbounded"/>
902 <xsd:element ref="switchExprDefaultClause"/>
903 </xsd:sequence>
904 </xsd:extension>
905 </xsd:complexContent>
906 </xsd:complexType>
907
908 <xsd:element name="switchExpr" type="switchExpr"
909 substitutionGroup="expr"/>
910
911
912<!-- handle the typeswitch expression -->
913<!-- Note: no substitutionGroup as we cannot use this anywhere except within typeswitch -->
914 <xsd:complexType name="typeswitchExprCaseClause">
915 <xsd:complexContent>
916 <xsd:extension base="expr">
917 <xsd:sequence>
918 <xsd:element ref="variableBinding" minOccurs="0"/>
919 <xsd:element ref="sequenceType"/>
920 <xsd:element name="resultExpr" type="exprWrapper"/>
921 </xsd:sequence>
922 </xsd:extension>
923 </xsd:complexContent>
924 </xsd:complexType>
925
926 <xsd:element name="typeswitchExprCaseClause"
927 type="typeswitchExprCaseClause"/>
928
929
930<!-- Note: no substitutionGroup as we cannot use this anywhere except within typeswitch -->
931 <xsd:complexType name="typeswitchExprDefaultClause">
932 <xsd:complexContent>
933 <xsd:extension base="expr">
934 <xsd:sequence>
935 <xsd:element ref="variableBinding" minOccurs="0"/>
936 <xsd:element name="resultExpr" type="exprWrapper"/>
937 </xsd:sequence>
938 </xsd:extension>
939 </xsd:complexContent>
940 </xsd:complexType>
941
942 <xsd:element name="typeswitchExprDefaultClause"
943 type="typeswitchExprDefaultClause"/>
944
945
946 <xsd:complexType name="typeswitchExpr">
947 <xsd:complexContent>
948 <xsd:extension base="expr">
949 <xsd:sequence>
950 <xsd:element name="argExpr" type="exprWrapper"/>
951 <xsd:element ref="typeswitchExprCaseClause" maxOccurs="unbounded"/>
952 <xsd:element ref="typeswitchExprDefaultClause"/>
953 </xsd:sequence>
954 </xsd:extension>
955 </xsd:complexContent>
956 </xsd:complexType>
957
958 <xsd:element name="typeswitchExpr" type="typeswitchExpr"
959 substitutionGroup="expr"/>
960
961
962<!-- TryCatchExpression -->
963<!-- Corresponds to the following XQuery syntax -->
964<!-- TryCatchExpression ::= TryClause CatchClause+ -->
965<!-- TryClause ::= "{" TryTargetExpr "}" -->
966<!-- TryTargetExpr ::= Expr -->
967 <xsd:complexType name="tryCatchExpr">
968 <xsd:complexContent>
969 <xsd:extension base="expr">
970 <xsd:sequence>
971 <xsd:element name="tryClause" type="exprWrapper"/>
972 <xsd:element ref="catchClause" maxOccurs="unbounded"/>
973 </xsd:sequence>
974 </xsd:extension>
975 </xsd:complexContent>
976 </xsd:complexType>
977
978 <xsd:element name="tryCatchExpr" type="tryCatchExpr"
979 substitutionGroup="expr"/>
980
981
982<!-- CatchClause (part of the TryCatchExpression) -->
983<!-- Corresponds to the following XQuery syntax -->
984<!-- CatchClause ::= "catch" CatchErrorList "{" Expr "}" -->
985 <xsd:complexType name="catchClause">
986 <xsd:sequence>
987 <xsd:element ref="catchErrorList"/>
988 <xsd:element name="catchExpr" type="exprWrapper"/>
989 </xsd:sequence>
990 </xsd:complexType>
991
992 <xsd:element name="catchClause" type="catchClause"/>
993
994
995<!-- CatchErrorList (part of the TryCatchExpression) -->
996<!-- Corresponds to the following XQuery syntax -->
997<!-- CatchErrorList ::= NameTest ( "|" NameTest )* -->
998<!-- (remembering that NameTest is either QName or Wildcard) -->
999 <xsd:complexType name="catchErrorList">
1000 <xsd:sequence maxOccurs="unbounded">
1001 <xsd:choice>
1002 <xsd:element ref="nameTest"/>
1003 <xsd:element ref="Wildcard"/>
1004 </xsd:choice>
1005 </xsd:sequence>
1006 </xsd:complexType>
1007
1008 <xsd:element name="catchErrorList" type="catchErrorList"/>
1009
1010
1011<!-- instance-of expressions -->
1012 <xsd:complexType name="instanceOfExpr">
1013 <xsd:complexContent>
1014 <xsd:extension base="expr">
1015 <xsd:sequence>
1016 <xsd:element name="argExpr" type="exprWrapper"/>
1017 <xsd:element ref="sequenceType"/>
1018 </xsd:sequence>
1019 </xsd:extension>
1020 </xsd:complexContent>
1021 </xsd:complexType>
1022
1023 <xsd:element name="instanceOfExpr" type="instanceOfExpr"
1024 substitutionGroup="expr"/>
1025
1026
1027<!-- treat-as expressions -->
1028 <xsd:complexType name="treatExpr">
1029 <xsd:complexContent>
1030 <xsd:extension base="expr">
1031 <xsd:sequence>
1032 <xsd:element name="argExpr" type="exprWrapper"/>
1033 <xsd:element ref="sequenceType"/>
1034 </xsd:sequence>
1035 </xsd:extension>
1036 </xsd:complexContent>
1037 </xsd:complexType>
1038
1039 <xsd:element name="treatExpr" type="treatExpr"
1040 substitutionGroup="expr"/>
1041
1042
1043<!-- castable and cast expressions -->
1044 <xsd:complexType name="castableExpr">
1045 <xsd:complexContent>
1046 <xsd:extension base="expr">
1047 <xsd:sequence>
1048 <xsd:element name="argExpr" type="exprWrapper"/>
1049 <xsd:element ref="singleType"/>
1050 </xsd:sequence>
1051 </xsd:extension>
1052 </xsd:complexContent>
1053 </xsd:complexType>
1054
1055 <xsd:element name="castableExpr" type="castableExpr"
1056 substitutionGroup="expr"/>
1057
1058
1059 <xsd:complexType name="castExpr">
1060 <xsd:complexContent>
1061 <xsd:extension base="expr">
1062 <xsd:sequence>
1063 <xsd:element name="argExpr" type="exprWrapper"/>
1064 <xsd:element ref="singleType"/>
1065 </xsd:sequence>
1066 </xsd:extension>
1067 </xsd:complexContent>
1068 </xsd:complexType>
1069
1070 <xsd:element name="castExpr" type="castExpr"
1071 substitutionGroup="expr"/>
1072
1073
1074<!-- Validate expressions -->
1075 <xsd:simpleType name="validationMode">
1076 <xsd:restriction base="xsd:NMTOKEN">
1077 <xsd:enumeration value="lax"/>
1078 <xsd:enumeration value="strict"/>
1079 </xsd:restriction>
1080 </xsd:simpleType>
1081
1082 <xsd:complexType name="validateExpr">
1083 <xsd:complexContent>
1084 <xsd:extension base="expr">
1085 <xsd:sequence>
1086 <xsd:choice>
1087 <xsd:element name="validationMode" type="validationMode" minOccurs="0"/>
1088 <xsd:element name="typeName" type="EQName" minOccurs="0"/>
1089 </xsd:choice>
1090 <xsd:element name="argExpr" type="exprWrapper"/>
1091 </xsd:sequence>
1092 </xsd:extension>
1093 </xsd:complexContent>
1094 </xsd:complexType>
1095
1096 <xsd:element name="validateExpr" type="validateExpr"
1097 substitutionGroup="expr"/>
1098
1099
1100<!-- Direct constructors. Only elementConstructor for now -->
1101<!-- Note the absence of constructors corresponding to -->
1102<!-- the directCommentConstructor and the directPIConstructor -->
1103<!-- productions in the XQuery grammar. This is because they are -->
1104<!-- trivially identical to the computed variants -->
1105
1106<!-- attributeConstructor is no longer a subclass of expr -->
1107 <xsd:complexType name="attributeConstructor">
1108 <xsd:sequence>
1109 <xsd:element name="attributeName" type="QName"/>
1110 <xsd:choice>
1111 <xsd:element name="attributeValueExpr" type="exprList"/>
1112 <xsd:element name="attributeValue" type="xsd:string"/>
1113 </xsd:choice>
1114 </xsd:sequence>
1115 </xsd:complexType>
1116
1117 <xsd:complexType name="namespaceDeclaration">
1118 <xsd:sequence>
1119 <xsd:element name="prefix" type="xsd:NCName" minOccurs="0"/>
1120 <xsd:element name="uri" type="xsd:string"/>
1121 </xsd:sequence>
1122 </xsd:complexType>
1123
1124
1125<!-- element constructors -->
1126 <xsd:complexType name="attributeList">
1127 <xsd:sequence>
1128 <xsd:choice maxOccurs="unbounded">
1129 <xsd:element name="attributeConstructor" type="attributeConstructor"/>
1130 <xsd:element name="namespaceDeclaration" type="namespaceDeclaration"/>
1131 </xsd:choice>
1132 </xsd:sequence>
1133 </xsd:complexType>
1134
1135 <xsd:element name="attributeList" type="attributeList"/>
1136
1137
1138 <xsd:element name="elementContent" type="exprList"/>
1139
1140
1141 <xsd:complexType name="elementConstructor">
1142 <xsd:complexContent>
1143 <xsd:extension base="expr">
1144 <xsd:sequence>
1145 <xsd:element name="tagName" type="QName"/>
1146 <xsd:element ref="attributeList" minOccurs="0"/>
1147 <xsd:element ref="elementContent" minOccurs="0"/>
1148 </xsd:sequence>
1149 </xsd:extension>
1150 </xsd:complexContent>
1151 </xsd:complexType>
1152
1153 <xsd:element name="elementConstructor" type="elementConstructor"
1154 substitutionGroup="expr"/>
1155
1156
1157<!-- computed constructors -->
1158<!-- computed element constructor -->
1159 <xsd:complexType name="computedElementConstructor">
1160 <xsd:complexContent>
1161 <xsd:extension base="expr">
1162 <xsd:sequence>
1163 <xsd:choice>
1164 <xsd:element name="tagName" type="EQName"/>
1165 <xsd:element name="tagNameExpr" type="exprWrapper"/>
1166 </xsd:choice>
1167 <xsd:element name="contentExpr" type="exprWrapper" minOccurs="0"/>
1168 </xsd:sequence>
1169 </xsd:extension>
1170 </xsd:complexContent>
1171 </xsd:complexType>
1172
1173 <xsd:element name="computedElementConstructor" type="computedElementConstructor"
1174 substitutionGroup="expr"/>
1175
1176
1177<!-- computed attribute constructor -->
1178 <xsd:complexType name="computedAttributeConstructor">
1179 <xsd:complexContent>
1180 <xsd:extension base="expr">
1181 <xsd:sequence>
1182 <xsd:choice>
1183 <xsd:element name="tagName" type="EQName"/>
1184 <xsd:element name="tagNameExpr" type="exprWrapper"/>
1185 </xsd:choice>
1186 <xsd:element name="valueExpr" type="exprWrapper" minOccurs="0"/>
1187 </xsd:sequence>
1188 </xsd:extension>
1189 </xsd:complexContent>
1190 </xsd:complexType>
1191
1192 <xsd:element name="computedAttributeConstructor" type="computedAttributeConstructor"
1193 substitutionGroup="expr"/>
1194
1195
1196<!-- computed document constructor -->
1197 <xsd:complexType name="computedDocumentConstructor">
1198 <xsd:complexContent>
1199 <xsd:extension base="expr">
1200 <xsd:sequence>
1201 <xsd:element name="argExpr" type="exprWrapper"/>
1202 </xsd:sequence>
1203 </xsd:extension>
1204 </xsd:complexContent>
1205 </xsd:complexType>
1206
1207 <xsd:element name="computedDocumentConstructor" type="computedDocumentConstructor"
1208 substitutionGroup="expr"/>
1209
1210
1211<!-- computed text constructor -->
1212 <xsd:complexType name="computedTextConstructor">
1213 <xsd:complexContent>
1214 <xsd:extension base="expr">
1215 <xsd:sequence>
1216 <xsd:element name="argExpr" type="exprWrapper" minOccurs="0"/>
1217 </xsd:sequence>
1218 </xsd:extension>
1219 </xsd:complexContent>
1220 </xsd:complexType>
1221
1222 <xsd:element name="computedTextConstructor" type="computedTextConstructor"
1223 substitutionGroup="expr"/>
1224
1225
1226<!-- computed comment constructor -->
1227 <xsd:complexType name="computedCommentConstructor">
1228 <xsd:complexContent>
1229 <xsd:extension base="expr">
1230 <xsd:sequence>
1231 <xsd:element name="argExpr" type="exprWrapper"/>
1232 </xsd:sequence>
1233 </xsd:extension>
1234 </xsd:complexContent>
1235 </xsd:complexType>
1236
1237 <xsd:element name="computedCommentConstructor" type="computedCommentConstructor"
1238 substitutionGroup="expr"/>
1239
1240
1241<!-- computed namespace constructor -->
1242 <xsd:complexType name="computedNamespaceConstructor">
1243 <xsd:complexContent>
1244 <xsd:extension base="expr">
1245 <xsd:sequence>
1246 <xsd:choice>
1247 <xsd:element name="prefix" type="xsd:NCName"/>
1248 <xsd:element name="prefixExpr" type="exprWrapper"/>
1249 </xsd:choice>
1250 <xsd:element name="URIExpr" type="exprWrapper" minOccurs="0"/>
1251 </xsd:sequence>
1252 </xsd:extension>
1253 </xsd:complexContent>
1254 </xsd:complexType>
1255
1256 <xsd:element name="computedNamespaceConstructor" type="computedNamespaceConstructor"
1257 substitutionGroup="expr"/>
1258
1259
1260<!-- computed processing instruction constructor -->
1261 <xsd:complexType name="computedPIConstructor">
1262 <xsd:complexContent>
1263 <xsd:extension base="expr">
1264 <xsd:sequence>
1265 <xsd:choice>
1266 <xsd:element name="piTarget" type="xsd:NCName"/>
1267 <xsd:element name="piTargetExpr" type="exprWrapper"/>
The diff has been truncated for viewing.

Subscribers

People subscribed via source and target branches

to all changes: