diff options
author | Nick Wellnhofer <wellnhofer@aevum.de> | 2022-05-20 23:28:25 +0200 |
---|---|---|
committer | Nick Wellnhofer <wellnhofer@aevum.de> | 2022-06-20 01:49:39 +0200 |
commit | 3e7b4f37aaaf920e6b81e20a3cd33c20420bfa15 (patch) | |
tree | ed6c8913b483884ef8173c000d4afffeb6102249 /xinclude.c | |
parent | 823bf161566da76a27a079d9febe78c4f996004a (diff) | |
download | libxml2-3e7b4f37aaaf920e6b81e20a3cd33c20420bfa15.tar.gz |
Avoid calling xmlSetTreeDoc
Create text nodes with xmlNewDocText or set the document directly to
avoid xmlSetTreeDoc being called when the node is inserted.
Diffstat (limited to 'xinclude.c')
-rw-r--r-- | xinclude.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -1849,7 +1849,7 @@ xmlXIncludeLoadTxt(xmlXIncludeCtxtPtr ctxt, const xmlChar *url, int nr) { */ for (i = 0; i < ctxt->txtNr; i++) { if (xmlStrEqual(URL, ctxt->txturlTab[i])) { - node = xmlNewText(ctxt->txtTab[i]); + node = xmlNewDocText(ctxt->doc, ctxt->txtTab[i]); goto loaded; } } @@ -1898,7 +1898,7 @@ xmlXIncludeLoadTxt(xmlXIncludeCtxtPtr ctxt, const xmlChar *url, int nr) { if (buf->encoder) xmlCharEncCloseFunc(buf->encoder); buf->encoder = xmlGetCharEncodingHandler(enc); - node = xmlNewText(NULL); + node = xmlNewDocText(ctxt->doc, NULL); /* * Scan all chars from the resource and add the to the node |