From: Christian Stocker Date: Fri, 8 Mar 2002 11:05:13 +0000 (+0000) Subject: @ domxml_elem_remove_attribute(attibutename) is now implemented (chregu) X-Git-Tag: help~131 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2cdb9f1bf9949a8643d2ba7f53a9242918f3315f;p=php @ domxml_elem_remove_attribute(attibutename) is now implemented (chregu) --- diff --git a/ext/domxml/php_domxml.c b/ext/domxml/php_domxml.c index f8fb980d04..10b240e7e3 100644 --- a/ext/domxml/php_domxml.c +++ b/ext/domxml/php_domxml.c @@ -469,6 +469,7 @@ static inline void node_wrapper_dtor(xmlNodePtr node) if (wrapper) zval_ptr_dtor(&wrapper); + } @@ -2197,21 +2198,19 @@ PHP_FUNCTION(domxml_elem_set_attribute) Removes given attribute */ PHP_FUNCTION(domxml_elem_remove_attribute) { - zval *id, *arg1; + zval *id; xmlNode *nodep; - - 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; + xmlAttr *attrp; + int name_len; + char *name; + + 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 */ + xmlUnlinkNode((xmlNodePtr)attrp); RETURN_TRUE; } /* }}} */