Commits on Nov 21, 2017
  1. Use correct namespace for all children of inserted node too

    vadz authored and vslavik committed Nov 17, 2017
    This completes the changes of 077fb03
    which set the namespace of the node being inserted into the tree
    correctly, but not the namespaces of its children, that also need to be
    set to inherit the parent namespace, if they don't already have their
    own one, for the same reasons as were mentioned in the other commit
Commits on Oct 12, 2017
  1. Fix crash when initializing the library from multiple threads

    vadz committed Oct 12, 2017
    Call xmlInitParser() before setting libxml2 global variables as these
    "variables" actually are function calls using global state protected by a
    critical section that must be initialized by xmlInitParser() before being
    This fixes a crash due to trying to enter an uninitialized critical section
    under MSW.
Commits on Oct 2, 2017
  1. Merge branch 'cast-qual-warn'

    vadz committed Oct 2, 2017
    Closes #41.
  2. Enable -Wcast-qual warning for g++ build

    vadz committed Oct 2, 2017
    This warning seems to be potentially useful and the library now (i.e.
    after the previous commit) compiles cleanly with it.
  3. Use const_cast<> instead of C cast for clarity

    vadz committed Oct 2, 2017
    No real changes, just use a more appropriate cast which already has a
    nice side-effect of not resulting in gcc -Wcast-qual warnings.
Commits on Sep 28, 2017
  1. Rename a parameter to avoid gcc -Wshadow warning

    vadz committed Sep 28, 2017
    Compiling code including xmlwrapp/node.h with -Wshadow resulted in
    warning: declaration of ‘text’ shadows a member of ‘xml::node::text’ [-Wshadow]
    Fix this by simply renaming xml::node::text ctor argument to "content"
    (used, rather than "contents", for consistency with the other similar
Commits on May 22, 2017
  1. Avoid annoying warnings from ar included in recent binutils

    vadz authored and vslavik committed May 21, 2017
    Explicitly set AR_FLAGS to "cr" to override the default value of "cru" used by
    libtool which results in warnings about not supported any more "u" option from
    all currently used versions of ar under Linux -- as we don't really care about
    the tiny extra efficiency from using "u", just stop using it completely.
Commits on Dec 11, 2016
  1. Increment version to 0.8.1 to make 0.8.0 bug fix release

    vadz committed Dec 11, 2016
    There are no changes at the code level, but it still seems more prudent to
    increment the version to avoid confusion in the future.
  2. Add libxml/cpp11.h to the sources list

    vadz committed Dec 11, 2016
    This ensures that it's included into the distribution, which was broken due to
    missing this file.
    Closes #38.
Commits on Dec 1, 2016
  1. Fix a typo in the NEWS file

    vadz committed Dec 1, 2016
Commits on Nov 29, 2016
  1. Increase version to 0.8.0

    vadz committed Nov 29, 2016
Commits on Sep 14, 2016
  1. Merge branch 'save-errors'

    vadz committed Sep 14, 2016
    Throw exceptions for the errors happening when saving the documents and during
    other operations and not only when loading them.
  2. Don't suppress all libxml2 errors by default

    vadz committed Sep 12, 2016
    It's not especially useful to show libxml2 error messages on stderr,
    especially under Windows, but it's even worse to not show them anywhere at all
    and silently ignore all errors.
    Don't do this any longer, errors should be handled by adding code using
    xml::impl::global_errors_collector to the functions where they may happen, as
    it was done in the previous commits on this branch.
  3. Throw exception when evaluating an invalid XPath expression

    vadz committed Sep 12, 2016
    Propagate libxslt and libxml2 error messages to the application as exceptions
    by default instead of simply ignoring them.
  4. Add "do nothing" ignore_errors error handler

    vadz committed Sep 12, 2016
    This could be useful for maintaining backwards-compatible behaviour instead of
    throwing an exception in case of error as document::save_to_{string,file}
    already does and more functions will do in the future.
Commits on Sep 12, 2016
  1. Make set of xpath_context::evaluate() overloads more maintainable

    vadz committed Sep 12, 2016
    Don't duplicate comments and (even if it's just a single line) code to make
    modifying these functions simpler in the future.
  2. Catch libxml2 errors when applying style sheets too

    vadz committed Sep 12, 2016
    In addition to XSLT errors, using an invalid style sheet can generate errors
    in libxml2 too, so catch them as well when doing this.
  3. Return libxml2 IO errors correctly to the user code

    vadz committed Sep 12, 2016
    It's simpler and better (as libxml2 may have more details) to just return the
    errors logged by libxml2 global error handler to the caller, instead of
    checking whether the input file could be opened ourselves.
    This does change the format of the error message, which now takes the form
    	I/O warning : failed to load external entity "$filename"
    so update the unit test to make it less strict: we don't really care about the
    exact message, just that it mentions the file that we failed to open.
  4. Make it possible to install a different object as libxml2 error sink

    vadz committed Sep 12, 2016
    Generalize global_errors_collector by factoring out global_errors_installer
    from it to allow installing other, already existing, error_message objects as
    global error sinks.
    This is not used yet, but will be in the upcoming commits.
  5. Improve error handling in document::save_to_{string,file}()

    vadz committed Sep 12, 2016
    Throw an exception if any errors occur while saving (this can happen if the
    document contains nodes with not well-formed UTF-8 text, for example) instead
    of ignoring any errors and silently losing data.
    Also make it possible to pass a custom on_error handler to these functions,
    just as it was already possible when loading the document.
  6. Refactor code temporarily changing document compression parameter

    vadz committed Sep 12, 2016
    Use a RAII-based helper instead of manually changing and restoring this field.
    This is less error-prone and will remain correct even in presence of
    No real changes in this commit.
