rrichards               Fri May  4 19:30:59 2007 UTC

  Added files:                 (Branch: PHP_5_2)
    /php-src/ext/dom/tests      bug41257.phpt 

  Modified files:              
    /php-src/ext/dom    element.c node.c 
  Log:
  fix bug #41257 (lookupNamespaceURI does not work as expected)
  fix related issue in isDefaultNamespace
  add test
  reconcile namespaces when setting attribute in a new namespace
  
http://cvs.php.net/viewvc.cgi/php-src/ext/dom/element.c?r1=1.36.2.4.2.7&r2=1.36.2.4.2.8&diff_format=u
Index: php-src/ext/dom/element.c
diff -u php-src/ext/dom/element.c:1.36.2.4.2.7 
php-src/ext/dom/element.c:1.36.2.4.2.8
--- php-src/ext/dom/element.c:1.36.2.4.2.7      Mon Jan  1 09:36:00 2007
+++ php-src/ext/dom/element.c   Fri May  4 19:30:59 2007
@@ -17,7 +17,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: element.c,v 1.36.2.4.2.7 2007/01/01 09:36:00 sebastian Exp $ */
+/* $Id: element.c,v 1.36.2.4.2.8 2007/05/04 19:30:59 rrichards Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -709,6 +709,7 @@
                                        } else {
                                                nsptr = dom_get_ns(elemp, uri, 
&errorcode, prefix);
                                        }
+                                       xmlReconciliateNs(elemp->doc, elemp);
                                }
                        } else {
                                if (is_xmlns == 1) {
http://cvs.php.net/viewvc.cgi/php-src/ext/dom/node.c?r1=1.37.2.3.2.7&r2=1.37.2.3.2.8&diff_format=u
Index: php-src/ext/dom/node.c
diff -u php-src/ext/dom/node.c:1.37.2.3.2.7 php-src/ext/dom/node.c:1.37.2.3.2.8
--- php-src/ext/dom/node.c:1.37.2.3.2.7 Sun Mar 18 21:31:04 2007
+++ php-src/ext/dom/node.c      Fri May  4 19:30:59 2007
@@ -17,7 +17,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: node.c,v 1.37.2.3.2.7 2007/03/18 21:31:04 rrichards Exp $ */
+/* $Id: node.c,v 1.37.2.3.2.8 2007/05/04 19:30:59 rrichards Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -1586,8 +1586,11 @@
        }
 
        DOM_GET_OBJ(nodep, id, xmlNodePtr, intern);
+       if (nodep->type == XML_DOCUMENT_NODE || nodep->type == 
XML_HTML_DOCUMENT_NODE) {
+               nodep = xmlDocGetRootElement((xmlDocPtr) nodep);
+       }
 
-       if (uri_len > 0) {
+       if (nodep && uri_len > 0) {
                nsptr = xmlSearchNs(nodep->doc, nodep, NULL);
                if (nsptr && xmlStrEqual(nsptr->href, uri)) {
                        RETURN_TRUE;
@@ -1617,6 +1620,12 @@
        }
 
        DOM_GET_OBJ(nodep, id, xmlNodePtr, intern);
+       if (nodep->type == XML_DOCUMENT_NODE || nodep->type == 
XML_HTML_DOCUMENT_NODE) {
+               nodep = xmlDocGetRootElement((xmlDocPtr) nodep);
+               if (nodep == NULL) {
+                       RETURN_NULL();
+               }
+       }
 
        nsptr = xmlSearchNs(nodep->doc, nodep, prefix);
        if (nsptr && nsptr->href != NULL) {

http://cvs.php.net/viewvc.cgi/php-src/ext/dom/tests/bug41257.phpt?view=markup&rev=1.1
Index: php-src/ext/dom/tests/bug41257.phpt
+++ php-src/ext/dom/tests/bug41257.phpt

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to