summaryrefslogtreecommitdiff
path: root/ext/domxml/php_domxml.c
diff options
context:
space:
mode:
authorChristian Stocker <chregu@php.net>2002-11-26 15:37:54 +0000
committerChristian Stocker <chregu@php.net>2002-11-26 15:37:54 +0000
commit20688a30ab55d1635fa416e61cc959948e35e421 (patch)
tree2814d7a7686a20ee239b9b0ba2b3ba7d663844d3 /ext/domxml/php_domxml.c
parentb1a543453772247692af05f018bd274f09ed3042 (diff)
downloadphp-git-20688a30ab55d1635fa416e61cc959948e35e421.tar.gz
Fix for Bug #20639 DomElement->get_elements_by_tagname() doesn't work
Diffstat (limited to 'ext/domxml/php_domxml.c')
-rw-r--r--ext/domxml/php_domxml.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/ext/domxml/php_domxml.c b/ext/domxml/php_domxml.c
index c00f618b67..c4f076af0f 100644
--- a/ext/domxml/php_domxml.c
+++ b/ext/domxml/php_domxml.c
@@ -616,11 +616,12 @@ static inline void node_list_wrapper_dtor(xmlNodePtr node)
}
}
-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 @@ static xmlNodeSetPtr php_get_elements_by_tagname(xmlNodePtr n, xmlChar* name)
xmlXPathNodeSetAdd( rv, cld );
}
}
+ rv = php_get_elements_by_tagname(cld, name, rv);
cld = cld->next;
}
}
@@ -3042,7 +3044,7 @@ PHP_FUNCTION(domxml_elem_get_elements_by_tagname)
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 @@ PHP_FUNCTION(domxml_elem_get_elements_by_tagname)
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++) {