cvs: php4(PHP_4_3) /ext/domxml php_domxml.c

From: Date: Tue, 26 Nov 2002 15:39:15 +0000
Subject: cvs: php4(PHP_4_3) /ext/domxml php_domxml.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-16671@lists.php.net to get a copy of this message
chregu Tue Nov 26 10:39:15 2002 EDT Modified files: (Branch: PHP_4_3) /php4/ext/domxml php_domxml.c Log: MFH (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.218.2.1 php4/ext/domxml/php_domxml.c:1.218.2.2 --- php4/ext/domxml/php_domxml.c:1.218.2.1 Fri Nov 15 06:07:34 2002 +++ php4/ext/domxml/php_domxml.c Tue Nov 26 10:39:13 2002 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_domxml.c,v 1.218.2.1 2002/11/15 11:07:34 helly Exp $ */ +/* $Id: php_domxml.c,v 1.218.2.2 2002/11/26 15:39:13 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++) {

« previous php.cvs (#16671) next »