cvs: php4 /ext/domxml php_domxml.c

From: Date: Fri, 08 Mar 2002 22:16:08 +0000
Subject: cvs: php4 /ext/domxml php_domxml.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-9837@lists.php.net to get a copy of this message
chregu Fri Mar 8 17:16:08 2002 EDT Modified files: /php4/ext/domxml php_domxml.c Log: @ implemented domxml_elem_get_attribute_node(attrname) (chregu) Index: php4/ext/domxml/php_domxml.c diff -u php4/ext/domxml/php_domxml.c:1.122 php4/ext/domxml/php_domxml.c:1.123 --- php4/ext/domxml/php_domxml.c:1.122 Fri Mar 8 06:05:13 2002 +++ php4/ext/domxml/php_domxml.c Fri Mar 8 17:16:07 2002 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_domxml.c,v 1.122 2002/03/08 11:05:13 chregu Exp $ */ +/* $Id: php_domxml.c,v 1.123 2002/03/08 22:16:07 chregu Exp $ */ /* TODO * - Support Notation Nodes @@ -334,8 +334,8 @@ 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 @@ 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); } /* }}} */

« previous php.cvs (#9837) next »