From d0a8e12ba08bc2311d780c55ab9ea1d158b36be3 Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Wed, 21 Feb 2024 18:14:23 +0100 Subject: [PATCH 01/28] Node: Add eval_xpath() Fixes #66 --- examples/dom_xpath/main.cc | 94 ++++++++++++++++++++++++---------- libxml++/nodes/node.cc | 100 +++++++++++++++++++++++++++++-------- libxml++/nodes/node.h | 27 ++++++++++ 3 files changed, 174 insertions(+), 47 deletions(-) diff --git a/examples/dom_xpath/main.cc b/examples/dom_xpath/main.cc index 8c15b60e..aaa20345 100644 --- a/examples/dom_xpath/main.cc +++ b/examples/dom_xpath/main.cc @@ -40,6 +40,36 @@ std::string result_type_to_ustring(xmlpp::XPathResultType result_type) } } +void print_nodeset(const xmlpp::Node::const_NodeSet& set) +{ + // Print the structural paths and the values: + for(const auto& child : set) + { + std::cout << " " << child->get_path(); + + auto attribute = dynamic_cast(child); + if (attribute) + std::cout << ", value=\"" << attribute->get_value() << "\""; + + auto content_node = dynamic_cast(child); + if (content_node) + std::cout << ", content=\"" << content_node->get_content() << "\""; + + auto entity_reference = dynamic_cast(child); + if (entity_reference) + std::cout << ", text=\"" << entity_reference->get_original_text() << "\""; + + auto element = dynamic_cast(child); + if (element) + { + auto text_node = element->get_first_child_text(); + if (text_node) + std::cout << ", first_child_text=\"" << text_node->get_content() << "\""; + } + std::cout << std::endl; + } +} + bool xpath_test(const xmlpp::Node* node, const std::string& xpath) { bool result = true; @@ -49,39 +79,46 @@ bool xpath_test(const xmlpp::Node* node, const std::string& xpath) try { auto set = node->find(xpath); + std::cout << "find(): " << set.size() << " nodes have been found:" << std::endl; + print_nodeset(set); + } + catch (const xmlpp::exception& ex) + { + std::cerr << "Exception caught from find: " << ex.what() << std::endl; + result = false; + } - std::cout << set.size() << " nodes have been found:" << std::endl; - - //Print the structural paths and the values: - for(const auto& child : set) + try + { + auto var = node->eval_xpath(xpath); + std::cout << "eval_xpath(): "; + switch (var.index()) { - std::cout << " " << child->get_path(); - - auto attribute = dynamic_cast(child); - if (attribute) - std::cout << ", value=\"" << attribute->get_value() << "\""; - - auto content_node = dynamic_cast(child); - if (content_node) - std::cout << ", content=\"" << content_node->get_content() << "\""; - - auto entity_reference = dynamic_cast(child); - if (entity_reference) - std::cout << ", text=\"" << entity_reference->get_original_text() << "\""; - - auto element = dynamic_cast(child); - if (element) - { - auto text_node = element->get_first_child_text(); - if (text_node) - std::cout << ", first_child_text=\"" << text_node->get_content() << "\""; - } - std::cout << std::endl; + case 0: // nodeset + { + auto set = std::get<0>(var); + std::cout << set.size() << " nodes have been found:" << std::endl; + print_nodeset(set); + break; + } + case 1: // boolean + std::cout << "Boolean: " << (std::get<1>(var) ? "true" : "false") << std::endl; + break; + case 2: // number + std::cout << "Number: " << std::get<2>(var) << std::endl; + break; + case 3: // string + std::cout << "String: " << std::get<3>(var) << std::endl; + break; + default: + std::cerr << "Unsupported result type." << std::endl; + result = false; + break; } } catch (const xmlpp::exception& ex) { - std::cerr << "Exception caught from find: " << ex.what() << std::endl; + std::cerr << "Exception caught from eval_xpath: " << ex.what() << std::endl; result = false; } @@ -122,6 +159,9 @@ int main(int argc, char* argv[]) // Find all sections, no matter where: result &= xpath_test(root, "//section"); + // Count the number of sections: + result &= !xpath_test(root, "count(//section)"); + // Find the title node (if there is one): result &= xpath_test(root, "title"); diff --git a/libxml++/nodes/node.cc b/libxml++/nodes/node.cc index c6ce949b..d3ead850 100644 --- a/libxml++/nodes/node.cc +++ b/libxml++/nodes/node.cc @@ -53,9 +53,8 @@ Tlist get_children_common(const xmlpp::ustring& name, xmlNode* child) return children; } -// Common part of all overloaded xmlpp::Node::find() methods. -template -Tvector find_common(const xmlpp::ustring& xpath, +// A common part of all overloaded xmlpp::Node::find() and eval_xpath() methods. +xmlXPathObject* find_common1(const xmlpp::ustring& xpath, const xmlpp::Node::PrefixNsMap* namespaces, xmlNode* node) { auto ctxt = xmlXPathNewContext(node->doc); @@ -72,22 +71,20 @@ Tvector find_common(const xmlpp::ustring& xpath, } auto result = xmlXPathEval((const xmlChar*)xpath.c_str(), ctxt); + xmlXPathFreeContext(ctxt); if (!result) - { - xmlXPathFreeContext(ctxt); - throw xmlpp::exception("Invalid XPath: " + xpath); - } - if (result->type != XPATH_NODESET) - { - xmlXPathFreeObject(result); - xmlXPathFreeContext(ctxt); - - throw xmlpp::internal_error("Only nodeset result types are supported."); - } + return result; +} +// A common part of all overloaded xmlpp::Node::find() and eval_xpath() methods. +// Tvector == NodeSet or const_NodeSet +// result->type == XPATH_NODESET +template +Tvector find_common2(xmlXPathObject* result, const char* method_name) +{ auto nodeset = result->nodesetval; Tvector nodes; if (nodeset && !xmlXPathNodeSetIsEmpty(nodeset)) @@ -99,15 +96,15 @@ Tvector find_common(const xmlpp::ustring& xpath, auto cnode = xmlXPathNodeSetItem(nodeset, i); if (!cnode) { - std::cerr << "Node::find(): The xmlNode was null." << std::endl; + std::cerr << "Node::" << method_name << "(): The xmlNode was null." << std::endl; continue; } if (cnode->type == XML_NAMESPACE_DECL) { - //In this case we would cast it to a xmlNs*, - //but this C++ method only returns Nodes. - std::cerr << "Node::find(): Ignoring an xmlNs object." << std::endl; + // In this case we would cast it to a xmlNs*, + // but this C++ method only returns Nodes. + std::cerr << "Node::" << method_name << "(): Ignoring an xmlNs object." << std::endl; continue; } @@ -122,11 +119,62 @@ Tvector find_common(const xmlpp::ustring& xpath, } xmlXPathFreeObject(result); - xmlXPathFreeContext(ctxt); return nodes; } +// Common part of all overloaded xmlpp::Node::find() methods. +template +Tvector find_common(const xmlpp::ustring& xpath, + const xmlpp::Node::PrefixNsMap* namespaces, xmlNode* node) +{ + auto result = find_common1(xpath, namespaces, node); + + if (result->type != XPATH_NODESET) + { + xmlXPathFreeObject(result); + throw xmlpp::internal_error("Only nodeset result types are supported."); + } + return find_common2(result, "find"); +} + +// Common part of all overloaded xmlpp::Node::eval_xpath() methods. +template +std::variant +eval_xpath_common(const xmlpp::ustring& xpath, + const xmlpp::Node::PrefixNsMap* namespaces, xmlNode* node) +{ + auto result = find_common1(xpath, namespaces, node); + + switch (result->type) + { + case XPATH_NODESET: + return find_common2(result, "eval_xpath"); + + case XPATH_BOOLEAN: + { + auto val = static_cast(result->boolval); + xmlXPathFreeObject(result); + return val; + } + case XPATH_NUMBER: + { + double val = result->floatval; + xmlXPathFreeObject(result); + return val; + } + case XPATH_STRING: + { + xmlpp::ustring val = reinterpret_cast(result->stringval); + xmlXPathFreeObject(result); + return val; + } + default: + xmlXPathFreeObject(result); + throw xmlpp::internal_error("Unsupported result type."); + } +} + // Common part of xmlpp::Node::eval_to_[boolean|number|string] xmlXPathObject* eval_common(const xmlpp::ustring& xpath, const xmlpp::Node::PrefixNsMap* namespaces, @@ -145,7 +193,7 @@ xmlXPathObject* eval_common(const xmlpp::ustring& xpath, reinterpret_cast(ns_uri.c_str())); } - auto xpath_value = xmlXPathEvalExpression( + auto xpath_value = xmlXPathEval( reinterpret_cast(xpath.c_str()), ctxt); xmlXPathFreeContext(ctxt); @@ -412,6 +460,18 @@ Node::const_NodeSet Node::find(const ustring& xpath, const PrefixNsMap& namespac return find_common(xpath, &namespaces, impl_); } +std::variant +Node::eval_xpath(const ustring& xpath, const PrefixNsMap& namespaces) +{ + return eval_xpath_common(xpath, &namespaces, impl_); +} + +std::variant +Node::eval_xpath(const ustring& xpath, const PrefixNsMap& namespaces) const +{ + return eval_xpath_common(xpath, &namespaces, impl_); +} + bool Node::eval_to_boolean(const ustring& xpath, XPathResultType* result_type) const { return eval_common_to_boolean(xpath, nullptr, result_type, impl_); diff --git a/libxml++/nodes/node.h b/libxml++/nodes/node.h index 9b4d2b08..fa1182bc 100644 --- a/libxml++/nodes/node.h +++ b/libxml++/nodes/node.h @@ -13,6 +13,7 @@ #include #include #include +#include #ifndef DOXYGEN_SHOULD_SKIP_THIS extern "C" { @@ -230,6 +231,32 @@ class LIBXMLPP_API Node : public NonCopyable */ const_NodeSet find(const ustring& xpath, const PrefixNsMap& namespaces) const; + /** Evaluate an XPath expression. + * @param xpath The XPath expression. + * @param namespaces A map of namespace prefixes to namespace URIs to be used while evaluating. + * @returns The resulting NodeSet (XPathResultType::NODESET), bool (XPathResultType::BOOLEAN), + * double (XPathResultType::NUMBER) or ustring (XPathResultType::STRING). + * @throws xmlpp::exception If the XPath expression cannot be evaluated. + * @throws xmlpp::internal_error If the result type is not nodeset, boolean, number or string. + * + * @newin{5,4} + */ + std::variant + eval_xpath(const ustring& xpath, const PrefixNsMap& namespaces = {}); + + /** Evaluate an XPath expression. + * @param xpath The XPath expression. + * @param namespaces A map of namespace prefixes to namespace URIs to be used while evaluating. + * @returns The resulting const_NodeSet (XPathResultType::NODESET), bool (XPathResultType::BOOLEAN), + * double (XPathResultType::NUMBER) or ustring (XPathResultType::STRING). + * @throws xmlpp::exception If the XPath expression cannot be evaluated. + * @throws xmlpp::internal_error If the result type is not nodeset, boolean, number or string. + * + * @newin{5,4} + */ + std::variant + eval_xpath(const ustring& xpath, const PrefixNsMap& namespaces = {}) const; + /** Evaluate an XPath expression. * @param xpath The XPath expression. * @param[out] result_type Result type of the XPath expression before conversion From ab5098e2a8b7fe69a991a28fe00a75e078f9a90e Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Tue, 21 May 2024 15:52:41 +0200 Subject: [PATCH 02/28] docs/index.md: Don't link to developer-old.gnome.org That web site has been removed. --- docs/index.md | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/docs/index.md b/docs/index.md index ec86e1a1..0c4051e7 100644 --- a/docs/index.md +++ b/docs/index.md @@ -43,7 +43,7 @@ or the [GNOME download site](https://download.gnome.org/sources/libxml++/). ## Required Libraries * [libxml2](http://www.xmlsoft.org/) -* libxml++-2.6 and libxml++-3.0: [glibmm-2.4](https://developer-old.gnome.org/glibmm/2.66/) +* libxml++-2.6 and libxml++-3.0: glibmm-2.4 * libxml++-4.0: [glibmm-2.68](https://gnome.pages.gitlab.gnome.org/glibmm/) ## Documentation @@ -55,17 +55,8 @@ You can also browse online the [reference documentation](reference/html/index.ht ### Other ABI Versions -libxml++-2.6: [manual](https://developer-old.gnome.org/libxml++-tutorial/2.42/) -and [reference documentation](https://developer-old.gnome.org/libxml++/2.42/) - -libxml++-3.0: [manual](https://developer-old.gnome.org/libxml++-tutorial/3.2/) -and [reference documentation](https://developer-old.gnome.org/libxml++/3.2/) - -libxml++-4.0: [manual](https://developer-old.gnome.org/libxml++-tutorial/4.0/) -and [reference documentation](https://developer-old.gnome.org/libxml++/4.0) - -This documentation is frozen on the web. It does not document the latest releases. -If you want newer documentation, you can download a tarball from +The documentation of libxml++-2.6, libxml++-3.0 and libxml++-4.0 is not +available online. You can download a tarball from [GitHub releases](https://github.com/libxmlplusplus/libxmlplusplus/releases/) or the [GNOME download site](https://download.gnome.org/sources/libxml++/), extract it, and view the documentation at *untracked/docs/*. From 4b39bf0e0ae4d6f5d569e923522ccdc644858d1f Mon Sep 17 00:00:00 2001 From: Andrew Potter Date: Thu, 6 Jun 2024 08:32:01 -0700 Subject: [PATCH 03/28] Meson build: Use libxml2 meson build as fallback Fixes #67 --- .github/workflows/meson-windows-2022.yml | 4 +- Makefile.am | 2 +- libxml++/meson.build | 4 -- meson.build | 61 +------------------ .../{libxml2_cmake.wrap => libxml2.wrap} | 3 + 5 files changed, 7 insertions(+), 67 deletions(-) rename subprojects/{libxml2_cmake.wrap => libxml2.wrap} (68%) diff --git a/.github/workflows/meson-windows-2022.yml b/.github/workflows/meson-windows-2022.yml index 27a924b7..0f27f89b 100644 --- a/.github/workflows/meson-windows-2022.yml +++ b/.github/workflows/meson-windows-2022.yml @@ -20,7 +20,7 @@ jobs: architecture: x64 - name: Configure - run: meson setup --warnlevel 3 --werror -Dlibxml2_cmake:werror=false -Dmaintainer-mode=false _build + run: meson setup --warnlevel 3 -Dlibxml2:warning_level=0 --werror -Dlibxml2:werror=false -Dlibxml2:python=false -Dmaintainer-mode=false _build - name: Compile run: ninja -C _build @@ -29,7 +29,7 @@ jobs: run: meson test -C _build - name: Configure static - run: meson setup --warnlevel 3 --werror -Dlibxml2_cmake:werror=false --default-library static -Dmaintainer-mode=false _build_static + run: meson setup --warnlevel 3 -Dlibxml2:warning_level=0 --werror -Dlibxml2:werror=false -Dlibxml2:python=false --default-library static -Dmaintainer-mode=false _build_static - name: Compile static run: ninja -C _build_static diff --git a/Makefile.am b/Makefile.am index 92c59007..b7d45e28 100644 --- a/Makefile.am +++ b/Makefile.am @@ -38,7 +38,7 @@ EXTRA_DIST = \ docs/reference/meson.build \ examples/meson.build \ libxml++/meson.build \ - subprojects/libxml2_cmake.wrap \ + subprojects/libxml2.wrap \ subprojects/mm-common.wrap \ tests/meson.build \ tools/build_scripts/tutorial-custom-cmd.py \ diff --git a/libxml++/meson.build b/libxml++/meson.build index 93736f9f..34233f9a 100644 --- a/libxml++/meson.build +++ b/libxml++/meson.build @@ -101,10 +101,6 @@ if host_machine.system() == 'windows' windows = import('windows') xmlxx_res = windows.compile_resources(xmlxx_rc) extra_xmlxx_objects += xmlxx_res - - if xml2_is_subproject - xmlxx_all_deps += [winsock_dep, bcrypt_dep] - endif endif extra_include_dirs = ['..'] diff --git a/meson.build b/meson.build index e4b27ed9..a111cee5 100644 --- a/meson.build +++ b/meson.build @@ -110,63 +110,9 @@ xml2_req = '>= @0@'.format(xml2_min_ver) xml2_dep = dependency( ['libxml-2.0', 'LibXml2'], version: xml2_req, - required: host_machine.system() != 'windows' + fallback: ['libxml2'] ) -# Setup CMake subproject for use, if needed -if not xml2_dep.found() - cmake = import('cmake') - opt_var = cmake.subproject_options() - build_shared = get_option('default_library') != 'static' - iconv_dep = dependency('iconv', required: false) - icu_i18n_dep = dependency('icu-i18n', 'ICU', - components: 'in', - required: false) - icu_uc_dep = dependency('icu-uc', 'ICU', - components: 'uc', - required: false) - lzma_dep = dependency(['liblzma','LibLZMA'], required: false) - thread_dep = dependency('threads', required: false) - zlib_dep = dependency('zlib', required: false) - winsock_dep = cpp_compiler.find_library('ws2_32', required: false) - bcrypt_dep = cpp_compiler.find_library('bcrypt', required: false) - cmake_build_type = get_option('buildtype') - if get_option('buildtype') == 'debugoptimized' - cmake_build_type = 'RelWithDebInfo' - elif get_option('buildtype') == 'minsize' - cmake_build_type = 'MinSizeRel' - elif get_option('buildtype') == 'plain' - cmake_build_type = '' - endif - opt_var.add_cmake_defines({ - 'BUILD_SHARED_LIBS': build_shared, - 'CMAKE_BUILD_TYPE': cmake_build_type, - 'CMAKE_MSVC_RUNTIME_LIBRARY': '', - 'CMAKE_C_FLAGS_INIT': '', - 'CMAKE_C_FLAGS_DEBUG': '', - 'CMAKE_C_FLAGS_RELEASE': '', - 'CMAKE_C_FLAGS_RELWITHDEBINFO': '', - 'CMAKE_C_FLAGS_MINSIZEREL': '', - 'LIBXML2_WITH_HTTP': host_machine.system() != 'windows' or winsock_dep.found(), - 'LIBXML2_WITH_ICONV': iconv_dep.found(), - 'LIBXML2_WITH_ICU': icu_i18n_dep.found() and icu_uc_dep.found(), - 'LIBXML2_WITH_LZMA': lzma_dep.found(), - 'LIBXML2_WITH_PYTHON': false, - 'LIBXML2_WITH_TESTS': build_tests, - 'LIBXML2_WITH_THREADS': thread_dep.found(), - 'LIBXML2_WITH_ZLIB': zlib_dep.found(), - }) - xml2_sp = cmake.subproject('libxml2_cmake', options: opt_var) - xml2_dep = xml2_sp.dependency('LibXml2') -endif - -xml2_is_subproject = xml2_dep.type_name() == 'internal' - -if xml2_is_subproject and build_tests - test('testchar', xml2_sp.target('testchar')) - test('testdict', xml2_sp.target('testdict')) -endif - xmlxx_requires = [] libxml2_lib_pkgconfig = '' @@ -174,11 +120,6 @@ libxml2_lib_pkgconfig = '' # we found it by pkg-config if xml2_dep.type_name() == 'pkgconfig' xmlxx_requires += ['libxml-2.0', xml2_req] -else - libxml2_lib_pkgconfig = xml2_dep.get_variable( - cmake: 'LIBXML2_LIBRARIES', - default_value: 'LibXml2.lib', - ) endif xmlxx_requires = ' '.join(xmlxx_requires) diff --git a/subprojects/libxml2_cmake.wrap b/subprojects/libxml2.wrap similarity index 68% rename from subprojects/libxml2_cmake.wrap rename to subprojects/libxml2.wrap index a6f60f33..9c0e5f6d 100644 --- a/subprojects/libxml2_cmake.wrap +++ b/subprojects/libxml2.wrap @@ -2,3 +2,6 @@ url = https://gitlab.gnome.org/GNOME/libxml2.git revision = master depth = 1 + +[provide] +dependency_names = libxml-2.0 From 1a34aa2070636a389ce81695c7ee93aa8caf781d Mon Sep 17 00:00:00 2001 From: Andrew Potter Date: Sat, 8 Jun 2024 08:58:17 -0700 Subject: [PATCH 04/28] meson: set LIBXML2_LIB_NO_PKGCONFIG for cmake dep --- meson.build | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/meson.build b/meson.build index a111cee5..4bebf5f9 100644 --- a/meson.build +++ b/meson.build @@ -118,8 +118,13 @@ libxml2_lib_pkgconfig = '' # Put libxml-2.0 in the 'Requires:' section in the generated pkg-config file if # we found it by pkg-config -if xml2_dep.type_name() == 'pkgconfig' +if xml2_dep.type_name() == 'pkgconfig' or xml2_dep.type_name() == 'internal' xmlxx_requires += ['libxml-2.0', xml2_req] +else + libxml2_lib_pkgconfig = xml2_dep.get_variable( + cmake: 'LIBXML2_LIBRARIES', + default_value: 'LibXml2.lib', + ) endif xmlxx_requires = ' '.join(xmlxx_requires) From e9782ba493add853088e160ff66badeb85d2358c Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Wed, 3 Jul 2024 18:56:18 +0200 Subject: [PATCH 05/28] docs/reference/Doxyfile.in: Remove obsolete entries --- docs/reference/Doxyfile.in | 5 ----- 1 file changed, 5 deletions(-) diff --git a/docs/reference/Doxyfile.in b/docs/reference/Doxyfile.in index 32fd1511..2f38f50d 100644 --- a/docs/reference/Doxyfile.in +++ b/docs/reference/Doxyfile.in @@ -163,7 +163,6 @@ HTML_EXTRA_FILES = HTML_COLORSTYLE_HUE = 220 HTML_COLORSTYLE_SAT = 100 HTML_COLORSTYLE_GAMMA = 80 -HTML_TIMESTAMP = YES HTML_DYNAMIC_SECTIONS = NO HTML_INDEX_NUM_ENTRIES = 100 GENERATE_DOCSET = NO @@ -194,7 +193,6 @@ ENUM_VALUES_PER_LINE = 1 TREEVIEW_WIDTH = 250 EXT_LINKS_IN_WINDOW = NO FORMULA_FONTSIZE = 10 -FORMULA_TRANSPARENT = YES USE_MATHJAX = NO MATHJAX_FORMAT = HTML-CSS MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest @@ -308,8 +306,6 @@ DIA_PATH = HIDE_UNDOC_RELATIONS = NO HAVE_DOT = @DOXYGEN_HAVE_DOT@ DOT_NUM_THREADS = 0 -DOT_FONTNAME = Sans -DOT_FONTSIZE = 10 DOT_FONTPATH = CLASS_GRAPH = YES COLLABORATION_GRAPH = NO @@ -333,7 +329,6 @@ PLANTUML_JAR_PATH = PLANTUML_INCLUDE_PATH = DOT_GRAPH_MAX_NODES = 50 MAX_DOT_GRAPH_DEPTH = 0 -DOT_TRANSPARENT = NO DOT_MULTI_TARGETS = YES GENERATE_LEGEND = YES DOT_CLEANUP = YES From 512df9f80d825893d81a2bce502a9faa699cc359 Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Wed, 3 Jul 2024 18:56:37 +0200 Subject: [PATCH 06/28] libxml++/libxml++.h: Don't link to developer-old.gnome.org meson.build: Require python3 >= 3.7. That's what Meson requires. --- libxml++/libxml++.h | 2 +- meson.build | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libxml++/libxml++.h b/libxml++/libxml++.h index e844a0e0..bb599527 100644 --- a/libxml++/libxml++.h +++ b/libxml++/libxml++.h @@ -14,7 +14,7 @@ * libxml++ is a C++ wrapper for the libxml2 XML parser and builder library. It presents a * simple C++-like API that can achieve common tasks with less code. * - * See also the libxml++ Tutorial + * See also the libxml++ Tutorial * and the libxml++ website. * * @section features Features diff --git a/meson.build b/meson.build index 4bebf5f9..8d5ecf7b 100644 --- a/meson.build +++ b/meson.build @@ -44,7 +44,7 @@ project_build_root = meson.project_build_root() cpp_compiler = meson.get_compiler('cpp') is_msvc = cpp_compiler.get_id() == 'msvc' -python3 = find_program('python3', version: '>=3.5') +python3 = find_program('python3', version: '>=3.7') # Do we build from a git repository? # Suppose we do if and only if the meson.build file is tracked by git. From 2fa72c0ffe9b330f77cf71c658348dc9c677c08d Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Wed, 3 Jul 2024 19:14:36 +0200 Subject: [PATCH 07/28] CI: Windows build: -Dlibxml2:python=disabled The type of this option has changed from boolean to feature. --- .github/workflows/meson-windows-2022.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/meson-windows-2022.yml b/.github/workflows/meson-windows-2022.yml index 0f27f89b..e9c99cdb 100644 --- a/.github/workflows/meson-windows-2022.yml +++ b/.github/workflows/meson-windows-2022.yml @@ -20,7 +20,7 @@ jobs: architecture: x64 - name: Configure - run: meson setup --warnlevel 3 -Dlibxml2:warning_level=0 --werror -Dlibxml2:werror=false -Dlibxml2:python=false -Dmaintainer-mode=false _build + run: meson setup --warnlevel 3 -Dlibxml2:warning_level=0 --werror -Dlibxml2:werror=false -Dlibxml2:python=disabled -Dmaintainer-mode=false _build - name: Compile run: ninja -C _build @@ -29,7 +29,7 @@ jobs: run: meson test -C _build - name: Configure static - run: meson setup --warnlevel 3 -Dlibxml2:warning_level=0 --werror -Dlibxml2:werror=false -Dlibxml2:python=false --default-library static -Dmaintainer-mode=false _build_static + run: meson setup --warnlevel 3 -Dlibxml2:warning_level=0 --werror -Dlibxml2:werror=false -Dlibxml2:python=disabled --default-library static -Dmaintainer-mode=false _build_static - name: Compile static run: ninja -C _build_static From 165eb9bd9c2a2b88dd5de3682812907099677ad7 Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Wed, 3 Jul 2024 21:29:10 +0200 Subject: [PATCH 08/28] CI: Windows build: -Dlibxml2:minimum=true Hopefully a minimum libxml2 will build on Windows and have enough functionality for libxml++. --- .github/workflows/meson-windows-2022.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/meson-windows-2022.yml b/.github/workflows/meson-windows-2022.yml index e9c99cdb..71786f35 100644 --- a/.github/workflows/meson-windows-2022.yml +++ b/.github/workflows/meson-windows-2022.yml @@ -20,7 +20,7 @@ jobs: architecture: x64 - name: Configure - run: meson setup --warnlevel 3 -Dlibxml2:warning_level=0 --werror -Dlibxml2:werror=false -Dlibxml2:python=disabled -Dmaintainer-mode=false _build + run: meson setup --warnlevel 3 -Dlibxml2:warning_level=0 --werror -Dlibxml2:werror=false -Dlibxml2:minimum=true -Dmaintainer-mode=false _build - name: Compile run: ninja -C _build @@ -29,7 +29,7 @@ jobs: run: meson test -C _build - name: Configure static - run: meson setup --warnlevel 3 -Dlibxml2:warning_level=0 --werror -Dlibxml2:werror=false -Dlibxml2:python=disabled --default-library static -Dmaintainer-mode=false _build_static + run: meson setup --warnlevel 3 -Dlibxml2:warning_level=0 --werror -Dlibxml2:werror=false -Dlibxml2:minimum=true --default-library static -Dmaintainer-mode=false _build_static - name: Compile static run: ninja -C _build_static From fdc2a7f7d3c86770999897378761361ec8d9843c Mon Sep 17 00:00:00 2001 From: Andrew Potter Date: Thu, 4 Jul 2024 08:34:52 -0700 Subject: [PATCH 09/28] Revert "CI: Windows build: -Dlibxml2:minimum=true" This reverts commit 165eb9bd9c2a2b88dd5de3682812907099677ad7. --- .github/workflows/meson-windows-2022.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/meson-windows-2022.yml b/.github/workflows/meson-windows-2022.yml index 71786f35..e9c99cdb 100644 --- a/.github/workflows/meson-windows-2022.yml +++ b/.github/workflows/meson-windows-2022.yml @@ -20,7 +20,7 @@ jobs: architecture: x64 - name: Configure - run: meson setup --warnlevel 3 -Dlibxml2:warning_level=0 --werror -Dlibxml2:werror=false -Dlibxml2:minimum=true -Dmaintainer-mode=false _build + run: meson setup --warnlevel 3 -Dlibxml2:warning_level=0 --werror -Dlibxml2:werror=false -Dlibxml2:python=disabled -Dmaintainer-mode=false _build - name: Compile run: ninja -C _build @@ -29,7 +29,7 @@ jobs: run: meson test -C _build - name: Configure static - run: meson setup --warnlevel 3 -Dlibxml2:warning_level=0 --werror -Dlibxml2:werror=false -Dlibxml2:minimum=true --default-library static -Dmaintainer-mode=false _build_static + run: meson setup --warnlevel 3 -Dlibxml2:warning_level=0 --werror -Dlibxml2:werror=false -Dlibxml2:python=disabled --default-library static -Dmaintainer-mode=false _build_static - name: Compile static run: ninja -C _build_static From 591f701dbd236cbbe8bc6d4e91b4c119d515c935 Mon Sep 17 00:00:00 2001 From: Andrew Potter Date: Thu, 4 Jul 2024 08:45:02 -0700 Subject: [PATCH 10/28] CI: Disable iconv for Windows libxml2 --- .github/workflows/meson-windows-2022.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/meson-windows-2022.yml b/.github/workflows/meson-windows-2022.yml index e9c99cdb..67bc84ec 100644 --- a/.github/workflows/meson-windows-2022.yml +++ b/.github/workflows/meson-windows-2022.yml @@ -20,7 +20,7 @@ jobs: architecture: x64 - name: Configure - run: meson setup --warnlevel 3 -Dlibxml2:warning_level=0 --werror -Dlibxml2:werror=false -Dlibxml2:python=disabled -Dmaintainer-mode=false _build + run: meson setup --warnlevel 3 -Dlibxml2:warning_level=0 --werror -Dlibxml2:werror=false -Dlibxml2:python=disabled -Dlibxml2:iconv=disabled -Dmaintainer-mode=false _build - name: Compile run: ninja -C _build @@ -29,7 +29,7 @@ jobs: run: meson test -C _build - name: Configure static - run: meson setup --warnlevel 3 -Dlibxml2:warning_level=0 --werror -Dlibxml2:werror=false -Dlibxml2:python=disabled --default-library static -Dmaintainer-mode=false _build_static + run: meson setup --warnlevel 3 -Dlibxml2:warning_level=0 --werror -Dlibxml2:werror=false -Dlibxml2:python=disabled -Dlibxml2:iconv=disabled --default-library static -Dmaintainer-mode=false _build_static - name: Compile static run: ninja -C _build_static From bc072b68b49775af37daab1ced64e40dbef157fc Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Fri, 5 Jul 2024 13:14:33 +0200 Subject: [PATCH 11/28] Parser: Ignore deprecation of xmlParserCtxt members * parsers/parser.cc: Direct access to xmlParserCtxt::options, linenumbers and lastError is deprecated since libxml2 2.14.0. Ignore deprecations. Use xmlCtxtGetLastError(). --- libxml++/parsers/parser.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/libxml++/parsers/parser.cc b/libxml++/parsers/parser.cc index 6d6c3f6a..398fc091 100644 --- a/libxml++/parsers/parser.cc +++ b/libxml++/parsers/parser.cc @@ -4,6 +4,12 @@ * included with libxml++ as the file COPYING. */ +// Direct access to xmlParserCtxt::options and xmlParserCtxt::linenumbers +// is deprecated since libxml2 2.14.0. +// xmlCtxtGetOptions() is new in libxml2 2.14.0. +// Ignore deprecations here. +#define XML_DEPRECATED_MEMBER + #include "libxml++/exceptions/wrapped_exception.h" #include "libxml++/parsers/parser.h" @@ -361,7 +367,7 @@ void Parser::callback_error_or_warning(bool is_parser, bool is_error, void* ctx, auto parser = static_cast(context->_private); if(parser) { - auto ubuff = format_xml_error(&context->lastError); + auto ubuff = format_xml_error(xmlCtxtGetLastError(context)); if (ubuff.empty()) { // Usually the result of formatting var_args with the format string msg From d4389e1e012af7ab51113243b1d2dde11e4dac3b Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Mon, 15 Jul 2024 13:37:49 +0200 Subject: [PATCH 12/28] Meson build: Use Meson's pkgconfig module instead of using the libxml++.pc.in template. Require meson >= 0.62. Remove the can_add_dist_script variable. It's unnecessary when the meson version >= 0.58. --- docs/manual/meson.build | 20 +++++------ docs/reference/meson.build | 22 ++++++------ libxml++/meson.build | 32 ++++++++++++++++- meson.build | 72 ++++++++++++-------------------------- 4 files changed, 73 insertions(+), 73 deletions(-) diff --git a/docs/manual/meson.build b/docs/manual/meson.build index 6c7bd67e..940ecdeb 100644 --- a/docs/manual/meson.build +++ b/docs/manual/meson.build @@ -1,7 +1,7 @@ # docs/manual # input: install_datadir, xmlxx_pcname, tutorial_custom_cmd_py, python3, -# build_documentation, book_name, can_add_dist_script, xsltproc +# build_documentation, book_name, xsltproc # output: can_parse_and_validate, build_pdf_by_default, can_build_pdf, # install_tutorialdir, build_manual_opt, build_manual @@ -106,13 +106,11 @@ if can_build_pdf ) endif -if can_add_dist_script - # Distribute built files. - meson.add_dist_script( - python3, tutorial_custom_cmd_py, 'dist_doc', - doc_dist_dir, - meson.current_build_dir(), - meson.current_build_dir() / 'libxml++.xml', - meson.current_build_dir() / 'libxml++.pdf', - ) -endif +# Distribute built files. +meson.add_dist_script( + python3, tutorial_custom_cmd_py, 'dist_doc', + doc_dist_dir, + meson.current_build_dir(), + meson.current_build_dir() / 'libxml++.xml', + meson.current_build_dir() / 'libxml++.pdf', +) diff --git a/docs/reference/meson.build b/docs/reference/meson.build index bf42bc91..19302569 100644 --- a/docs/reference/meson.build +++ b/docs/reference/meson.build @@ -2,7 +2,7 @@ # Input: project_build_root, project_source_root, xmlxx_pcname, # xmlxx_api_version, build_documentation, source_h_files, -# install_datadir, python3, doc_reference_py, can_add_dist_script, dot +# install_datadir, python3, doc_reference_py, dot # Output: install_docdir, install_devhelpdir, book_name, # if build_documentation: tag_file @@ -128,14 +128,12 @@ meson.add_install_script( docinstall_flags ) -if can_add_dist_script - # Distribute built files and files copied by mm-common-get. - meson.add_dist_script( - python3, doc_reference_py, 'dist_doc', - doctool_dir, - doctool_dist_dir, - meson.current_build_dir(), - tag_file.full_path(), - devhelp_file.full_path(), - ) -endif +# Distribute built files and files copied by mm-common-get. +meson.add_dist_script( + python3, doc_reference_py, 'dist_doc', + doctool_dir, + doctool_dist_dir, + meson.current_build_dir(), + tag_file.full_path(), + devhelp_file.full_path(), +) diff --git a/libxml++/meson.build b/libxml++/meson.build index 34233f9a..eddb58e7 100644 --- a/libxml++/meson.build +++ b/libxml++/meson.build @@ -1,7 +1,8 @@ # libxml++ # Input: xmlxx_build_dep, xmlxx_pcname, xmlxx_libversion, xmlxx_api_version, -# install_includedir, xmlxx_rc, xmlxx_libname, macos_darwin_versions +# install_includedir, xmlxx_rc, xmlxx_libname, macos_darwin_versions, +# xmlxx_pc_requires, libxml2_lib_pkgconfig # Output: source_h_files, xmlxx_own_dep # There are no built source files in libxml++-5.0. @@ -116,6 +117,35 @@ xmlxx_library = library(xmlxx_libname, install: true, ) +# Generate .pc files, used by pkg-config. +pkg_config = import('pkgconfig') +pc_common_variables = [ + 'doxytagfile=${docdir}/reference/' + xmlxx_pcname + '.tag', + 'htmlrefdir=${docdir}/reference/html', + 'htmlrefpub=https://libxmlplusplus.github.io/libxmlplusplus/reference/html', +] +pc_variables = [ + 'exec_prefix=${prefix}', + 'datarootdir=${datadir}', + 'docdir=${datadir}/doc/' + xmlxx_pcname, +] + pc_common_variables +pc_uninstalled_variables = [ + 'docdir=${prefix}/docs', +] + pc_common_variables + +pkg_config.generate(xmlxx_library, + filebase: xmlxx_pcname, + variables: pc_variables, + uninstalled_variables: pc_uninstalled_variables, + name: meson.project_name(), + description: 'C++ wrapper for libxml2', + url: 'https://libxmlplusplus.github.io/libxmlplusplus/', + requires: xmlxx_pc_requires, + libraries: libxml2_lib_pkgconfig, + subdirs: [xmlxx_pcname], + extra_cflags: ['-I${libdir}/' + xmlxx_pcname + '/include'], +) + # This is used when building example programs and test programs. # It's also a part of xmlxx_dep, when libxml++ is a subproject. xmlxx_own_dep = declare_dependency( diff --git a/meson.build b/meson.build index 8d5ecf7b..9104b05b 100644 --- a/meson.build +++ b/meson.build @@ -7,7 +7,7 @@ project('libxml++', 'cpp', 'warning_level=1', 'cpp_std=c++17', ], - meson_version: '>= 0.60.0', # required for dependency('iconv') + meson_version: '>= 0.62.0', # required for variables in pkgconfig.generate() ) xmlxx_api_version = '5.0' @@ -113,22 +113,20 @@ xml2_dep = dependency( fallback: ['libxml2'] ) -xmlxx_requires = [] -libxml2_lib_pkgconfig = '' +xmlxx_pc_requires = [] +libxml2_lib_pkgconfig = [] # Put libxml-2.0 in the 'Requires:' section in the generated pkg-config file if # we found it by pkg-config if xml2_dep.type_name() == 'pkgconfig' or xml2_dep.type_name() == 'internal' - xmlxx_requires += ['libxml-2.0', xml2_req] + xmlxx_pc_requires += ['libxml-2.0' + xml2_req] else - libxml2_lib_pkgconfig = xml2_dep.get_variable( + libxml2_lib_pkgconfig += [xml2_dep.get_variable( cmake: 'LIBXML2_LIBRARIES', default_value: 'LibXml2.lib', - ) + )] endif -xmlxx_requires = ' '.join(xmlxx_requires) - # Make sure we link to libxml-2.0 xmlxx_build_dep = [xml2_dep] @@ -270,20 +268,8 @@ endif # Configure files pkg_conf_data = configuration_data() -pkg_conf_data.set('prefix', install_prefix) -pkg_conf_data.set('exec_prefix', '${prefix}') -pkg_conf_data.set('libdir', '${exec_prefix}' / install_libdir) -pkg_conf_data.set('datarootdir', '${prefix}' / install_datadir) -pkg_conf_data.set('datadir', '${datarootdir}') -pkg_conf_data.set('includedir', '${prefix}' / install_includedir) pkg_conf_data.set('PACKAGE_NAME', meson.project_name()) # MSVC_NMake/libxml++/libxml++.rc -pkg_conf_data.set('PACKAGE_TARNAME', meson.project_name()) pkg_conf_data.set('PACKAGE_VERSION', meson.project_version()) -pkg_conf_data.set('LIBXMLXX_MODULE_NAME', xmlxx_pcname) -pkg_conf_data.set('LIBXMLXX_API_VERSION', xmlxx_api_version) -pkg_conf_data.set('LIBXMLXX_MODULES', xmlxx_requires) -pkg_conf_data.set('LIBXML2_LIB_NO_PKGCONFIG', libxml2_lib_pkgconfig) -pkg_conf_data.set('MSVC_TOOLSET_VER', msvc14x_toolset_ver) if not build_deprecated_api pkg_conf_data.set('LIBXMLXX_DISABLE_DEPRECATED', 1) @@ -308,13 +294,6 @@ if cpp_compiler.get_argument_syntax() == 'msvc' endif endif -configure_file( - input: 'libxml++.pc.in', - output: xmlxx_pcname + '.pc', - configuration: pkg_conf_data, - install_dir: install_pkgconfigdir, -) - xmlxxconfig_h_meson = files('libxml++config.h.meson') install_includeconfigdir = install_libdir / xmlxx_pcname / 'include' configure_file( @@ -324,9 +303,6 @@ configure_file( install_dir: install_includeconfigdir, ) -# add_dist_script() is not allowed in a subproject if meson.version() < 0.58.0. -can_add_dist_script = not meson.is_subproject() or meson.version().version_compare('>= 0.58.0') - subdir('MSVC_NMake/libxml++') subdir('libxml++') subdir('examples') @@ -334,26 +310,24 @@ subdir('tests') subdir('docs/reference') subdir('docs/manual') -if can_add_dist_script - # Add a ChangeLog file to the distribution directory. - meson.add_dist_script( - python3, dist_changelog_py, - project_source_root, - ) +# Add a ChangeLog file to the distribution directory. +meson.add_dist_script( + python3, dist_changelog_py, + project_source_root, +) - # Don't distribute these files and directories. - dont_distribute = [ - '.github', - ] - # Add build scripts to the distribution directory, and delete .gitignore - # files and an empty $MESON_PROJECT_DIST_ROOT/build/ directory. - meson.add_dist_script( - python3, dist_build_scripts_py, - project_source_root, - 'untracked' / 'build_scripts', - dont_distribute, - ) -endif +# Don't distribute these files and directories. +dont_distribute = [ + '.github', +] +# Add build scripts to the distribution directory, and delete .gitignore +# files and an empty $MESON_PROJECT_DIST_ROOT/build/ directory. +meson.add_dist_script( + python3, dist_build_scripts_py, + project_source_root, + 'untracked' / 'build_scripts', + dont_distribute, +) if meson.is_subproject() pkgconfig_vars = { From 20ecb77bd12cfe45a046ffbdfc9a786175271a3c Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Mon, 15 Jul 2024 13:38:13 +0200 Subject: [PATCH 13/28] CI: Install meson >= 0.62 * .github/workflows/meson-clang.yml: * .github/workflows/meson-gcc.yml: * .github/workflows/publish-docs.yml: Install meson with pip instead of apt. --- .github/workflows/meson-clang.yml | 7 ++++++- .github/workflows/meson-gcc.yml | 7 ++++++- .github/workflows/publish-docs.yml | 8 ++++++-- 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/.github/workflows/meson-clang.yml b/.github/workflows/meson-clang.yml index d2a3a272..dd8d4a11 100644 --- a/.github/workflows/meson-clang.yml +++ b/.github/workflows/meson-clang.yml @@ -1,3 +1,5 @@ +# 2024-07-15: ubuntu-latest = ubuntu-22.04 +# See https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners/about-github-hosted-runners#standard-github-hosted-runners-for-public-repositories name: "Meson: clang" on: [push] @@ -14,7 +16,10 @@ jobs: # Prevent blocking apt install on a question during configuring of tzdata. export DEBIAN_FRONTEND=noninteractive sudo apt update - sudo apt install libxml2-dev libxml2-utils docbook5-xml docbook-xsl mm-common clang meson ninja-build python3-setuptools --yes + sudo apt install libxml2-dev libxml2-utils docbook5-xml docbook-xsl mm-common clang ninja-build python3-setuptools python3-pip --yes + # Ubuntu 22.04 contains meson 0.61.2, but libxml++ requires meson >= 0.62.0. + # Install it with pip instead of apt. + sudo pip install "meson>=0.62.0" export CC=clang export CXX=clang++ meson setup -Dwarnings=fatal -Dwarning_level=3 -Dwerror=true _build diff --git a/.github/workflows/meson-gcc.yml b/.github/workflows/meson-gcc.yml index 625b700d..aaa1eff6 100644 --- a/.github/workflows/meson-gcc.yml +++ b/.github/workflows/meson-gcc.yml @@ -1,3 +1,5 @@ +# 2024-07-15: ubuntu-latest = ubuntu-22.04 +# See https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners/about-github-hosted-runners#standard-github-hosted-runners-for-public-repositories name: "Meson: gcc" on: [push] @@ -14,7 +16,10 @@ jobs: # Prevent blocking apt install on a question during configuring of tzdata. export DEBIAN_FRONTEND=noninteractive sudo apt update - sudo apt install libxml2-dev libxml2-utils docbook5-xml docbook-xsl mm-common g++ meson ninja-build python3-setuptools --yes + sudo apt install libxml2-dev libxml2-utils docbook5-xml docbook-xsl mm-common g++ ninja-build python3-setuptools python3-pip --yes + # Ubuntu 22.04 contains meson 0.61.2, but libxml++ requires meson >= 0.62.0. + # Install it with pip instead of apt. + sudo pip install "meson>=0.62.0" export CC=gcc export CXX=g++ meson setup -Dwarnings=fatal -Dwarning_level=3 -Dwerror=true _build diff --git a/.github/workflows/publish-docs.yml b/.github/workflows/publish-docs.yml index fbbe7826..eb4009f1 100644 --- a/.github/workflows/publish-docs.yml +++ b/.github/workflows/publish-docs.yml @@ -5,7 +5,8 @@ name: Publish docs -# 2023-07-28: ubuntu-latest = ubuntu-22.04 +# 2024-07-15: ubuntu-latest = ubuntu-22.04 +# See https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners/about-github-hosted-runners#standard-github-hosted-runners-for-public-repositories on: # Runs on pushes targeting the default branch push: @@ -37,7 +38,10 @@ jobs: # Prevent blocking apt install on a question during configuring of tzdata. export DEBIAN_FRONTEND=noninteractive sudo apt update - sudo apt install libxml2-dev libxml2-utils docbook5-xml docbook-xsl mm-common g++ meson ninja-build python3-setuptools python3-pip --yes + sudo apt install libxml2-dev libxml2-utils docbook5-xml docbook-xsl mm-common g++ ninja-build python3-setuptools python3-pip --yes + # Ubuntu 22.04 contains meson 0.61.2, but libxml++ requires meson >= 0.62.0. + # Install it with pip instead of apt. + sudo pip install "meson>=0.62.0" meson setup -Dbuild-documentation=true -Dbuild-examples=false -Dbuild-tests=false _build meson compile -C _build - name: Collect Documentation From e37dd04ced67c409188001cf3bdf6fcde861c77a Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Tue, 13 Aug 2024 16:23:04 +0200 Subject: [PATCH 14/28] 5.4.0 --- NEWS | 26 ++++++++++++++++++++++++++ configure.ac | 2 +- meson.build | 2 +- 3 files changed, 28 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index ca80f85c..aae1fdff 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,29 @@ +5.4.0 (stable): + +* Node: Add eval_xpath(). + (Kjell Ahlstedt) Issue #66 (Marie Preusse) + +Meson build: +* Require meson >= 0.62. +* Use Meson's pkgconfig module instead of the libxml++.pc.in template. + (Kjell Ahlstedt) + + +5.2.1 (stable): + +* Parser: Ignore deprecation of xmlParserCtxt members. + (Kjell Ahlstedt) + +Documentation: +* Don't link to removed developer-old.gnome.org. + (Kjell Ahlstedt) + +Meson build: +* Use libxml2 meson build when libxml2 is built as a subproject. + (Andrew Potter) Issue #67, Pull request #68 +* Require python3 >= 3.7. That's what Meson requires. + (Kjell Ahlstedt) + 5.2.0 (stable): * Use callback functions with C linkage diff --git a/configure.ac b/configure.ac index 240b43cd..1677fe1b 100644 --- a/configure.ac +++ b/configure.ac @@ -1,6 +1,6 @@ ## This file is part of libxml++. -AC_INIT([libxml++], [5.2.0], +AC_INIT([libxml++], [5.4.0], [https://github.com/libxmlplusplus/libxmlplusplus/issues], [libxml++], [https://libxmlplusplus.github.io/libxmlplusplus/]) AC_PREREQ([2.59]) diff --git a/meson.build b/meson.build index 9104b05b..b599220d 100644 --- a/meson.build +++ b/meson.build @@ -1,7 +1,7 @@ # This file is part of libxml++. project('libxml++', 'cpp', - version: '5.2.0', + version: '5.4.0', license: 'LGPLv2.1+', default_options: [ 'warning_level=1', From fd1d79fa23b7fa7789acd2e12512c8dd4e7a01dc Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Tue, 5 Nov 2024 09:22:28 +0100 Subject: [PATCH 15/28] docs/reference/Doxyfile.in: Remove unsupported entries --- docs/reference/Doxyfile.in | 2 -- 1 file changed, 2 deletions(-) diff --git a/docs/reference/Doxyfile.in b/docs/reference/Doxyfile.in index 2f38f50d..e6ac8265 100644 --- a/docs/reference/Doxyfile.in +++ b/docs/reference/Doxyfile.in @@ -142,8 +142,6 @@ REFERENCES_LINK_SOURCE = YES SOURCE_TOOLTIPS = YES USE_HTAGS = NO VERBATIM_HEADERS = NO -CLANG_ASSISTED_PARSING = NO -CLANG_OPTIONS = #--------------------------------------------------------------------------- # Configuration options related to the alphabetical class index #--------------------------------------------------------------------------- From 1e521236bb634c5b6446d16bc0f3edffd5577da9 Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Tue, 5 Nov 2024 13:01:06 +0100 Subject: [PATCH 16/28] TextReader::get_xml_lang(): Fix memory leak --- libxml++/parsers/textreader.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libxml++/parsers/textreader.cc b/libxml++/parsers/textreader.cc index 88f7ecd9..7ba56a39 100644 --- a/libxml++/parsers/textreader.cc +++ b/libxml++/parsers/textreader.cc @@ -186,7 +186,7 @@ ustring TextReader::get_value() const ustring TextReader::get_xml_lang() const { return propertyreader->String( - xmlTextReaderXmlLang(impl_)); + xmlTextReaderXmlLang(impl_), true); } TextReader::ReadState TextReader::get_read_state() const @@ -221,7 +221,8 @@ ustring TextReader::get_attribute( const ustring& namespaceURI) const { return propertyreader->String( - xmlTextReaderGetAttributeNs(impl_, (const xmlChar *)localName.c_str(), (const xmlChar *)namespaceURI.c_str()), true); + xmlTextReaderGetAttributeNs(impl_, (const xmlChar *)localName.c_str(), + (const xmlChar *)namespaceURI.c_str()), true); } ustring TextReader::lookup_namespace( From a4b335e680bf83cf0fc196da2fd92f1673714ce2 Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Thu, 7 Nov 2024 12:44:51 +0100 Subject: [PATCH 17/28] TextReader: Use xmlTextReaderSetStructuredErrorHandler() instead of xmlTextReaderSetErrorHandler(). Use callback function with C linkage. The callback in textreader.cc was overlooked in commit a8d810fdbc2bf4c524a22e528cf168e7711d363d. --- libxml++/parsers/textreader.cc | 53 +++++++++++++++++++++++++++------- libxml++/parsers/textreader.h | 2 ++ 2 files changed, 45 insertions(+), 10 deletions(-) diff --git a/libxml++/parsers/textreader.cc b/libxml++/parsers/textreader.cc index 7ba56a39..346dc128 100644 --- a/libxml++/parsers/textreader.cc +++ b/libxml++/parsers/textreader.cc @@ -6,6 +6,43 @@ #include +namespace +{ +//TODO: When we can break ABI, change on_libxml_error(), and change ErrorFuncType to +// using ErrorFuncType = void (*)(void* userData, const xmlError* error); +// C++ linkage +using ErrorFuncType = void (*)(void* arg, const char* msg, int severity, void* locator); +ErrorFuncType p_callback_error; + +extern "C" +{ +static void c_callback_error(void* userData, const xmlError* error) +{ + const xmlpp::ustring msg = xmlpp::format_xml_error(error); + + // Compute severity as in libxml2's xmlreader.c file, + // static (i.e. private) function xmlTextReaderStructuredRelay(). + xmlParserSeverities severity{}; + switch (error->domain) + { + case XML_FROM_VALID: + case XML_FROM_DTD: + severity = (error->level == XML_ERR_WARNING) ? + XML_PARSER_SEVERITY_VALIDITY_WARNING : + XML_PARSER_SEVERITY_VALIDITY_ERROR; + break; + default: + severity = (error->level == XML_ERR_WARNING) ? + XML_PARSER_SEVERITY_WARNING : + XML_PARSER_SEVERITY_ERROR; + break; + } + p_callback_error(userData, msg.c_str(), severity, nullptr); +} + +} // extern "C" +} // anonymous namespace + namespace xmlpp { @@ -347,20 +384,16 @@ bool TextReader::is_valid() const void TextReader::setup_exceptions() { - xmlTextReaderErrorFunc func = nullptr; - void* arg = nullptr; - - // We respect any other error handlers already setup: - xmlTextReaderGetErrorHandler(impl_, &func, &arg); - if(!func) - { - func = (xmlTextReaderErrorFunc)&TextReader::on_libxml_error; - xmlTextReaderSetErrorHandler(impl_, func, this); - } + p_callback_error = &on_libxml_error; + xmlTextReaderSetStructuredErrorHandler(impl_, &c_callback_error, this); } void TextReader::on_libxml_error(void* arg, const char* msg, int severity, void* /* locator */) { + //TODO: Change this function when we can break ABI. + // It was created when setup_exceptions() called xmlTextReaderSetErrorHandler() + // instead of xmlTextReaderSetStructuredErrorHandler(). + auto ths = static_cast(arg); ths->severity_ = severity; ths->error_ = msg ? msg : "unknown parse error"; diff --git a/libxml++/parsers/textreader.h b/libxml++/parsers/textreader.h index dbc22ed8..8aea92a2 100644 --- a/libxml++/parsers/textreader.h +++ b/libxml++/parsers/textreader.h @@ -296,6 +296,8 @@ class TextReader: public NonCopyable LIBXMLPP_API void setup_exceptions(); + //TODO: When we can break ABI, change on_libxml_error() to + // static void on_libxml_error(void* userData, const xmlError* error); LIBXMLPP_API static void on_libxml_error(void * arg, const char *msg, int severity, void * locator); From e53842bb17638e0ab9a639bb034e591b6a79bf6d Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Thu, 7 Nov 2024 14:58:27 +0100 Subject: [PATCH 18/28] TextReader: xmlStructuredErrorFunc() changed in libxml2 2.12.0 Before 2.12.0: typedef void (*xmlStructuredErrorFunc) (void *userData, xmlError *error); Since 2.12.0: typedef void (*xmlStructuredErrorFunc) (void *userData, const xmlError *error); * libxml++/parsers/textreader.cc: The declaration of c_callback_error() must fit the libxml2 version being compiled with. As it's a function with C linkage, its name is not mangled. It's not an ABI break. --- libxml++/parsers/textreader.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libxml++/parsers/textreader.cc b/libxml++/parsers/textreader.cc index 346dc128..5c779313 100644 --- a/libxml++/parsers/textreader.cc +++ b/libxml++/parsers/textreader.cc @@ -5,6 +5,7 @@ #include #include +#include namespace { @@ -16,7 +17,11 @@ ErrorFuncType p_callback_error; extern "C" { +#if LIBXML_VERSION >= 21200 static void c_callback_error(void* userData, const xmlError* error) +#else +static void c_callback_error(void* userData, xmlError* error) +#endif { const xmlpp::ustring msg = xmlpp::format_xml_error(error); From 6cdfd912e8e3fe683f2c17f124a846c0f79d8dee Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Mon, 25 Nov 2024 10:24:20 +0100 Subject: [PATCH 19/28] TextReader: Add methods that return std::optional Add read_inner_xml2(), read_outer_xml2(), read_string2(), get_base_uri2(), get_local_name2(), get_name2(), get_namespace_uri2(), get_prefix2(), get_value2(), get_xml_lang2(), get_attribute2() (3 overloaded ones), lookup_namespace2(). An empty string is not necessarily the same as no string. Deprecate the corresponding functions that return xmlpp::ustring. Fixes #71 --- examples/textreader/main.cc | 26 ++--- libxml++/parsers/textreader.cc | 101 ++++++++++++++++ libxml++/parsers/textreader.h | 207 ++++++++++++++++++++++++++++++++- 3 files changed, 318 insertions(+), 16 deletions(-) diff --git a/examples/textreader/main.cc b/examples/textreader/main.cc index 87129f69..16d72187 100644 --- a/examples/textreader/main.cc +++ b/examples/textreader/main.cc @@ -1,5 +1,3 @@ -// -*- C++ -*- - /* main.cc * * Copyright (C) 2002 The libxml++ development team @@ -19,13 +17,7 @@ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#ifdef HAVE_CONFIG_H -#include -#endif - #include -#include - #include #include @@ -43,6 +35,12 @@ std::ostream & operator<<(std::ostream & o, indent const & in) return o; } +std::ostream& operator<<(std::ostream& o, const std::optional& s) +{ + o << s.value_or("{[(no value)]}"); + return o; +} + int main(int /* argc */, char** /* argv */) { try @@ -53,16 +51,18 @@ int main(int /* argc */, char** /* argv */) { int depth = reader.get_depth(); std::cout << indent(depth) << "--- node ---" << std::endl; - std::cout << indent(depth) << "name: " << reader.get_name() << std::endl; + std::cout << indent(depth) << "name: " << reader.get_name2() << std::endl; std::cout << indent(depth) << "depth: " << reader.get_depth() << std::endl; if(reader.has_attributes()) { std::cout << indent(depth) << "attributes: " << std::endl; + std::cout << indent(depth) << "attribute 0: " << reader.get_attribute2(0) << std::endl; + std::cout << indent(depth) << "attribute 9: " << reader.get_attribute2(9) << std::endl; reader.move_to_first_attribute(); do { - std::cout << indent(depth) << " " << reader.get_name() << ": " << reader.get_value() << std::endl; + std::cout << indent(depth) << " " << reader.get_name2() << ": " << reader.get_value2() << std::endl; } while(reader.move_to_next_attribute()); reader.move_to_element(); } @@ -71,11 +71,7 @@ int main(int /* argc */, char** /* argv */) std::cout << indent(depth) << "no attributes" << std::endl; } - if(reader.has_value()) - std::cout << indent(depth) << "value: '" << reader.get_value() << "'" << std::endl; - else - std::cout << indent(depth) << "novalue" << std::endl; - + std::cout << indent(depth) << "value: '" << reader.get_value2() << "'" << std::endl; } } catch(const std::exception& e) diff --git a/libxml++/parsers/textreader.cc b/libxml++/parsers/textreader.cc index 5c779313..58c4863f 100644 --- a/libxml++/parsers/textreader.cc +++ b/libxml++/parsers/textreader.cc @@ -63,6 +63,7 @@ class TextReader::PropertyReader char Char(int value); ustring String(xmlChar* value, bool free = false); ustring String(xmlChar const* value); + std::optional OptString(xmlChar* value); TextReader & owner_; }; @@ -115,6 +116,7 @@ bool TextReader::read() xmlTextReaderRead(impl_)); } +#ifndef LIBXMLXX_DISABLE_DEPRECATED ustring TextReader::read_inner_xml() { return propertyreader->String( @@ -132,6 +134,22 @@ ustring TextReader::read_string() return propertyreader->String( xmlTextReaderReadString(impl_), true); } +#endif // LIBXMLXX_DISABLE_DEPRECATED + +std::optional TextReader::read_inner_xml2() +{ + return propertyreader->OptString(xmlTextReaderReadInnerXml(impl_)); +} + +std::optional TextReader::read_outer_xml2() +{ + return propertyreader->OptString(xmlTextReaderReadOuterXml(impl_)); +} + +std::optional TextReader::read_string2() +{ + return propertyreader->OptString(xmlTextReaderReadString(impl_)); +} bool TextReader::read_attribute_value() { @@ -145,11 +163,18 @@ int TextReader::get_attribute_count() const xmlTextReaderAttributeCount(impl_)); } +#ifndef LIBXMLXX_DISABLE_DEPRECATED ustring TextReader::get_base_uri() const { return propertyreader->String( xmlTextReaderBaseUri(impl_), true); } +#endif // LIBXMLXX_DISABLE_DEPRECATED + +std::optional TextReader::get_base_uri2() const +{ + return propertyreader->OptString(xmlTextReaderBaseUri(impl_)); +} int TextReader::get_depth() const { @@ -181,6 +206,7 @@ bool TextReader::is_empty_element() const xmlTextReaderIsEmptyElement(impl_)); } +#ifndef LIBXMLXX_DISABLE_DEPRECATED ustring TextReader::get_local_name() const { return propertyreader->String( @@ -198,6 +224,22 @@ ustring TextReader::get_namespace_uri() const return propertyreader->String( xmlTextReaderNamespaceUri(impl_), true); } +#endif // LIBXMLXX_DISABLE_DEPRECATED + +std::optional TextReader::get_local_name2() const +{ + return propertyreader->OptString(xmlTextReaderLocalName(impl_)); +} + +std::optional TextReader::get_name2() const +{ + return propertyreader->OptString(xmlTextReaderName(impl_)); +} + +std::optional TextReader::get_namespace_uri2() const +{ + return propertyreader->OptString(xmlTextReaderNamespaceUri(impl_)); +} TextReader::NodeType TextReader::get_node_type() const { @@ -207,11 +249,18 @@ TextReader::NodeType TextReader::get_node_type() const return static_cast(result); } +#ifndef LIBXMLXX_DISABLE_DEPRECATED ustring TextReader::get_prefix() const { return propertyreader->String( xmlTextReaderPrefix(impl_), true); } +#endif // LIBXMLXX_DISABLE_DEPRECATED + +std::optional TextReader::get_prefix2() const +{ + return propertyreader->OptString(xmlTextReaderPrefix(impl_)); +} char TextReader::get_quote_char() const { @@ -219,6 +268,7 @@ char TextReader::get_quote_char() const xmlTextReaderQuoteChar(impl_)); } +#ifndef LIBXMLXX_DISABLE_DEPRECATED ustring TextReader::get_value() const { return propertyreader->String( @@ -230,6 +280,17 @@ ustring TextReader::get_xml_lang() const return propertyreader->String( xmlTextReaderXmlLang(impl_), true); } +#endif // LIBXMLXX_DISABLE_DEPRECATED + +std::optional TextReader::get_value2() const +{ + return propertyreader->OptString(xmlTextReaderValue(impl_)); +} + +std::optional TextReader::get_xml_lang2() const +{ + return propertyreader->OptString(xmlTextReaderXmlLang(impl_)); +} TextReader::ReadState TextReader::get_read_state() const { @@ -245,6 +306,7 @@ void TextReader::close() check_for_exceptions(); } +#ifndef LIBXMLXX_DISABLE_DEPRECATED ustring TextReader::get_attribute(int number) const { return propertyreader->String( @@ -273,6 +335,33 @@ ustring TextReader::lookup_namespace( return propertyreader->String( xmlTextReaderLookupNamespace(impl_, (const xmlChar *)prefix.c_str()), true); } +#endif // LIBXMLXX_DISABLE_DEPRECATED + +std::optional TextReader::get_attribute2(int number) const +{ + return propertyreader->OptString(xmlTextReaderGetAttributeNo(impl_, number)); +} + +std::optional TextReader::get_attribute2(const ustring& name) const +{ + return propertyreader->OptString( + xmlTextReaderGetAttribute(impl_, (const xmlChar*)name.c_str())); +} + +std::optional TextReader::get_attribute2( + const ustring& localName, + const ustring& namespaceURI) const +{ + return propertyreader->OptString( + xmlTextReaderGetAttributeNs(impl_, (const xmlChar*)localName.c_str(), + (const xmlChar *)namespaceURI.c_str())); +} + +std::optional TextReader::lookup_namespace2(const ustring& prefix) const +{ + return propertyreader->OptString(xmlTextReaderLookupNamespace( + impl_, prefix.empty() ? nullptr : (const xmlChar*)prefix.c_str())); +} bool TextReader::move_to_attribute(int number) { @@ -467,4 +556,16 @@ ustring TextReader::PropertyReader::String(xmlChar const* value) return (const char*)value; } +std::optional TextReader::PropertyReader::OptString(xmlChar* value) +{ + owner_.check_for_exceptions(); + + if (!value) + return {}; + + std::optional result = (char*)value; + xmlFree(value); + return result; +} + } // namespace xmlpp diff --git a/libxml++/parsers/textreader.h b/libxml++/parsers/textreader.h index 8aea92a2..caa3da64 100644 --- a/libxml++/parsers/textreader.h +++ b/libxml++/parsers/textreader.h @@ -13,12 +13,15 @@ #include "libxml++/ustring.h" #include +#include extern "C" { struct _xmlTextReader; } +//TODO: When we can break ABI/API, remove deprecated methods +// and rename all xyz2() to xyz(). namespace xmlpp { @@ -115,10 +118,12 @@ class TextReader: public NonCopyable */ LIBXMLPP_API bool read(); +#ifndef LIBXMLXX_DISABLE_DEPRECATED /** Reads the contents of the current node, including child nodes and markup. * @return A ustring containing the XML content, or an empty ustring if the current node is neither an element nor attribute, or has no child nodes. * @throws xmlpp::parse_error * @throws xmlpp::validity_error + * @deprecated 5.6: Use read_inner_xml2() instead. */ LIBXMLPP_API ustring read_inner_xml(); @@ -126,6 +131,7 @@ class TextReader: public NonCopyable * @return A ustring containing the XML content, or an empty ustring if the current node is neither an element nor attribute. * @throws xmlpp::parse_error * @throws xmlpp::validity_error + * @deprecated 5.6: Use read_outer_xml2() instead. */ LIBXMLPP_API ustring read_outer_xml(); @@ -133,8 +139,37 @@ class TextReader: public NonCopyable * @return A ustring containing the contents of the Element or Text node, or an empty ustring if the reader is positioned on any other type of node. * @throws xmlpp::parse_error * @throws xmlpp::validity_error + * @deprecated 5.6: Use read_string2() instead. */ LIBXMLPP_API ustring read_string(); +#endif // LIBXMLXX_DISABLE_DEPRECATED + + /** Reads the contents of the current node, including child nodes and markup. + * @return A std::optional containing the XML content, or no value if + * the current node is neither an element nor attribute, or has no child nodes. + * @throws xmlpp::parse_error + * @throws xmlpp::validity_error + * @newin{5,6} + */ + LIBXMLPP_API std::optional read_inner_xml2(); + + /** Reads the current node and its contents, including child nodes and markup. + * @return A std::optional containing the XML content, or no value if + * the current node is neither an element nor attribute. + * @throws xmlpp::parse_error + * @throws xmlpp::validity_error + * @newin{5,6} + */ + LIBXMLPP_API std::optional read_outer_xml2(); + + /** Reads the contents of an element or a text node as a string. + * @return A std::optional containing the contents of the Element or Text node, + * or no value if the reader is positioned on any other type of node. + * @throws xmlpp::parse_error + * @throws xmlpp::validity_error + * @newin{5,6} + */ + LIBXMLPP_API std::optional read_string2(); /** Parses an attribute value into one or more Text and EntityReference nodes. * @return A bool where true indicates the attribute value was parsed, and false indicates the reader was not positioned on an attribute node or all the attribute values have been read. @@ -153,10 +188,23 @@ class TextReader: public NonCopyable LIBXMLPP_API int get_attribute_count() const; +#ifndef LIBXMLXX_DISABLE_DEPRECATED /** Gets the base Uniform Resource Identifier (URI) of the current node. * @return The base URI of the current node or an empty ustring if not available. + * @throws xmlpp::parse_error + * @throws xmlpp::validity_error + * @deprecated 5.6: Use get_base_uri2() instead. */ LIBXMLPP_API ustring get_base_uri() const; +#endif // LIBXMLXX_DISABLE_DEPRECATED + + /** Gets the base Uniform Resource Identifier (URI) of the current node. + * @return The base URI of the current node, or no value if not available. + * @throws xmlpp::parse_error + * @throws xmlpp::validity_error + * @newin{5,6} + */ + LIBXMLPP_API std::optional get_base_uri2() const; /** Gets the depth of the current node in the XML document. * @return The depth of the current node in the XML document, or -1 in case of error. @@ -188,9 +236,51 @@ class TextReader: public NonCopyable LIBXMLPP_API bool is_empty_element() const; +#ifndef LIBXMLXX_DISABLE_DEPRECATED + /** Gets the local name of the node. + * @return The local name of the node, or an empty ustring if not available. + * @throws xmlpp::parse_error + * @throws xmlpp::validity_error + * @deprecated 5.6: Use get_local_name2() instead. + */ LIBXMLPP_API ustring get_local_name() const; + + /** Gets the qualified name of the node, equal to Prefix:LocalName. + * @return The qualified name of the node, or an empty ustring if not available. + * @throws xmlpp::parse_error + * @throws xmlpp::validity_error + * @deprecated 5.6: Use get_name2() instead. + */ LIBXMLPP_API ustring get_name() const; + + /** Gets the URI defining the namespace associated with the node. + * @return The namespace URI, or an empty ustring if not available. + * @deprecated 5.6: Use get_namespace_uri2() instead. + */ LIBXMLPP_API ustring get_namespace_uri() const; +#endif // LIBXMLXX_DISABLE_DEPRECATED + + /** Gets the local name of the node. + * @return The local name of the node, or no value if not available. + * @throws xmlpp::parse_error + * @throws xmlpp::validity_error + * @newin{5,6} + */ + LIBXMLPP_API std::optional get_local_name2() const; + + /** Gets the qualified name of the node, equal to Prefix:LocalName. + * @return The qualified name of the node, or no value if not available. + * @throws xmlpp::parse_error + * @throws xmlpp::validity_error + * @newin{5,6} + */ + LIBXMLPP_API std::optional get_name2() const; + + /** Gets the URI defining the namespace associated with the node. + * @return The namespace URI, or no value if not available. + * @newin{5,6} + */ + LIBXMLPP_API std::optional get_namespace_uri2() const; /** Get the node type of the current node. * @returns The xmlpp::TextReader::NodeType of the current node. @@ -202,10 +292,19 @@ class TextReader: public NonCopyable LIBXMLPP_API NodeType get_node_type() const; +#ifndef LIBXMLXX_DISABLE_DEPRECATED /** Get the namespace prefix associated with the current node. * @returns The namespace prefix, or an empty string if not available. + * @deprecated 5.6: Use get_prefix2() instead. */ LIBXMLPP_API ustring get_prefix() const; +#endif // LIBXMLXX_DISABLE_DEPRECATED + + /** Get the namespace prefix associated with the current node. + * @returns The namespace prefix, or no value if not available. + * @newin{5,6} + */ + LIBXMLPP_API std::optional get_prefix2() const; /** Get the quotation mark character used to enclose the value of an attribute. * @returns Returns " or ' and -1 in case of error. @@ -213,25 +312,131 @@ class TextReader: public NonCopyable LIBXMLPP_API char get_quote_char() const; +#ifndef LIBXMLXX_DISABLE_DEPRECATED + /** Gets the text value of the node. + * @return The text value, or an empty ustring if not available. + * @throws xmlpp::parse_error + * @throws xmlpp::validity_error + * @deprecated 5.6: Use get_value2() instead. + */ LIBXMLPP_API ustring get_value() const; + + /** Gets the xml:lang scope within which the node resides. + * @return The xml:lang value, or an empty ustring if not available. + * @deprecated 5.6: Use get_xml_lang2() instead. + */ LIBXMLPP_API ustring get_xml_lang() const; +#endif // LIBXMLXX_DISABLE_DEPRECATED + + /** Gets the text value of the node. + * @return The text value, or no value if not available. + * @throws xmlpp::parse_error + * @throws xmlpp::validity_error + * @newin{5,6} + */ + LIBXMLPP_API std::optional get_value2() const; + + /** Gets the xml:lang scope within which the node resides. + * @return The xml:lang value, or no value if not available. + * @newin{5,6} + */ + LIBXMLPP_API std::optional get_xml_lang2() const; + /** Gets the read state of the reader. + * @return The state value, or xmlpp::TextReader::ReadState::InternalError in case of error. + */ LIBXMLPP_API ReadState get_read_state() const; LIBXMLPP_API void close(); +#ifndef LIBXMLXX_DISABLE_DEPRECATED + /** Gets the value of the attribute with the specified index relative to the containing element. + * @param number The zero-based index of the attribute relative to the containing element. + * @return The value of the specified attribute, or an empty ustring in case of error. + * @throws xmlpp::parse_error + * @throws xmlpp::validity_error + * @deprecated 5.6: Use get_attribute2(int) const instead. + */ LIBXMLPP_API ustring get_attribute(int number) const; + + /** Gets the value of the attribute with the specified qualified name. + * @param name The qualified name of the attribute. + * @return The value of the specified attribute, or an empty ustring in case of error. + * @throws xmlpp::parse_error + * @throws xmlpp::validity_error + * @deprecated 5.6: Use get_attribute2(const ustring&) const instead. + */ LIBXMLPP_API ustring get_attribute(const ustring& name) const; + + /** Gets the value of the specified attribute. + * @param local_name The local name of the attribute. + * @param ns_uri The namespace URI of the attribute. + * @return The value of the specified attribute, or an empty ustring in case of error. + * @throws xmlpp::parse_error + * @throws xmlpp::validity_error + * @deprecated 5.6: Use get_attribute2(const ustring&, const ustring&) const instead. + */ LIBXMLPP_API ustring get_attribute(const ustring& local_name, const ustring& ns_uri) const; + /** Resolves a namespace prefix in the scope of the current element. + * @param prefix The prefix whose namespace URI is to be resolved. + * To return the default namespace, specify an empty string. + * @return The the namespace URI to which the prefix maps, or an empty ustring in case of error. + * @throws xmlpp::parse_error + * @throws xmlpp::validity_error + * @deprecated 5.6: Use lookup_namespace2() instead. + */ + LIBXMLPP_API + ustring lookup_namespace(const ustring& prefix) const; +#endif // LIBXMLXX_DISABLE_DEPRECATED + + /** Gets the value of the attribute with the specified index relative to the containing element. + * @param number The zero-based index of the attribute relative to the containing element. + * @return The value of the specified attribute, or no value in case of error. + * @throws xmlpp::parse_error + * @throws xmlpp::validity_error + * @newin{5,6} + */ + LIBXMLPP_API + std::optional get_attribute2(int number) const; + + /** Gets the value of the attribute with the specified qualified name. + * @param name The qualified name of the attribute. + * @return The value of the specified attribute, or no value in case of error. + * @throws xmlpp::parse_error + * @throws xmlpp::validity_error + * @newin{5,6} + */ + LIBXMLPP_API + std::optional get_attribute2(const ustring& name) const; + + /** Gets the value of the specified attribute. + * @param local_name The local name of the attribute. + * @param ns_uri The namespace URI of the attribute. + * @return The value of the specified attribute, or no value in case of error. + * @throws xmlpp::parse_error + * @throws xmlpp::validity_error + * @newin{5,6} + */ + LIBXMLPP_API + std::optional get_attribute2(const ustring& local_name, const ustring& ns_uri) const; + // TODO InputBuffer GetRemainder; + /** Resolves a namespace prefix in the scope of the current element. + * @param prefix The prefix whose namespace URI is to be resolved. + * To return the default namespace, specify an empty string. + * @return The the namespace URI to which the prefix maps, or no value in case of error. + * @throws xmlpp::parse_error + * @throws xmlpp::validity_error + * @newin{5,6} + */ LIBXMLPP_API - ustring lookup_namespace(const ustring& prefix) const; + std::optional lookup_namespace2(const ustring& prefix) const; LIBXMLPP_API bool move_to_attribute(int number); From ade9636a402f9de3c8edfa4024b1e6ff8b7d628c Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Sun, 8 Dec 2024 10:28:58 +0100 Subject: [PATCH 20/28] Add more methods that return std::optional * libxml++/attribute.[cc|h]: * libxml++/attributedeclaration.[cc|h]: * libxml++/attributenode.[cc|h]: Add get_value2(). * libxml++/document.[cc|h]: Add get_encoding2() * libxml++/dtd.[cc|h]: Add get_external_id2(), get_name2(), get_system_id2(). * libxml++/nodes/contentnode.[cc|h]: Add get_content2(). * libxml++/nodes/element.[cc|h]: Add get_attribute_value2(). * libxml++/nodes/entitydeclaration.[cc|h]: * libxml++/nodes/entityreference.[cc|h]: Add get_original_text2(), get_resolved_text2(). * libxml++/nodes/node.[cc|h]: Add get_name2(), get_namespace_prefix2(), get_namespace_uri2(), get_path2(). Deprecate the corresponding methods that return xmlpp::ustring. See #71 * examples/dom_build/main.cc: * examples/dom_parse_entities/main.cc: * examples/dom_parser/main.cc: * examples/dom_parser_raw/main.cc: * examples/dom_xinclude/main.cc: * examples/dom_xpath/main.cc: * examples/sax_parser_build_dom/main.cc: * tests/istream_ioparser/main.cc: Use the new methods instead of the deprecated ones. --- examples/dom_build/main.cc | 7 +-- examples/dom_parse_entities/main.cc | 18 ++++--- examples/dom_parser/main.cc | 34 +++++++------ examples/dom_parser_raw/main.cc | 2 +- examples/dom_xinclude/main.cc | 32 ++++++------ examples/dom_xpath/main.cc | 18 ++++--- examples/sax_parser_build_dom/main.cc | 6 +-- libxml++/attribute.cc | 13 +++++ libxml++/attribute.h | 13 ++++- libxml++/attributedeclaration.cc | 7 +++ libxml++/attributedeclaration.h | 8 +++ libxml++/attributenode.cc | 16 ++++++ libxml++/attributenode.h | 7 +++ libxml++/document.cc | 9 ++++ libxml++/document.h | 15 +++++- libxml++/dtd.cc | 23 +++++++++ libxml++/dtd.h | 35 +++++++++++++ libxml++/nodes/contentnode.cc | 13 +++++ libxml++/nodes/contentnode.h | 11 +++++ libxml++/nodes/element.cc | 11 +++++ libxml++/nodes/element.h | 15 +++++- libxml++/nodes/entitydeclaration.cc | 16 ++++++ libxml++/nodes/entitydeclaration.h | 19 +++++++ libxml++/nodes/entityreference.cc | 26 +++++++++- libxml++/nodes/entityreference.h | 18 +++++++ libxml++/nodes/node.cc | 71 ++++++++++++++++++++------- libxml++/nodes/node.h | 36 +++++++++++++- tests/istream_ioparser/main.cc | 4 +- 28 files changed, 416 insertions(+), 87 deletions(-) diff --git a/examples/dom_build/main.cc b/examples/dom_build/main.cc index eadc98d0..fcaef275 100644 --- a/examples/dom_build/main.cc +++ b/examples/dom_build/main.cc @@ -17,10 +17,6 @@ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#ifdef HAVE_CONFIG_H -#include -#endif - #include #include #include @@ -28,7 +24,6 @@ int main(int /* argc */, char** /* argv */) { - try { xmlpp::Document document; @@ -64,7 +59,7 @@ main(int /* argc */, char** /* argv */) auto whole = document.write_to_string(); std::cout << "XML built at runtime: " << std::endl << whole << std::endl; - std::cout << "namespace of root node: " << nodeRoot->get_namespace_uri() << std::endl; + std::cout << "namespace of root node: " << nodeRoot->get_namespace_uri2().value_or("{[(no URI)]}") << std::endl; } catch(const std::exception& ex) { diff --git a/examples/dom_parse_entities/main.cc b/examples/dom_parse_entities/main.cc index 621fac74..f3e7c552 100644 --- a/examples/dom_parse_entities/main.cc +++ b/examples/dom_parse_entities/main.cc @@ -17,15 +17,17 @@ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#ifdef HAVE_CONFIG_H -#include -#endif - #include #include #include #include +std::ostream& operator<<(std::ostream& o, const std::optional& s) +{ + o << s.value_or("{[(no value)]}"); + return o; +} + void print_node(const xmlpp::Node* node, bool substitute_entities, unsigned int indentation = 0) { const std::string indent(indentation, ' '); @@ -37,7 +39,7 @@ void print_node(const xmlpp::Node* node, bool substitute_entities, unsigned int const auto nodeText = dynamic_cast(node); if (nodeText && !nodeText->is_white_space()) { - std::cout << indent << "text = " << nodeText->get_content() << std::endl; + std::cout << indent << "text = " << nodeText->get_content2() << std::endl; } } else @@ -46,9 +48,9 @@ void print_node(const xmlpp::Node* node, bool substitute_entities, unsigned int const auto nodeEntityReference = dynamic_cast(node); if (nodeEntityReference) { - std::cout << indent << "entity reference name = " << nodeEntityReference->get_name() << std::endl; - std::cout << indent << " resolved text = " << nodeEntityReference->get_resolved_text() << std::endl; - std::cout << indent << " original text = " << nodeEntityReference->get_original_text() << std::endl; + std::cout << indent << "entity reference name = " << nodeEntityReference->get_name2() << std::endl; + std::cout << indent << " resolved text = " << nodeEntityReference->get_resolved_text2() << std::endl; + std::cout << indent << " original text = " << nodeEntityReference->get_original_text2() << std::endl; } } // end if (substitute_entities) diff --git a/examples/dom_parser/main.cc b/examples/dom_parser/main.cc index ae78b733..e9264a4f 100644 --- a/examples/dom_parser/main.cc +++ b/examples/dom_parser/main.cc @@ -17,14 +17,16 @@ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#ifdef HAVE_CONFIG_H -#include -#endif - #include #include #include +std::ostream& operator<<(std::ostream& o, const std::optional& s) +{ + o << s.value_or("{[(no value)]}"); + return o; +} + void print_node(const xmlpp::Node* node, unsigned int indentation = 0) { const std::string indent(indentation, ' '); @@ -37,14 +39,14 @@ void print_node(const xmlpp::Node* node, unsigned int indentation = 0) if(nodeText && nodeText->is_white_space()) //Let's ignore the indenting - you don't always want to do this. return; - const auto nodename = node->get_name(); + const auto nodename = node->get_name2(); - if(!nodeText && !nodeComment && !nodename.empty()) //Let's not say "name: text". + if(!nodeText && !nodeComment && nodename) //Let's not say "name: text". { - const auto namespace_prefix = node->get_namespace_prefix(); + const auto namespace_prefix = node->get_namespace_prefix2(); std::cout << indent << "Node name = "; - if(!namespace_prefix.empty()) + if(namespace_prefix) std::cout << namespace_prefix << ":"; std::cout << nodename << std::endl; } @@ -56,15 +58,15 @@ void print_node(const xmlpp::Node* node, unsigned int indentation = 0) //Treat the various node types differently: if(nodeText) { - std::cout << indent << "text = \"" << nodeText->get_content() << "\"" << std::endl; + std::cout << indent << "text = \"" << nodeText->get_content2() << "\"" << std::endl; } else if(nodeComment) { - std::cout << indent << "comment = " << nodeComment->get_content() << std::endl; + std::cout << indent << "comment = " << nodeComment->get_content2() << std::endl; } else if(nodeContent) { - std::cout << indent << "content = " << nodeContent->get_content() << std::endl; + std::cout << indent << "content = " << nodeContent->get_content2() << std::endl; } else if(auto nodeElement = dynamic_cast(node)) { @@ -76,13 +78,13 @@ void print_node(const xmlpp::Node* node, unsigned int indentation = 0) //Print attributes: for (const auto& attribute : nodeElement->get_attributes()) { - const auto namespace_prefix = attribute->get_namespace_prefix(); + const auto namespace_prefix = attribute->get_namespace_prefix2(); std::cout << indent << " Attribute "; - if(!namespace_prefix.empty()) + if(namespace_prefix) std::cout << namespace_prefix << ":"; - std::cout << attribute->get_name() << " = " - << attribute->get_value() << std::endl; + std::cout << attribute->get_name2() << " = " + << attribute->get_value2() << std::endl; } const auto attribute = nodeElement->get_attribute("title"); @@ -93,7 +95,7 @@ void print_node(const xmlpp::Node* node, unsigned int indentation = 0) std::cout << "AttributeNode "; else if (dynamic_cast(attribute)) std::cout << "AttributeDeclaration "; - std::cout << "title = " << attribute->get_value() << std::endl; + std::cout << "title = " << attribute->get_value2() << std::endl; } } diff --git a/examples/dom_parser_raw/main.cc b/examples/dom_parser_raw/main.cc index 653128ca..3ab9bf85 100644 --- a/examples/dom_parser_raw/main.cc +++ b/examples/dom_parser_raw/main.cc @@ -27,7 +27,7 @@ void print_node(const xmlpp::Node* node, unsigned int indentation = 0) { std::cout << std::endl; //Separate nodes by an empty line. - std::cout << "Node name = " << node->get_name() << std::endl; + std::cout << "Node name = " << node->get_name2().value_or("{[(no name)]}") << std::endl; //Recurse through child nodes: for(const auto& child : node->get_children()) diff --git a/examples/dom_xinclude/main.cc b/examples/dom_xinclude/main.cc index 8017e0b6..f42fc7a4 100644 --- a/examples/dom_xinclude/main.cc +++ b/examples/dom_xinclude/main.cc @@ -16,14 +16,16 @@ * License along with this library. If not, see . */ -#ifdef HAVE_CONFIG_H -#include -#endif - #include #include #include +std::ostream& operator<<(std::ostream& o, const std::optional& s) +{ + o << s.value_or("{[(no value)]}"); + return o; +} + void print_node(const xmlpp::Node* node, unsigned int indentation = 0) { const std::string indent(indentation, ' '); @@ -36,14 +38,14 @@ void print_node(const xmlpp::Node* node, unsigned int indentation = 0) if (nodeText && nodeText->is_white_space()) return; - const auto nodename = node->get_name(); + const auto nodename = node->get_name2(); - if (!nodeText && !nodeComment && !nodename.empty()) //Let's not say "name: text". + if (!nodeText && !nodeComment && nodename) //Let's not say "name: text". { - const auto namespace_prefix = node->get_namespace_prefix(); + const auto namespace_prefix = node->get_namespace_prefix2(); std::cout << indent << "Node name = "; - if (!namespace_prefix.empty()) + if (namespace_prefix) std::cout << namespace_prefix << ":"; std::cout << nodename << std::endl; } @@ -55,15 +57,15 @@ void print_node(const xmlpp::Node* node, unsigned int indentation = 0) //Treat the various node types differently: if (nodeText) { - std::cout << indent << "text = \"" << nodeText->get_content() << "\"" << std::endl; + std::cout << indent << "text = \"" << nodeText->get_content2() << "\"" << std::endl; } else if (nodeComment) { - std::cout << indent << "comment = " << nodeComment->get_content() << std::endl; + std::cout << indent << "comment = " << nodeComment->get_content2() << std::endl; } else if (nodeContent) { - std::cout << indent << "content = " << nodeContent->get_content() << std::endl; + std::cout << indent << "content = " << nodeContent->get_content2() << std::endl; } else if (auto nodeElement = dynamic_cast(node)) { @@ -73,18 +75,18 @@ void print_node(const xmlpp::Node* node, unsigned int indentation = 0) //Print attributes: for (const auto& attribute : nodeElement->get_attributes()) { - const auto namespace_prefix = attribute->get_namespace_prefix(); + const auto namespace_prefix = attribute->get_namespace_prefix2(); std::cout << indent << " Attribute "; - if (!namespace_prefix.empty()) + if (namespace_prefix) std::cout << namespace_prefix << ":"; - std::cout << attribute->get_name() << " = " << attribute->get_value() << std::endl; + std::cout << attribute->get_name2() << " = " << attribute->get_value2() << std::endl; } const auto attribute = nodeElement->get_attribute("title"); if (attribute) { - std::cout << indent << "title = " << attribute->get_value() << std::endl; + std::cout << indent << "title = " << attribute->get_value2() << std::endl; } } else if (dynamic_cast(node)) diff --git a/examples/dom_xpath/main.cc b/examples/dom_xpath/main.cc index aaa20345..f9b7b180 100644 --- a/examples/dom_xpath/main.cc +++ b/examples/dom_xpath/main.cc @@ -17,14 +17,16 @@ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#ifdef HAVE_CONFIG_H -#include -#endif - #include #include #include +std::ostream& operator<<(std::ostream& o, const std::optional& s) +{ + o << s.value_or("{[(no value)]}"); + return o; +} + std::string result_type_to_ustring(xmlpp::XPathResultType result_type) { switch (result_type) @@ -45,7 +47,7 @@ void print_nodeset(const xmlpp::Node::const_NodeSet& set) // Print the structural paths and the values: for(const auto& child : set) { - std::cout << " " << child->get_path(); + std::cout << " " << child->get_path2(); auto attribute = dynamic_cast(child); if (attribute) @@ -53,18 +55,18 @@ void print_nodeset(const xmlpp::Node::const_NodeSet& set) auto content_node = dynamic_cast(child); if (content_node) - std::cout << ", content=\"" << content_node->get_content() << "\""; + std::cout << ", content=\"" << content_node->get_content2() << "\""; auto entity_reference = dynamic_cast(child); if (entity_reference) - std::cout << ", text=\"" << entity_reference->get_original_text() << "\""; + std::cout << ", text=\"" << entity_reference->get_original_text2() << "\""; auto element = dynamic_cast(child); if (element) { auto text_node = element->get_first_child_text(); if (text_node) - std::cout << ", first_child_text=\"" << text_node->get_content() << "\""; + std::cout << ", first_child_text=\"" << text_node->get_content2() << "\""; } std::cout << std::endl; } diff --git a/examples/sax_parser_build_dom/main.cc b/examples/sax_parser_build_dom/main.cc index 2bf67596..21927b65 100644 --- a/examples/sax_parser_build_dom/main.cc +++ b/examples/sax_parser_build_dom/main.cc @@ -19,10 +19,6 @@ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#ifdef HAVE_CONFIG_H -#include -#endif - #include #include #include @@ -55,7 +51,7 @@ main(int argc, char* argv[]) // Use the custom DOM auto element = doc.get_root(); - std::cout << "root's name is \"" << element->get_name() << "\"" << std::endl; + std::cout << "root's name is \"" << element->get_name2().value_or("{[(no name)]}") << "\"" << std::endl; auto nl = element->find("//path[@style != '']"); if(!nl.empty()) { diff --git a/libxml++/attribute.cc b/libxml++/attribute.cc index 18b1f44b..e10d1a50 100644 --- a/libxml++/attribute.cc +++ b/libxml++/attribute.cc @@ -5,6 +5,8 @@ */ #include "libxml++/attribute.h" +#include "libxml++/attributedeclaration.h" +#include "libxml++/attributenode.h" #include @@ -20,4 +22,15 @@ Attribute::~Attribute() { } +std::optional Attribute::get_value2() const +{ + auto attr_decl = dynamic_cast(this); + if (attr_decl) + return attr_decl->get_value2(); + auto attr_node = dynamic_cast(this); + if (attr_node) + return attr_node->get_value2(); + return {}; +} + } //namespace xmlpp diff --git a/libxml++/attribute.h b/libxml++/attribute.h index b450ce3e..9e902713 100644 --- a/libxml++/attribute.h +++ b/libxml++/attribute.h @@ -7,11 +7,13 @@ #ifndef __LIBXMLPP_ATTRIBUTE_H #define __LIBXMLPP_ATTRIBUTE_H - #include "libxml++/ustring.h" - #include +#include +//TODO: When we can break API/ABI, remove get_value(), rename get_value2() +// to get_value(), make it virtual. Do the same in AttributeDeclaration and +// AttributeNmode. namespace xmlpp { @@ -26,8 +28,15 @@ class LIBXMLPP_API Attribute : public Node /** Get the value of this attribute. * @returns The attribute's value. + * @deprecated 5.6: Use get_value2() instead. */ virtual ustring get_value() const = 0; + + /** Get the value of this attribute. + * @returns The attribute's value, or no value if the attribute has no value. + * @newin{5,6} + */ + std::optional get_value2() const; }; } // namespace xmlpp diff --git a/libxml++/attributedeclaration.cc b/libxml++/attributedeclaration.cc index bd30b097..f15ce60b 100644 --- a/libxml++/attributedeclaration.cc +++ b/libxml++/attributedeclaration.cc @@ -22,6 +22,13 @@ AttributeDeclaration::~AttributeDeclaration() ustring AttributeDeclaration::get_value() const { + return cobj()->defaultValue ? (const char*)cobj()->defaultValue : ""; +} + +std::optional AttributeDeclaration::get_value2() const +{ + if (!cobj()->defaultValue) + return {}; return (const char*)cobj()->defaultValue; } diff --git a/libxml++/attributedeclaration.h b/libxml++/attributedeclaration.h index 0072da77..c14f765a 100644 --- a/libxml++/attributedeclaration.h +++ b/libxml++/attributedeclaration.h @@ -33,9 +33,17 @@ class LIBXMLPP_API AttributeDeclaration : public Attribute /** Get the default value of this attribute. * @returns The attribute's default value. + * @deprecated 5.6: Use get_value2() instead. */ ustring get_value() const override; + /** Get the default value of this attribute. + * @returns The attribute's default value, or not value if the attribute + * has no default value. + * @newin{5,6} + */ + std::optional get_value2() const; + ///Access the underlying libxml implementation. _xmlAttribute* cobj() noexcept; diff --git a/libxml++/attributenode.cc b/libxml++/attributenode.cc index cd48554c..44d2f4ac 100644 --- a/libxml++/attributenode.cc +++ b/libxml++/attributenode.cc @@ -34,6 +34,22 @@ ustring AttributeNode::get_value() const return retn; } +std::optional AttributeNode::get_value2() const +{ + xmlChar* value = nullptr; + if (cobj()->ns && cobj()->ns->href) + value = xmlGetNsProp(cobj()->parent, cobj()->name, cobj()->ns->href); + else + value = xmlGetNoNsProp(cobj()->parent, cobj()->name); + + if (!value) + return {}; + + std::optional result = (const char*)value; + xmlFree(value); + return result; +} + void AttributeNode::set_value(const ustring& value) { if (cobj()->ns) diff --git a/libxml++/attributenode.h b/libxml++/attributenode.h index 77dcfd92..a72250c5 100644 --- a/libxml++/attributenode.h +++ b/libxml++/attributenode.h @@ -34,9 +34,16 @@ class LIBXMLPP_API AttributeNode : public Attribute /** Get the value of this attribute. * @returns The attribute's value. + * @deprecated 5.6: Use get_value2() instead. */ ustring get_value() const override; + /** Get the value of this attribute. + * @returns The attribute's value, or no value if the attribute has no value. + * @newin{5,6} + */ + std::optional get_value2() const; + /** Set the value of this attribute. * * @newin{3,0} Replaces Attribute::set_value() diff --git a/libxml++/document.cc b/libxml++/document.cc index 85ca59f6..3cd72aab 100644 --- a/libxml++/document.cc +++ b/libxml++/document.cc @@ -194,6 +194,7 @@ Document::~Document() xmlFreeDoc(impl_); } +#ifndef LIBXMLXX_DISABLE_DEPRECATED ustring Document::get_encoding() const { ustring encoding; @@ -202,6 +203,14 @@ ustring Document::get_encoding() const return encoding; } +#endif // LIBXMLXX_DISABLE_DEPRECATED + +std::optional Document::get_encoding2() const +{ + if (!impl_->encoding) + return {}; + return (const char*)impl_->encoding; +} Dtd* Document::get_internal_subset() const { diff --git a/libxml++/document.h b/libxml++/document.h index bf204a5b..9ae580fa 100644 --- a/libxml++/document.h +++ b/libxml++/document.h @@ -17,6 +17,7 @@ #include #include +#include #include /* std::string or ustring in function prototypes in libxml++? @@ -92,10 +93,22 @@ class Document : public NonCopyable LIBXMLPP_API ~Document() override; - /** @return The encoding used in the source from which the document has been loaded. +#ifndef LIBXMLXX_DISABLE_DEPRECATED + /** Get the encoding used in the source from which the document has been loaded. + * @return The encoding used in the source from which the document has been loaded. + * @deprecated 5.6: Use get_encoding2() instead. */ LIBXMLPP_API ustring get_encoding() const; +#endif // LIBXMLXX_DISABLE_DEPRECATED + + /** Get the encoding used in the source from which the document has been loaded. + * @return The encoding used in the source from which the document has been loaded, + * if any, else no value. + * @newin{5,6} + */ + LIBXMLPP_API + std::optional get_encoding2() const; /** Get the internal subset of this document. * @returns A pointer to the DTD, or nullptr if not found. diff --git a/libxml++/dtd.cc b/libxml++/dtd.cc index 8014c071..dda2a41c 100644 --- a/libxml++/dtd.cc +++ b/libxml++/dtd.cc @@ -107,6 +107,7 @@ void Dtd::parse_stream(std::istream& in) pimpl_->is_dtd_owner = true; } +#ifndef LIBXMLXX_DISABLE_DEPRECATED ustring Dtd::get_name() const { return (pimpl_->dtd && pimpl_->dtd->name) ? (const char*)pimpl_->dtd->name : ""; @@ -121,6 +122,28 @@ ustring Dtd::get_system_id() const { return (pimpl_->dtd && pimpl_->dtd->SystemID) ? (const char*)pimpl_->dtd->SystemID : ""; } +#endif // LIBXMLXX_DISABLE_DEPRECATED + +std::optional Dtd::get_name2() const +{ + if (!(pimpl_->dtd && pimpl_->dtd->name)) + return {}; + return (const char*)pimpl_->dtd->name; +} + +std::optional Dtd::get_external_id2() const +{ + if (!(pimpl_->dtd && pimpl_->dtd->ExternalID)) + return {}; + return (const char*)pimpl_->dtd->ExternalID; +} + +std::optional Dtd::get_system_id2() const +{ + if (!(pimpl_->dtd && pimpl_->dtd->SystemID)) + return {}; + return (const char*)pimpl_->dtd->SystemID; +} _xmlDtd* Dtd::cobj() noexcept { diff --git a/libxml++/dtd.h b/libxml++/dtd.h index cd9b51a2..258c7c3f 100644 --- a/libxml++/dtd.h +++ b/libxml++/dtd.h @@ -9,6 +9,7 @@ #include #include "libxml++/ustring.h" +#include #include #include // std::unique_ptr @@ -117,9 +118,43 @@ class Dtd : public NonCopyable */ LIBXMLPP_API void parse_stream(std::istream& in); +#ifndef LIBXMLXX_DISABLE_DEPRECATED + /** Get the name of the DTD. + * @return The name of the DTD. + * @deprecated 5.6: Use get_name2() instead. + */ LIBXMLPP_API ustring get_name() const; + + /** Get the external identifier for PUBLIC DTD. + * @return The external identifier for PUBLIC DTD. + * @deprecated 5.6: Use get_external_id2() instead. + */ LIBXMLPP_API ustring get_external_id() const; + + /** Get the URI for a SYSTEM or PUBLIC DTD. + * @return The URI for a SYSTEM or PUBLIC DTD. + * @deprecated 5.6: Use get_system_id2() instead. + */ LIBXMLPP_API ustring get_system_id() const; +#endif // LIBXMLXX_DISABLE_DEPRECATED + + /** Get the name of the DTD. + * @return The name of the DTD, if any, else no value. + * @newin{5,6} + */ + LIBXMLPP_API std::optional get_name2() const; + + /** Get the external identifier for PUBLIC DTD. + * @return The external identifier for PUBLIC DTD, if any, else no value. + * @newin{5,6} + */ + LIBXMLPP_API std::optional get_external_id2() const; + + /** Get the URI for a SYSTEM or PUBLIC DTD. + * @return The URI for a SYSTEM or PUBLIC DTD, if any, else no value. + * @newin{5,6} + */ + LIBXMLPP_API std::optional get_system_id2() const; /** Access the underlying libxml implementation. */ diff --git a/libxml++/nodes/contentnode.cc b/libxml++/nodes/contentnode.cc index 2347f479..a7a42535 100644 --- a/libxml++/nodes/contentnode.cc +++ b/libxml++/nodes/contentnode.cc @@ -19,6 +19,7 @@ ContentNode::ContentNode(xmlNode* node) ContentNode::~ContentNode() {} +#ifndef LIBXMLXX_DISABLE_DEPRECATED ustring ContentNode::get_content() const { if(cobj()->type == XML_ELEMENT_NODE) @@ -28,6 +29,18 @@ ustring ContentNode::get_content() const return cobj()->content ? (char*)cobj()->content : ""; } +#endif // LIBXMLXX_DISABLE_DEPRECATED + +std::optional ContentNode::get_content2() const +{ + if (cobj()->type == XML_ELEMENT_NODE) + throw internal_error("this node type doesn't have content"); + + if (!cobj()->content) + return {}; + + return (char*)cobj()->content; +} void ContentNode::set_content(const ustring& content) { diff --git a/libxml++/nodes/contentnode.h b/libxml++/nodes/contentnode.h index b14485db..b074ac8d 100644 --- a/libxml++/nodes/contentnode.h +++ b/libxml++/nodes/contentnode.h @@ -20,11 +20,22 @@ class LIBXMLPP_API ContentNode : public Node explicit ContentNode(_xmlNode* node); ~ContentNode() override; +#ifndef LIBXMLXX_DISABLE_DEPRECATED /** Get the text of this content node. * @returns The text. Note that the 5 predefined entities (&, ", <, >, ') * are always resolved, so this content will show their human-readable equivalents. + * @deprecated 5.6: Use get_content2() instead. */ ustring get_content() const; +#endif // LIBXMLXX_DISABLE_DEPRECATED + + /** Get the text of this content node. + * @returns The text, or no value if this node has no text. Note that the 5 + * predefined entities (&, ", <, >, ') are always resolved, + * so this content will show their human-readable equivalents. + * @newin{5,6} + */ + std::optional get_content2() const; /** Set the text of this content node * @param content The text. This must be unescaped, meaning that the predefined entities will be created for you where necessary. diff --git a/libxml++/nodes/element.cc b/libxml++/nodes/element.cc index ef1b6b03..64abd3f2 100644 --- a/libxml++/nodes/element.cc +++ b/libxml++/nodes/element.cc @@ -92,11 +92,22 @@ const Attribute* Element::get_attribute(const ustring& name, return const_cast(this)->get_attribute(name, ns_prefix); } +#ifndef LIBXMLXX_DISABLE_DEPRECATED ustring Element::get_attribute_value(const ustring& name, const ustring& ns_prefix) const { const auto attr = get_attribute(name, ns_prefix); return attr ? attr->get_value() : ustring(); } +#endif // LIBXMLXX_DISABLE_DEPRECATED + +std::optional Element::get_attribute_value2( + const ustring& name, const ustring& ns_prefix) const +{ + const auto attr = get_attribute(name, ns_prefix); + if (!attr) + return {}; + return attr->get_value2(); +} Attribute* Element::set_attribute(const ustring& name, const ustring& value, const ustring& ns_prefix) diff --git a/libxml++/nodes/element.h b/libxml++/nodes/element.h index 922a26c9..8252ab31 100644 --- a/libxml++/nodes/element.h +++ b/libxml++/nodes/element.h @@ -79,16 +79,27 @@ class LIBXMLPP_API Element : public Node const Attribute* get_attribute(const ustring& name, const ustring& ns_prefix = ustring()) const; +#ifndef LIBXMLXX_DISABLE_DEPRECATED /** Get the value of the attribute with this name, and optionally with this namespace. * For finer control, you might use get_attribute() and use the methods of the Attribute class. * @param name The name of the attribute whose value will be retrieved. * @param ns_prefix Namespace prefix. * @return The text value of the attribute, or an empty string if no such attribute was found. - * - * @newin{2,20} + * @deprecated 5.6: Use get_attribute_value2() instead. */ ustring get_attribute_value(const ustring& name, const ustring& ns_prefix = ustring()) const; +#endif // LIBXMLXX_DISABLE_DEPRECATED + + /** Get the value of the attribute with this name, and optionally with this namespace. + * For finer control, you might use get_attribute() and use the methods of the Attribute class. + * @param name The name of the attribute whose value will be retrieved. + * @param ns_prefix Namespace prefix. + * @return The text value of the attribute, or no value if no such attribute was found. + * @newin{5,6} + */ + std::optional get_attribute_value2(const ustring& name, + const ustring& ns_prefix = {}) const; /** Set the value of the attribute with this name, and optionally with this namespace. * A matching attribute will be added if no matching attribute already exists. diff --git a/libxml++/nodes/entitydeclaration.cc b/libxml++/nodes/entitydeclaration.cc index d5bfa751..ba26f409 100644 --- a/libxml++/nodes/entitydeclaration.cc +++ b/libxml++/nodes/entitydeclaration.cc @@ -17,6 +17,7 @@ EntityDeclaration::EntityDeclaration(xmlNode* node) EntityDeclaration::~EntityDeclaration() {} +#ifndef LIBXMLXX_DISABLE_DEPRECATED ustring EntityDeclaration::get_resolved_text() const { return cobj()->content ? (const char*)cobj()->content : ""; @@ -26,6 +27,21 @@ ustring EntityDeclaration::get_original_text() const { return cobj()->orig ? (const char*)cobj()->orig : ""; } +#endif // LIBXMLXX_DISABLE_DEPRECATED + +std::optional EntityDeclaration::get_resolved_text2() const +{ + if (!cobj()->content) + return {}; + return (const char*)cobj()->content; +} + +std::optional EntityDeclaration::get_original_text2() const +{ + if (!cobj()->orig) + return {}; + return (const char*)cobj()->orig; +} xmlEntity* EntityDeclaration::cobj() noexcept { diff --git a/libxml++/nodes/entitydeclaration.h b/libxml++/nodes/entitydeclaration.h index 30d3df8d..a78f378a 100644 --- a/libxml++/nodes/entitydeclaration.h +++ b/libxml++/nodes/entitydeclaration.h @@ -29,18 +29,37 @@ class LIBXMLPP_API EntityDeclaration : public ContentNode explicit EntityDeclaration(_xmlNode* node); ~EntityDeclaration() override; +#ifndef LIBXMLXX_DISABLE_DEPRECATED /** Get the text with character references (like "ß") resolved. * If the entity declaration does not contain any reference to another entity, * this is the text that an entity reference would have resolved to, if the XML * document had been parsed with Parser::set_substitute_entities(true). * @returns The text with character references unescaped. + * @deprecated 5.6: Use get_resolved_text2() instead. */ ustring get_resolved_text() const; /** Get the text as read from the XML or DTD file. * @returns The escaped text. + * @deprecated 5.6: Use get_original_text2() instead. */ ustring get_original_text() const; +#endif // LIBXMLXX_DISABLE_DEPRECATED + + /** Get the text with character references (like "ß") resolved. + * If the entity declaration does not contain any reference to another entity, + * this is the text that an entity reference would have resolved to, if the XML + * document had been parsed with Parser::set_substitute_entities(true). + * @returns The text with character references unescaped, if any, else no value. + * @newin{5,6} + */ + std::optional get_resolved_text2() const; + + /** Get the text as read from the XML or DTD file. + * @returns The escaped text, if any, else no value. + * @newin{5,6} + */ + std::optional get_original_text2() const; ///Access the underlying libxml implementation. _xmlEntity* cobj() noexcept; diff --git a/libxml++/nodes/entityreference.cc b/libxml++/nodes/entityreference.cc index 278a1263..18e5ccf9 100644 --- a/libxml++/nodes/entityreference.cc +++ b/libxml++/nodes/entityreference.cc @@ -18,6 +18,7 @@ EntityReference::EntityReference(xmlNode* node) EntityReference::~EntityReference() {} +#ifndef LIBXMLXX_DISABLE_DEPRECATED ustring EntityReference::get_resolved_text() const { ustring result; @@ -48,10 +49,33 @@ ustring EntityReference::get_original_text() const if(pch) result = (const char*)pch; } - return result; } +#endif // LIBXMLXX_DISABLE_DEPRECATED + +std::optional EntityReference::get_resolved_text2() const +{ + // Get the child xmlEntity node (there should only be 1). + auto cChild = cobj()->children; + if (!(cChild && cChild->type == XML_ENTITY_DECL)) + return {}; + auto cEntity = (xmlEntity*)cChild; + if (!cEntity->content) + return {}; + return (const char*)cEntity->content; +} +std::optional EntityReference::get_original_text2() const +{ + // Get the child xmlEntity node (there should only be 1). + auto cChild = cobj()->children; + if (!(cChild && cChild->type == XML_ENTITY_DECL)) + return {}; + auto cEntity = (xmlEntity*)cChild; + if (!cEntity->orig) + return {}; + return (const char*)cEntity->orig; +} } //namespace xmlpp diff --git a/libxml++/nodes/entityreference.h b/libxml++/nodes/entityreference.h index 60a64fc7..768cb5d5 100644 --- a/libxml++/nodes/entityreference.h +++ b/libxml++/nodes/entityreference.h @@ -20,19 +20,37 @@ class LIBXMLPP_API EntityReference : public Node explicit EntityReference(_xmlNode* node); ~EntityReference() override; +#ifndef LIBXMLXX_DISABLE_DEPRECATED /** Get the text with character references (like "ß") resolved. * If the corresponding entity declaration does not contain any reference to * another entity, this is the text that the reference would have resolved to * if the XML document had been parsed with Parser::set_substitute_entities(true). * @returns The text with character references unescaped. + * @deprecated 5.6: Use get_resolved_text2() instead. */ ustring get_resolved_text() const; /** Get the text as read from the XML or DTD file. * @returns The escaped text. + * @deprecated 5.6: Use get_original_text2() instead. */ ustring get_original_text() const; +#endif // LIBXMLXX_DISABLE_DEPRECATED + /** Get the text with character references (like "ß") resolved. + * If the corresponding entity declaration does not contain any reference to + * another entity, this is the text that the reference would have resolved to + * if the XML document had been parsed with Parser::set_substitute_entities(true). + * @returns The text with character references unescaped, if any, else no value. + * @newin{5,6} + */ + std::optional get_resolved_text2() const; + + /** Get the text as read from the XML or DTD file. + * @returns The escaped text, if any, else no value. + * @newin{5,6} + */ + std::optional get_original_text2() const; }; } // namespace xmlpp diff --git a/libxml++/nodes/node.cc b/libxml++/nodes/node.cc index d3ead850..cdf03ee4 100644 --- a/libxml++/nodes/node.cc +++ b/libxml++/nodes/node.cc @@ -406,10 +406,19 @@ Node* Node::import_node(const Node* node, bool recursive) return static_cast(added_node->_private); } +#ifndef LIBXMLXX_DISABLE_DEPRECATED ustring Node::get_name() const { return impl_->name ? (const char*)impl_->name : ""; } +#endif // LIBXMLXX_DISABLE_DEPRECATED + +std::optional Node::get_name2() const +{ + if (!impl_->name) + return {}; + return (const char*)impl_->name; +} void Node::set_name(const ustring& name) { @@ -432,6 +441,7 @@ const xmlNode* Node::cobj() const noexcept return impl_; } +#ifndef LIBXMLXX_DISABLE_DEPRECATED ustring Node::get_path() const { xmlChar* path = xmlGetNodePath(impl_); @@ -439,6 +449,17 @@ ustring Node::get_path() const xmlFree(path); return retn; } +#endif // LIBXMLXX_DISABLE_DEPRECATED + +std::optional Node::get_path2() const +{ + xmlChar* path = xmlGetNodePath(impl_); + if (!path) + return {}; + std::optional result = (char*)path; + xmlFree(path); + return result; +} Node::NodeSet Node::find(const ustring& xpath) { @@ -505,11 +526,23 @@ ustring Node::eval_to_string(const ustring& xpath, const PrefixNsMap& namespaces return eval_common_to_string(xpath, &namespaces, result_type, impl_); } +#ifndef LIBXMLXX_DISABLE_DEPRECATED ustring Node::get_namespace_prefix() const { - if(impl_->type == XML_DOCUMENT_NODE || - impl_->type == XML_HTML_DOCUMENT_NODE || - impl_->type == XML_ENTITY_DECL) + return get_namespace_prefix2().value_or(""); +} + +ustring Node::get_namespace_uri() const +{ + return get_namespace_uri2().value_or(""); +} +#endif // LIBXMLXX_DISABLE_DEPRECATED + +std::optional Node::get_namespace_prefix2() const +{ + if (impl_->type == XML_DOCUMENT_NODE || + impl_->type == XML_HTML_DOCUMENT_NODE || + impl_->type == XML_ENTITY_DECL) { //impl_ is actually of type xmlDoc or xmlEntity, instead of just xmlNode. //libxml does not always use GObject-style inheritance, so xmlDoc and @@ -517,22 +550,24 @@ ustring Node::get_namespace_prefix() const //Therefore, a call to impl_->ns would be invalid. //This can be an issue when calling this method on a Node returned by Node::find(). //See the TODO comment on Document, suggesting that Document should derive from Node. - - return ustring(); + return {}; } - else if (impl_->type == XML_ATTRIBUTE_DECL) + + if (impl_->type == XML_ATTRIBUTE_DECL) { - //impl_ is actually of type xmlAttribute, instead of just xmlNode. + // impl_ is actually of type xmlAttribute, instead of just xmlNode. auto attr = reinterpret_cast(impl_); - return attr->prefix ? (const char*)attr->prefix : ""; + if (!attr->prefix) + return {}; + return (const char*)attr->prefix; } - else if(impl_->ns && impl_->ns->prefix) - return (char*)impl_->ns->prefix; - else - return ustring(); + + if (!(impl_->ns && impl_->ns->prefix)) + return {}; + return (const char*)impl_->ns->prefix; } -ustring Node::get_namespace_uri() const +std::optional Node::get_namespace_uri2() const { if(impl_->type == XML_DOCUMENT_NODE || impl_->type == XML_HTML_DOCUMENT_NODE || @@ -545,14 +580,12 @@ ustring Node::get_namespace_uri() const //Therefore, a call to impl_->ns would be invalid. //This can be an issue when calling this method on a Node returned by Node::find(). //See the TODO comment on Document, suggesting that Document should derived from Node. - - return ustring(); + return {}; } - if(impl_->ns && impl_->ns->href) - return (char*)impl_->ns->href; - else - return ustring(); + if (!(impl_->ns && impl_->ns->href)) + return {}; + return (const char*)impl_->ns->href; } void Node::set_namespace(const ustring& ns_prefix) diff --git a/libxml++/nodes/node.h b/libxml++/nodes/node.h index fa1182bc..c0693600 100644 --- a/libxml++/nodes/node.h +++ b/libxml++/nodes/node.h @@ -12,6 +12,7 @@ #include "libxml++/ustring.h" #include #include +#include #include #include @@ -68,10 +69,19 @@ class LIBXMLPP_API Node : public NonCopyable */ ~Node() override; +#ifndef LIBXMLXX_DISABLE_DEPRECATED /** Get the name of this node. * @returns The node's name. + * @deprecated 5.6: Use get_name2() instead. */ ustring get_name() const; +#endif // LIBXMLXX_DISABLE_DEPRECATED + + /** Get the name of this node. + * @returns The node's name, if any, else no value. + * @newin{5,6} + */ + std::optional get_name2() const; /** Set the name of this node. * @param name The new name for the node. @@ -85,15 +95,31 @@ class LIBXMLPP_API Node : public NonCopyable */ void set_namespace(const ustring& ns_prefix); +#ifndef LIBXMLXX_DISABLE_DEPRECATED /** Get the namespace prefix of this node. * @returns The node's namespace prefix. Can be an empty string. + * @deprecated 5.6: Use get_namespace_prefix2() instead. */ ustring get_namespace_prefix() const; /** Get the namespace URI of this node. * @returns The node's namespace URI. Can be an empty string. + * @deprecated 5.6: Use get_namespace_uri2() instead. */ ustring get_namespace_uri() const; +#endif // LIBXMLXX_DISABLE_DEPRECATED + + /** Get the namespace prefix of this node. + * @returns The node's namespace prefix, or no value if the node has no namespace prefix. + * @newin{5,6} + */ + std::optional get_namespace_prefix2() const; + + /** Get the namespace URI of this node. + * @returns The node's namespace URI, or no value if the node has no namespace URI. + * @newin{5,6} + */ + std::optional get_namespace_uri2() const; /** Discover at what line number this node occurs in the XML file. * @returns The line number. @@ -187,11 +213,19 @@ class LIBXMLPP_API Node : public NonCopyable */ Node* import_node(const Node* node, bool recursive = true); - +#ifndef LIBXMLXX_DISABLE_DEPRECATED /** Get the XPath of this node. * @result The XPath of the node. + * @deprecated 5.6: Use get_path2() instead. */ ustring get_path() const; +#endif // LIBXMLXX_DISABLE_DEPRECATED + + /** Get the XPath of this node. + * @result The XPath of the node, or no value in case of error. + * @newin{5,6} + */ + std::optional get_path2() const; /** Find nodes from an XPath expression. * @param xpath The XPath of the nodes. diff --git a/tests/istream_ioparser/main.cc b/tests/istream_ioparser/main.cc index b94dc825..906d57f5 100644 --- a/tests/istream_ioparser/main.cc +++ b/tests/istream_ioparser/main.cc @@ -107,7 +107,7 @@ int main() { auto doc = parser.get_document(); - assert(doc->get_root_node()->get_name() == "root"); + assert(doc->get_root_node()->get_name2() == "root"); } { @@ -120,7 +120,7 @@ int main() } assert(buf.underflow_calls + buf.uflow_calls < 3); auto doc = parser.get_document(); - assert(doc->get_root_node()->get_name() == "root"); + assert(doc->get_root_node()->get_name2() == "root"); } } { // Check SaxParser works well with normal and custom istreams. From 4819ea5e5dfda475bdc2d6ab9377b8c7c080540b Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Thu, 12 Dec 2024 15:25:57 +0100 Subject: [PATCH 21/28] CI: Update publish-docs.yml Use actions/upload-pages-artifact@v3 instead of v1, to avoid a soon deprecated version of upload-artifact. --- .github/workflows/publish-docs.yml | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/.github/workflows/publish-docs.yml b/.github/workflows/publish-docs.yml index eb4009f1..c4a885b4 100644 --- a/.github/workflows/publish-docs.yml +++ b/.github/workflows/publish-docs.yml @@ -1,11 +1,11 @@ # Sample workflow for building and deploying a Jekyll site to GitHub Pages # Copied from https://github.com/libxmlplusplus/libxmlplusplus/actions/new -# and changed. Actions -> New workflow -> Pages -> Jekyll +# and changed. Actions -> New workflow -> Pages -> GitHub Pages Jekyll name: Publish docs -# 2024-07-15: ubuntu-latest = ubuntu-22.04 +# 2024-12-12: ubuntu-latest = ubuntu-22.04 # See https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners/about-github-hosted-runners#standard-github-hosted-runners-for-public-repositories on: # Runs on pushes targeting the default branch @@ -21,10 +21,11 @@ permissions: pages: write id-token: write -# Allow one concurrent deployment +# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. +# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. concurrency: group: "pages" - cancel-in-progress: true + cancel-in-progress: false jobs: # Build job @@ -32,7 +33,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Build run: | # Prevent blocking apt install on a question during configuring of tzdata. @@ -55,14 +56,14 @@ jobs: mv _build/docs/manual/html _publish/manual mv _build/docs/reference/html _publish/reference - name: Setup Pages - uses: actions/configure-pages@v2 + uses: actions/configure-pages@v5 - name: Build with Jekyll uses: actions/jekyll-build-pages@v1 with: source: ./_publish destination: ./_site - name: Upload artifact - uses: actions/upload-pages-artifact@v1 + uses: actions/upload-pages-artifact@v3 # Deployment job # Publish documentation at https://libxmlplusplus.github.io/libxmlplusplus/ @@ -75,5 +76,5 @@ jobs: steps: - name: Deploy to GitHub Pages id: deployment - uses: actions/deploy-pages@v1 + uses: actions/deploy-pages@v4 From 1f48d89e4540f7fdf47b128ac44bd19235664b0a Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Tue, 21 Jan 2025 09:13:04 +0100 Subject: [PATCH 22/28] Meson build: Simplify some get_variable() calls * docs/reference/meson.build: dependency().get_variable(pkgconfig: 'varname', internal: 'varname') -> dependency().get_variable('varname'). Possible when meson version >= 0.58. --- docs/reference/meson.build | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/reference/meson.build b/docs/reference/meson.build index 19302569..0ea195d0 100644 --- a/docs/reference/meson.build +++ b/docs/reference/meson.build @@ -17,7 +17,7 @@ docinstall_flags = [] foreach module : tag_file_modules depmod = dependency(module, required: false) if depmod.found() - doxytagfile = depmod.get_variable(pkgconfig: 'doxytagfile', internal: 'doxytagfile', default_value: '') + doxytagfile = depmod.get_variable('doxytagfile', default_value: '') if doxytagfile != '' if depmod.type_name() == 'internal' # Subprojects must build their tag files before doxygen is called. @@ -27,8 +27,8 @@ foreach module : tag_file_modules doxygen_tag_targets += subproject(module).get_variable('global_tag_file_target') endif endif - htmlrefpub = depmod.get_variable(pkgconfig: 'htmlrefpub', internal: 'htmlrefpub', default_value: '') - htmlrefdir = depmod.get_variable(pkgconfig: 'htmlrefdir', internal: 'htmlrefdir', default_value: '') + htmlrefpub = depmod.get_variable('htmlrefpub', default_value: '') + htmlrefdir = depmod.get_variable('htmlrefdir', default_value: '') if htmlrefpub == '' htmlrefpub = htmlrefdir elif htmlrefdir == '' From 52bbe149d5b7096f36fb124b1467313225eb57e0 Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Wed, 12 Feb 2025 19:22:15 +0100 Subject: [PATCH 23/28] Meson build: Add install_tag keyword argument --- docs/manual/meson.build | 3 ++- docs/reference/meson.build | 4 +++- examples/meson.build | 3 ++- meson.build | 2 ++ tests/meson.build | 3 ++- 5 files changed, 11 insertions(+), 4 deletions(-) diff --git a/docs/manual/meson.build b/docs/manual/meson.build index 940ecdeb..1c69899d 100644 --- a/docs/manual/meson.build +++ b/docs/manual/meson.build @@ -72,7 +72,8 @@ custom_target('manual_html', ], build_by_default: true, install: true, - install_dir: install_tutorialdir + install_dir: install_tutorialdir, + install_tag: 'doc', ) if can_parse_and_validate diff --git a/docs/reference/meson.build b/docs/reference/meson.build index 0ea195d0..72c7077f 100644 --- a/docs/reference/meson.build +++ b/docs/reference/meson.build @@ -102,6 +102,7 @@ tag_file = custom_target('html_and_tag', build_by_default: build_documentation, install: true, install_dir: install_reference_docdir, + install_tag: 'doc', ) devhelp_file = custom_target('devhelp', @@ -125,7 +126,8 @@ meson.add_install_script( devhelp_file.full_path(), install_devhelpdir, install_reference_docdir / 'html', - docinstall_flags + docinstall_flags, + install_tag: 'doc', ) # Distribute built files and files copied by mm-common-get. diff --git a/examples/meson.build b/examples/meson.build index 938e1c03..e9d9bd60 100644 --- a/examples/meson.build +++ b/examples/meson.build @@ -39,7 +39,8 @@ foreach ex : example_programs exe_file = executable(ex_name, ex_sources, dependencies: xmlxx_own_dep, implicit_include_directories: false, - build_by_default: build_examples + build_by_default: build_examples, + install: false, ) if build_examples diff --git a/meson.build b/meson.build index b599220d..ca525da2 100644 --- a/meson.build +++ b/meson.build @@ -300,7 +300,9 @@ configure_file( input: xmlxxconfig_h_meson, output: 'libxml++config.h', configuration: pkg_conf_data, + install: true, install_dir: install_includeconfigdir, + install_tag: 'devel', ) subdir('MSVC_NMake/libxml++') diff --git a/tests/meson.build b/tests/meson.build index 7dd04142..161a6462 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -25,7 +25,8 @@ foreach ex : test_programs exe_file = executable(ex_name, ex_sources, dependencies: xmlxx_own_dep, implicit_include_directories: false, - build_by_default: build_tests + build_by_default: build_tests, + install: false, ) if build_tests From 9ab8b9b640cb9a0c6572df77652dbe537d228ee1 Mon Sep 17 00:00:00 2001 From: Tom spot Callaway Date: Tue, 25 Mar 2025 11:59:36 -0400 Subject: [PATCH 24/28] remove invalid FSF licenses from license text and in-file attributions Signed-off-by: Tom spot Callaway --- COPYING | 5 ++--- examples/dom_build/main.cc | 3 +-- examples/dom_parse_entities/main.cc | 3 +-- examples/dom_parser/main.cc | 3 +-- examples/dom_parser_raw/main.cc | 3 +-- examples/dom_read_write/main.cc | 3 +-- examples/dom_xpath/main.cc | 3 +-- examples/dtdvalidation/main.cc | 3 +-- examples/sax_exception/main.cc | 3 +-- examples/sax_exception/myparser.cc | 3 +-- examples/sax_exception/myparser.h | 3 +-- examples/sax_parser/main.cc | 3 +-- examples/sax_parser/myparser.cc | 3 +-- examples/sax_parser/myparser.h | 3 +-- examples/sax_parser_build_dom/main.cc | 3 +-- examples/sax_parser_build_dom/svgdocument.cc | 3 +-- examples/sax_parser_build_dom/svgdocument.h | 3 +-- examples/sax_parser_build_dom/svgelement.cc | 3 +-- examples/sax_parser_build_dom/svgelement.h | 3 +-- examples/sax_parser_build_dom/svggroup.h | 3 +-- examples/sax_parser_build_dom/svgparser.cc | 3 +-- examples/sax_parser_build_dom/svgparser.h | 3 +-- examples/sax_parser_build_dom/svgpath.h | 3 +-- examples/sax_parser_entities/main.cc | 3 +-- examples/sax_parser_entities/myparser.cc | 3 +-- examples/sax_parser_entities/myparser.h | 3 +-- examples/schemavalidation/main.cc | 3 +-- examples/textreader/main.cc | 3 +-- libxml++/exceptions/exception.h | 3 +-- libxml++/exceptions/internal_error.h | 3 +-- libxml++/exceptions/parse_error.h | 3 +-- libxml++/exceptions/validity_error.h | 3 +-- libxml++/exceptions/wrapped_exception.cc | 3 +-- libxml++/exceptions/wrapped_exception.h | 3 +-- libxml++/ustring.h | 3 +-- tests/Makefile.am | 3 +-- tests/istream_ioparser/main.cc | 3 +-- tests/saxparser_chunk_parsing_inconsistent_state/main.cc | 3 +-- tests/saxparser_parse_double_free/main.cc | 3 +-- tests/saxparser_parse_stream_inconsistent_state/main.cc | 3 +-- 40 files changed, 41 insertions(+), 81 deletions(-) diff --git a/COPYING b/COPYING index b1e3f5a2..2551a65a 100644 --- a/COPYING +++ b/COPYING @@ -2,7 +2,7 @@ Version 2.1, February 1999 Copyright (C) 1991, 1999 Free Software Foundation, Inc. - 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. @@ -484,8 +484,7 @@ convey the exclusion of warranty; and each file should have at least the Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + License along with this library; if not, see . Also add information on how to contact you by electronic and paper mail. diff --git a/examples/dom_build/main.cc b/examples/dom_build/main.cc index fcaef275..2fd160e9 100644 --- a/examples/dom_build/main.cc +++ b/examples/dom_build/main.cc @@ -13,8 +13,7 @@ * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * License along with this library; if not, see . */ #include diff --git a/examples/dom_parse_entities/main.cc b/examples/dom_parse_entities/main.cc index f3e7c552..f3295cd2 100644 --- a/examples/dom_parse_entities/main.cc +++ b/examples/dom_parse_entities/main.cc @@ -13,8 +13,7 @@ * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * License along with this library; if not, see . */ #include diff --git a/examples/dom_parser/main.cc b/examples/dom_parser/main.cc index e9264a4f..85dd5b7b 100644 --- a/examples/dom_parser/main.cc +++ b/examples/dom_parser/main.cc @@ -13,8 +13,7 @@ * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * License along with this library; if not, see . */ #include diff --git a/examples/dom_parser_raw/main.cc b/examples/dom_parser_raw/main.cc index 3ab9bf85..3d1fc38d 100644 --- a/examples/dom_parser_raw/main.cc +++ b/examples/dom_parser_raw/main.cc @@ -13,8 +13,7 @@ * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * License along with this library; if not, see . */ #include diff --git a/examples/dom_read_write/main.cc b/examples/dom_read_write/main.cc index 3cdba11f..3d9a115a 100644 --- a/examples/dom_read_write/main.cc +++ b/examples/dom_read_write/main.cc @@ -15,8 +15,7 @@ * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * License along with this library; if not, see . */ #ifdef HAVE_CONFIG_H diff --git a/examples/dom_xpath/main.cc b/examples/dom_xpath/main.cc index f9b7b180..1df4884a 100644 --- a/examples/dom_xpath/main.cc +++ b/examples/dom_xpath/main.cc @@ -13,8 +13,7 @@ * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * License along with this library; if not, see . */ #include diff --git a/examples/dtdvalidation/main.cc b/examples/dtdvalidation/main.cc index 8ac0a314..d1abbfce 100644 --- a/examples/dtdvalidation/main.cc +++ b/examples/dtdvalidation/main.cc @@ -13,8 +13,7 @@ * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * License along with this library; if not, see . */ diff --git a/examples/sax_exception/main.cc b/examples/sax_exception/main.cc index 2b5407ed..67d77553 100644 --- a/examples/sax_exception/main.cc +++ b/examples/sax_exception/main.cc @@ -13,8 +13,7 @@ * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * License along with this library; if not, see . */ /* This example is nearly the same than sax_parser, but demonstrate how exception diff --git a/examples/sax_exception/myparser.cc b/examples/sax_exception/myparser.cc index 5004b251..85833fdd 100644 --- a/examples/sax_exception/myparser.cc +++ b/examples/sax_exception/myparser.cc @@ -13,8 +13,7 @@ * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * License along with this library; if not, see . */ #include "myparser.h" diff --git a/examples/sax_exception/myparser.h b/examples/sax_exception/myparser.h index 7ac22901..4aa15f02 100644 --- a/examples/sax_exception/myparser.h +++ b/examples/sax_exception/myparser.h @@ -13,8 +13,7 @@ * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * License along with this library; if not, see . */ #ifndef __LIBXMLPP_EXAMPLES_MYPARSER_H diff --git a/examples/sax_parser/main.cc b/examples/sax_parser/main.cc index 0cb5adc0..16265482 100644 --- a/examples/sax_parser/main.cc +++ b/examples/sax_parser/main.cc @@ -13,8 +13,7 @@ * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * License along with this library; if not, see . */ #ifdef HAVE_CONFIG_H diff --git a/examples/sax_parser/myparser.cc b/examples/sax_parser/myparser.cc index 5c929479..fb8335c4 100644 --- a/examples/sax_parser/myparser.cc +++ b/examples/sax_parser/myparser.cc @@ -15,8 +15,7 @@ * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * License along with this library; if not, see . */ #include "myparser.h" diff --git a/examples/sax_parser/myparser.h b/examples/sax_parser/myparser.h index 9dde6643..dc45c429 100644 --- a/examples/sax_parser/myparser.h +++ b/examples/sax_parser/myparser.h @@ -15,8 +15,7 @@ * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * License along with this library; if not, see . */ #ifndef __LIBXMLPP_EXAMPLES_MYPARSER_H diff --git a/examples/sax_parser_build_dom/main.cc b/examples/sax_parser_build_dom/main.cc index 21927b65..bfbd26a6 100644 --- a/examples/sax_parser_build_dom/main.cc +++ b/examples/sax_parser_build_dom/main.cc @@ -15,8 +15,7 @@ * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * License along with this library; if not, see . */ #include diff --git a/examples/sax_parser_build_dom/svgdocument.cc b/examples/sax_parser_build_dom/svgdocument.cc index b9190536..82387312 100644 --- a/examples/sax_parser_build_dom/svgdocument.cc +++ b/examples/sax_parser_build_dom/svgdocument.cc @@ -15,8 +15,7 @@ * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * License along with this library; if not, see . */ #include "svgdocument.h" diff --git a/examples/sax_parser_build_dom/svgdocument.h b/examples/sax_parser_build_dom/svgdocument.h index 9c343919..f0f32e2d 100644 --- a/examples/sax_parser_build_dom/svgdocument.h +++ b/examples/sax_parser_build_dom/svgdocument.h @@ -15,8 +15,7 @@ * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * License along with this library; if not, see . */ #ifndef __LIBXMLPP_SVGDOCUMENT_H diff --git a/examples/sax_parser_build_dom/svgelement.cc b/examples/sax_parser_build_dom/svgelement.cc index de17d4e4..fc7fde62 100644 --- a/examples/sax_parser_build_dom/svgelement.cc +++ b/examples/sax_parser_build_dom/svgelement.cc @@ -15,8 +15,7 @@ * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * License along with this library; if not, see . */ #include "svgelement.h" diff --git a/examples/sax_parser_build_dom/svgelement.h b/examples/sax_parser_build_dom/svgelement.h index 362869e6..c371990f 100644 --- a/examples/sax_parser_build_dom/svgelement.h +++ b/examples/sax_parser_build_dom/svgelement.h @@ -15,8 +15,7 @@ * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * License along with this library; if not, see . */ #ifndef __LIBXMLPP_SVGELEMENT_H diff --git a/examples/sax_parser_build_dom/svggroup.h b/examples/sax_parser_build_dom/svggroup.h index 3502ad4e..d4f3c905 100644 --- a/examples/sax_parser_build_dom/svggroup.h +++ b/examples/sax_parser_build_dom/svggroup.h @@ -15,8 +15,7 @@ * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * License along with this library; if not, see . */ #ifndef __LIBXMLPP_SVGGROUP_H diff --git a/examples/sax_parser_build_dom/svgparser.cc b/examples/sax_parser_build_dom/svgparser.cc index 89f9e529..fe32385b 100644 --- a/examples/sax_parser_build_dom/svgparser.cc +++ b/examples/sax_parser_build_dom/svgparser.cc @@ -15,8 +15,7 @@ * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * License along with this library; if not, see . */ #include diff --git a/examples/sax_parser_build_dom/svgparser.h b/examples/sax_parser_build_dom/svgparser.h index ef28c29a..111d9ac0 100644 --- a/examples/sax_parser_build_dom/svgparser.h +++ b/examples/sax_parser_build_dom/svgparser.h @@ -15,8 +15,7 @@ * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * License along with this library; if not, see . */ #ifndef __LIBXMLPP_SVGPARSER_H diff --git a/examples/sax_parser_build_dom/svgpath.h b/examples/sax_parser_build_dom/svgpath.h index bc75970a..2d9e7f98 100644 --- a/examples/sax_parser_build_dom/svgpath.h +++ b/examples/sax_parser_build_dom/svgpath.h @@ -15,8 +15,7 @@ * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * License along with this library; if not, see . */ #ifndef __LIBXMLPP_SVGPATH_H diff --git a/examples/sax_parser_entities/main.cc b/examples/sax_parser_entities/main.cc index 97948873..e2d558c2 100644 --- a/examples/sax_parser_entities/main.cc +++ b/examples/sax_parser_entities/main.cc @@ -13,8 +13,7 @@ * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * License along with this library; if not, see . */ #ifdef HAVE_CONFIG_H diff --git a/examples/sax_parser_entities/myparser.cc b/examples/sax_parser_entities/myparser.cc index a19cdf6e..d8b4a980 100644 --- a/examples/sax_parser_entities/myparser.cc +++ b/examples/sax_parser_entities/myparser.cc @@ -13,8 +13,7 @@ * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * License along with this library; if not, see . */ #include "myparser.h" diff --git a/examples/sax_parser_entities/myparser.h b/examples/sax_parser_entities/myparser.h index 312667c2..61d2f6f6 100644 --- a/examples/sax_parser_entities/myparser.h +++ b/examples/sax_parser_entities/myparser.h @@ -13,8 +13,7 @@ * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * License along with this library; if not, see . */ #ifndef __LIBXMLPP_EXAMPLES_MYPARSER_H diff --git a/examples/schemavalidation/main.cc b/examples/schemavalidation/main.cc index a5de5e07..2c6fb29d 100644 --- a/examples/schemavalidation/main.cc +++ b/examples/schemavalidation/main.cc @@ -13,8 +13,7 @@ * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * License along with this library; if not, see . */ #ifdef HAVE_CONFIG_H diff --git a/examples/textreader/main.cc b/examples/textreader/main.cc index 16d72187..da5d85b4 100644 --- a/examples/textreader/main.cc +++ b/examples/textreader/main.cc @@ -13,8 +13,7 @@ * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * License along with this library; if not, see . */ #include diff --git a/libxml++/exceptions/exception.h b/libxml++/exceptions/exception.h index 7a657222..b86269b5 100644 --- a/libxml++/exceptions/exception.h +++ b/libxml++/exceptions/exception.h @@ -13,8 +13,7 @@ * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * License along with this library; if not, see . */ #ifndef __LIBXMLPP_EXCEPTION_H diff --git a/libxml++/exceptions/internal_error.h b/libxml++/exceptions/internal_error.h index 2ad6fe19..0126247d 100644 --- a/libxml++/exceptions/internal_error.h +++ b/libxml++/exceptions/internal_error.h @@ -13,8 +13,7 @@ * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * License along with this library; if not, see . */ #ifndef __LIBXMLPP_INTERNAL_ERROR_H diff --git a/libxml++/exceptions/parse_error.h b/libxml++/exceptions/parse_error.h index 50ebc8d6..c4185fc0 100644 --- a/libxml++/exceptions/parse_error.h +++ b/libxml++/exceptions/parse_error.h @@ -13,8 +13,7 @@ * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * License along with this library; if not, see . */ #ifndef __LIBXMLPP_PARSE_ERROR_H diff --git a/libxml++/exceptions/validity_error.h b/libxml++/exceptions/validity_error.h index d8831b4f..1a1ab0ad 100644 --- a/libxml++/exceptions/validity_error.h +++ b/libxml++/exceptions/validity_error.h @@ -13,8 +13,7 @@ * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * License along with this library; if not, see . */ #ifndef __LIBXMLPP_VALIDITY_ERROR_H diff --git a/libxml++/exceptions/wrapped_exception.cc b/libxml++/exceptions/wrapped_exception.cc index 00cdc37f..6044a7e1 100644 --- a/libxml++/exceptions/wrapped_exception.cc +++ b/libxml++/exceptions/wrapped_exception.cc @@ -11,8 +11,7 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * License along with this library; if not, see . */ #include "wrapped_exception.h" diff --git a/libxml++/exceptions/wrapped_exception.h b/libxml++/exceptions/wrapped_exception.h index ad60f88e..f523e319 100644 --- a/libxml++/exceptions/wrapped_exception.h +++ b/libxml++/exceptions/wrapped_exception.h @@ -11,8 +11,7 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * License along with this library; if not, see . */ #ifndef __LIBXMLPP_WRAPPED_EXCEPTION_H diff --git a/libxml++/ustring.h b/libxml++/ustring.h index fabb3ffb..97a53461 100644 --- a/libxml++/ustring.h +++ b/libxml++/ustring.h @@ -12,8 +12,7 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * License along with this library; if not, see . * */ diff --git a/tests/Makefile.am b/tests/Makefile.am index ad58ba03..734ca14b 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -11,8 +11,7 @@ ## Lesser General Public License for more details. ## ## You should have received a copy of the GNU Lesser General Public -## License along with this library; if not, write to the Free Software -## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +## License along with this library; if not, see . AM_CPPFLAGS = -I$(top_builddir) -I$(top_srcdir) -I. $(LIBXMLXX_CFLAGS) AM_CXXFLAGS = $(LIBXMLXX_WXXFLAGS) diff --git a/tests/istream_ioparser/main.cc b/tests/istream_ioparser/main.cc index 906d57f5..61f5833c 100644 --- a/tests/istream_ioparser/main.cc +++ b/tests/istream_ioparser/main.cc @@ -11,8 +11,7 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * License along with this library; if not, see . */ #include diff --git a/tests/saxparser_chunk_parsing_inconsistent_state/main.cc b/tests/saxparser_chunk_parsing_inconsistent_state/main.cc index 53f55b3f..a6ee1787 100644 --- a/tests/saxparser_chunk_parsing_inconsistent_state/main.cc +++ b/tests/saxparser_chunk_parsing_inconsistent_state/main.cc @@ -11,8 +11,7 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * License along with this library; if not, see . */ #include diff --git a/tests/saxparser_parse_double_free/main.cc b/tests/saxparser_parse_double_free/main.cc index 75ef6c9d..395bf6ed 100644 --- a/tests/saxparser_parse_double_free/main.cc +++ b/tests/saxparser_parse_double_free/main.cc @@ -11,8 +11,7 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * License along with this library; if not, see . */ #include diff --git a/tests/saxparser_parse_stream_inconsistent_state/main.cc b/tests/saxparser_parse_stream_inconsistent_state/main.cc index 795d5848..8e319284 100644 --- a/tests/saxparser_parse_stream_inconsistent_state/main.cc +++ b/tests/saxparser_parse_stream_inconsistent_state/main.cc @@ -11,8 +11,7 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * License along with this library; if not, see . */ #include From e7c72ef72133a5620319193d5c141f4ba9369022 Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Mon, 28 Apr 2025 15:02:45 +0200 Subject: [PATCH 25/28] Remove ChangeLog.pre-2-36-0 --- ChangeLog.pre-2-36-0 | 2839 ------------------------------------------ 1 file changed, 2839 deletions(-) delete mode 100644 ChangeLog.pre-2-36-0 diff --git a/ChangeLog.pre-2-36-0 b/ChangeLog.pre-2-36-0 deleted file mode 100644 index 0b836fe1..00000000 --- a/ChangeLog.pre-2-36-0 +++ /dev/null @@ -1,2839 +0,0 @@ -2.36.0: - -2012-10-25 Kjell Ahlstedt - - Element::set_namespace_declaration(): No error to set the same URI twice. - - * libxml++/nodes/element.[h|cc]: Don't throw an exception from - set_namespace_declaration(), if a namespace prefix is assigned the same URI - twice. Bug #635846, comment 27. - -2012-10-10 Kjell Ahlstedt - - Require libxml-2.0 >= 2.7.3. - - * configure.ac: Require libxml-2.0 >= 2.7.3. - Don't know if it's really necessary, but 2.7.2 from 2008-10-03 is the oldest - release available at ftp://xmlsoft.org/libxml2, and 2.7.2 contains a bug that - makes examples/import_node segfault. - -2012-10-10 Kjell Ahlstedt - - Parser::initialize_context(): Call xmlCtxtUseOptions(). - - * libxml++/parsers/parser.cc: initialize_context(): Call xmlCtxtUseOptions() - instead of setting context_->validate and replaceEntities. - xmlCtxtUseOptions() does that and more. - -2.35.4: - -2012-08-28 Kjell Ahlstedt - - Add XInclude processing. - - * Makefile.am: Add XIncludeStart and XIncludeEnd nodes. - * examples/Makefile.am: Add dom_xinclude example. - * examples/README: Add dom_xinclude example and other missing examples. - * examples/dom_xinclude/example.xml: - * examples/dom_xinclude/include1.txt: - * examples/dom_xinclude/include2.xml: - * examples/dom_xinclude/main.cc: New files. - * libxml++/document.[h|cc]: Add process_xinclude(). - * libxml++/libxml++.h: Add new header files. - * libxml++/nodes/node.cc: create_wrapper(): Create XIncludeStart and - XIncludeEnd nodes. - * libxml++/nodes/xincludeend.[h|cc]: - * libxml++/nodes/xincludestart.[h|cc]: New files. - * .gitignore: Ignore /examples/dom_xinclude/dom_xinclude. Bug #338521. - -2012-08-28 Kjell Ahlstedt - - Parser: Make it thread-safe. - - * configure.ac: Require glibmm-2.4 >= 2.32.0. - * libxml++/parsers/parser.cc: Protect all accesses to extra_parser_data with - a Glib::Threads::Mutex. Bug #681467. - -2012-08-10 Kjell Ahlstedt - - Document: Make the Document(xmlDoc*) constructor public. - - * libxml++/document.h: Make the Document(xmlDoc*) constructor public. - Remove friend declarations that become unnecessary. Bug #668980. - -2012-08-09 Kjell Ahlstedt - - Improve the DtdValidation and SchemaValidation example programs. - - * examples/dtdvalidation/main.cc: - * examples/schemavalidation/main.cc: Print all information from all thrown - xmlpp exceptions. - -2012-08-09 Kjell Ahlstedt - - Validators: Improve the error handling. - - * libxml++/validators/validator.[h|cc]: - * libxml++/validators/dtdvalidator.[h|cc]: - * libxml++/validators/schemavalidator.[h|cc]: Check more return codes from - libxml2 functions. Improve the description of member functions in the - reference documentation. Bug #635846. - -2012-08-07 Kjell Ahlstedt - - Add incremental parsing to the SaxParser example program. - - * examples/sax_parser/main.cc: Uncomment and correct the code that shows - incremental parsing with SaxParser::parse_chunk(). - -2012-08-07 Kjell Ahlstedt - - Parsers: Improve the error handling. - - * libxml++/parsers/domparser.[h|cc]: - * libxml++/parsers/saxparser.[h|cc]: - * libxml++/parsers/textreader.[h|cc]: Check more return codes from libxml2 - functions. Improve the description of errors in the reference documentation. - Bug #635846. - -2012-08-07 Kjell Ahlstedt - - Document, Element, Node: Remove unnecessary tests for null pointers. - - * libxml++/document.cc: - * libxml++/nodes/element.cc: - * libxml++/nodes/node.cc: Remove tests for null pointer before calling - xmlFreeNode(), which does nothing if given a null pointer. These unnecessary - tests were newly added when error handling was improved. Bug #635846. - -2012-08-05 Kjell Ahlstedt - - Schema::set_document(): Create empty document. - - * libxml++/schema.[h|cc]: set_document(): If the argument 'document' is 0, - create an empty document, as the documentation says. - -2012-08-05 Kjell Ahlstedt - - Document, Schema: Improve the error handling. - - * libxml++/document.[h|cc]: - * libxml++/schema.[h|cc]: Check more return codes from libxml2 functions. - Improve the description of errors in the reference documentation. Bug #635846. - -2012-08-02 Kjell Ahlstedt - - Element, Node: Improve the error handling. - - * libxml++/nodes/element.[h|cc]: - * libxml++/nodes/node.[h|cc]: Check more return codes from libxml2 functions. - Improve the description of errors in the reference documentation. Bug #635846. - -2.35.3: - -2012-06-19 Kjell Ahlstedt - - Add examples/Makefile.am. Let 'make check' run the examples. - - * examples/Makefile.am: New file. Let 'make check' both compile and run the - example programs. - * Makefile.am: Call examples/Makefile. Move all 'examples' stuff to - examples/Makefile.am. - * configure.ac: Remove --enable-examples. Generate examples/Makefile. - * .gitignore: Ignore make-check-sh. Bug #678390. - -2012-06-19 Kjell Ahlstedt - - Example programs: Fix return codes and print errors on std::cerr. - - * examples/*/main.cc: Return EXIT_FAILURE in case of failure. Print error - messages on std::cerr. The example programs can then be run by 'make check'. - Bug #678390. - -2012-04-20 Kjell Ahlstedt - - Node: Add functions eval_to_[boolean|number|string](). - - * examples/dom_xpath/example.xml: Add an element with numeric value. - * examples/dom_xpath/main.cc: Add calls to the new functions. - * libxml++/nodes/node.[h|cc]: - Add the functions eval_to_[boolean|number|string](). Bug #316244. - -2012-04-19 Kjell Ahlstedt - - Node: Make the previous fix thread-safe. - - * libxml++/nodes/node.cc: Delete the C++ wrapper of a deleted attribute node - without using xmlDeregisterNodeDefault. Bug #672992 comments 9-12. - -2012-04-19 Kjell Ahlstedt - - Node: Fix memory problems in import_node(). - - * libxml++/nodes/node.[h|cc]: Return added_node instead of imported_node, - which libxml2 may delete. Delete the C++ wrapper of a deleted attribute node. - * examples/import_node/example[1|2].xml: - * examples/import_node/main.cc: Import attributes and a text node which is - merged with an existing text node. Bug #672992. - -2012-04-12 Kjell Ahlstedt - - Define LIBXMLCPP_EXCEPTIONS_ENABLED unconditionally. - - * configure.ac: Add AC_DEFINE([LIBXMLCPP_EXCEPTIONS_ENABLED],[1],... - -2012-03-30 Murray Cumming - - Node: Check for a null pointer, to fix a scan-build warning. - - * libxml++/nodes/node.cc: This seems unlikely. - -2.35.2: - -2012-03-21 Murray Cumming - - Fix a warning found by clang++ - - * libxml++/parsers/textreader.h: PropertyReader is a class, not - a struct. - -2012-03-20 Murray Cumming - - Remove the --disable-api-exceptions configure option. - - And remove the #ifdefs and #else blocks from the code. - This is not used by anybody now, as far as I know, so this makes the - code easier to maintain. - -2012-03-20 Murray Cumming - - A fix for the previous commit. - - * libxml++/nodes/node.cc: get_first_child() const: Use the name - parameter. - -2012-03-19 Murray Cumming - - Node: Add get_first_child(). - - * libxml++/nodes/node.[h|cc]: This is like get_children(), - but it returns only the first node, optionally returning - the first one with a certain name. - Based on a patch by Ilya Murav'jov in bug #648125 . - -2.35.1: - -2012-02-15 Kjell Ahlstedt - - Handle attributes with default values correctly. - - * libxml++/attributedeclaration.[h|cc]: - * libxml++/attributenode.[h|cc]: New files. - * Makefile.am: - * libxml++/Makefile.am: Add the new files. - * libxml++/libxml++.h: Add the new .h files. - * docs/manual/libxml++_without_code.xml: Add AttributeDeclaration and - AttributeNode in the list of node classes. - * libxml++/attribute.[h|cc]: Make get_value() useful also for default values - (XML_ATTRIBUTE_DECL). Fix set_value() for attributes in a namespace. - * libxml++/nodes/element.[h|cc]: get_attribute(): Add description. Don't use - xmlHasProp(), it ignores namespace. - * libxml++/nodes/node.cc: get_namespace_prefix(), get_namespace_uri(), - set_namespace(), create_wrapper(): Add code for XML_ATTRIBUTE_DECL. - * examples/dom_parser/example.dtd: Add attribute 'title' with default value. - * examples/dom_parser/example.xml: Add attribute 'title' with explicit value. - Bug #669635. - -2012-02-15 Kjell Ahlstedt - - Node: Correct mis-spelt LIBXMLCPP_EXCEPTIONS_ENABLED. - - * libxml++/nodes/node.h: Add some "@throws exception". - * libxml++/nodes/node.cc: Change LIBXMLCPP_EXCEPTIONS_ENABLE to - LIBXMLCPP_EXCEPTIONS_ENABLED in find_impl() and set_namespace(). - -2012-02-15 Kjell Ahlstedt - - Improved handling of entity references and processing instructions. - - * libxml++/nodes/entitydeclaration.[h|cc]: New files. - * Makefile.am: - * libxml++/Makefile.am: Add the new files. - * libxml++/libxml++.h: Add the new .h file. - * docs/manual/libxml++_without_code.xml: Add EntityDeclaration in the list - of node classes. - * libxml++/document.[h|cc]: Add add_processing_instruction(). - * libxml++/nodes/element.[h|cc]: Add add_child_entity_reference() and - add_child_processing_instruction(). - * libxml++/nodes/entityreference.h: Improve the description of - get_resolved_text() and get_original_text(). - * libxml++/nodes/node.cc: get_namespace_prefix() and get_namespace_uri(): - XML_ENTITY_DECL has no namespace. Don't try to find it. - create_wrapper(): Create an EntityDeclaration when type == XML_ENTITY_DECL. - free_wrappers(): Don't walk the child list when type == XML_ENTITY_REF_NODE. - * examples/dom_build/main.cc: Add entity declarations and references, and - processing instructions to the built xml file. - * examples/dom_parse_entities/example.dtd: Make it compatible with example.xml. - * examples/dom_parse_entities/example.xml: Add an entity definition that - contains entity references. - * examples/dom_parse_entities/main.cc: Print the parsed file both with and - without entity substitution. - * examples/dom_parser/example.dtd: Make it compatible with example.xml. - * examples/dom_parser/main.cc: Add command flag -E (Don't substitute entities). - Bug #669481 - -2012-02-15 Kjell Ahlstedt - - Add some files to .gitignore. - - * .gitignore: Add docs files that are copied from mm-common. - Add /MSVC_Net2010/libxml++/libxml++.rc and - /examples/dom_read_write/example_output.xml. - -2012-02-15 Kjell Ahlstedt - - Add @newin{2,36} to some new functions where it's missing. - - * libxml++/exceptions/exception.h: Add @newin{2,36} to format_xml_error() and - format_xml_parser_error(). - * libxml++/parsers/parser.h: Add @newin{2,36} to [set|get]_throw_messages(). - Bug #304020. - -2012-02-10 Kjell Ahlstedt - - Make the schema validation example program work with no arguments. - - * examples/schemavalidation/main.cc: Correct the test for number of arguments. - -2012-01-30 Kjell Ahlstedt - - Parser: Throw more detailed error messages. - - * examples/dom_parser/main.cc: Add command parameters -v -e -t. - * libxml++/exceptions/exception.[h|cc]: Add format_xml_error() and - format_xml_parser_error(). - * libxml++/parsers/domparser.cc: Call format_xml_error() and - format_xml_parser_error() to get more detailed messages in exceptions. - * libxml++/parsers/parser.[h|cc]: Add [set|get]_throw_messages() and (local in - .cc until ABI can be broken) on_parser_[error|warning](). Bug #304020. - -2012-01-30 Murray Cumming - - Document: Make the Document(xmlDoc*) constructor protected. - - * libxml++/document.h: This was requested in bug #668980 (A. Pignotti). - -2011-09-09 Murray Cumming - - Document: write_to_*(): Make sure that we write UTF-8 out. - - * libxml++/document.cc: Because the xmlDocDump*() functions use some other - encoding if you specify NULL, causing errors such as: - xmlEscapeEntities : char out of range - -2.34.2: - -2011-09-06 Mathias Lorente - - Node::create_new_child_node(): Use the default namespace if none is specified. - - * libxml++/nodes/node.cc: This is better than just ignoring it. - Bug #656110 - -2011-07-20 Murray Cumming - - ContentNode::get_content(): Fix a documentation typo. - - * libxml++/nodes/contentnode.h: Mention > instead of &qt (a q - instead of a g, and no ;.). - -2011-07-20 Mathias Lorente - - Add Element::add_child_cdata(). - - * libxml++/nodes/element.[h|cc]: Add add_child_cdata(), using - xmlNewCDataBlock(), like the existing add_child_text(). - * examples/sax_parser_build_dom/example.xml: - * examples/sax_parser_build_dom/svgparser.[h|cc]: Use the new API. - -2.34.1: - -2011-04-17 Murray Cumming - - Fix distcheck. - - * Makefile.am: Specify the full path to docbook-customisation.xsl, - which is apparently necessary with the autotools that I have here. - -2011-04-17 Murray Cumming - - Fix the build with --enable-warnings=fatal. - - * configure.ac: Use -no-long-long to avoid an (apparently new) compiler - warning about long long not being supported by C++98. glibmm already had - this option. - -2011-04-17 Murray Cumming - - Do not require mm-common during the tarball build. - - * configure.ac: Add a MM_CONFIG_DOCTOOL_DIR() call. - -2.34.0: - -2011-02-24 Murray Cumming - - Fix the build with the changed linker behaviour on Ubuntu Natty. - - * Makefile.am: Link the examples to glibmm explicitly. - -2.33.2: - -2011-02-11 Murray Cumming - - Node::remove_child(): Fix a use of deleted memory - - * libxml++/nodes/node.cc: - Use a temporary variable to avoid accessing the node C++ instance after we - have deleted it. Valgrind foudn this. - Also remove the comment about the libxml deleting our C++ instance via a - callback, because we don't do that anymore. - -2010-11-26 Murray Cumming - - Check some libxml function return values. - - * libxml++/document.cc: do_write_to_stream(): - * libxml++/schema.cc: set_document(): Check the results from - xmlSchemaNewDocParserCtxt() and xmlSaveFormatFileTo(). - Bug #635846 (Markus Elfring). - -2.33.1: - -2010-11-14 Murray Cumming - - free_wrappers(): Fix crash. - - * libxml++/nodes/node.cc: free_wrappers(): Revert my change to check - xmlNode::properties for all types, because the layout of some structs - is apparently completely different (not really deriving fully), and this - caused a crash in examples/sax_parser/. - Added an explanatory comment. - -2010-11-14 Murray Cumming - - Change the --enable-examples default to yes. - - * configure.ac: Build the examples by default, so we at least check the - build more often. Disabling them is only useful for package building, - which is the less common case. - -2010-11-14 Murray Cumming - - Moved create_wrapper() and free_wrappers() to Node. - - * libxml++/document.[h|cc]: - * libxml++/nodes/node.[h|cc]: Moved create_wrapper() and free_wrappers() - to here from Document. - free_wrappers(): Never return inside the switch/case, so we check - xmlNode::properties for all struct types, and to avoid making the behaviour - non-obvious. - * libxml++/parsers/textreader.cc: - * libxml++/validators/dtdvalidator.cc: - * libxml++/nodes/element.cc: Adapted. - -2010-11-08 Alessandro Pignotti - - Make libxml++ compatible with separate and multi-threaded libxml2 usage. - - * libxml++/document.[h|cc]: Added create_wrapper() and free_wrappers(), - replacing on_libxml_construct() and on_libxml_destruct() . - Init(): Do not register these global callbacks with libxml. - * libxml++/nodes/element.cc: - * libxml++/nodes/node.[h|cc]: - * libxml++/parsers/textreader.cc: - * libxml++/validators/dtdvalidator.cc: Call these create_wrapper() before - ever trying to get a C++ instance from a C instance. Call free_wrappers() - in destructors and other places where we want the instance to be destroyed. - - This avoids use of libxml's global function pointers, which are not - thread-safe. - -2010-11-08 Murray Cumming - - Do not call xmlCleanupParser() because it is brutal. - - * libxml++/document.cc: ~Init(): Do not call xmlCleanupParser() because it - breaks libxml generally and should only be called by an application - explicitly before it ends, for instance at the end of its main(). - -2010-10-19 Knut Aksel Røysland - - Node::get_parent(): Removed code duplication. - - * libxml++/nodes/node.cc: get_parent() const: Use const_cast<> to call - the non-const version, instead of duplicating the code. - -2.32.0: - -2010-10-14 Murray Cumming - - website: Change the mailing list location, because I moved it. - - * docs/index.html: The mailing list is now at gnome.org. - -2010-10-03 Armin Burgmeier - - * MSVC_Net2005/README: - * MSVC_Net2005/examples/dom_build/dom_build.vcproj: - * MSVC_Net2005/examples/dom_parse_entities/dom_parse_entities.vcproj: - * MSVC_Net2005/examples/dom_parser/dom_parser.vcproj: - * MSVC_Net2005/examples/dom_parser_raw/dom_parser_raw.vcproj: - * MSVC_Net2005/examples/dom_read_write/dom_read_write.vcproj: - * MSVC_Net2005/examples/dom_xpath/dom_xpath.vcproj: - * MSVC_Net2005/examples/dtdvalidation/dtdvalidation.vcproj: - * MSVC_Net2005/examples/import_node/import_node.vcproj: - * MSVC_Net2005/examples/sax_exception/sax_exception.vcproj: - * MSVC_Net2005/examples/sax_parser/sax_parser.vcproj: - * MSVC_Net2005/examples/sax_parser_build_dom/sax_parser_build_dom.vcproj: - * MSVC_Net2005/examples/sax_parser_entities/sax_parser_entities.vcproj: - * MSVC_Net2005/examples/schemavalidation/schemavalidation.vcproj: - * MSVC_Net2005/examples/textreader/textreader.vcproj: - * MSVC_Net2005/gendef/gendef.vcproj: - * MSVC_Net2005/libxml++.sln: - * MSVC_Net2005/libxml++/libxml++.vcproj: - * MSVC_Net2008/README: - * MSVC_Net2008/examples/dom_build/dom_build.vcproj: - * MSVC_Net2008/examples/dom_parse_entities/dom_parse_entities.vcproj: - * MSVC_Net2008/examples/dom_parser/dom_parser.vcproj: - * MSVC_Net2008/examples/dom_parser_raw/dom_parser_raw.vcproj: - * MSVC_Net2008/examples/dom_read_write/dom_read_write.vcproj: - * MSVC_Net2008/examples/dom_xpath/dom_xpath.vcproj: - * MSVC_Net2008/examples/dtdvalidation/dtdvalidation.vcproj: - * MSVC_Net2008/examples/import_node/import_node.vcproj: - * MSVC_Net2008/examples/sax_exception/sax_exception.vcproj: - * MSVC_Net2008/examples/sax_parser/sax_parser.vcproj: - * MSVC_Net2008/examples/sax_parser_build_dom/sax_parser_build_dom.vcproj: - * MSVC_Net2008/examples/sax_parser_entities/sax_parser_entities.vcproj: - * MSVC_Net2008/examples/schemavalidation/schemavalidation.vcproj: - * MSVC_Net2008/examples/textreader/textreader.vcproj: - * MSVC_Net2008/gendef/gendef.vcproj: - * MSVC_Net2008/libxml++.sln: - * MSVC_Net2008/libxml++/libxml++.vcproj: - * MSVC_Net2010/README: - * MSVC_Net2010/examples/dom_build/dom_build.vcxproj: - * MSVC_Net2010/examples/dom_build/dom_build.vcxproj.filters: - * MSVC_Net2010/examples/dom_parse_entities/dom_parse_entities.vcxproj: - * MSVC_Net2010/examples/dom_parse_entities/dom_parse_entities.vcxproj.filters: - * MSVC_Net2010/examples/dom_parser/dom_parser.vcxproj: - * MSVC_Net2010/examples/dom_parser/dom_parser.vcxproj.filters: - * MSVC_Net2010/examples/dom_parser_raw/dom_parser_raw.vcxproj: - * MSVC_Net2010/examples/dom_parser_raw/dom_parser_raw.vcxproj.filters: - * MSVC_Net2010/examples/dom_read_write/dom_read_write.vcxproj: - * MSVC_Net2010/examples/dom_read_write/dom_read_write.vcxproj.filters: - * MSVC_Net2010/examples/dom_xpath/dom_xpath.vcxproj: - * MSVC_Net2010/examples/dom_xpath/dom_xpath.vcxproj.filters: - * MSVC_Net2010/examples/dtdvalidation/dtdvalidation.vcxproj: - * MSVC_Net2010/examples/dtdvalidation/dtdvalidation.vcxproj.filters: - * MSVC_Net2010/examples/import_node/import_node.vcxproj: - * MSVC_Net2010/examples/import_node/import_node.vcxproj.filters: - * MSVC_Net2010/examples/sax_exception/sax_exception.vcxproj: - * MSVC_Net2010/examples/sax_exception/sax_exception.vcxproj.filters: - * MSVC_Net2010/examples/sax_parser/sax_parser.vcxproj: - * MSVC_Net2010/examples/sax_parser/sax_parser.vcxproj.filters: - * MSVC_Net2010/examples/sax_parser_build_dom/sax_parser_build_dom.vcxproj: - * MSVC_Net2010/examples/sax_parser_build_dom/sax_parser_build_dom.vcxproj.filters: - * MSVC_Net2010/examples/sax_parser_entities/sax_parser_entities.vcxproj: - * MSVC_Net2010/examples/sax_parser_entities/sax_parser_entities.vcxproj.filters: - * MSVC_Net2010/examples/schemavalidation/schemavalidation.vcxproj: - * MSVC_Net2010/examples/schemavalidation/schemavalidation.vcxproj.filters: - * MSVC_Net2010/examples/textreader/textreader.vcxproj: - * MSVC_Net2010/examples/textreader/textreader.vcxproj.filters: - * MSVC_Net2010/gendef/gendef.cc: - * MSVC_Net2010/gendef/gendef.vcxproj: - * MSVC_Net2010/gendef/gendef.vcxproj.filters: - * MSVC_Net2010/libxml++.sln: - * MSVC_Net2010/libxml++/libxml++.rc.in: - * MSVC_Net2010/libxml++/libxml++.vcxproj: - * MSVC_Net2010/libxml++/libxml++.vcxproj.filters: - * Makefile.am: - * configure.ac: Added support for MSVC 2010 and 64 bit. - -2010-06-13 Murray Cumming - - Node::find(): Check xmlNode::type for a XML_NAMESPACE_DECL. - - * libxml++/nodes/node.cc: find_impl(): if the xmlNode has type - XML_NAMESPACE_DECL then it is actually a xmlNs, which is not like a xmlNode - at all (thanks to the awful undocumented libxml++ system of struct - inheritance). - So we just igore these items. We need to decide what the caller really - expects. - -2010-06-13 Murray Cumming - - Node::find(): Revert some of my previous change because it breaks some code. - - * libxml++/nodes/node.cc: find_impl(): Restore the previous behaviour, - because the strange use of _private only seems to happen sometimes. - -2010-06-13 Murray Cumming - - Node::find(): Cope with weird use of _private in xmlNodeSet. - - * libxml++/nodes/node.cc: The xmlNodeSet seems to contain extra xmlNodes that - were never given to on_libxml_construct(). Those xmlNodes seem to abuse - private_, where we find our real xmlNodes containing our C++ Nodes. - This fixes bug #386013 (Max Kirillov) though it depends on undocumented - libxml behaviour. - -2010-06-13 Murray Cumming > - - Node::find(): Use libxml functions instead of direct C access. - - * libxml++/nodes/node.cc: Use xmlXPathNodeSetIsEmpty(), - xmlXPathNodeSetGetLength() and xmlXPathNodeSetItem() instead of direct - xmlNodeSet struct access. - -2010-06-13 Murray Cumming - - Manual: Use git.gnome.org as the link to the examples source code. - - * docs/manual/libxml++_without_code.xml: Use git.gnome.org for the examples - url base, as we do in gtkmm-documentation. - -2010-06-13 Murray Cumming - - Restore the mm-common make target and update a link. - - * Makefile.am: Restore (and update) the post-html target that was lost when - we redid the build system for mm-common. - * docs/index.html: Change the link to the manual to point to its new location - at library.gnome.org. - -2.30.1: - -2010-05-04 Murray Cumming - - Documentation: Don't hide undocumented API. - - * docs/reference/Doxyfile.in: Use the same options as gtkmm (mostly). - In particular, don't hide undocumented API, such as NodeSet, to fix - bug #583412 (Hubert Figuiere). - -2010-05-04 Murray Cumming - - Documentation: Improvements. - - * libxml++/libxml++.h: Expand the main page text, linking to the tutorial - and to important classes. - * libxml++/parsers/domparser.h: - * libxml++/schema.h: Correct the class descriptions. - * libxml++/parsers/textreader.h: Add a class description. - * libxml++/nodes/element.h: - * libxml++/nodes/node.h: - * libxml++/parsers/saxparser.h: - * libxml++/validators/schemavalidator.h: - Correct @newin2p2* to @newin{2,*} now that we use mm-common. - -2010-04-27 David King - - Further documentation main page improvements - - * libxml++/libxml++.h: Some minor improvements. - -2010-04-23 David King - - Documentation main page improvements - - * libxml++/libxml++.h: Add external links and compilation example. - -2010-04-16 David King - - Minor documentation update - - * docs/index.html: Link to latest gnome.org resources. - * libxml++/libxml++.h: Add minimal documentation for main page. - -2010-04-06 Murray Cumming - - .pc file: Add datarootdir. - - * libxml++-2.6.pc.in: Add datarootdir and datadir, as in the gtkmm .pc.in - file, because I started seeing this warning when running autogen.sh in Glom: - Variable 'datarootdir' not defined in '/opt/gnome228/lib/pkgconfig/libxml++-2.6.pc' - -2010-04-03 Armin Burgmeier - - * MSVC_Net2005/libxml++.sln: - * MSVC_Net2008/libxml++.sln: Add dom_parser_raw project to the - solution files. - -2010-03-30 Murray Cumming - - Stop exceptions when using std::cout and UTF-8. - - * examples/*/main.cc: Initialize the global C and C++ locale to prevent - exceptions when ouputing a ustring (with non-ASCII UTF-8) to std::cout. - We don't see this problem when writing gtkmm apps because gtk_init() (via - Gtk::Main) initializes the C locale correctly. - - Thanks to Daniel Elstner for the solution (he will document it properly - in the Glib::ustring API reference) and to Nic Reveles and others for - noticing the problem. - -2010-03-30 David King - - Update pkg-config file - - * libxml++-2.6.pc.in: Add documentation locations to pkg-config file. - Update other fields to use variables, rather than hardcoded values. - -=== 2.30.0 === - -2010-03-30 David King - - Disable AM_MAINTAINER_MODE by default - - * configure.ac: Pass the disable parameter to AM_MAINTAINER_MODE so - that tarball users do not need doxygen, mm-common, etc. if they modify - files. Maintainer mode is still enabled if running autogen.sh. - -2010-03-29 David King - - Move a target outside a conditional block to fix the build - - * Makefile.am: Move docs/manual/libxml++.xml target outside the - ENABLE_DOCUMENTATION conditional block. - -2010-03-29 David King - - Use mm-common for reference documentation generation - - * .gitignore: Update. - - * Makefile.am: Remove SUBDIRS. Make examples build and documentation - build conditional. Build reference documentation with doc-reference.am - from mm-common. Add docs/manual/libxml++.pdf target, but do not enable - it by default. Add autogen.sh and docs/manual/insert_example_code.pl to - dist_noinst_SCRIPTS. Add docs/manual/html/*.html to - MAINTAINERCLEANFILES. - - * autogen.sh: Add --enable-maintainer-mode to arguments passed to - configure. - - * configure.ac: Add AM_MAINTAINER_MODE. Add a configure argument to - enable the build of the examples. Use mm-common macros to add a - configure argument to enable documentation, and use the glibmm - tagfile. Check for xmllint and db2latex for DTD validation of the - DocBook manual and building the PDF documentation, repectively. Remove - the last non-toplevel Makefiles from AC_CONFIG_FILES. - - * docs/Makefile.am: - * docs/Makefile_web.am_fragment: - * docs/manual/Makefile.am: - * docs/reference/Makefile.am: Remove from repository, and move content - to Makefile.am. - - * docs/manual/docbook-customisation.xsl: Add DocBook customisation - parameters. - - * docs/manual/libxml++_without_code.xml: Make validate. - - * docs/reference/Doxyfile.in: Update from mm-common. - - * docs/reference/README: Remove empty file. - -2010-03-27 David King - - Fix several compiler warnings - - * examples/dom_build/main.cc: - * examples/dtdvalidation/main.cc: - * examples/import_node/main.cc: - * examples/sax_exception/main.cc: - * examples/sax_exception/my_parser.cc: - * examples/sax_parser/main.cc: - * examples/sax_parser/my_parser.cc: - * examples/sax_parser_build_dom/svgparser.cc: - * examples/sax_parser_entities/myparser.cc: - * examples/textreader/main.cc: - * libxml++/parsers/textreader.cc: Comment out unused parameters and - variables. - - * libxml++/parsers/saxparser.cc: Fill in missing fields of - xmlSAXHandler struct. - -2010-03-27 David King - - Refactor build system - - * Makefile.am: Merge from subdir Makefile.am files, excluding doc. - - * MSVC_Net2005/examples/dom_parser_raw/dom_parser_raw.vcproj: - * MSVC_Net2008/examples/dom_parser_raw/dom_parser_raw.vcproj: Add - missing Visual studio project files. - - * MSVC_Net2005/examples/*/Makefile.am: - * MSVC_Net2005/examples/Makefile.am: - * MSVC_Net2005/gendef/Makefile.am: - * MSVC_Net2005/libxml++/Makefile.am: - * MSVC_Net2008/examples/*/Makefile.am: - * MSVC_Net2008/examples/Makefile.am: - * MSVC_Net2008/gendef/Makefile.am: - * MSVC_Net2008/libxml++/Makefile.am: Remove from repository, and move - content to Makefile.am, making the MSVC project file build - non-recursive. - - * README: Update. - - * autogen.sh: Copy from gtkmm. - - * configure.in: Move to configure.ac. - - * configure.ac: Require autoconf 2.59 and automake 1.9. Use new-style - AC_INIT() with bug-report link and homepage URL. Use mm-common for - initialisation of version variables. Require libtool 2.2.6 for much - faster builds. Use MM_ARG_ENABLE_WARNINGS to configure compiler - warning flags. Use MM_CHECK_PERL to check for the required Perl - version. Use AC_CONFIG_FILES rather than AC_OUTPUT. Update for - Makefile.am changes. - - * config.h.in: Remove from repository, as autoheader is now used. - - * */.cvsignore: Remove old files. - - * doc/manual/Makefile.am: Use the correct Perl. - - * doc/reference/Doxyfile.in: - * MSVC_Net2005/libxml++/libxml++.rc.in: - * MSVC_Net2008/libxml++/libxml++.rc.in: Use new-style variable names. - - * examples/Makefile.am_fragment: - * examples/Makefile.am: - * examples/*/Makefile.am: Remove from repository, and move content to - Makefile.am, making the examples build non-recursive. - - * .gitignore: Update. - - * libxml++/Makefile.am: - * libxml++/*/Makefile.am: Remove from repository, and move content to - Makefile.am, making the libxml++ build non-recursive. - - * libxml++.spec.in: - * INSTALL: Remove from repository. - - * scripts/README: - * scripts/Makfile.am: Remove from repository. - - * scripts/reduced.m4: Move to macros/reduced.m4 - -2010-03-08 Murray Cumming - - Use 0 instead of NULL. - - * MSVC_Net2005/gendef/gendef.cc: - * MSVC_Net2008/gendef/gendef.cc: - * libxml++/attribute.cc: - * libxml++/document.cc: - * libxml++/io/outputbuffer.cc: - * libxml++/io/parserinputbuffer.cc: - * libxml++/nodes/node.cc: - * libxml++/parsers/domparser.cc: - * libxml++/parsers/parser.cc: - * libxml++/parsers/textreader.cc: - * libxml++/schema.cc: - * libxml++/schema.h: Do not use NULL. It is unwise in C++. - -=== 2.26.1 === - -2009-07-27 Johannes Schmid - - * libxml++/validators/schemavalidator.cc: - * libxml++/schema.cc: Fixed exception handling - problems in non-exception build - * examples/sax_parser/myparser.cc/h: Make example build withouth exceptions, - it's useless then though - * examples/schemavalidation/main.cc: Fixed build without exceptions - -2009-07-27 Johannes Schmid - - New tarball release - - * configure.in: Updated version to 2.26.1 - * NEWS: updated - -2009-05-07 Murray Cumming - - Fix the build without exceptions, hopefully. - - * libxml++/parsers/textreader.cc: check_for_exceptions(): - Add an ifdef so that this should build with exceptions disabled, - though there is no alternative API yet. Noticed by David King. - -2009-05-07 Murray Cumming - - * libxml++/parsers/textreader.cc: Whitespace corrections. - -2009-03-25 Hubert Figuiere - - * libxml++/parsers/saxparser.h: Fix some warnings triggered - by -Wshadow. - -2009-03-23 Hubert Figuiere - - * libxml++/parsers/textreader.cc: severity_ was not initialised - at construction time. (Closes #576516) - -2.26.0: - -2009-03-16 Murray Cumming - - * configure.in: Increased version number to match GNOME 2.26. - -2.24.3: - -2009-03-02 Armin Burgmeier - - * libxml++/validators/validator.h: - * libxml++/parsers/parser.h: Removed the vsnprintf #define on Windows. - This could conflict with another define otherwise. Both MSVC and MinGW - have vsnprintf (without underscore) as well, and I verified libxml++ - still compiles in both. If we still need the definition for some - reason, then we should re-add it into the source files, so that other - libraries don't conflict with our definition. - -2009-01-09 Stef Walter - - * libxml++/parsers/textreader.[h|cc]: Add setup_exceptions(), setting - the on_libxml_error() callback, and call it from the constructors. - check_for_exceptions(): Actually check some member variables and throw an - exception if necessary. - This should fix bug #348006. - It breaks ABI because it adds member variables, but we decided that is - OK because nobody could actually be using this class seriously before - now because it had no error checking. - -2.24.2: - -2008-12-20 Armin Burgmeier - - * libxml++/schema.cc (set_document): Set embedded_doc_ according to - the embed parameter instead of always setting it to false, so that we - actually release the document in release_underlying(). - (release_underlying): Free the schema in all cases, also when the - document was not embedded, to avoid a memory leak. - - * libxml++/validators/schemavalidator.cc (parse_file, parse_memory, - parse_document): Make sure not to leak the xmlSchemaParserCtxtPtr in - case of an exception. Bug #563321, Arjan Franzen. - -2008-12-18 Armin Burgmeier - - * win32_msvc6/: - * Makefile.am: - * configure.in: Removed outdated MSVC6 project. - -2.24.1: - -2008-12-12 Armin Burgmeier - - * MSVC_Net2008/examples/sax_parser/sax_parser.vcproj.HALLWA.Armin.user: - Removed this generated file. It went in by accident. - - * MSVC_Net2008/examples/sax_parser/sax_parser.vcproj: Added the - example project file instead, which should have been added from the - beginning. - -2008-12-12 Armin Burgmeier - - * MSVC_Net2005/libxml++/libxml++.vcproj: - * MSVC_Net2008/libxml++/libxml++.vcproj: Added schema.cc and - schemavalidator.cc to the project. Bug #563664 (Arjan Franzen). - - * MSVC_Net2005/examples/schemavalidation/schemavalidation.vcproj: - * MSVC_Net2005/examples/schemavalidation/Makefile.am: - * MSVC_Net2005/examples/Makefile.am: - * MSVC_Net2005/libxml++.sln: Added the schema validator example to the - MSVC8 solution file. - - * MSVC_Net2008/examples/schemavalidation/schemavalidation.vcproj: - * MSVC_Net2008/examples/schemavalidation/Makefile.am: - * MSVC_Net2008/examples/Makefile.am: - * MSVC_Net2008/libxml++.sln: Added the schema validator example to the - MSVC9 solution file. - -2008-12-12 PrzemysÅ‚aw Grzegorczyk - - * libxml++/schema.cc: Fix a typo to fix the build. - -2008-12-08 Murray Cumming - - * libxml++/validators/validator.cc: check_for_exception(): Use an - auto_ptr<> to avoid leaking the exception, as in - Parser::check_for_exception(). - Bug #563321 (Arjan Franzen) - -2008-12-05 Murray Cumming - - * libxml++/schema.cc: release_underlying(): Use xmlSchemaFree() - to avoid a leak, as suggested by Balazs Tirpak. Bug #312216. - -2008-10-09 Armin Burgmeier - - * MSVC_Net2005/*/*.vcproj: Adapt the new DLL naming convention. - - * MSVC_Net2008/: Added project files for Visual Studio 2008. - - * Makefile.am: - * configure.in: Added the new files to the distribution. - -2.24.0: - - * configure.in: Increased version to match GNOME 2.24: - -2.23.3: - -2008-08-16 Murray Cumming - - * libxml++/attribute.cc: get_value(): xmlGetNsProp() takes the - namespace URI, not the prefix. - Bug #547689 (Sergei Fedorov) - -2008-08-14 Murray Cumming - - * examples/dom_parser/Makefile.am: - * examples/dom_parser/example_with_namespace.xml: - Added an example using namespace prefixes, from bug - #547689. - * examples/dom_parser/main.cc: Comment out the call to set_validate(), - because that example does not have a DTD. - Show the namespace prefixes in the output. - * libxml++/attribute.cc: get_value(): Use xmlGetNsProp() instead of - xmlGetProp(), so we don't ignore the namespace prefix, so we get - the correct value. - Bug #547689 (Sergei Fedorov) - -2008-08-10 Armin Burgmeier - - * MSVC_Net2005/: Renamed from MSVC_Net2003. - - * MSVC_Net2005/libxml++/libxml++.vcproj: Link against libxml2.lib - instead of xml2.lib because that's how it is called in Tor's GTK+ - bundle. - - * MSVC_Net2005/libxml++/libxml++.rc.in: Removed "#include resource.h" - because there is no resource.h. - - * MSVC_Net2005/libxml++/libxml++.sln: Build all examples by default. - - * Makefile.am: - * configure.in: Adapt build files for the MSVC_Net2003 -> MSVC_Net2005 - rename. - -2.23.2: - -2008-05-05 Murray Cumming - - * examples/sax_parser/main.cc (main): Use parse_file() but leave - the parse_chunk() version commented out, to simplify this example. - * examples/sax_parser/myparser.cc - Catch Glib::ConvertError exceptions when using std::cout, though - libxml++ should really always supply valid UTF-8 to us. - -2008-04-14 Armin Burgmeier - - * libxml++/parsers/saxparser.h: - * libxml++/parsers/saxparser.cc: Added a parse_chunk_raw() method and - changed parse_chunk() to use it. - -2.23.1: - -2008-03-26 Murray Cumming - - * examples/schemavalidation/Makefile.am: Corrected a filename to - fix distcheck - * libxml++/schema.h: - * libxml++/validators/schemavalidator.h: Added the newin2p24 doxygen - keyword. - -2008-03-26 Emilien KIA - - * configure.in: - * libxml++/Makefile.am: - * libxml++/libxml++.h: - * libxml++/schema.cc: - * libxml++/schema.h: Added Schema class, similar to the existing Dtd - class. - * libxml++/validators/Makefile.am: - * libxml++/validators/schemavalidator.cc - * libxml++/validators/schemavalidator.h: Added Schema validator class, - similar to the existing DtdValidator class. - - * examples/Makefile.am: - * examples/schemavalidation/: New example, similar to the - existing dtdvalidation example. - - Bug #312216. - -2008-03-26 Murray Cumming - - * docs/Makefile.am: Fixed the post-html rule. - * docs/index.html: Corrected some links. - * libxml++/nodes/node.h: Corrected documentation for the new methods - from the previous commit. - -2008-03-26 Murray Cumming - - * libxml++/nodes/element.cc: - * libxml++/nodes/element.h: Added add_child_text() with a previous_node - parameter, for adding between existing nodes. - Added add_child_text_before() too. - * libxml++/nodes/node.cc: - * libxml++/nodes/node.h: Added add_child() with a previous_node - parameter, for adding between existing nodes. - Added add_child_before() too. - - * docs/index.html: Removed the license clarifications text because I - always found it to be arbitrary and not very informative. - * docs/reference/Doxyfile.in: Added a newin2p24 doxygen keyword. - * docs/reference/Makefile.am: Do not create a version-specific - directory name for reference documentation. The Since: text and links - in the documentation are enough to know what was in what version. - -This is the svn trunk branch. See also the gnome-2-22 branch. - -2.22.0: - -2008-03-07 Deng Xiyue - - * libxml++/document.cc: - * libxml++/document.h: Add a destructor - (does not break ABI because the base class already has a - virtual destructor) that calls xmlCleanupParser to match the - existing call to xmlInitParser() in the constructor. Fixes - a memory leak. - Bug #501168 (Matt G.) - -2008-01-17 Roland Stigge - - * libxml++/attribute.cc: - * libxml++/dtd.cc: - * libxml++/dtd.h: - * libxml++/io/ostreamoutputbuffer.h: - * libxml++/io/outputbuffer.h: - * libxml++/keepblanks.cc: - * libxml++/keepblanks.h: - * libxml++/libxml++.h: - * libxml++/nodes/cdatanode.cc: - * libxml++/nodes/cdatanode.h: - * libxml++/nodes/commentnode.cc: - * libxml++/nodes/commentnode.h: - * libxml++/nodes/contentnode.cc: - * libxml++/nodes/element.cc: - * libxml++/nodes/element.h: - * libxml++/nodes/entityreference.cc: - * libxml++/nodes/entityreference.h: - * libxml++/nodes/node.cc: - * libxml++/nodes/processinginstructionnode.cc: - * libxml++/nodes/processinginstructionnode.h: - * libxml++/nodes/textnode.cc: - * libxml++/nodes/textnode.h: - * libxml++/parsers/domparser.cc: - * libxml++/parsers/domparser.h: - * libxml++/parsers/parser.cc: - * libxml++/parsers/parser.h: - * libxml++/parsers/saxparser.cc: - * libxml++/parsers/textreader.h: - Correct the name of the files in their comment blocks, - though this could just be removed instead. - Bug #510056. - -2008-01-17 Martin Michlmayr > - - * libxml++/parsers/parser.cc: - * libxml++/parsers/textreader.h: - Added includes to fix the build with gcc 4.3 - pre-releases. - Bug #510053. - -2.20.0: - -2007-08-30 Murray Cumming - - * examples/dom_parser_raw/main.cc: When exceptions are disabled, assume that they are also - disabled in glibmm and then use the extra error parameter to Glib::convert(), to fix the - build when using glibmm with disabled exceptions. - * docs/manual/Makefile.am: Use maintainer-clean instead of clean-local to delete the html, - but this still seems to be deleted when building debian packages. - -2.19.2: - -2007-08-29 Murray Cumming - - * scripts/Makefile.am: distcheck fixes. - -2007-08-29 Murray Cumming - - * autogen.sh: - * Makefile.am: - * configure.in: - * scripts/Makefile.am: - * scripts/reduced.m4: Added an --enable-api-exceptions - configure option, which defines LIBXMLCPP_EXCEPTIONS_ENABLED - in libxml++config.h. - * examples/dom_build/main.cc: - * examples/dom_parse_entities/main.cc: - * examples/dom_parser/main.cc: - * examples/dom_parser_raw/main.cc: - * examples/dom_read_write/main.cc: - * examples/dom_xpath/main.cc: - * examples/dtdvalidation/main.cc: - * examples/import_node/main.cc: - * examples/sax_exception/main.cc: - * examples/sax_exception/myparser.cc: - * examples/sax_parser/main.cc: - * examples/sax_parser_build_dom/main.cc: - * examples/sax_parser_entities/main.cc: - * examples/textreader/main.cc: - * libxml++/document.cc: - * libxml++/exceptions/exception.cc: - * libxml++/exceptions/internal_error.cc: - * libxml++/exceptions/parse_error.cc: - * libxml++/exceptions/validity_error.cc: - * libxml++/io/outputbuffer.cc: - * libxml++/io/parserinputbuffer.cc: - * libxml++/libxml++config.h.in: - * libxml++/nodes/contentnode.cc: - * libxml++/nodes/element.cc: - * libxml++/nodes/node.cc: - * libxml++/parsers/domparser.cc: - * libxml++/parsers/parser.cc: - * libxml++/parsers/saxparser.cc: - * libxml++/parsers/textreader.cc: - * libxml++/validators/dtdvalidator.cc: - * libxml++/validators/validator.cc: - Put LIBXMLCPP_EXCEPTIONS_ENABLED ifdefs around uses of - try, catch, and throw, so that libxml++ can build with - CXXFLAGS="-fno-exceptions". However, we might still - need some alternative error checking API. - -2.19.1: - -2007-07-30 Stef Walter - - * libxml++/nodes/element.cc: - * libxml++/nodes/element.h: Added get_attribute_value(), - to get a simple text value for an attribute, as a - convenience. - Patch in bug #373573. - -2007-07-30 Murray Cumming - - * docs/reference/Doxyfile.in: Added newin2p18, - newin2p20, and newin2p22 tags. - -This is the trunk branch for libxml++ 2.19/2.20. -See also the gnome-2-18 branch. - -2.18.2: - -2007-07-25 Christophe de Vienne - - * libxml++/parsers/textreader.cc: get_name(): - Fixed a memory leak. bug #447535. - -2.18.1: - -2007-06-10 Murray Cumming - - * libxml++/document.cc: add_comment(), - * libxml++/nodes/element.cc: add_child_text(): - add_child_comment(): Avoid accessing freed memory - when the text nodes are merged by xmlAddChild(). - -2.18.0: - -2007-02-10 Murray Cumming - - * examples/dom_parse_entities/main.cc: - * examples/dom_parser/main.cc: - * examples/dom_parser_raw/main.cc: - * examples/dom_read_write/main.cc: - * examples/dom_xpath/main.cc: - * examples/dtdvalidation/main.cc: - * examples/sax_parser/main.cc: - * examples/sax_parser_build_dom/main.cc: - * examples/sax_parser_entities/main.cc: Use std::string for file paths, - because we can not know the encoding of file paths. std::string therefore - means unknown encoding. - -2007-02-06 Artur Wegele - - * libxml++/parsers/parser.h: - * libxml++/validators/validator.h: Check for _MSC_VER instead - of WIN32 before setting MSVC++ pragmas, because that is apparently - more reliable. Bug #380110. - -2.17.2: - -2006-10-25 Nate Nielsen - - * libxml++/nodes/node.cc: - * libxml++/nodes/node.h: Node::get_next_sibling(), - Node::get_previous_sibling(). Bug #351867 - -2006-11-17 Nate Nielsen - - * libxml++/parsers/textreader.cc - * libxml++/parsers/textreader.h: Clean up TextReader() data - constructor signature. Removed '-1' as a special null terminated - value. This brings it inline with other parsers. - -2.17.1: - -2006-11-11 Nate Nielsen - - * libxml++/nodes/element.cc: Element::set_attribute(): - Fix redeclaration of variable in if-block. Bug #361950 - -2006-11-11 Nate Nielsen - - * libxml++/parsers/textreader.cc - * libxml++/parsers/textreader.h: TextReader() can now parse - memory buffers as well as files. Bug #351215 - -2006-11-11 Nate Nielsen - - * libxml++/nodes/node.cc: - * libxml++/nodes/node.h: Add Node::get_parent() Bug #351876 - -2006-04-24 Cedric Gustin - - * configure.in: Disable autoheader. - * config.h.in: New file. Added comments about the difference - between config.h.in and libxml++config.h.in. - -2006-04-21 Cedric Gustin - - * libxml++/Makefile.am: Added libxml++config.h.in to EXTRA_DIST. - -2006-04-21 Cedric Gustin - - * MSVC_Net2003/*.vcproj: Updated for Visual Studio 2005. Added the - /vd2 compiler flag (Bug #158040). Renamed target DLL to - xml++-2.6 to comply to the value returned by "pkg-config --libs - --msvc-syntax libxml++-2.6". - * MSVC_Net2003/libxml++.sln: Updated for Visual Studio 2005. - * MSVC_Net2003/gendef/gendef.cc: Redirect output of dumpbin to a - file. - * MSVC_Net2003/libxml++/Makefile.am: Get a local copy of the - libxml++config.h file created at configure time and distribute it - in the source tarball. - * libxml++/Makefile.am: Add -DLIBXMLPP_BUILD to the DEFS compiler - flags (switch between dllexport/dllimport on win32). Also install - libxml++config.h to $(prefix)/lib/libxml++-2.6/include. - * libxml++/*/*.Makefile.am: Add -DLIBXMLPP_BUILD to the DEFS - compiler flags (switch between dllexport/dllimport on win32). - * libxml++/exceptions/exception.h: Tag the xmlpp:exception classs - with LIBXMLPP_API to get rid of auto-import errors on win32 - (mingw32/cygwin). - * libxml++/libxml++config.h.in: New file. Define LIBXMLPP_API and - switch between dllimport and dllexport on win32. - * libxml++-2.6.pc.in: Add ${libdir}/libxml++-2.6/include to Cflags - (for libxml++config.h). - * configure.in: Added test for a native win32 platform. Use the - ms-bitfields on this platform only. Added the libxml++config.h - configuration file. - -2.14.0: - -2006-03-13 Christophe de Vienne - - * docs/index.html: Updated version number - -2006-03-13 Christophe de Vienne - - * NEWS, configure.in: Prepared release 2.14.0 - -2006-03-08 Murray Cumming - - * libxml++/nodes/contentnode.h: get_content() documentation: - Replace the TODO because I know know that apos is the fifth - predefined entity. - set_content(): Mention that the predefined entities are used - _where necessary_ because XML does not require use of quot or - apos in text nodes - just in attribute values. - -2.13.1: - -2005-12-20 Murray Cumming - - * docs/manual/libxml++_without_code.xml: Mention pkg-config. - -2005-12-16 Murray Cumming - - * libxml++/document.h: Minor grammar fixes in documentation. - * libxml++/nodes/node.h: Correct find() documentation slightly. - -2005-12-15 Robert Fleming - - * libxml++/nodes/node.cc: - * libxml++/nodes/node.h: Add find() overload that - takes namespaces to register, using xmlXPathRegisterNs(). - Bug #323935. - -2005-12-15 Murray Cumming - - * libxml++/nodes/node.cc: set_namespace(): Pass 0 to - xmlSearchNs() for empty (default) namespaces, instead of - an empty string, as we do elsewhere. This makes - Document::create_root_node() for when not specifying a - namespace. Bug #318186 from Erik Oestby. - -2005-12-15 Vadim Zeitlin - - * docs/reference/Doxyfile.in: Fix paths so buildir!=srcdir - builds work. Bug #319863. - -2005-09-21 Christophe de Vienne - - * libxml++.spec.in: Fixed include and .pc paths. Fixes #316827. - -This is the HEAD branch, for API additions. See also the gnome-2-12 branch. - -2.12.0: - -2005-08-26 Christophe de Vienne - - * libxml++/parsers/textreader.h: Added xmlReadState "Reading" as - suggested by Sebastian Moss. - -2.11.0: - -2005-08-25 YS - - * libxml++/Makefile.am: Changed link order to solve a link issue - on cygwin. Bug #314419. - -2005-06-13 Marek Rouchal - - * libxml++/io/istreamparserinputbuffer.cc: - * libxml++/io/istreamparserinputbuffer.h: - * libxml++/io/parserinputbuffer.cc: - * libxml++/io/parserinputbuffer.h: Remove extra ;s. - Bug #307481 - -2005-05-15 Murray Cumming - - * libxml++/document.h: Add comments about possibly deriving this - from Node, though it needs investigation, and we can not do this - in the stable API. - * libxml++/nodes/node.cc: get_namespace(), get_namespace_prefix(): - Return an empty string if the node is actually a Document, because - the underlying xmlDocument struct has no ns field. This should - prevent the crash in bug #161825. - -2005-05-15 Murray Cumming - - * docs/index.html: Add link to the LGPL text. - -2005-04-24 Murray Cumming - - * libxml++/parsers/domparser.cc: parse_context(): - Delete the context after, not before, checking it for an error. - Bug #156352 from Jim Garrison. - -2005-04-24 Murray Cumming - - * libxml++/parsers/saxparser.cc: SaxParserCallback::characters() - Call on_characters(), not on_cdata_block(), so that the correct - derived handler is called. Bug #301712 and patch from - Aaron Walker. - -2005-04-24 Murray Cumming - - * libxml++-2.6.pc.in: Remove -I for the include location of - a config file, because we don't install one. Bug #301727 - from Aaron Walker. - -2005-03-15 Murray Cumming - - * libxml++/document.cc: set_entity_declaration(): Pass 0 instead - of empty strings for the public ID and system ID, if an empty - string is provided. This stops libxml from using a useless empty - string. - -2005-03-09 Cedric Gustin - - * MSVC_Net2003/Makefile.am: Add blank.cpp to EXTRA_DIST. - * MSVC_Net2003/examples/*/*.vcproj: Change name of PDB file to - $(OutDir)/$(TargetName).pdb. - -This is the HEAD branch. - -2.10.0: - -2005-03-08 Christophe de Vienne - - * docs/reference/Makefile.am: Added one more rule so the "make - distcheck" works from a clean cvs working copy. - -2005-03-08 Christophe de Vienne - - * docs/manual/Makefile.am, docs/reference/Makefile.am: Added a few - rules so that "make dist" generated the documentation if it's - absent. - -2005-02-15 Murray Cumming - - * docs/manual/Makefule.am: Added insert_example_code to EXTRA_DIST, - though it should not be needed when building from a DIST anyway, - because we distribute the html. - -2.9.2: - -2005-02-13 Christophe de Vienne - - * docs/manual/Makefile.am: Removed README from EXTRA_DIST. - -2005-02-12 Christophe de Vienne - - * libxml++/nodes/node.cc: Fixed a little inefficency in find (#161925) - -2005-02-11 Murray Cumming - - * docs/: Added manual. - * configure.in: Use GLIBMM_CHECK_PERL to get the perl path, needed - to insert the example code in the manual. - * docs/Makefile.am: Move the reference and manual into a docs folder - so that the docs and the examples have the same relative path. - * docs/index.html: Mention the manual and update the links. - -2005-02-11 Murray Cumming - - * libxml++/document.cc: do_write_to_string(): libml returns the - number of bytes instead of the number of characters, so use the - appropriate ustring constructor, to avoid an exception later. - Bug found by Cyril Picard. - * docs/reference/Makefile.am: Install the reference documentation. - Distribute the built reference documentatoin, and Do not rebuild it - every time. - * docs/reference/Doxyfile.in: Generate doxygen tags so that other - documentation can link to the libxml++ documentation. Use the - libstdc++ and glibmm doxygen tags to link to their documentation, - for instance for Glib::ustring. - -2005-01-26 Cedric Gustin - - * MSVC_Net2003/README: Updated for 2.8.0 - -2005-01-26 Cedric Gustin - - * configure.in: parse micro version tags at configure time (for - libxml++.rc). Added support for shared libraries (DLL) on - win32. Added MSVC_Net2003 Makefiles. - * Makefile.am: Added MSVC_Net2003 subdir. - * libxml++/Makefile.am: Added linker flags for shared libraries - (DLL) on win32. - * examples/Makefile.am_fragment: Removed trailing slash in INCLUDES. - * MSVC_Net2003/*: Initial release. - -2.9.1: - -2004-12-25 Murray Cumming - - * libxml++/parsers/domparser.[h|cc], saxparser.[h|cc]: Added - parse_memory_raw() for libxml documents that are not utf8-encoded or - are encoded in an unknown encoding. - * examples/: Added dom_parser_raw() to test parsing of UCS2-encoded - text. - -2004-12-20 Murray Cumming - - * This is the HEAD branch, for gnome 2.9/2.10. - -2004-12-18 Murray Cumming - - * libxml++/docs/index.html: Bugs: Minor english corrections, and - more useful bugzilla links. - * libxml++/docs/Makefile.am: Build the reference documentation as - part of the main cvs build, but distribute it so that it does not need - to be rebuilt when building a tarball. - -2004-12-18 Murray Cumming - - * libxml++/nodes/node.cc: Node::find(): Check the result of - xmlXPathEval and throw an exception about invalid xpaths, instead of - crashing. Bug #161549 from Caleb Epstein. - -2004-12-18 Murray Cumming - - * libxml++/parsers/saxparser.cc: parse_memory(), parse_chunk(), - domparser.cc: parse_memory, parse_chunk(): Use Glib::ustring::bytes() - to get the size of the array, not size() or length(), which gets - the number of utf8 characters. It might not even be utf8. - * examples/sax_parser_build_dom/svgparser.cc: Use !empty() instead of - size() > 0. It is more efficient. - -2004-11-30 Murray Cumming - - * libxml++/validator.h: Removed an extra ; that g++ 3.4 complains - about. - -2.8.0: - -2004-09-12 Murray Cumming - - * libxml++/libxml++.h: Add include for xmlreader.h. - * examples/saxparser/myparser.cc, saxparser_entities/myparser.cc: - Correct (and uncomment) the code to read the attribute values. - -2.7.1: - -2004-09-06 Christophe de Vienne - - * configure.in: Prepared release 2.7.1. - -2004-08-13 Christophe de Vienne - - * libxml++/parsers/domparser.cc, libxml++/parsers/parser.cc: Fixed - bug #150082. - -2.7.0: - -2004-06-24 Murray Cumming - - * configure.in, Makefile.am, libxml++-2.*.pc.in: Reverted the changes - that made it install a 2.8 pc.in file, and which decreased the .so - name. 2.8 is not parallel-installable with 2.6, and this would only - have been a half-done transition if it was. - -2004-06-22 Murray Cumming - - * libxml++/io/outputbuffer.cc, inputbuffer.cc: - Added include of libxml/globals.h before include of libxml/xmlIO.h, - because xmlIO.h needs the definition of - xmlParserInputBufferCreateFilenameFunc. - -2004-05-28 Christophe de Vienne - - * configure.in, examples/Makefile.am, examples/dtdvalidation/Makefile.am, - examples/dtdvalidation/example.dtd, examples/dtdvalidation/main.cc, - libxml++/Makefile.am, libxml++/dtd.[h|cc], libxml++/io/Makefile.am, - libxml++/io/istreamparserinputbuffer.[h|cc], - libxml++/io/parserinputbuffer.[h|cc], - libxml++/libxml++.h, libxml++/validators/Makefile.am, - libxml++/validators/dtdvalidator.[h|cc] - libxml++/validators/validator.[h|cc]: - Integrated dtdvalidator patch proposed by Guillaume Arreckx. - Modified a bit the patch: - - renamed *.cpp -> *.cc - - fixed a few comments which where copy/paste from other files - - replaced std::string with Glib::ustring - - Added Dtd::cobj, since the patch rely on it. - - added a validaty_error as suggested by jon - - -2004-04-26 Christophe de VIENNE - - * libxml++/nodes/contentnode.cc: Fixed set_content which used xmlNodeAddContent - instead of xmlNodeSetContent (thanks to Marcello Orizi who outlined it). - -2004-05-05 Christophe de Vienne - - * libxml++/parsers/saxparser.cc: One more (last one I hope) change - about Glib::ustring instanciation from a buffer + lenght. We now - use Glib::ustring::ustring(In begin, In end) constructor. Thanks to - Jonathan Wakely. - -2004-05-04 Christophe de Vienne - - * libxml++/parsers/saxparser.cc: Replaced again the use of - Glib::ustring(const char*) constructor by Glib::ustring(std::string). - Fixes #141824. - -2004-05-04 Christophe de Vienne - - * libxml++/parsers/saxparser.cc: Replace the use of - Glib::ustring(const char*, unsigned) constructor by Glib::ustring(const char*). - Fixes #141824. - -2004-05-04 Murray Cumming - - * libxml++-2.6.pc.in: Made it require glibmm-2.4, so that apps do not - have to check for this themselves. - -2.6.0: - -2004-04-13 Murray Cumming - - * libxml++/Makefile.am: Change library name to 2.6 instead of 2.5. - * libxml++-2.6.pc.in: Report the changed library name. - -2004-03-27 Murray Cumming - - * libxml++/parsers/textreader.[h|cc]: Correct constness of - get_current_node(), so there is a const and non-const version. - -2.5.2: - -2004-02-16 Christophe de VIENNE - - * libxml++/nodes/element.cc: Check return value of xmlHasNsProp to - fix issue #134390 (as reported by John Coyle). Use xmlHasProp instead - of testing each attributes. - -2004-02-16 Christophe de VIENNE - - * libxml++-2.6.pc.in: Added libxml-2.0 to Requires: and removed - @LIBXML_LIBS@ from libs, as suggested by Albert Chin. - -2004-02-16 Christophe de VIENNE - - * libxml++/nodes/node.cc, libxml++/parsers/parser.h: - Merged in patches from Albert Chin to get libxml++ build using the SUN, - HP, SGI & AIX C++ compilers. - -2004-02-13 Jim Garrison - - * libxml++/attribute.h, libxml++/document.h, libxml++/dtd.h, - libxml++/io/ostreamoutputbuffer.[h|cc], - libxml++/io/outputbuffer.[h|cc], libxml++/keepblanks.[h|cc], - libxml++/nodes/node.h, libxml++/parsers/parser.h, - libxml++/parsers/saxparser.h, libxml++/parsers/textreader.[h|cc]: - Removed unnecessary semicolons - -2.5.1: - -2004-02-08 Jim Garrison - - * libxml++/document.[h|cc]: added Document::cobj() function - -2004-02-06 Christophe de Vienne - - * libxml++/parsers/sax_parser.cc: Fixed issue #132014. - -2004-02-06 Christophe de Vienne - - * libxml++/parsers/[Makefile.am|textreader.h|textreader.cc]: Added - TextReader interface. It is almost the patch which is here : - http://sourceforge.net/tracker/index.php?func=detail&aid=842730&group_id=12999&atid=312999 - with Glib::ustring instead of std::string, and member functions names - changed to be consistent with other interfaces. - * configure.in, examples/Makefile.am, examples/textreader: Added an example - of TextReader interface. - -2004-02-05 Jim Garrison - - * libxml++/document.[h|cc]: added create_root_node_by_import() - -2004-01-13 Christophe de Vienne - - * libxml++/io/document.cc: Gives NULL strings instead of empty ones to - xmlCreateIntSubset. Fixes issue #131329. - -2004-01-12 Christophe de Vienne - - * libxml++/io/outputbuffer.cc: Fix return value of xmlIO callbacks. (Fixes - issue #131018). - -2003-12-19 Murray Cumming - - * configure.in: Added glibmm-2.4 to the pkg-config check. - * Used regexxer to do a complete std::string/Glib::ustring rename. - Everything seems to still work. I think the parse_chunk(stream) - stuff might need some attention/thought. - -2003-12-19 Murray Cumming - - * removed acinclude.m4 because we do not need it anymore because - we do not need AM_LIBXML now that we use pkg-config. - * libxml++/Makefile.am: Generate a library with 2.5 in the name, - instead of 1.0 - * configure.in: Change version to 2.5.0. - * examples/Makefile.am_fragment: Link to the new library name. - * Renamed libxml++-1.0.pc.in to libxml++-2.6.pc.in: and changed the - library name that pkg-config reports for --libs. - * So, this is now the libxml++ 2.6 API, with a library name of 2.5 - while it is unstable. It is parallel-installable with libxml++ 1.0. - -This is the HEAD branch, for libxml++ 2.5/2.6. - -1.0.0: - -2003-12-18 Ephraim Vider - * examples/sax_parser_build_dom/svgelement.cc,svgpath.h: - - removed unneeded method qualification (msvc6 error) - * examples/sax_parser_entities/myparser.cc: - - removed namespace qualification (msvc6 error) - - removed return from void function - -2003-12-18 Ephraim Vider - - * win32_msvc6: updated MSVC projects to include new sources and examples - -2003-12-12 Christophe de Vienne - - * libxml++/parsers/sax_parser.cc: removed initialisation of userData - with this at the context creation (solution given by Murray). - -2003-12-11 Murray Cumming - - * libxml++/Makefile.am: Generate a library with 1.0 in the name, - instead of 0.1 - * configure.in: Change version to 1.0.0, and change shared library - version to 1.0.0 because we are staring again witt the first - version of a new shared library. - * examples/Makefile.am_fragment: Link to the new library name. - * libxml++-1.0.pc.in: Change the library name that pkg-config - reports for --libs. - -2003-12-08 Ephraim Vider - - * libxml++/document.cc: remove return statement from void functions - -0.28: - -2003-12-08 Christophe de Vienne - - * libxml++.spec.in: Removed libxml++.m4 and xml++-config from %files - section. - -2003-12-08 Murray Cumming - - * examples/ Added sax_parser_build_dom example from Dan Dennedy. - It does some funky stuff (see the comments) but it is an - interesting concept. See the description in examples/README. - -2003-12-03 Christophe de Vienne - - * configure.in: use libxml-2.0 instead of xml2 for libxml2 detection - by pkg-config. - * libxml++/parser/sax_parser.[h|cc]: Replaced AttributeMap by AttributeList, - which is now an ordered container (std::deque). Added a functor that can be - used with std::find_if to get an Attribute by it's name. - * libxml++/document.h: Fixed a typo in a doxygen command. - -2003-12-03 Murray Cumming - - * examples/README: explained what the examples do. - -2003-11-28 Christophe de Vienne - - * libxml++/docs/index.html: Added libxml2 version we relay on, as - suggested by Paul Breslin. - * configure.in: Prepared 0.28 release. Check for libxml2 >= 2.5.8 using - pkg-config instead of old-style autoconf macro. - * acinclude.m4: Removed. - -2003-11-27 Murray Cumming - - * Added examples/sax_parser_entites to test the new functionality. - * Added doxygen documentation to almost every class and method, - including mentioning that the parse methods throw exceptions. - -2003-11-27 Murray Cumming - - * Applied patch from Dan Dennedy to add entity handling to the - SAX parser, using a 2nd Document instance to manage the entity - definitions in order to provide a default entity reference resolver - implementation for on_get_entity(). With some minor changes from me. - -2003-11-13 Christophe de Vienne - - * libxml++/io/Makefile.am: Made libio a non installed library. - * libxml++/document.cc: Fixed a serious issue with threading: callbacks - were defined only for the main thread. - -0.27: - -2003-10-28 Murray Cumming - - * libxml++/nodes/element.[h|cc]: Changed get_child_content() to - get_child_text(), set_child_content() to set_child_text(), - add_comment() to add_child_comment(), and add_content() to - add_child_content() to make the API clearer. - -2003-10-25 Christophe de Vienne - - * libxml++/document.[h|cc]: Added Document::add_comment and added some - documentation. - -2003-10-22 Murray Cumming - - * libxml++/parsers/saxparser.[h.cc]: Added on_entity_declararation() - callback, and demonstrated it in examples/sax_parser/. - Added documentation to on_get_entity() giving clues about how to use - it, though it is too difficult for me to try. - -2003-10-18 Christophe de Vienne - - * All: All private members previously having a leading underscore in their - name now have it postfixed. Ex: _impl becomes impl_. - -2003-10-18 Christophe de Vienne - - * libxml++/io/outputbuffer.[h|cc]: Removed conversion operator to - underlying C structure. cobj() is now public. - * libxml++/document.cc: use OutputBuffer::cobj() instead of implicit - conversion. - -2003-10-18 Christophe de Vienne - - * libxml++/nodes/Makefile.am: Removed some trailing white spaces after a - backslash. - -2003-10-14 Murray Cumming - - * Added lots of doxygen documentation, try to document everything 100%. - * libxml++/nodes/element.[h|cc]: Made get_attributes() non-const - and added a const get_attributes() const overload, like - Node::get_children(). - * Moved AttributesList typedef from Node to Element, because that's - where it is used. - * libxml++/parsers/parser.[h|cc]: Added get/set_substitute_entities(), - like get/set_validate(), which affects _context->replaceEntities in - initialize_context(). - * Added libxml++/nodes/entityreference.[h|cc], with a - get_resolved_text() method. - * libxml++/document.cc: - - on_libxml_construct(): For the default, used when a node is not - recognised, create a Node rather than a ContentNode. Everything is a - Node so this should have less chance of being wrong. - - Added case to create an EntityReference. - * Added examples/dom_parse_entities. - -2003-09-30 Jonathan Wakely - - * libxml++/document.cc, libxml++/nodes/element.cc, - libxml++/nodes/node.cc: Preserve const-quals when casting between - strings of different character types. - -2003-09-26 Christophe de Vienne - - * libxml++/io/outputbuffer.[h|cc]: Yet another cleaning of the interface - and implementation. OutputBuffer is now non copyable, and the callback - process is now the same for write and close. - * libxml++/io/(ostream)outputbuffer.h: Added Doxygen documentation. - -2003-09-26 Christophe de Vienne - - * libxml++/io/: Small corrections after Murray comments on the patch. It's - even more clean now. - -2003-09-26 Christophe de Vienne - - * libxml++/io/: Added classes to wrap xmlIO output buffers. This classes - are OutputBuffer and OStreamOutputBuffer. - * libxml++/document.h: - - Added write_to_stream, which is implemented thanks to OutputBuffer. - - Removed virtual specifier on write_to_xxx functions. Their - implemention now calls a private virtual function do_write_to_xxx. This - also avoid having almost identical functions implementation in normal and - formatted versions of the functions. - -2003-09-24 Christophe de Vienne - - * libxml++/examples/dom_build/main.cc: Now demonstrate add_comment - too. - -2003-09-24 Dan Dennedy - - * libxml++/nodes/element.[h|cc]: Added Element::add_comment. - -2003-09-23 Christophe de Vienne - - * libxml++/document.h, libxml++/keepblanks.h, libxml++/noncopyable.h, - libxml++/nodes/node.h: Updated documentation. - -0.26: - -2003-09-22 Christophe de Vienne - - * examples/dom_build/main.cpp: Use Element::set_attribute instead of - Element::add_attribute which no longer exists. - -2003-09-19 Murray Cumming - - * libxml++/node/element.h: Removed add_attribute because it is the same as - set_attribute. - -2003-09-18 Murray Cumming - - * libxml++/node/element.h: Added set_namespace_declaration(). - element, node: methods take prefix instead of uri and prefix, because - that's what we want to specify most of the time. If no such namespace - prefix has been declared then an exception will be thrown. If we want - to specify a node name and attribute namespaces by uri (which would - result in a prefix in the eventual .xml code) then we could add those - methods later. If anybody needs them. - -2003-09-17 Christophe de Vienne - - * docs/reference/Doxyfile(.in): Doxyfile is now generated from Doxyfile.in - by configure so the version number is included in main page. The dot image - format is changed to png, the index is not disabled anymore. - -2003-09-15 Fredrik Arnerup - - * libxml++/document.cc: Added a call to xmlInitParser to avoid - threading problems. - -2003-09-05 Murray Cumming - - Based on the patch from Dan Dennedy, with changes: - * libxml++/node.[h|cc], - libxml++/element.[h|cc]: Added namespace_uri and namespace_prefix - parameters to methods, to support speficiation of nodes and children - also with namespace information. - * Added Node::get_namespace_prefix() and get_namespace_uri() and - set_namespace(). - * examples/dom_build/: Modified the example to do namespace stuff, - to test this. - -2003-08-20 Murray Cumming - - * libxml++/node.[h|cc]: import_node() now takes a _const_ Node, as - suggested by Rafael Vuijk. - -2003-07-20 Ephraim Vider - - * win32_msvc6: libxml++.dsp, examples/import_node.dsp, examples/Makefile.am: - - added import_node example project - -0.25: - -2003-07-16 Christophe de Vienne - - * libxml++.m4, xml++-config.in, configure.in, Makefile.am: removed old-style - autoconf libxml++ detection macro and script. - -2003-07-15 Christophe de Vienne - - * all but exceptions/*.[h|cc]: removed throw specification from functions - declaration. - -2003-07-11 Eric Bourque - - * nodes/node.[h|cc]: Added import_node function - * examples/import_node: Added an example of using import_node, and modified - autoconf files accordingly. - -2003-06-25 Ephraim Vider - - * win32_msvc6: libxml++.dsp: added _REENTRANT to support libxml with threads - - examples/Makefile.am: added new example project - -2003-06-16 Christophe de Vienne - - * docs/index.html: Added a link to Doxygen website. - -2003-06-16 Ephraim Vider - - * win32_msvc6/*: Fixed MSVC6 project files. - -2003-06-13 Christophe de Vienne - - * docs/Makefile.am: Fixed the post-html rule which was sending twice the - reference. - * docs/index.html: Added keyword "XML". - -0.24: - -2003-06-11 Christophe de Vienne - - * libxml++/parsers/domparser.cc: - - Fixed parse_stream. Parsing success was not checked before creating - Document. - - Check for errNo after parsing. - -2003-06-02 Ephraim Vider - * libxml++/nodes: - Added ContentNode as a base class for all non-element nodes - - TextNode and CommentNode are derived from ContentNode - - Added CdataNode and ProcessingInstructionNode as specific types - derived from ContentNode - - Will create ContentNode as a default node type when assert is - disabled - - Modified dom_parser example to better handle new types - Modified files: textnode.[h|cc] commentnode.[h|cc] - Added files: contentnode.[h|cc] cdatanode.[h|cc] processinginstructionnode.[h|cc] - - * node.cc: - Fix. return empty string and not 0 - * updated MSVC projects to include new sources and example - -2003-06-10 Jonathan Wakely - - * libxml++/parsers/saxparser.cc: Replace with - to support older compilers. - -2003-06-06 Christophe de Vienne - - * libxml++/document.cc: Little change in write_to_xxx_formatted. The - keepblanks parameter is kept to true, but xmlIndentOutputTree is set to 1. - This avoid libxml2 to add some significant whitespace into content nodes, - but still format the output. - -2003-06-05 Christophe de Vienne - - * libxml++/keepblanks.[h|cc]: Moved KeepBlanks::Default definition - to .cc file if compiler is MSVC 6.0. - -2003-06-04 Morten Hanssen - - * libxml++/Document.cc: Fixed a memory leak in - write_to_string[_formatted]() functions. - -2003-06-02 Murray Cumming - - * libxml++/Document.[h|cc]: Removed the standalone parse_* methods - because they just duplicate functionality and nobody seems to be - using them. - Renamed the private construct() and destruct() callbacks to - on_libxml_construct() and on_libxml_destruct() and added some - simple comments to explain their purpose. - * libxml++/node.[h|cc]: Added Node::is_white_space(), to make it - easier for the application to ignore white space. Used it in - the dom_parser example.. - -2003-05-29 Murray Cumming - - * Removed some struct keywords from method and variable definitions. - They don't seem to be necessary, and they do not match the method - definitions in the .cc files. - * Some syntax clean-up - tabs to spaces and adding spaces. - * examples/dom_parse/main.cc: Say when something is a text node. - -2003-05-28 Christophe de Vienne - - * lixml++/document.[h|cc]: Added write_to_file_formatted and - write_to_string_formatted. - -2003-05-25 Jonathan Wakely - - * libxml++/parsers/saxparser.cc: Included - -2003-05-23 Jonathan Wakely - - * libxml++/parsers/saxparser.[h|cc]: Correct comments. - -2003-05-23 Christophe de Vienne - - * all header files: Removed libxml2 headers inclusion. Added necessary - forward declaration of libxml2 structures. - * libxml++/parsers/saxparser.[h|cc]: Moved static callback functions into - a struct defined only in the .cc file, SaxParserCallback. - Added boolean parameter to SaxParser constructor to activate on_get_entity - callback (default to false). This technique could eventually be extended to - other functions in the future. - * libxml++-1.0.pc.in: removed libxml headers include path from Cflags. - -2003-05-22 Christophe de Vienne - - * libxml++/nodes/node.[h|cc]: Added Node::set_name(). - -2003-05-20 Christophe de Vienne - - * libxml++/nodes/[node.cc|element.h]: Minor syntax adjustments to allow - compiling with g++ -ansi -pedantic -Wall without any warning. - -0.23: - -2003-05-20 Christophe de Vienne - - * libxml++/keepblanks.[h|cc]: New KeepBlanks class which change settings - related to xmlKeepBlanksDefault and xmlIndentTreeOuput. - * libxml++/[document.cc|parsers/*parsers.cc]: use KeepBlanks instead of - manually call xmlKeepBlanksDefault(). Significant white spaces are not - removed/added anymore. - * example/dom_read_write/example_output.xml: removed. - -2003-05-16 Murray Cumming - - * libxml++/noncopyable.[h|cc]: New xmlpp::NonCopyable base class, which - should prevent people from using automatically-generated copy - constructors when they shouldn't. Not tested yet. - * libxml++/examples/dom_read_write: New example/test. This does - show that we are removing significant white space. This has been - discussed on the list and apparently Christophe has a fix for it. - -2003-05-06 Andy Glew - - * libxml++/nodes/node.cc: Node::find( nonexistent_xpath ) now return - empty NodeSet - -2003-04-24 Christophe de Vienne - - * libxml++/parsers/saxparser.cc: Fixed a memory leak pointed by "thierry" - . The sax handler of the context is not reset - to 0 before context release anymore. In parse() the default one is saved - then restored after effective parsing, so libxml handle itself its - destruction. - -2003-04-20 Christophe de Vienne - - * libxml++/document.cc: Removed a warning message that was put on std::cout - if an unknown type of node was created and replaced it by an assert. This - avoid the need to include iostream(.h). - -2003-04-18 Murray Cumming - - * Applied Jaka Jejcic's patch to fix compilation on NetBSD, including - iostream.h instead of istream.h. - -2003-04-09 Eric Bourque - - * libxml++.spec.in: modified spec file to be library version agnostic. - -2003-03-19 Ephraim Vider - - * added msvc support in win32_msvc6. - -2003-03-17 Ephraim Vider - - * Modified sax_exception example: - - corrected Clone() return type for MyException in myparser.[h|cc] - - catch all exceptions in main.cc - handle real errors too - -0.22: - -2003-03-15 Murray Cumming - - * libxml++/parser/domparser.cc: Added const overload of get_document(). - -2003-03-13 Christophe de Vienne - - * libxml++/parser/domparser.cc: Test if context creation is - successfull in the different parse_xxx functions. If it is no an - internal_error is thrown. - -2003-03-06 Ephraim Vider - - * made DomParser a wrapper around Document - removed all functions that were duplicates of document - functions and added get_document() - files: domparser.[h|cc] document.h - - * fixed compilation errors for msvc: - - corrected Clone() return type for derived exceptions - - corrected getline to std::getline in saxparser.cc - - changed clear() to erase() in parser.cc - - added #define for vsprintf in parser.h - - fixed warning in element.cc - -0.21: - -2003-02-21 Eric Bourque - - * Added spec.in, for creating RPMs. - -2003-02-20 Murray Cumming - - * libxml++/nodes/node.[h|cc]: Moved get_child_content(), - set_child_content(), add_content(), and has_content() from Node to - derived Element class instead of just throwing an exception if it - isn't an Element. This means you can't use set_child_content() on a - TextNode - you should be using TextNode::set_content() anyway, which - makes a lot more sense. Corrected set_child_content() to create a - TextNode instead of creating a node with the content as the name, - fixing the output of the dom_build example. - -2003-02-20 Murray Cumming - - * libxml++/parsers/parser.[h|cc]: - initialize_contex(): Request iniitialization and connect callbacks - check_exception(): Throw exception if any validation problems have - been found - the messages are built up gradually by repeated - callbacks. - set_validate(): Enables validation before calling parse_*(). - Alternatively, use 2nd bool parameter to the DomParser constructor. - * libxml++/exceptions/: Added validation_error class. - * examples/dom_parser: Added a DTD and changed example.xml to - something that uses it. Also added example_invalid.xml to test - the exceptions. - -2003-02-12 Ole Laursen - - * examples/sax_parser/main.cc: Added chunk-wise parsing to the - example. - - * libxml++/parsers/saxparser.[h,cc]: Added functionality for - parsing chunks of data. - -2003-02-17 Murray Cumming - - * libxml++/parsers/*.[h|cc]: All parsing is now done via contexts, - which required a little duplication of the implementation of functions - such as xmlParseFile(), most of which is now in - DomParser::parse_context(). This avoids use of global functions such - as xmlKeepBlanksDefault() by setting these booleans directly in the - context, in Parser::initialize_context(). - However, xmlCreateFileParserCtxt() does seem to be affected by - xmlKeepBlanksDefault so we still have to use it temporarily, restoring - the old value afterwards - see the comments in DomParser::parse_file(). - This should allow us to add validation to the API. - -0.20: - -2003-02-15 Murray Cumming - - * libxml++/nodes/node.cc: (remove_child): Implemented it with - xmlUnlinkNode and xmlFreeNode, so that it's actually removed. - -2003-02-15 Murray Cumming - - * Added examples/dom_xpath, with code from Stefan Seefeld's dom - example. - -2003-02-15 Murray Cumming - - * Reverted the Node::child_iterator API change because it was - undiscussed and is unfinished. The BRANCH_1_0 and HEAD branches are now - merged. BRANCH_1_0 should no longer be used. This was never in 0.19. - -0.19: - -2003-02-07 Murray Cumming - - * Moved method implementations such as get_attributes() into derived - classes instead of using "using methodname();". That seems clearer. - However it shows that we should probably create a shared base class for - Content and Comment, as in the DOM. - -2003-02-06 Murray Cumming - - * libxml++/parsers/saxparser.[h|cc]: Corrected some coding style. - -2003-02-06 Murray Cumming - - * Changed c_obj() to cobj() because it's more like gobj() used in - gtkmm, gnomemm, etc. - -2003-02-06 Murray Cumming - - * libxml++/nodes/node.*: Corrected code style. - -2003-02-06 Murray Cumming - - * libxml++/nodes/node.[h|cc], libxml++/attribute.[h|cc]: Made c_obj() - accessors public so people can use them. Provided const and non-const - versions of them. Put implementation in .cc file. - * Reverted some of Stefan's coding style changes and corrected the - coding style in libxml++/nodes/document.[h|cc]. - * libxml++/document.h: Made the destructor virtual, because there are - virtual methods. - -2002-02-04 Stefan Seefeld - - * libxml++/node.[h,cc]: add new insert_child and append_child methods - (using new iterators), add get_path and find methods for xpath lookup - - * examples/dom: new example code to illustrate the new features - -2002-02-03 Stefan Seefeld - - * libxml++/node.h, libxml++/parsers/saxparser.[h,cc], - examples/sax_parser/*.[h,cc], examples/sax_exception/*.[h,cc]: - SaxParser::AttributeMap is now a map. - -2002-02-03 Stefan Seefeld - - * libxml++/node.h: add child_iterators for simple C++ style - iteration (to get eventually rid of NodeList) - -2002-02-03 Stefan Seefeld - - * libxml++/attribute.[h,cc], libxml++/nodes/node.[h,cc], - libxml++/document.cc: derive Attribute from Node, and make - get_value() use libxml2 accessor instead of raw pointer - -2002-02-03 Stefan Seefeld - - * libxml++/document.[h,cc], libxml++/parsers/domparser.[h,cc], - libxml++/libxml++.h, libxml++/Makefile.am: introduce new Document type. - * examples/dom_build/main.cc: make dom_build example use new - Document type - -2002-02-03 Stefan Seefeld - - * acinclude.m4: The AM_LIBXML macro now checks for a libxml2 - version >= 2.5.1. - * libxml++/nodes/node.cc: compare strings, not pointers, in - get_attribute() - -2003-01-31 Stefan Seefeld - - * various: overall change to use libxml2 as implementation, - not only as I/O backend. With corrections by Murray Cumming. - Further explanation by murrayc: Instead of maintaining its own - C++ data structures and then creating libxml data structures from them, - it now manipulates the libxml data structures directly, so the C++ and C - APIs are always in sync. - -2003-01-21 Valentin Rusu - - * added CDATA section handler to SaxParser - -2003-01-05 Valentin Rusu - - * fixed a potential buffer overflow problem into saxparser.cc - -0.18: - -2003-01-31 Stefan Seefeld - - * various: overall change to use libxml2 as implementation, - not only as I/O backend. - -2003-01-05 Murray Cumming - - * examples/dom_build/main.cc: Removed some useless test C code. - -2002-12-24 Morten Brix Pedersen - - * Include instead of to compile on gcc 2.95.4. - -2002-12-26 Murray Cumming - - * libxml++/nodes/element.c (write): Add back the code to write the - attributes to the C libxml structure. This code got lost during the - refactoring. - -2002-12-25 Murray Cumming - - * Removed unused constructors, to simplify things. Made Node's - destructor virtual, because we delete them polymorphically, and - because it has virtual methods. - -2002-12-25 Murray Cumming - - * libxml++/nodes/node.[h|cc]: Removed the initialized member - variable and its accessor, because it's not used. - -2002-12-19 Murray Cumming - - * libxml++/parsers/domparser.[h|cc]: get/set_root_node() now returns - an Element instead of a Node. - -2002-12-19 Murray Cumming - - * Changed const & accessors to get_*() methods. For instance, - Node::name -> Node::get_name - Node::children() -> Node::get_children() - Element::attributes() -> Element::get_attributes() - Attribute::value -> Attribute::get_value() - -2002-12-18 Murray Cumming - - * Added libxml++/nodes/commentnode.[h|cc] and used it in Node so that - comments don't just show up as name=comment Nodes. - * examples/dom_parser/example.xml: Added a comment. - * examples/dom_parser/main.cc: Do a dynamic_cast<> check for comments - too. - -2002-12-18 Christophe de Vienne - - * libxml++/parser/saxparser.cc: Fixed a bug in exception handling in - parse_stream. Thanks to Fredrik Arnerup for reporting - the bug. - -2002-12-17 Murray Cumming - - * Added libxml++/nodes/textnode.[h|cc]. This should remove the - confusion about whether content()/set_content() should be used on - a text node or the parent of a text node. - * libxml++/nodes/node.[h|cc]: - - Node::write() is now virtual, and - different in TextNode. - - content() replaced by get_child_content, which returns a TextNode* - instead of a string. - - set_content() replaced by set_child_content(). - * Added libxml++/nodes/element.[h|cc] so that TextNode can inherit - from a Node class without the attributes API. As per the Java DOM API, - Node still has the children API - I guess there's some reason for that, - though I don't see how a TextNode could have children. - -2002-12-17 Murray Cumming - - * Moved node.[h|cc] into nodes sub directory, in preparation for the - multiple-node-types API change. - -2002-12-12 Jonathan Wakely - - * libxml++/parsers/saxparser.cc, saxparser.h (on_get_entity): New - virtual function to allow derived classes to override entity handling - -2002-12-16 Murray Cumming - - * libxml++/node.cc: write(): - - Don't set the node->type directly. Let - xmlNodeSetContent take care of adding a suitable child node. This - was leading to segfaults when write() later tried to add a child node - to a text node. - - Throw internal_error exception when xmlNewChild returns NULL. - - -0.17:. - -2002-12-10 Christophe de Vienne - - * configure.in: updated version numbers for next release. Generic - version is now 0.17, library version is 3:0:0 - * NEWS: updated with changes since 0.16 version. - -2002-12-10 Christophe de Vienne - - * libxml++/node.cc: fixed write() which was using the accessors content() - and has_content(). Since they return something for both the text - node and the parent node, the output was weird. - -2002-12-09 Murray Cumming - - * libxml++/node.cc: content(): If the cached content string is empty, - try to get the content of a child "text" node. This makes content() - work as expected after creating a document with set_content() and - later reparsing it. - -2002-12-09 Murray Cumming - - * libxml++/parsers/dom_parser.cc (release_underlying): Set pointers - to 0 so that the get_*() methods generate new instances instead of - returning invalid pointers. - -2002-12-09 Murray Cumming - - * libxml++/node.cc: Node::remove_child() and Node::remove_attribute: - delete the objects when forgetting about them. - * libxml++/node.h: Added reference docs explaining the above. - -2002-12-07 Murray Cumming - - * libxml++/parsers/domparser.cc, saxparser.cc: Added comments about - the use of xmlKeepBlanksDefault() and xmlLineNumbersDefault(). - * libxml++/parsers/saxparser.[h|cc]: Change exception & to exception&. - -2002-12-06 Christophe de Vienne - - * libxml++/parsers/domparser.cc: Enabled xml option LineNumbers - and disabled KeepBlanks before each parsing. - * libxml++/parsers/sax_parser.cc: Enabled xml option KeepBlanks - before each parsing. - * example/dom_parser/main.cc: Added line number display for each - non-content node. Changed a bit content display - * Note: in a near future I may change these options settings to - let the user choose which options he wants/wants not. - - -2002-12-03 Jone Marius Vignes - - * libxml++/parsers/domparser.cc: Changed the exception in - write_to_string() to "write_to_string() failed." - * libxml++/parsers/domparser.h: Corrected documentation of - write_to_string() and write_to_file() to clarify that these methods - doesn't return booleans - -2002-12-02 Christophe de Vienne - - * libxml++/exceptions/*.[h|cc]: Added and implemented virtual - methods Raise() and Clone. - * libxml++/parser/sax_parser.[h|cc]: Each callback method can now - throw some exceptions as long as they herit from xmlpp::exception - AND implement Raise() and Clone(). - * libxml++/examples/sax_exception/: Added an example which demonstrate - the use of exceptions inside a SaxParser. - -2002-11-29 Murray Cumming - - * autogen.sh: Added libtoolize to generate files such as ltmain.sh. - -2002-11-28 Christophe de Vienne - - * acinclude.m4: The AM_LIBXML macro now checks for a libxml2 - version >= 2.4.1. - -2002-11-21 Christophe de Vienne - - * libxml++/parsers/*.[h|cc]: added Parser::parse_stream method - and implemented it in both DomParser and SaxParser. Tests based - on the examples (not commited in the cvs) worked perfectly. - -2002-11-20 Christophe de Vienne - - * libxml++/parsers/saxparser.cc: fixed a memory leak (thanks - to Chris Leishman who reported it. - -2002-11-20 Murray Cumming - - * Changed use of the term properties to attributes in the API, - because that is the correct terminology. - -0.16: - -2002-11-19 Christophe de Vienne - - * configure.in: updated version numbers for next release. - version is set to 0.16, library version to 2:0:0 - -2002-11-19 Murray Cumming - - * docs: Added index.html, which can be a main website page. - * docs/Makefile.am: Added rsync command to upload the html, - including the reference documentation. - -2002-11-19 Murray Cumming - - * Added Dtd class, which is just a collection of std::strings. - * libxml++/parsers/domparser.[h|cc]: Added set_internal_subset() and - get_internal_subset() to set the DTD declaration. This is set in the - underlying C xmlDoc during write_to_file() and write_to_disk(). - -2002-11-18 Murray Cumming - - * libxml++/node.[h|cc]: - - Rename is_content() to has_content(), because that's what it tells - us. Removed _is_content member bool - we can check _content.empty() - instead. - - write(): Do not manually set the xmlNode's type field to TEXT. This - corrupted the tree. Tested content nodes in example/dom_build. - -2002-11-18 Murray Cumming - - * libxml++/parsers/domparser.cc (write_to_*): Corrected no-root-node - check. - -2002-11-18 Murray Cumming - - * libxml++/exceptions/exception.[h|cc]: Corrected signature of what() - method, adding const throw(). - -2002-11-18 Murray Cumming - - * libxml++/parsers/domparser.[h|cc]: Added DomParser::set_root_node(). - * examples: Added dom_build, to show runtime construction of an XML - tree. - -2002-11-18 Murray Cumming - - * Parser, DomParser, SaxParser: parse_file() and parse_memory() now - throw exceptions. - * DomParser::write_to_file(): throws exception instead of using a bool - return value. - * examples/domparser/: Catches exceptions. - -2002-11-18 Christophe de Vienne - * libxml++/exceptions: splitted exception.[h|cc] in this directory. - The libxml_error has been removed for now, and a parse_error added. - -2002-11-17 Christophe de Vienne - * libxml++/attribute.h: Changed macro __LIBXMLPP_PROPERTY_H to __LIBXMLPP_ATTRIBUTE_H - * libxml++/exception.[h|cc]: Added xmlpp::exception, xmlpp::libxml_error and - xmlpp::internal_error classes. It's very basic for now. - -2002-11-17 Murray Cumming - - * Node, Attribute: set_*() method now have void return types. - * DomParser: Now has an empty underlying in-memory document when the - default constructor is used. This means that get_root_node() should - always return something, so we can build XML documents in memory - without loading any XML first. - -2002-11-16 Murray Cumming - - * libxml++/attribute.h: Added explicit to constructor. - -2002-11-16 Murray CUmming - - * libxml++/parsers/domparser: Renamed write() method to write_to_file() - and added write_to_string(). - -2002-11-16 Murray Cumming - - * libxml++-1.0.pc.in: More corrections. This was hopelessly broken - before. - -2002-11-16 Murray Cumming - - * libxml++-1.0.pc.in: Corrected typo. - -2002-11-16 Murray Cumming - - * docs/reference/Doxyfile: Used doxywizard to mark the Recursive - option, so it reads the libxml++/parsers directory too. - -2002-11-16 Murray Cumming - - * Attribute, Node: Added Doxygen class comment block. Changed some - something * to something*. - -2002-11-16 Murray Cumming - - * libxml++/node.[h|cc]: Added parameter names. Made const and non-const - overloads of children() method. - * libxml++/parsers/domparser.[h|cc]: Added const get_root_node() const - overload. - -2002-11-16 Christophe de Vienne - * libxml++/parsers/*: renamed method Parser::parse to - Parser::parse_file - -2002-11-16 Christophe de Vienne - * libxml++/parsers/saxparser.[h|cc]: rewritten - SaxParser::parse(filename) and SaxParser::parse_memory(string). - They both use a SaxParser::parse() - method. The parse_chunk and finish methods has been removed. - * example/sax_parser/parser.cc: minor bugfix: the Attribute pointer - was printed instead of the value. - -2002-11-16 Christophe de Vienne - * Property: has been renamed to Attribute. However, the "properties" - token has been kept when speaking of all the attributes of a node, - as in the libxml library. - * node.cc: rewritten a few loops so they have a more 'c++' looking. - rewritten some portions of code where an attribute is searched by name. - -2002-11-15 Murray Cumming - * Changed e.g. std::string &something to std::string& something, - using regexxer. - -2002-11-15 Christophe de Vienne - * example/sax_parser/parser.cc: #included - -2002-11-15 Christophe de Vienne - * libxml++/parsers/saxparser.cc: #included cstdarg instead of stdarg.h - to follow the c++ standard. #included to have std::cerr - it's - needed on strict c++ compiler (g++ 3.2 for instance). - * example/dom_parser/main.cc: #included - -2002-11-15 Murray Cumming - - * libxml++/parsers/saxparser.cc: #included stdarg.h - it seems to - be necessary with some compilers. - -2002-11-15 Murray Cumming - - * DomParser:: Added get_encoding() and write() methods. - * Removed Tree - Use DomParser instead. - -2002-11-15 Murray Cumming - - * SaxParser now inherits from Parser, with parse() and parse_memory() - methods. - * Added example/sax_parser example, but the start_element callback - doesn't seem to be called. - -2002-11-15 Murray Cumming - - * Parser, DomParser: Added parse_memory() method. - * Node::children(): Removed bad early-optimisation hack - it returned - a static function variable instead of returning by value. This meant - that >1 results of children() could not be used simultaneously. - For instance, this meant that it could not be called recursively. - -2002-11-12 Murray Cumming - - * Node, Property: Used explicit keyword on constructors. - -2002-11-12 Murray Cumming - - * Added parsers directory. - * Renamed Parser to SaxParser. - * Added DomParser, intended as a replacement for Tree, but that has - not yet been removed. I don't intend to implement the libxml-1 - compatibility stuff. - * Added examples directory structure, with one tiny dom_parser example. - -2002-11-12 Christophe de Vienne - * node.[h|cc]: name() method now return a reference. - * Tree/Node: The readnode and writenode functions have been removed - and transfered somehow into Node as a new constructor and write(). - The libxml++-private.[h|cc] has been removed. - -2002-11-12 Murray Cumming - - * Parser: It's no longer a templated type - to provide your own - callback implementations you can now just derive your own parser and - override the on_*() methods. - -2002-11-12 Murray Cumming - - * Moved implementation into the .cc files. - * Changed n, v and p parameter names to name, value and properties. - -2002-11-12 Murray Cumming - - * Split the single xml.[h|cc] files into node, property, tree and - parser files, with a libxml++.h header file that includes them all. - * Removed the XML prefixes from type names - we don't need it because - we use a namespace now. - * Placed typedefed lists and map inside their classes. For instance, - XMLNodeList is now xmlpp::Node::NodeList. - * Node::children(): Use !(n.empty()) instead of (n.length() == 0), for - perfomance. - * Tree: changed fn parameter names to filename. - -2002-11-12 Christophe de Vienne - * AUTHORS: Added Murray Cumming to the contributors - -2002-11-08 Christophe de Vienne - * libxml++/xml.cc: corrected _line initialisation in XMLNode::XMLNode(const XMLNode *from) - -2002-11-08 Christophe de Vienne - - * libxml++/xml.cc: Test if doc encoding is not null before - reading it (thanks to Marcel Bosc). - -2002-11-05 Murray Cumming - - * Added docs/reference/. Run make in this directory to generate - reference documentation with doxygen. - * libxml++/xml.h: Removed macros around namespace - all compilers - must now support namespaces. - * libxml++/xml.[h|cc]: Replaced (void) with () - it's not necessary - in C++. - -2002-11-05 Murray Cumming - - * libxml++/Makefile.am and configure.in: Implemented shared library - interface versioning. - -2002-11-05 Murray Cumming - - * Put source code in libxml++ directory, ready for it to be split up - into separate files. Client code should now include - libxml++/xml++.h rather than just xml++.h. - -2002-11-05 Murray Cumming - - * Headers are now installed in a versioned directory, to allow - coexistence with future major versions of libxml++. You may need to - remove the previously installed xml++.h file. - * Library name changed to libxml++-0.1, to be changed to libxml++-1.0 - when libxml++ stabilizes its API. This is also to allow future versions - to be parallel installed. - * Added pkg-config file as a simpler and more maintainable alternative - to the -config file and m4 script. - -Version 0.14 - * Ported to g++ 3.2. The code should now also compile on compilers which are a bit more strict about c++ than previous versions of g++ - * Added method XMLNode::line() wich returns the line number of a non content node in the source file. - * Added encoding file support through XMLTree::encoding() and XMLTree::set_encoding() methods - * Replacement of hash_map by map for node properties lists, since it has been reported to be faster, and to simplify porting to other plarfoms. - * libxml++ classes has been put in a separated namespace, libxmlpp. If you don't want namespace, just undefine the LIBXMLPP_USE_NAMESPACE - * encoding and compression settings are now loaded at parsing of file/buffer. - - -Version O.12 to 0.13 - No Changelog. - -Version O.11 - * Modified interface to allow for more complete coverage of possible uses of XML files. - -Version O.10 - * Added SAX parser. - -Version O.2 to 0.9 - No Changelog. - -Version O.1 - * Original release. From 24cce95ddedec35bf16e22e1e4686307d6e56b8c Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Mon, 28 Apr 2025 15:03:23 +0200 Subject: [PATCH 26/28] Meson build: Don't distribute libxmlplusplus.doap --- meson.build | 1 + 1 file changed, 1 insertion(+) diff --git a/meson.build b/meson.build index ca525da2..b7f31e55 100644 --- a/meson.build +++ b/meson.build @@ -320,6 +320,7 @@ meson.add_dist_script( # Don't distribute these files and directories. dont_distribute = [ + 'libxmlplusplus.doap', '.github', ] # Add build scripts to the distribution directory, and delete .gitignore From 3b5399b24dff7343b0ee1f27dc0e12ab28954971 Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Mon, 28 Apr 2025 15:04:25 +0200 Subject: [PATCH 27/28] Documentation: Clarify download locations Future releases will not be stored at download.gnome.org/sources/. Very old releases are not stored at github.com/libxmlplusplus/ libxmlplusplus/releases/. --- README.md | 2 +- docs/.gitignore | 1 + docs/index.md | 4 +++- 3 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 docs/.gitignore diff --git a/README.md b/README.md index d6e6145a..15e40c8b 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ Web site - https://libxmlplusplus.github.io/libxmlplusplus/ Download location - - https://download.gnome.org/sources/libxml++/ + - https://download.gnome.org/sources/libxml++/ (until 5.4.0) - https://github.com/libxmlplusplus/libxmlplusplus/releases/ Reference documentation diff --git a/docs/.gitignore b/docs/.gitignore new file mode 100644 index 00000000..57510a2b --- /dev/null +++ b/docs/.gitignore @@ -0,0 +1 @@ +_site/ diff --git a/docs/index.md b/docs/index.md index 0c4051e7..db26ce69 100644 --- a/docs/index.md +++ b/docs/index.md @@ -38,7 +38,9 @@ don't have access to the newer glibmm-2.68 ABI (glibmm version 2.68.0 or higher) ## Download You can download libxml++ from [GitHub releases](https://github.com/libxmlplusplus/libxmlplusplus/releases/) -or the [GNOME download site](https://download.gnome.org/sources/libxml++/). +(since 2.42.0, 3.2.0, 4.0.0 and 5.0.0) +or the [GNOME download site](https://download.gnome.org/sources/libxml++/) +(until 2.42.3, 3.2.5, 4.2.0 and 5.4.0). ## Required Libraries From 3f4f5405cc94870ae95071c9414d0f091a468b84 Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Mon, 28 Apr 2025 16:13:12 +0200 Subject: [PATCH 28/28] Document: Ignore deprecation of xmlIndentTreeOutput --- libxml++/document.cc | 4 ++++ libxml++/keepblanks.cc | 1 + 2 files changed, 5 insertions(+) diff --git a/libxml++/document.cc b/libxml++/document.cc index 3cd72aab..9222a6e3 100644 --- a/libxml++/document.cc +++ b/libxml++/document.cc @@ -7,6 +7,10 @@ * which should be included with libxml++ as the file COPYING. */ +// xmlIndentTreeOutput is deprecated since libxml2 2.15.0. +// Ignore deprecations here. +#define XML_DEPRECATED + #include #include #include diff --git a/libxml++/keepblanks.cc b/libxml++/keepblanks.cc index 56b00cf5..f00660f6 100644 --- a/libxml++/keepblanks.cc +++ b/libxml++/keepblanks.cc @@ -6,6 +6,7 @@ */ // xmlKeepBlanksDefault() is deprecated since libxml2 2.12.0. +// xmlIndentTreeOutput is deprecated since libxml2 2.15.0. // Ignore deprecations here. #define XML_DEPRECATED