diff options
-rw-r--r-- | Makefile | 9 | ||||
-rw-r--r-- | libs/glibmm2/aclocal.m4 | 284 | ||||
-rw-r--r-- | libs/glibmm2/glib/Makefile.in | 19 | ||||
-rw-r--r-- | libs/pbd/pbd/xml++.h | 20 | ||||
-rw-r--r-- | libs/pbd/tests/Makefile | 5 | ||||
-rw-r--r-- | libs/pbd/tests/rosegardenpatchfile.xml | 519 | ||||
-rw-r--r-- | libs/pbd/tests/xpath.cc | 26 | ||||
-rw-r--r-- | libs/pbd/xml++.cc | 67 |
8 files changed, 837 insertions, 112 deletions
@@ -1,10 +1,13 @@ -all: scons +all: + true + #make sconsi + #./build-tmp.sh scons: - scons + scons DEBUG=1 DIST_TARGET=i686 -j 3 sconsi: - scons --implicit-deps-unchanged + scons --implicit-deps-unchanged DEBUG=1 DIST_TARGET=i686 -j 3 cscope: cscope.out diff --git a/libs/glibmm2/aclocal.m4 b/libs/glibmm2/aclocal.m4 index 91d9c67062..a1d7330922 100644 --- a/libs/glibmm2/aclocal.m4 +++ b/libs/glibmm2/aclocal.m4 @@ -1,7 +1,7 @@ -# generated automatically by aclocal 1.10 -*- Autoconf -*- +# generated automatically by aclocal 1.10.1 -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, -# 2005, 2006 Free Software Foundation, Inc. +# 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -11,14 +11,17 @@ # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. -m4_if(m4_PACKAGE_VERSION, [2.61],, -[m4_fatal([this file was generated for autoconf 2.61. -You have another version of autoconf. If you want to use that, -you should regenerate the build system entirely.], [63])]) +m4_ifndef([AC_AUTOCONF_VERSION], + [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl +m4_if(AC_AUTOCONF_VERSION, [2.61],, +[m4_warning([this file was generated for autoconf 2.61. +You have another version of autoconf. It may work, but is not guaranteed to. +If you have problems, you may need to regenerate the build system entirely. +To do so, use the procedure documented by the package, typically `autoreconf'.])]) # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- -# serial 51 AC_PROG_LIBTOOL +# serial 52 Debian 1.5.26-1ubuntu1 AC_PROG_LIBTOOL # AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED) @@ -106,7 +109,6 @@ AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl AC_REQUIRE([AC_OBJEXT])dnl AC_REQUIRE([AC_EXEEXT])dnl dnl - AC_LIBTOOL_SYS_MAX_CMD_LEN AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE AC_LIBTOOL_OBJDIR @@ -208,6 +210,8 @@ file_magic*) ;; esac +_LT_REQUIRED_DARWIN_CHECKS + AC_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no) AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL], enable_win32_dll=yes, enable_win32_dll=no) @@ -287,9 +291,80 @@ ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` -$rm conftest* +$rm -r conftest* ])# _LT_LINKER_BOILERPLATE +# _LT_REQUIRED_DARWIN_CHECKS +# -------------------------- +# Check for some things on darwin +AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS],[ + case $host_os in + rhapsody* | darwin*) + AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:]) + AC_CHECK_TOOL([NMEDIT], [nmedit], [:]) + + AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod], + [lt_cv_apple_cc_single_mod=no + if test -z "${LT_MULTI_MODULE}"; then + # By default we will add the -single_module flag. You can override + # by either setting the environment variable LT_MULTI_MODULE + # non-empty at configure time, or by adding -multi_module to the + # link flags. + echo "int foo(void){return 1;}" > conftest.c + $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ + -dynamiclib ${wl}-single_module conftest.c + if test -f libconftest.dylib; then + lt_cv_apple_cc_single_mod=yes + rm -rf libconftest.dylib* + fi + rm conftest.c + fi]) + AC_CACHE_CHECK([for -exported_symbols_list linker flag], + [lt_cv_ld_exported_symbols_list], + [lt_cv_ld_exported_symbols_list=no + save_LDFLAGS=$LDFLAGS + echo "_main" > conftest.sym + LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" + AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], + [lt_cv_ld_exported_symbols_list=yes], + [lt_cv_ld_exported_symbols_list=no]) + LDFLAGS="$save_LDFLAGS" + ]) + case $host_os in + rhapsody* | darwin1.[[0123]]) + _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; + darwin1.*) + _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; + darwin*) + # if running on 10.5 or later, the deployment target defaults + # to the OS version, if on x86, and 10.4, the deployment + # target defaults to 10.4. Don't you love it? + case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in + 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*) + _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; + 10.[[012]]*) + _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; + 10.*) + _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; + esac + ;; + esac + if test "$lt_cv_apple_cc_single_mod" = "yes"; then + _lt_dar_single_mod='$single_module' + fi + if test "$lt_cv_ld_exported_symbols_list" = "yes"; then + _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' + else + _lt_dar_export_syms="~$NMEDIT -s \$output_objdir/\${libname}-symbols.expsym \${lib}" + fi + if test "$DSYMUTIL" != ":"; then + _lt_dsymutil="~$DSYMUTIL \$lib || :" + else + _lt_dsymutil= + fi + ;; + esac +]) # _LT_AC_SYS_LIBPATH_AIX # ---------------------- @@ -570,7 +645,6 @@ s390*-*linux*|sparc*-*linux*) esac ;; *64-bit*) - libsuff=64 case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" @@ -615,7 +689,11 @@ sparc*-*solaris*) *64-bit*) case $lt_cv_prog_gnu_ld in yes*) LD="${LD-ld} -m elf64_sparc" ;; - *) LD="${LD-ld} -64" ;; + *) + if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then + LD="${LD-ld} -64" + fi + ;; esac ;; esac @@ -708,7 +786,7 @@ AC_CACHE_CHECK([$1], [$2], $2=yes fi fi - $rm conftest* + $rm -r conftest* LDFLAGS="$save_LDFLAGS" ]) @@ -979,7 +1057,7 @@ else AC_CHECK_FUNC([shl_load], [lt_cv_dlopen="shl_load"], [AC_CHECK_LIB([dld], [shl_load], - [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"], + [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"], [AC_CHECK_FUNC([dlopen], [lt_cv_dlopen="dlopen"], [AC_CHECK_LIB([dl], [dlopen], @@ -987,7 +1065,7 @@ else [AC_CHECK_LIB([svld], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], [AC_CHECK_LIB([dld], [dld_link], - [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"]) + [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"]) ]) ]) ]) @@ -1304,7 +1382,7 @@ aix3*) soname_spec='${libname}${release}${shared_ext}$major' ;; -aix4* | aix5*) +aix[[4-9]]*) version_type=linux need_lib_prefix=no need_version=no @@ -1629,13 +1707,11 @@ linux* | k*bsd*-gnu) # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes - sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" - sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` - sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra" + sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on @@ -1647,6 +1723,18 @@ linux* | k*bsd*-gnu) dynamic_linker='GNU/Linux ld.so' ;; +netbsdelf*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='NetBSD ld.elf_so' + ;; + netbsd*) version_type=sunos need_lib_prefix=no @@ -1827,6 +1915,13 @@ esac AC_MSG_RESULT([$dynamic_linker]) test "$dynamic_linker" = no && can_build_shared=no +AC_CACHE_VAL([lt_cv_sys_lib_search_path_spec], +[lt_cv_sys_lib_search_path_spec="$sys_lib_search_path_spec"]) +sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" +AC_CACHE_VAL([lt_cv_sys_lib_dlsearch_path_spec], +[lt_cv_sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec"]) +sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" + variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" @@ -2326,7 +2421,7 @@ lt_cv_deplibs_check_method='unknown' # whether `pass_all' will *always* work, you probably want this one. case $host_os in -aix4* | aix5*) +aix[[4-9]]*) lt_cv_deplibs_check_method=pass_all ;; @@ -2421,7 +2516,7 @@ linux* | k*bsd*-gnu) lt_cv_deplibs_check_method=pass_all ;; -netbsd*) +netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' else @@ -2762,7 +2857,7 @@ aix3*) fi ;; -aix4* | aix5*) +aix[[4-9]]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi @@ -2819,6 +2914,7 @@ _LT_AC_TAGVAR(postdep_objects, $1)= _LT_AC_TAGVAR(predeps, $1)= _LT_AC_TAGVAR(postdeps, $1)= _LT_AC_TAGVAR(compiler_lib_search_path, $1)= +_LT_AC_TAGVAR(compiler_lib_search_dirs, $1)= # Source file extension for C++ test sources. ac_ext=cpp @@ -2928,7 +3024,7 @@ case $host_os in # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; - aix4* | aix5*) + aix[[4-9]]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. @@ -2941,7 +3037,7 @@ case $host_os in # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. - case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*) + case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do case $ld_flag in *-brtl*) @@ -3087,51 +3183,23 @@ case $host_os in fi ;; darwin* | rhapsody*) - case $host_os in - rhapsody* | darwin1.[[012]]) - _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress' - ;; - *) # Darwin 1.3 on - if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then - _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' - else - case ${MACOSX_DEPLOYMENT_TARGET} in - 10.[[012]]) - _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' - ;; - 10.*) - _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup' - ;; - esac - fi - ;; - esac _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_automatic, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='' _LT_AC_TAGVAR(link_all_deplibs, $1)=yes - - if test "$GXX" = yes ; then - lt_int_apple_cc_single_mod=no + _LT_AC_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined" + if test "$GXX" = yes ; then output_verbose_link_cmd='echo' - if $CC -dumpspecs 2>&1 | $EGREP 'single_module' >/dev/null ; then - lt_int_apple_cc_single_mod=yes + _LT_AC_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" + _LT_AC_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" + _LT_AC_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" + _LT_AC_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" + if test "$lt_cv_apple_cc_single_mod" != "yes"; then + _LT_AC_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}" + _LT_AC_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}" fi - if test "X$lt_int_apple_cc_single_mod" = Xyes ; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' - else - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' - fi - _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds - if test "X$lt_int_apple_cc_single_mod" = Xyes ; then - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - else - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - fi - _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else case $cc_basename in xlc*) @@ -3382,7 +3450,7 @@ case $host_os in _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' ;; - pgCC*) + pgCC* | pgcpp*) # Portland Group C++ compiler _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' @@ -3455,7 +3523,7 @@ case $host_os in ;; esac ;; - netbsd*) + netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= @@ -3817,7 +3885,8 @@ lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld # compiler output when linking a shared library. # Parse the compiler output and extract the necessary # objects, libraries and library flags. -AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP],[ +AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP], +[AC_REQUIRE([LT_AC_PROG_SED])dnl dnl we can't use the lt_simple_compile_test_code here, dnl because it contains code intended for an executable, dnl not a library. It's possible we should let each @@ -3942,6 +4011,11 @@ fi $rm -f confest.$objext +_LT_AC_TAGVAR(compiler_lib_search_dirs, $1)= +if test -n "$_LT_AC_TAGVAR(compiler_lib_search_path, $1)"; then + _LT_AC_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_AC_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'` +fi + # PORTME: override above test on systems where it is broken ifelse([$1],[CXX], [case $host_os in @@ -3998,7 +4072,6 @@ solaris*) ;; esac ]) - case " $_LT_AC_TAGVAR(postdeps, $1) " in *" -lc "*) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no ;; esac @@ -4083,7 +4156,7 @@ aix3*) postinstall_cmds='$RANLIB $lib' fi ;; -aix4* | aix5*) +aix[[4-9]]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi @@ -4260,6 +4333,7 @@ if test -f "$ltmain"; then _LT_AC_TAGVAR(predeps, $1) \ _LT_AC_TAGVAR(postdeps, $1) \ _LT_AC_TAGVAR(compiler_lib_search_path, $1) \ + _LT_AC_TAGVAR(compiler_lib_search_dirs, $1) \ _LT_AC_TAGVAR(archive_cmds, $1) \ _LT_AC_TAGVAR(archive_expsym_cmds, $1) \ _LT_AC_TAGVAR(postinstall_cmds, $1) \ @@ -4322,7 +4396,7 @@ ifelse([$1], [], # Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) # NOTE: Changes made to this file will be lost: look at ltmain.sh. # -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 # Free Software Foundation, Inc. # # This file is part of GNU Libtool: @@ -4559,6 +4633,10 @@ predeps=$lt_[]_LT_AC_TAGVAR(predeps, $1) # shared library. postdeps=$lt_[]_LT_AC_TAGVAR(postdeps, $1) +# The directories searched by this compiler when creating a shared +# library +compiler_lib_search_dirs=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_dirs, $1) + # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_path, $1) @@ -4908,7 +4986,7 @@ EOF echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD cat conftest.$ac_ext >&5 fi - rm -f conftest* conftst* + rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then @@ -4965,7 +5043,8 @@ AC_MSG_CHECKING([for $compiler option to produce PIC]) # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' + m4_if([$1], [GCJ], [], + [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; darwin* | rhapsody*) # PIC is the default on this platform @@ -5002,7 +5081,7 @@ AC_MSG_CHECKING([for $compiler option to produce PIC]) esac else case $host_os in - aix4* | aix5*) + aix[[4-9]]*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor @@ -5098,7 +5177,7 @@ AC_MSG_CHECKING([for $compiler option to produce PIC]) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; - pgCC*) + pgCC* | pgcpp*) # Portland Group C++ compiler. _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' @@ -5136,7 +5215,7 @@ AC_MSG_CHECKING([for $compiler option to produce PIC]) ;; esac ;; - netbsd*) + netbsd* | netbsdelf*-gnu) ;; osf3* | osf4* | osf5*) case $cc_basename in @@ -5249,7 +5328,8 @@ AC_MSG_CHECKING([for $compiler option to produce PIC]) # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' + m4_if([$1], [GCJ], [], + [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; darwin* | rhapsody*) @@ -5319,7 +5399,8 @@ AC_MSG_CHECKING([for $compiler option to produce PIC]) mingw* | cygwin* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' + m4_if([$1], [GCJ], [], + [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; hpux9* | hpux10* | hpux11*) @@ -5456,7 +5537,7 @@ AC_MSG_RESULT([$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)]) # if test -n "$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)"; then AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) works], - _LT_AC_TAGVAR(lt_prog_compiler_pic_works, $1), + _LT_AC_TAGVAR(lt_cv_prog_compiler_pic_works, $1), [$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])], [], [case $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) in "" | " "*) ;; @@ -5480,7 +5561,7 @@ esac # wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_AC_TAGVAR(lt_prog_compiler_static, $1)\" AC_LIBTOOL_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], - _LT_AC_TAGVAR(lt_prog_compiler_static_works, $1), + _LT_AC_TAGVAR(lt_cv_prog_compiler_static_works, $1), $lt_tmp_static_flag, [], [_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=]) @@ -5496,7 +5577,7 @@ AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) ifelse([$1],[CXX],[ _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' case $host_os in - aix4* | aix5*) + aix[[4-9]]*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | grep 'GNU' > /dev/null; then @@ -5511,10 +5592,14 @@ ifelse([$1],[CXX],[ cygwin* | mingw*) _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;/^.*[[ ]]__nm__/s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' ;; + linux* | k*bsd*-gnu) + _LT_AC_TAGVAR(link_all_deplibs, $1)=no + ;; *) _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac + _LT_AC_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] ],[ runpath_var= _LT_AC_TAGVAR(allow_undefined_flag, $1)= @@ -5545,12 +5630,14 @@ ifelse([$1],[CXX],[ # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. - _LT_AC_TAGVAR(exclude_expsyms, $1)="_GLOBAL_OFFSET_TABLE_" + _LT_AC_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. + # Exclude shared library initialization/finalization symbols. +dnl Note also adjust exclude_expsyms for C++ above. extract_expsyms_cmds= # Just being paranoid about ensuring that cc_basename is set. _LT_CC_BASENAME([$compiler]) @@ -5600,7 +5687,7 @@ ifelse([$1],[CXX],[ # See if GNU ld supports shared libraries. case $host_os in - aix3* | aix4* | aix5*) + aix[[3-9]]*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then _LT_AC_TAGVAR(ld_shlibs, $1)=no @@ -5716,12 +5803,13 @@ EOF $echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi + _LT_AC_TAGVAR(link_all_deplibs, $1)=no else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; - netbsd*) + netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= @@ -5819,7 +5907,7 @@ _LT_EOF fi ;; - aix4* | aix5*) + aix[[4-9]]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. @@ -5839,7 +5927,7 @@ _LT_EOF # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. - case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*) + case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes @@ -5999,11 +6087,10 @@ _LT_EOF _LT_AC_TAGVAR(link_all_deplibs, $1)=yes if test "$GCC" = yes ; then output_verbose_link_cmd='echo' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' - _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + _LT_AC_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" + _LT_AC_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" + _LT_AC_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" + _LT_AC_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" else case $cc_basename in xlc*) @@ -6153,7 +6240,7 @@ _LT_EOF _LT_AC_TAGVAR(link_all_deplibs, $1)=yes ;; - netbsd*) + netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else @@ -6742,7 +6829,7 @@ else fi[]dnl ])# PKG_CHECK_MODULES -# Copyright (C) 2002, 2003, 2005, 2006 Free Software Foundation, Inc. +# Copyright (C) 2002, 2003, 2005, 2006, 2007 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -6757,7 +6844,7 @@ AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.10' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. -m4_if([$1], [1.10], [], +m4_if([$1], [1.10.1], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) @@ -6773,8 +6860,10 @@ m4_define([_AM_AUTOCONF_VERSION], []) # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AC_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], -[AM_AUTOMAKE_VERSION([1.10])dnl -_AM_AUTOCONF_VERSION(m4_PACKAGE_VERSION)]) +[AM_AUTOMAKE_VERSION([1.10.1])dnl +m4_ifndef([AC_AUTOCONF_VERSION], + [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl +_AM_AUTOCONF_VERSION(AC_AUTOCONF_VERSION)]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- @@ -7046,7 +7135,7 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. - if sed 10q "$mf" | grep '^#.*generated by automake' > /dev/null 2>&1; then + if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`AS_DIRNAME("$mf")` else continue @@ -7106,13 +7195,13 @@ AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)]) # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, -# 2005, 2006 Free Software Foundation, Inc. +# 2005, 2006, 2008 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 12 +# serial 13 # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. @@ -7217,16 +7306,17 @@ AC_PROVIDE_IFELSE([AC_PROG_OBJC], # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. +_am_arg=$1 _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in - $1 | $1:* ) + $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done -echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count]) +echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # @@ -7527,7 +7617,7 @@ AC_SUBST([INSTALL_STRIP_PROGRAM])]) # _AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- -# Prevent Automake from outputing VARIABLE = @VARIABLE@ in Makefile.in. +# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. # This macro is traced by Automake. AC_DEFUN([_AM_SUBST_NOTMAKE]) diff --git a/libs/glibmm2/glib/Makefile.in b/libs/glibmm2/glib/Makefile.in index d46602f325..05b0d49506 100644 --- a/libs/glibmm2/glib/Makefile.in +++ b/libs/glibmm2/glib/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.10 from Makefile.am. +# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -101,6 +101,7 @@ DEPDIR = @DEPDIR@ DISABLE_DEPRECATED_API_CFLAGS = @DISABLE_DEPRECATED_API_CFLAGS@ DISABLE_DEPRECATED_CFLAGS = @DISABLE_DEPRECATED_CFLAGS@ DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ @@ -137,6 +138,7 @@ M4 = @M4@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ +NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ @@ -398,8 +400,8 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ + $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS @@ -424,8 +426,8 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) glibmmconfig.h.in $(TAGS_DEPENDENCIES unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ @@ -435,13 +437,12 @@ ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) glibmmconfig.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ - here=`pwd`; \ list='$(SOURCES) $(HEADERS) glibmmconfig.h.in $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique diff --git a/libs/pbd/pbd/xml++.h b/libs/pbd/pbd/xml++.h index 7171fce6cc..1aae15bbc3 100644 --- a/libs/pbd/pbd/xml++.h +++ b/libs/pbd/pbd/xml++.h @@ -92,6 +92,8 @@ public: XMLNode *add_child_copy (const XMLNode&); XMLNode *child (const char*) const; void add_child_nocopy (XMLNode&); + + XMLNodeList *find(const std::string xpath) const; const XMLPropertyList & properties() const { return _proplist; }; XMLProperty *property(const char * ); @@ -127,5 +129,23 @@ public: const string & set_value(const string &v) { return _value = v; }; }; +class XMLException: public std::exception +{ +public: + explicit XMLException(const string message) + : message_(message) + { + } + + virtual ~XMLException() throw() {}; + + virtual const char* what() const throw() { return message_.c_str(); } + virtual void Raise() const { throw *this; } + virtual exception * Clone() const { return new exception(*this); } + +private: + string message_; +}; + #endif /* __XML_H */ diff --git a/libs/pbd/tests/Makefile b/libs/pbd/tests/Makefile new file mode 100644 index 0000000000..78cc489579 --- /dev/null +++ b/libs/pbd/tests/Makefile @@ -0,0 +1,5 @@ +test: xpath + LD_LIBRARY_PATH=..:../../sigc++2:../../glibmm2 ./xpath + +xpath: xpath.cc + gcc -o $@ -g -I.. `xml2-config --libs --cflags` -L.. -L../../sigc++2 -L../../glibmm2 -lstdc++ -lpbd -lglibmm2 -lsigc++2 $<
\ No newline at end of file diff --git a/libs/pbd/tests/rosegardenpatchfile.xml b/libs/pbd/tests/rosegardenpatchfile.xml new file mode 100644 index 0000000000..11db71560f --- /dev/null +++ b/libs/pbd/tests/rosegardenpatchfile.xml @@ -0,0 +1,519 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE rosegarden-data> +<rosegarden-data version="1.5.1"> +<studio thrufilter="0" recordfilter="0" audioinputpairs="2" mixerdisplayoptions="0" metronomedevice="0"> + + + <device id="0" name="Roland E-09 GM Banks" direction="play" variation="MSB" connection="16:0 ES1371 (duplex)" type="midi"> + + <librarian name="Sasha Clarkson" email="sashaclarkson@yahoo.co.uk"/> + <metronome instrument="2009" barpitch="37" beatpitch="37" subbeatpitch="37" depth="2" barvelocity="120" beatvelocity="100" subbeatvelocity="80"/> + + <bank name="GM2 Standard" percussion="false" msb="0" lsb="2"> + <program id="0" name="Piano 1" /> + <program id="1" name="Piano 2" /> + <program id="2" name="Piano 3" /> + <program id="3" name="Honkytonk" /> + <program id="4" name="E.Piano 1" /> + <program id="5" name="E.Piano 2" /> + <program id="6" name="Harpsi 1" /> + <program id="7" name="Clav" /> + <program id="8" name="Celesta" /> + <program id="9" name="Glocken" /> + <program id="10" name="Music Box" /> + <program id="11" name="Vibraphone" /> + <program id="12" name="Marimba" /> + <program id="13" name="Xylophone" /> + <program id="14" name="Tublr Bell" /> + <program id="15" name="Santur 1" /> + <program id="16" name="Organ 1" /> + <program id="17" name="Organ 2" /> + <program id="18" name="Organ 3" /> + <program id="19" name="ChurchOrg1" /> + <program id="20" name="Reed Organ" /> + <program id="21" name="Accrdn Fr" /> + <program id="22" name="Harmonica1" /> + <program id="23" name="Bandoneon" /> + <program id="24" name="Nylon Gt 1" /> + <program id="25" name="StlStr Gt1" /> + <program id="26" name="Jazz Gt 1" /> + <program id="27" name="Clean Gt 1" /> + <program id="28" name="Muted Gt" /> + <program id="29" name="Overdrive" /> + <program id="30" name="Dist Gt 1" /> + <program id="31" name="E.Gt Harm" /> + <program id="32" name="Ac.Bass 1" /> + <program id="33" name="Fingrd Bs1" /> + <program id="34" name="Pick Bass1" /> + <program id="35" name="Frtlss Bs1" /> + <program id="36" name="Slap Bass1" /> + <program id="37" name="Slap Bass2" /> + <program id="38" name="Syn Bass 1" /> + <program id="39" name="Syn Bass 2" /> + <program id="40" name="Violin 1" /> + <program id="41" name="Viola 1" /> + <program id="42" name="Cello 1" /> + <program id="43" name="Contrabass" /> + <program id="44" name="Trem Str" /> + <program id="45" name="Pizz Str" /> + <program id="46" name="Harp" /> + <program id="47" name="Timpani" /> + <program id="48" name="Strings 1" /> + <program id="49" name="Slow Str 1" /> + <program id="50" name="SynStrings" /> + <program id="51" name="Syn Str 2" /> + <program id="52" name="ChoirAahs1" /> + <program id="53" name="Voice Doos" /> + <program id="54" name="Syn Vox" /> + <program id="55" name="Orch Hit" /> + <program id="56" name="Trumpet 1" /> + <program id="57" name="Trombone 1" /> + <program id="58" name="Tuba 1" /> + <program id="59" name="Mute Tp 1" /> + <program id="60" name="Fr.Horns 1" /> + <program id="61" name="Brass 1" /> + <program id="62" name="Syn Brass1" /> + <program id="63" name="Syn Brass2" /> + <program id="64" name="Sop Sax 1" /> + <program id="65" name="Alto Sax 1" /> + <program id="66" name="Tenor Sax1" /> + <program id="67" name="Baritn Sax" /> + <program id="68" name="Oboe" /> + <program id="69" name="EnglshHorn" /> + <program id="70" name="Bassoon" /> + <program id="71" name="JzClarinet" /> + <program id="72" name="Piccolo" /> + <program id="73" name="Flute" /> + <program id="74" name="Recorder" /> + <program id="75" name="Pan Flute" /> + <program id="76" name="BottleBlow" /> + <program id="77" name="Shakuhachi" /> + <program id="78" name="Whistle" /> + <program id="79" name="Ocarina" /> + <program id="80" name="SquareWave" /> + <program id="81" name="Saw Wave 1" /> + <program id="82" name="SynCalliop" /> + <program id="83" name="Chiffer Ld" /> + <program id="84" name="Charang" /> + <program id="85" name="Solo Vox" /> + <program id="86" name="5thSawWave" /> + <program id="87" name="Bass and Lead" /> + <program id="88" name="Fantasia 1" /> + <program id="89" name="Warm Pad" /> + <program id="90" name="Poly Syn" /> + <program id="91" name="SpaceVoice" /> + <program id="92" name="BowedGlass" /> + <program id="93" name="Metal Pad" /> + <program id="94" name="Halo Pad" /> + <program id="95" name="Sweep Pad" /> + <program id="96" name="Ice Rain" /> + <program id="97" name="Soundtrack" /> + <program id="98" name="Crystal" /> + <program id="99" name="Atmosphere" /> + <program id="100" name="Brightness" /> + <program id="101" name="Goblin" /> + <program id="102" name="Echo Drops" /> + <program id="103" name="StarTheme1" /> + <program id="104" name="Sitar 1" /> + <program id="105" name="Banjo 1" /> + <program id="106" name="Shamisen" /> + <program id="107" name="Koto" /> + <program id="108" name="Kalimba 1" /> + <program id="109" name="Bagpipe" /> + <program id="110" name="Fiddle" /> + <program id="111" name="Shehnai 1" /> + <program id="112" name="TinkleBell" /> + <program id="113" name="Agogo Bell" /> + <program id="114" name="SteelDrums" /> + <program id="115" name="Woodblock" /> + <program id="116" name="Taiko" /> + <program id="117" name="Melo Tom 1" /> + <program id="118" name="Synth Drum" /> + <program id="119" name="RevCymbal1" /> + <program id="120" name="Gt Fret Nz" /> + <program id="121" name="Breath Nz" /> + <program id="122" name="Seashore" /> + <program id="123" name="Bird 1" /> + <program id="124" name="Telephone1" /> + <program id="125" name="Helicopter" /> + <program id="126" name="Applause 1" /> + <program id="127" name="Gun Shot" /> + </bank> + + <bank name="Alternative 1" percussion="false" msb="1" lsb="2"> + <program id="2" name="EG+EP 1" /> + <program id="11" name="Hard Vibe" /> + <program id="15" name="Santur 2" /> + <program id="16" name="Organ 101" /> + <program id="17" name="Organ 201" /> + <program id="22" name="Harmonica2" /> + <program id="26" name="Mellow Gt" /> + <program id="27" name="Clean Gt 2" /> + <program id="28" name="Mt Dist Bs" /> + <program id="30" name="Dist Gt 2" /> + <program id="32" name="Ac.Bass 2" /> + <program id="33" name="Fingrd Bs2" /> + <program id="35" name="Frtlss Bs2" /> + <program id="38" name="Syn Bs 101" /> + <program id="39" name="Syn Bs 201" /> + <program id="40" name="Violin 2" /> + <program id="41" name="Viola 2" /> + <program id="42" name="Cello 2" /> + <program id="48" name="Strings 2" /> + <program id="49" name="Slow Str 2" /> + <program id="50" name="OB Strings" /> + <program id="51" name="Syn Str 3" /> + <program id="55" name="Bass Hit" /> + <program id="56" name="Trumpet 2" /> + <program id="57" name="Trombone 2" /> + <program id="58" name="Tuba 2" /> + <program id="60" name="Fr.Horns 2" /> + <program id="61" name="Brass 2" /> + <program id="62" name="Poly Brass" /> + <program id="63" name="Soft Brass" /> + <program id="65" name="Alto Sax 2" /> + <program id="66" name="Tenor Sax2" /> + <program id="71" name="Clarinet" /> + <program id="80" name="Square" /> + <program id="81" name="P5 Saw" /> + <program id="82" name="Vent Synth" /> + <program id="84" name="Wire Lead" /> + <program id="86" name="Big Fives" /> + <program id="87" name="Big and Raw" /> + <program id="88" name="Fantasia 2" /> + <program id="89" name="Thick Pad" /> + <program id="90" name="80sPolySyn" /> + <program id="91" name="Heaven II" /> + <program id="93" name="Tine Pad" /> + <program id="95" name="Polar Pad" /> + <program id="96" name="Harm Rain" /> + <program id="97" name="Ancestral" /> + <program id="98" name="Syn Mallet" /> + <program id="99" name="Warm Atoms" /> + <program id="102" name="Echo Bell" /> + <program id="103" name="StarTheme2" /> + <program id="104" name="Sitar 2" /> + <program id="105" name="Mute Banjo" /> + <program id="106" name="Tsugaru" /> + <program id="111" name="Shehnai 2" /> + <program id="117" name="Real Tom" /> + <program id="119" name="RevCymbal2" /> + <program id="120" name="Gt CutNz 1" /> + <program id="121" name="FlKeyClick" /> + <program id="122" name="Rain" /> + <program id="123" name="Dog" /> + <program id="124" name="Telephone2" /> + <program id="125" name="Car Engine" /> + <program id="126" name="Laughing" /> + <program id="127" name="MachineGun" /> + </bank> + + <bank name="Alternative 2" percussion="false" msb="2" lsb="2"> + <program id="2" name="EG+EP 2" /> + <program id="26" name="Jazz Gt 2" /> + <program id="30" name="Dazed Gt" /> + <program id="32" name="Ac.Bass 3" /> + <program id="33" name="Jazz Bass" /> + <program id="35" name="Frtlss Bs3" /> + <program id="38" name="Juno Bass" /> + <program id="39" name="Mod Bass" /> + <program id="50" name="Syn Str 1" /> + <program id="55" name="6th Hit" /> + <program id="56" name="Trumpet 3" /> + <program id="57" name="Trombone 3" /> + <program id="59" name="Mute Tp 2" /> + <program id="80" name="Hollow Min" /> + <program id="81" name="Pulse Saw" /> + <program id="82" name="PurePan Ld" /> + <program id="87" name="Fat and Perky" /> + <program id="89" name="Horn Pad" /> + <program id="93" name="Panner Pad" /> + <program id="96" name="African wd" /> + <program id="97" name="Prologue" /> + <program id="98" name="Sft Crystl" /> + <program id="99" name="Nylon Harp" /> + <program id="101" name="50s Sci-Fi" /> + <program id="102" name="Echo Pan 1" /> + <program id="104" name="Dtnd Sitar" /> + <program id="120" name="Str Slap" /> + <program id="122" name="Thunder" /> + <program id="123" name="HorseGallp" /> + <program id="124" name="Door Creak" /> + <program id="125" name="Car-Stop" /> + <program id="126" name="Screaming" /> + <program id="127" name="Laser Gun" /> + </bank> + + <bank name="Alternative 8" percussion="false" msb="8" lsb="2"> + <program id="0" name="St.Piano 1" /> + <program id="1" name="St.Piano 2" /> + <program id="2" name="St.Piano 3" /> + <program id="3" name="OldUpright" /> + <program id="4" name="St.Soft EP" /> + <program id="5" name="Detuned EP" /> + <program id="6" name="CoupledHps" /> + <program id="7" name="Comp Clav" /> + <program id="11" name="St.Vibe" /> + <program id="12" name="St.Marimba" /> + <program id="14" name="ChurchBell" /> + <program id="15" name="Cimbalom" /> + <program id="16" name="Trem Organ" /> + <program id="17" name="Chorus Org" /> + <program id="18" name="Rotary Org" /> + <program id="19" name="ChurchOrg2" /> + <program id="21" name="Accrdn It" /> + <program id="24" name="Ukulele" /> + <program id="25" name="12 Str Gt" /> + <program id="26" name="PedalSteel" /> + <program id="27" name="Chorus Gt" /> + <program id="28" name="Funk Pop" /> + <program id="30" name="Feedback 1" /> + <program id="31" name="Feedback 3" /> + <program id="34" name="Mt Pick Bs" /> + <program id="35" name="Frtlss Bs5" /> + <program id="36" name="Reso Slap" /> + <program id="38" name="Acid Bass" /> + <program id="39" name="Beef FM Bs" /> + <program id="40" name="SlowVioln1" /> + <program id="44" name="Slow Trem" /> + <program id="48" name="Orchestra1" /> + <program id="49" name="Legato Str" /> + <program id="50" name="70s Str 1" /> + <program id="52" name="St.Choir" /> + <program id="54" name="Syn Voice" /> + <program id="55" name="Impact Hit" /> + <program id="56" name="FlugelHorn" /> + <program id="60" name="FrHornSolo" /> + <program id="61" name="Brass 3" /> + <program id="62" name="Syn Brass3" /> + <program id="63" name="Syn Brass4" /> + <program id="64" name="Sop Sax 2" /> + <program id="65" name="Hyper Alto" /> + <program id="66" name="Blow Tenor" /> + <program id="71" name="BsClarinet" /> + <program id="75" name="Kawala 1" /> + <program id="80" name="Sine Wave" /> + <program id="81" name="Dr.Solo" /> + <program id="84" name="Dist Lead" /> + <program id="95" name="Converge" /> + <program id="96" name="Clav Pad" /> + <program id="97" name="Rave" /> + <program id="98" name="VibraBells" /> + <program id="105" name="Rabab 1" /> + <program id="107" name="TaishoKoto" /> + <program id="111" name="Pungi" /> + <program id="112" name="Bonang 1" /> + <program id="113" name="Atarigane" /> + <program id="115" name="Castanets" /> + <program id="116" name="Concert BD" /> + <program id="117" name="Melo Tom 2" /> + <program id="118" name="808 Tom" /> + <program id="119" name="Rev Snare1" /> + <program id="125" name="Starship" /> + </bank> + + <bank name="Alternative 16" percussion="false" msb="16" lsb="2"> + <program id="0" name="EuropeanPf" /> + <program id="4" name="FM+SA EP" /> + <program id="5" name="St.FM EP" /> + <program id="6" name="St.Harpsi" /> + <program id="12" name="Balafon 1" /> + <program id="16" name="60s Organ1" /> + <program id="18" name="RotarySlow" /> + <program id="19" name="ChurchOrg3" /> + <program id="20" name="Puff Organ" /> + <program id="24" name="Nylon Gt 2" /> + <program id="25" name="Mandolin" /> + <program id="28" name="Funk Gt" /> + <program id="30" name="Power Gt 1" /> + <program id="31" name="Ac.Gt Harm" /> + <program id="38" name="Reso SH Bs" /> + <program id="39" name="RubberBass" /> + <program id="48" name="St.Strings" /> + <program id="55" name="Lo-Fi Rave" /> + <program id="60" name="Horn Orch" /> + <program id="61" name="Brass Fall" /> + <program id="62" name="OctSynBrss" /> + <program id="63" name="VeloBrass1" /> + <program id="80" name="DistSquare" /> + <program id="81" name="Waspy Syn" /> + <program id="98" name="Choir and Bell" /> + <program id="105" name="Gopichant" /> + <program id="107" name="Kanoon 1" /> + <program id="111" name="Hichiriki" /> + <program id="112" name="RamaCymbal" /> + <program id="119" name="Rev Kick" /> + </bank> + + <bank name="Standard" percussion="true" msb="0" lsb="2"> + <program id="0" name="Standard 1" /> + <program id="1" name="Standard 2" /> + <program id="2" name="Standard 3" /> + <program id="8" name="Room" /> + <program id="9" name="Hip Hop" /> + <program id="10" name="Drum’n’Bss" /> + <program id="11" name="Tech and House" /> + <program id="13" name="R and B" /> + <program id="16" name="Power" /> + <program id="24" name="Electronic" /> + <program id="25" name="TR-808 and 909" /> + <program id="26" name="Dance" /> + <program id="30" name="New TR-909" /> + <program id="32" name="Jazz Kit 1" /> + <program id="33" name="Jazz Kit 2" /> + <program id="40" name="Brush Kit" /> + <program id="48" name="Orchestra" /> + <program id="49" name="Ethnic" /> + <program id="50" name="Kick and Snare" /> + <program id="56" name="SFX" /> + </bank> + + <bank name="Extra" percussion="true" msb="0" lsb="3"> + <program id="116" name="OR Kit 2" /> + </bank> + + <bank name="Ethnic" percussion="true" msb="0" lsb="4"> + <program id="43" name="China Perc" /> + <program id="44" name="India Perc" /> + <program id="45" name="GamelanPrc" /> + <program id="46" name="Latin Perc" /> + <program id="66" name="Std Asia" /> + <program id="67" name="Jazz Asia" /> + <program id="68" name="TR909 Asia" /> + <program id="69" name="HipHopAsia" /> + <program id="70" name="R and B Asia" /> + <program id="71" name="TechnoAsia" /> + <program id="72" name="D’n’B Asia" /> + <program id="74" name="Std Latin" /> + <program id="75" name="Jazz Latin" /> + <program id="76" name="TR909Latin" /> + <program id="77" name="TechnoLatn" /> + <program id="78" name="D’n’B Latn" /> + <program id="79" name="HipHopLatn" /> + <program id="80" name="R and B Latin" /> + <program id="81" name="Std OR1" /> + <program id="82" name="Jazz OR1" /> + <program id="83" name="TR-909 OR1" /> + <program id="84" name="Techno OR1" /> + <program id="85" name="D’n’B OR1" /> + <program id="86" name="HipHop OR1" /> + <program id="87" name="R and B OR1" /> + <program id="88" name="MxKit and Latn" /> + <program id="89" name="MxKt and India" /> + <program id="90" name="MxKit and Chin" /> + <program id="91" name="MxKit and OR1" /> + <program id="92" name="OR Kit 1" /> + <program id="93" name="India Kit" /> + <program id="94" name="OrientPerc" /> + <program id="95" name="Std OR2" /> + <program id="96" name="Jazz OR2" /> + <program id="97" name="TR-909 OR2" /> + <program id="98" name="HipHop OR2" /> + <program id="99" name="R and B OR2" /> + <program id="100" name="Techno OR2" /> + <program id="101" name="D’n’B OR2" /> + <program id="102" name="MxKit and OR2" /> + </bank> + + <controls> + <control name="Pan" type="controller" description="<none>" min="0" max="127" default="64" controllervalue="10" colourindex="2" ipbposition="0"/> + <control name="Chorus" type="controller" description="<none>" min="0" max="127" default="0" controllervalue="93" colourindex="3" ipbposition="1"/> + <control name="Volume" type="controller" description="<none>" min="0" max="127" default="0" controllervalue="7" colourindex="1" ipbposition="2"/> + <control name="Reverb" type="controller" description="<none>" min="0" max="127" default="0" controllervalue="91" colourindex="3" ipbposition="3"/> + <control name="Sustain" type="controller" description="<none>" min="0" max="127" default="0" controllervalue="64" colourindex="4" ipbposition="-1"/> + <control name="Expression" type="controller" description="<none>" min="0" max="127" default="100" controllervalue="11" colourindex="2" ipbposition="-1"/> + <control name="Modulation" type="controller" description="<none>" min="0" max="127" default="0" controllervalue="1" colourindex="4" ipbposition="-1"/> + <control name="PitchBend" type="pitchbend" description="<none>" min="0" max="16383" default="8192" controllervalue="1" colourindex="4" ipbposition="-1"/> + </controls> + + <instrument id="2000" channel="0" type="midi"> + <bank percussion="false" msb="0" lsb="2"/> + <program id="0"/> + <pan value="64"/> + <volume value="100"/> + </instrument> + + <instrument id="2001" channel="1" type="midi"> + <pan value="64"/> + <volume value="100"/> + </instrument> + + <instrument id="2002" channel="2" type="midi"> + <pan value="64"/> + <volume value="100"/> + </instrument> + + <instrument id="2003" channel="3" type="midi"> + <pan value="64"/> + <volume value="100"/> + </instrument> + + <instrument id="2004" channel="4" type="midi"> + <pan value="64"/> + <volume value="100"/> + </instrument> + + <instrument id="2005" channel="5" type="midi"> + <pan value="64"/> + <volume value="100"/> + </instrument> + + <instrument id="2006" channel="6" type="midi"> + <pan value="64"/> + <volume value="100"/> + </instrument> + + <instrument id="2007" channel="7" type="midi"> + <pan value="64"/> + <volume value="100"/> + </instrument> + + <instrument id="2008" channel="8" type="midi"> + <pan value="64"/> + <volume value="100"/> + </instrument> + + <instrument id="2009" channel="9" type="midi"> + <pan value="64"/> + <volume value="100"/> + </instrument> + + <instrument id="2010" channel="10" type="midi"> + <pan value="64"/> + <volume value="100"/> + </instrument> + + <instrument id="2011" channel="11" type="midi"> + <pan value="64"/> + <volume value="100"/> + </instrument> + + <instrument id="2012" channel="12" type="midi"> + <pan value="64"/> + <volume value="100"/> + </instrument> + + <instrument id="2013" channel="13" type="midi"> + <pan value="64"/> + <volume value="100"/> + </instrument> + + <instrument id="2014" channel="14" type="midi"> + <pan value="64"/> + <volume value="100"/> + </instrument> + + <instrument id="2015" channel="15" type="midi"> + <pan value="64"/> + <volume value="100"/> + </instrument> + + </device> + + + + +</studio> + + +</rosegarden-data> diff --git a/libs/pbd/tests/xpath.cc b/libs/pbd/tests/xpath.cc new file mode 100644 index 0000000000..f10d4b4254 --- /dev/null +++ b/libs/pbd/tests/xpath.cc @@ -0,0 +1,26 @@ +#include "assert.h" +#include <iostream> + +#include "pbd/xml++.h" + +using namespace std; + +int main() +{ + XMLTree doc("./rosegardenpatchfile.xml"); + XMLNode* root = doc.root(); + // "//bank" gives as last element an empty element libxml bug???? + XMLNodeList* result = root->find("//bank[@name]"); + + cerr << "Found " << result->size() << " banks" << endl; + assert(result->size() == 8); + int counter = 1; + for(XMLNodeList::const_iterator i = result->begin(); i != result->end(); ++i) { + assert((*i)->name() == "bank"); + assert((*i)->property("name")); + cout << "Found bank number " << counter++ << " with name: " << (*i)->property("name")->value() << endl; + for(XMLNodeList::const_iterator j = (*i)->children().begin(); j != (*i)->children().end(); ++j) { + cout << "\t found program with name: " << (*j)->property("name")->value() << endl; + } + } +} diff --git a/libs/pbd/xml++.cc b/libs/pbd/xml++.cc index e603b4c50f..9881dc5bee 100644 --- a/libs/pbd/xml++.cc +++ b/libs/pbd/xml++.cc @@ -6,9 +6,14 @@ #include <pbd/xml++.h> #include <libxml/debugXML.h> +#include <libxml/xpath.h> +#include <libxml/xpathInternals.h> + +#define XML_VERSION "1.0" static XMLNode *readnode(xmlNodePtr); static void writenode(xmlDocPtr, XMLNode *, xmlNodePtr, int); +static XMLNodeList *find_impl(xmlXPathContext* ctxt, const string xpath); XMLTree::XMLTree() : _filename(), @@ -99,6 +104,7 @@ XMLTree::read_buffer(const string & buffer) return true; } + bool XMLTree::write(void) const { @@ -107,7 +113,7 @@ XMLTree::write(void) const int result; xmlKeepBlanksDefault(0); - doc = xmlNewDoc((xmlChar *) "1.0"); + doc = xmlNewDoc((xmlChar *) XML_VERSION); xmlSetDocCompressMode(doc, _compression); writenode(doc, _root, doc->children, 1); result = xmlSaveFormatFileEnc(_filename.c_str(), doc, "UTF-8", 1); @@ -127,7 +133,7 @@ XMLTree::debug(FILE* out) const XMLNodeList children; xmlKeepBlanksDefault(0); - doc = xmlNewDoc((xmlChar *) "1.0"); + doc = xmlNewDoc((xmlChar *) XML_VERSION); xmlSetDocCompressMode(doc, _compression); writenode(doc, _root, doc->children, 1); xmlDebugDumpDocument (out, doc); @@ -144,7 +150,7 @@ XMLTree::write_buffer(void) const XMLNodeList children; xmlKeepBlanksDefault(0); - doc = xmlNewDoc((xmlChar *) "1.0"); + doc = xmlNewDoc((xmlChar *) XML_VERSION); xmlSetDocCompressMode(doc, _compression); writenode(doc, _root, doc->children, 1); xmlDocDumpMemory(doc, (xmlChar **) & ptr, &len); @@ -279,6 +285,21 @@ XMLNode::add_child_copy(const XMLNode& n) return copy; } +XMLNodeList* +XMLNode::find(const string xpath) const +{ + xmlDocPtr doc = xmlNewDoc((xmlChar *) XML_VERSION); + writenode(doc, (XMLNode *) this, doc->children, 1); + xmlXPathContext* ctxt = xmlXPathNewContext(doc); + + XMLNodeList* result = find_impl(ctxt, xpath); + + xmlXPathFreeContext(ctxt); + xmlFreeDoc(doc); + + return result; +} + XMLNode * XMLNode::add_content(const string & c) { @@ -475,3 +496,43 @@ writenode(xmlDocPtr doc, XMLNode * n, xmlNodePtr p, int root = 0) writenode(doc, *curchild, node); } } + +static XMLNodeList* find_impl(xmlXPathContext* ctxt, const string xpath) +{ + xmlXPathObject* result = xmlXPathEval((const xmlChar*)xpath.c_str(), ctxt); + + if(!result) + { + xmlXPathFreeContext(ctxt); + xmlFreeDoc(ctxt->doc); + + throw XMLException("Invalid XPath: " + xpath); + } + + if(result->type != XPATH_NODESET) + { + xmlXPathFreeObject(result); + xmlXPathFreeContext(ctxt); + xmlFreeDoc(ctxt->doc); + + throw XMLException("Only nodeset result types are supported."); + } + + xmlNodeSet* nodeset = result->nodesetval; + XMLNodeList* nodes = new XMLNodeList(); + if( nodeset ) + { + for (int i = 0; i < nodeset->nodeNr; ++i) { + XMLNode* node = readnode(nodeset->nodeTab[i]); + nodes->push_back(node); + } + } + else + { + // return empty set + } + + xmlXPathFreeObject(result); + + return nodes; +} |