comparison libgaim/xmlnode.c @ 15123:c6978ee9ac4d

[gaim-migrate @ 17908] maybe fix 1608655 committer: Tailor Script <tailor@pidgin.im>
author Nathan Walp <nwalp@pidgin.im>
date Thu, 07 Dec 2006 04:25:29 +0000
parents 58202142e9ad
children 50f263712df1
comparison
equal deleted inserted replaced
15122:e3e668ddf945 15123:c6978ee9ac4d
292 292
293 node_name = g_markup_escape_text(node->name, -1); 293 node_name = g_markup_escape_text(node->name, -1);
294 g_string_append_printf(text, "<%s", node_name); 294 g_string_append_printf(text, "<%s", node_name);
295 295
296 if (node->namespace) { 296 if (node->namespace) {
297 char *namespace = g_markup_escape_text(node->namespace, -1); 297 if(!node->parent || !node->parent->namespace || strcmp(node->namespace, node->parent->namespace))
298 g_string_append_printf(text, " xmlns='%s'", namespace); 298 {
299 g_free(namespace); 299 char *namespace = g_markup_escape_text(node->namespace, -1);
300 g_string_append_printf(text, " xmlns='%s'", namespace);
301 g_free(namespace);
302 }
300 } 303 }
301 for(c = node->child; c; c = c->next) 304 for(c = node->child; c; c = c->next)
302 { 305 {
303 if(c->type == XMLNODE_TYPE_ATTRIB) { 306 if(c->type == XMLNODE_TYPE_ATTRIB) {
304 esc = g_markup_escape_text(c->name, -1); 307 esc = g_markup_escape_text(c->name, -1);