cvs: php4 /ext/domxml php_domxml.c
| From: | Christian Stocker | Date: | Fri, 08 Mar 2002 11:05:14 +0000 |
| Subject: | cvs: php4 /ext/domxml php_domxml.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-9826@lists.php.net to get a copy of this message | ||
chregu Fri Mar 8 06:05:14 2002 EDT
Modified files:
/php4/ext/domxml php_domxml.c
Log:
@ domxml_elem_remove_attribute(attibutename) is now implemented (chregu)
Index: php4/ext/domxml/php_domxml.c
diff -u php4/ext/domxml/php_domxml.c:1.121 php4/ext/domxml/php_domxml.c:1.122
--- php4/ext/domxml/php_domxml.c:1.121 Fri Mar 8 04:18:31 2002
+++ php4/ext/domxml/php_domxml.c Fri Mar 8 06:05:13 2002
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_domxml.c,v 1.121 2002/03/08 09:18:31 chregu Exp $ */
+/* $Id: php_domxml.c,v 1.122 2002/03/08 11:05:13 chregu Exp $ */
/* TODO
* - Support Notation Nodes
@@ -469,6 +469,7 @@
if (wrapper)
zval_ptr_dtor(&wrapper);
+
}
@@ -2197,21 +2198,19 @@
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;
}
/* }}} */