Commits on Sep 11, 2016
  1. Ensure that temporary test file is always deleted

    vadz committed Sep 11, 2016
    Use a tiny RAII helper to delete the temporary file created by the document
    tests on scope exit, even if the test fails.
  2. Don't leak memory when creating a document object fails

    vadz committed Sep 11, 2016
    There is no need to allocate a new doc_impl when creating a document from file
    or data, it's not used at all in the normal case after a call to swap() and is
    simply leaked if an error occurs.
    This fixes memory leak reports from MSVC debug CRT and, perhaps more
    importantly, avoids an unnecessary allocation in the normal case.
  3. Fix warnings about signed/unsigned comparison in MSVS tests build

    vadz committed Sep 11, 2016
    Compiling tests code with MSVS at "all" warning level gave several warnings
    about comparing signed literal values with unsigned result of calling size().
    Fix these warnings by making the literals unsigned as well.
  4. Merge branch 'windows-tests'

    vadz committed Sep 11, 2016
  5. Generate MSVS projects for building the test suite too

    vadz committed Sep 11, 2016
    Make it possible to build (and run) the unit test suite under Windows too.
  6. Use reasonably maximal warning level for MSVS projects

    vadz committed Sep 11, 2016
    Use bakefile "all" warnings level and fix two warnings that appeared when
    using it with MSVS 2015.
  7. Allow skipping building a single test case using zlib

    vadz committed Sep 11, 2016
    This is especially useful under Windows where zlib might not be available out
    of the box, unlike under Unix systems which always have it, because the test
    suite can avoid linking to it then.
    By default, zlib is still required and XMLWRAPP_NO_ZLIB needs to be explicitly
    predefined to avoid depending on it.
  8. Allow linking Boost.Test statically in the test suite

    vadz committed Sep 11, 2016
    This is especially useful under Windows where it's built as a static library
    by bjam by default.
    By default, it is still used dynamically and XMLWRAPP_NO_BOOST_TEST_DYN_LINK
    needs to be explicitly predefined when building to avoid it.
Commits on Sep 9, 2016
  1. Generate project files for MSVS 2013 and 2015 in bakefile too

    vadz committed Sep 9, 2016
    Just support newer versions of the compiler in exactly the same way as we
    already supported the previous ones.
Commits on Jul 25, 2016
  1. Fix crashes in some of xslt::stylesheet::apply() overloads

    vadz authored and vslavik committed Jul 25, 2016
    If the provided on_error handler doesn't throw an exception (e.g. if it's an
    xml::error_messages object), don't crash in apply() overloads returning the
    result of the transformation.
    Just check for apply_stylesheet() success there too, just as it was already
    done in the overloads using the "result" document object.
    See #31.
  2. Merge pull request #32 from vslavik/suncc-fixes

    vslavik committed Jul 25, 2016
    Sun CC fixes
Commits on Jul 20, 2016
  1. Fix compilation fix for ancient libxslt 1.1.15

    vadz committed Mar 17, 2015
    It didn't have xsltInit() yet, so just don't call it then.
    This is necessary to fix Solaris build which uses this version of the library.
  2. Fix compilation for calling convention mismatch with Sun CC

    vadz committed Jul 3, 2014
    We can't use extern "C" xmlXPathFreeObject pointer with xml_scoped_ptr<> which
    expects a C++ function pointer, so add an intermediate C++ helper function
    wrapping it to make compilation work with this compiler (whose behaviour is
    unusually picky but is 100% standard conforming in this aspect).
Commits on Apr 4, 2016
  1. Fix build with MSVS 2010, don't enable C++11 support for it

    vadz committed Apr 4, 2016
    While it does support std::unique_ptr<>, it doesn't support alias templates
    which we need to alias it to auto_ptr<>.