diff options
author | Christian Stocker <chregu@php.net> | 2002-03-08 11:05:13 +0000 |
---|---|---|
committer | Christian Stocker <chregu@php.net> | 2002-03-08 11:05:13 +0000 |
commit | 2cdb9f1bf9949a8643d2ba7f53a9242918f3315f (patch) | |
tree | 131f90e1c7c03e8ecaec6db95a0c3a421669def9 /ext/domxml/php_domxml.c | |
parent | 90f6005f5864a11c48462e2046879d1aa78d2e3d (diff) | |
download | php-git-2cdb9f1bf9949a8643d2ba7f53a9242918f3315f.tar.gz |
@ domxml_elem_remove_attribute(attibutename) is now implemented (chregu)
Diffstat (limited to 'ext/domxml/php_domxml.c')
-rw-r--r-- | ext/domxml/php_domxml.c | 25 |
1 files changed, 12 insertions, 13 deletions
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; } /* }}} */ |