Patch simplexml.c.patch for SimpleXML related Bug #54354
Patch version 2011-03-23 04:58 UTC 
Return to Bug #54354 |
Download this patch 
Patch Revisions:
Developer: tom@samplonius.org
--- simplexml.c.orig	2011-03-22 18:29:33.000000000 -0700
+++ simplexml.c	2011-03-22 21:25:15.000000000 -0700
@@ -1619,12 +1619,14 @@
 		localname = xmlStrdup((xmlChar *)qname);
 	}
 
+	/* Add new child with no namespace */
 	newnode = xmlNewChild(node, NULL, localname, (xmlChar *)value);
 
 	if (nsuri != NULL) {
+		/* If namespace is not NULL but blank, use no namespace
+		   Use this to prevent inheriting the name space of the parent */
 		if (nsuri_len == 0) {
 			newnode->ns = NULL;
-			nsptr = xmlNewNs(newnode, (xmlChar *)nsuri, prefix);
 		} else {
 			nsptr = xmlSearchNsByHref(node->doc, node, (xmlChar *)nsuri);
 			if (nsptr == NULL) {
         |