Skip to content

Commit

Permalink
XML: fixed tests with libxml2 2.13 and later.
Browse files Browse the repository at this point in the history
This fixes #812 issue on Github.
  • Loading branch information
xeioex committed Nov 7, 2024
1 parent e845d5e commit 597b1fd
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions external/njs_xml_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -1275,17 +1275,13 @@ njs_xml_node_tags_handler(njs_vm_t *vm, xmlNode *current, njs_str_t *name,

/* set or delete. */

copy = xmlDocCopyNode(current, current->doc, 1);
copy = xmlDocCopyNode(current, current->doc,
2 /* copy properties and namespaces */);
if (njs_slow_path(copy == NULL)) {
njs_vm_internal_error(vm, "xmlDocCopyNode() failed");
return NJS_ERROR;
}

if (copy->children != NULL) {
xmlFreeNodeList(copy->children);
copy->children = NULL;
}

if (retval == NULL) {
/* delete. */
return njs_xml_replace_node(vm, current, copy);
Expand Down

0 comments on commit 597b1fd

Please sign in to comment.