From: Christian Stocker Date: Fri, 8 Mar 2002 22:16:07 +0000 (+0000) Subject: @ implemented domxml_elem_get_attribute_node(attrname) (chregu) X-Git-Tag: help~123 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f8964007f8f7156047ee68592bbd67bd960ebab8;p=php @ implemented domxml_elem_get_attribute_node(attrname) (chregu) --- 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); } /* }}} */