diff options
| author | Christian Stocker <chregu@php.net> | 2002-11-26 15:39:13 +0000 |
|---|---|---|
| committer | Christian Stocker <chregu@php.net> | 2002-11-26 15:39:13 +0000 |
| commit | 106c57d48f05b3f5a06f988e7915f298354e9227 (patch) | |
| tree | 82c16752be58ed3708c70f0418c41b68d975094b /ext/domxml/php_domxml.c | |
| parent | 7801f9609689557b5dbd9b5a3b1a5b2a2e8a3aeb (diff) | |
| download | php-git-106c57d48f05b3f5a06f988e7915f298354e9227.tar.gz | |
MFH (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.c | 12 |
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++) { |
