create new nodes with attributes correctly
authorDana Jansens <danakj@orodu.net>
Wed, 30 May 2007 14:39:06 +0000 (14:39 +0000)
committerDana Jansens <danakj@orodu.net>
Wed, 30 May 2007 14:39:06 +0000 (14:39 +0000)
src/tree.c

index ed51f0b3ebcb3324c1ec9e0093a809ab72c8548c..a9ccefef9f35bb25ef92ddbf9c163f4315b157d3 100644 (file)
@@ -57,8 +57,11 @@ xmlNodePtr tree_get_node(const gchar *path, const gchar *def)
 
         if (!c) {
             gint i;
+            gchar **attrs;
 
-            c = xmlNewTextChild(n, NULL, *it, *next ? NULL : def);
+            attrs = g_strsplit(*it, ":", 0);
+
+            c = xmlNewTextChild(n, NULL, *it, *next ? NULL : attrs[0]);
 
             for (i = 1; attrs[i]; ++i) {
                 gchar **eq = g_strsplit(attrs[i], "=", 2);