summaryrefslogtreecommitdiff
path: root/ext/domxml/php_domxml.c
diff options
context:
space:
mode:
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++) {