mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-10-26 00:37:43 +03:00
Avoid calling xmlSetTreeDoc
Create text nodes with xmlNewDocText or set the document directly to avoid xmlSetTreeDoc being called when the node is inserted.
This commit is contained in:
@@ -25,7 +25,7 @@ main(void)
|
||||
* Create the document.
|
||||
*/
|
||||
doc = xmlNewDoc(BAD_CAST "1.0");
|
||||
n = xmlNewNode(NULL, BAD_CAST "root");
|
||||
n = xmlNewDocNode(doc, NULL, BAD_CAST "root", NULL);
|
||||
xmlNodeSetContent(n, BAD_CAST "content");
|
||||
xmlDocSetRootElement(doc, n);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user