I think it's more a question for Daniel, but any help is welcome of course. Libxml2 merges text nodes to a single node when you add text child next to existing text node for example, so at least xmlAddNextSibling, xmlAddPrevSibling and xmlAddChild are doing that. For a project I'm using libxml2 I want all nodes to be preserved as I add them, so for example I can edit text content of particular text node in children list. The question is what could or will potentially break if I'll use my own versions of these tree manipulation calls that do not perform such merging? e.g. does a lib really expect to have only one text node with no text siblings somewhere in the code, or maybe libxslt does?

P.S. attached patch is just to fix a compiler warning I'm seeing with current git builds, obviously completely unrelated to this topic.
>From fabdca3c0314e4ede352dbab8fb50017d78fda52 Mon Sep 17 00:00:00 2001
From: Nikolay Sivov <nsi...@codeweavers.com>
Date: Tue, 30 Apr 2013 17:45:36 +0400
Subject: [PATCH] Cast encoding name to char pointer to match arg type

---
 parser.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/parser.c b/parser.c
index b9df6d8..1d478c3 100644
--- a/parser.c
+++ b/parser.c
@@ -13607,7 +13607,7 @@ xmlParseInNodeContext(xmlNodePtr node, const char 
*data, int datalen,
            xmlFree((xmlChar *) ctxt->encoding);
         ctxt->encoding = xmlStrdup((const xmlChar *) doc->encoding);
 
-        hdlr = xmlFindCharEncodingHandler(doc->encoding);
+        hdlr = xmlFindCharEncodingHandler((const char *) doc->encoding);
         if (hdlr != NULL) {
             xmlSwitchToEncoding(ctxt, hdlr);
        } else {
-- 
1.7.10.4

_______________________________________________
xml mailing list, project page  http://xmlsoft.org/
xml@gnome.org
https://mail.gnome.org/mailman/listinfo/xml

Reply via email to