Skip to content

Commit

Permalink
Merge branch 'main' into xml-int
Browse files Browse the repository at this point in the history
  • Loading branch information
hadley authored Nov 30, 2023
2 parents 05f5b59 + e4a54ae commit a588b4a
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 2 deletions.
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
* `xml_find_int()` analogous to `xml_find_num()` for returning integers
matched by an XPath (#365, @michaelchirico).

* Now compatible with limxml2 2.12.0 and later (@KNnut).

* Fix format string issues detected in R-devel.

* `xml_serialize()` now includes the document type so that `xml_unserialize()` works also for HTML documents (#407, @HenrikBengtsson).
Expand Down
11 changes: 11 additions & 0 deletions src/xml2_init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,18 @@
#include <string>
#include "xml2_utils.h"

/* * *
* Author: Nick Wellnhofer <[email protected]>
* Date: Tue, 24 Oct 2023 15:02:36 +0200
* https://github.com/GNOME/libxml2/commit/61034116d0a3c8b295c6137956adc3ae55720711
*
* error: Make more xmlError structs constant
*/
#if defined(LIBXML_VERSION) && (LIBXML_VERSION >= 21200)
void handleStructuredError(void* userData, const xmlError* error) {
#else
void handleStructuredError(void* userData, xmlError* error) {
#endif

BEGIN_CPP
std::string message = std::string(error->message);
Expand Down
13 changes: 11 additions & 2 deletions src/xml2_schema.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,18 @@
#include "xml2_types.h"
#include "xml2_utils.h"

/* * *
* Author: Nick Wellnhofer <[email protected]>
* Date: Tue, 24 Oct 2023 15:02:36 +0200
* https://github.com/GNOME/libxml2/commit/61034116d0a3c8b295c6137956adc3ae55720711
*
* error: Make more xmlError structs constant
*/
#if defined(LIBXML_VERSION) && (LIBXML_VERSION >= 21200)
void handleSchemaError(void* userData, const xmlError* error) {
#else
void handleSchemaError(void* userData, xmlError* error) {
#endif
std::vector<std::string> * vec = (std::vector<std::string> *) userData;
std::string message = std::string(error->message);
message.resize(message.size() - 1);
Expand All @@ -22,8 +33,6 @@ extern "C" SEXP doc_validate(SEXP doc_sxp, SEXP schema_sxp) {
XPtrDoc doc(doc_sxp);
XPtrDoc schema(schema_sxp);

xmlLineNumbersDefault(1);

BEGIN_CPP

std::vector<std::string> vec;
Expand Down

0 comments on commit a588b4a

Please sign in to comment.