From: Dmitry Volyntsev Date: Thu, 7 Nov 2024 06:08:21 +0000 (-0800) Subject: XML: fixed tests with libxml2 2.13 and later. X-Git-Tag: 0.8.8~10 X-Git-Url: http://www.kaiwu.me/postgresql/commit/static/gitweb.js?a=commitdiff_plain;h=597b1fd1fa34999ec47bbd574da35491f56b8893;p=njs.git XML: fixed tests with libxml2 2.13 and later. This fixes #812 issue on Github. --- diff --git a/external/njs_xml_module.c b/external/njs_xml_module.c index 86c896c0..d9f3bbb5 100644 --- a/external/njs_xml_module.c +++ b/external/njs_xml_module.c @@ -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);