chregu          Tue Nov 26 10:37:55 2002 EDT

  Modified files:              
    /php4/ext/domxml    php_domxml.c 
  Log:
  Fix for Bug #20639  DomElement->get_elements_by_tagname() doesn't work
  
  
Index: php4/ext/domxml/php_domxml.c
diff -u php4/ext/domxml/php_domxml.c:1.219 php4/ext/domxml/php_domxml.c:1.220
--- php4/ext/domxml/php_domxml.c:1.219  Fri Nov 15 06:06:13 2002
+++ php4/ext/domxml/php_domxml.c        Tue Nov 26 10:37:54 2002
@@ -16,7 +16,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: php_domxml.c,v 1.219 2002/11/15 11:06:13 helly Exp $ */
+/* $Id: php_domxml.c,v 1.220 2002/11/26 15:37:54 chregu Exp $ */
 
 /* TODO
  * - Support Notation Nodes
@@ -616,11 +616,12 @@
        }
 }
 
-static xmlNodeSetPtr php_get_elements_by_tagname(xmlNodePtr n, xmlChar* name)
+static xmlNodeSetPtr php_get_elements_by_tagname(xmlNodePtr n, xmlChar* name, 
+xmlNodeSet *rv )
 {
-       xmlNodeSetPtr rv = NULL;
        xmlNodePtr cld = NULL;
-
+       /* TODO
+          Namespace support
+        */
        if ( n != NULL && name != NULL ) {
                cld = n->children;
                while ( cld != NULL ) {
@@ -632,6 +633,7 @@
                                        xmlXPathNodeSetAdd( rv, cld );
                                }
                        }
+                       rv = php_get_elements_by_tagname(cld, name, rv);
                        cld = cld->next;
                }
        }
@@ -3042,7 +3044,7 @@
        xmlNode *nodep;
        int name_len,i;
        char *name;
-       xmlNodeSet *nodesetp;
+       xmlNodeSet *nodesetp = NULL;
 
        DOMXML_PARAM_TWO(nodep, id, le_domxmlelementp, "s", &name, &name_len);
 
@@ -3053,7 +3055,7 @@
                RETURN_FALSE;
        }
 
-       nodesetp = php_get_elements_by_tagname(nodep,name);
+       nodesetp = php_get_elements_by_tagname(nodep, name, NULL);
 
        if(nodesetp) {
                for (i = 0; i < nodesetp->nodeNr; i++) {



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

Reply via email to