diff options
author | Christian Stocker <chregu@php.net> | 2002-03-08 22:16:07 +0000 |
---|---|---|
committer | Christian Stocker <chregu@php.net> | 2002-03-08 22:16:07 +0000 |
commit | f8964007f8f7156047ee68592bbd67bd960ebab8 (patch) | |
tree | bb6ec2018c1e1dd74b44a615566fd521c6bc2524 /ext/domxml/php_domxml.c | |
parent | 42e478c7aa5ca620cb21ef5357a841b02aca54c5 (diff) | |
download | php-git-f8964007f8f7156047ee68592bbd67bd960ebab8.tar.gz |
@ implemented domxml_elem_get_attribute_node(attrname) (chregu)
Diffstat (limited to 'ext/domxml/php_domxml.c')
-rw-r--r-- | ext/domxml/php_domxml.c | 28 |
1 files changed, 12 insertions, 16 deletions
diff --git a/ext/domxml/php_domxml.c b/ext/domxml/php_domxml.c index 10b240e7e3..5fe4b4b5a9 100644 --- a/ext/domxml/php_domxml.c +++ b/ext/domxml/php_domxml.c @@ -334,8 +334,8 @@ static zend_function_entry php_domxmlelement_class_functions[] = { PHP_FALIAS(get_attribute, domxml_elem_get_attribute, NULL) PHP_FALIAS(set_attribute, domxml_elem_set_attribute, NULL) PHP_FALIAS(remove_attribute, domxml_elem_remove_attribute, NULL) - PHP_FALIAS(get_attributenode, domxml_elem_get_attribute_node, NULL) - PHP_FALIAS(set_attributenode, domxml_elem_set_attribute_node, NULL) + PHP_FALIAS(get_attribute_node, domxml_elem_get_attribute_node, NULL) + PHP_FALIAS(set_attribute_node, domxml_elem_set_attribute_node, NULL) PHP_FALIAS(get_element_by_tagname, domxml_elem_get_element_by_tagname, NULL) {NULL, NULL, NULL} }; @@ -2219,23 +2219,19 @@ PHP_FUNCTION(domxml_elem_remove_attribute) Returns value of given attribute */ PHP_FUNCTION(domxml_elem_get_attribute_node) { - zval *id, *arg1; + zval *id, *rv; xmlNode *nodep; + xmlAttr *attrp; + int name_len, ret; + char *name; - DOMXML_NOT_IMPLEMENTED(); - - if ((ZEND_NUM_ARGS() == 1) && getParameters(ht, 1, &arg1) == SUCCESS) { - id = getThis(); - nodep = php_dom_get_object(id, le_domxmlelementp, 0 TSRMLS_CC); - } else { - WRONG_PARAM_COUNT; + DOMXML_PARAM_TWO(nodep, id, le_domxmlelementp, "s", &name, &name_len); + attrp = xmlHasProp(nodep,name); + if (attrp == NULL) + { + RETURN_FALSE; } - - convert_to_string(arg1); - - /* FIXME: not implemented */ - - RETURN_TRUE; + DOMXML_RET_OBJ(rv, (xmlNodePtr) attrp, &ret); } /* }}} */ |