cvs: php4 /ext/domxml php_domxml.c php_domxml.h

From: Date: Fri, 18 Jan 2002 11:04:10 +0000
Subject: cvs: php4 /ext/domxml php_domxml.c php_domxml.h
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-9085@lists.php.net to get a copy of this message
chregu Fri Jan 18 06:04:10 2002 EDT Modified files: /php4/ext/domxml php_domxml.c php_domxml.h Log: @- Added function domxml_node_get_content() (chregu) Index: php4/ext/domxml/php_domxml.c diff -u php4/ext/domxml/php_domxml.c:1.101 php4/ext/domxml/php_domxml.c:1.102 --- php4/ext/domxml/php_domxml.c:1.101 Fri Jan 18 02:58:47 2002 +++ php4/ext/domxml/php_domxml.c Fri Jan 18 06:04:09 2002 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_domxml.c,v 1.101 2002/01/18 07:58:47 chregu Exp $ */ +/* $Id: php_domxml.c,v 1.102 2002/01/18 11:04:09 chregu Exp $ */ /* TODO * - Support Notation Nodes @@ -188,11 +188,11 @@ PHP_FE(domxml_elem_set_attribute, NULL) PHP_FE(domxml_node_children, NULL) PHP_FE(domxml_node_has_attributes, NULL) - PHP_FE(domxml_node_new_child, NULL) PHP_FE(domxml_node, NULL) PHP_FE(domxml_node_unlink_node, NULL) PHP_FE(domxml_node_set_content, NULL) + PHP_FE(domxml_node_get_content, NULL) PHP_FE(domxml_new_xmldoc, NULL) #if defined(LIBXML_XPATH_ENABLED) @@ -302,6 +302,7 @@ PHP_FALIAS(unlink, domxml_node_unlink_node, NULL) PHP_FALIAS(replace_node, domxml_node_replace_node, NULL) PHP_FALIAS(set_content, domxml_node_set_content, NULL) + PHP_FALIAS(get_content, domxml_node_get_content, NULL) PHP_FALIAS(text_concat, domxml_node_text_concat, NULL) PHP_FALIAS(set_name, domxml_node_set_name, NULL) PHP_FALIAS(node_name, domxml_node_name, NULL) @@ -2024,6 +2025,30 @@ RETURN_TRUE; } /* }}} */ + +/* {{{ proto string domxml_node_get_content() + Gets content of a node. + + "Read the value of a node, this can be either the text carried directly by +this node if it's a TEXT node or the aggregate string of the values carried by +this node child's (TEXT and ENTITY_REF). Entity references are substituted." + */ +PHP_FUNCTION(domxml_node_get_content) +{ + zval *id; + xmlNode *nodep; + xmlChar *mem; + + DOMXML_PARAM_NONE(nodep, id, le_domxmlnodep); + mem = xmlNodeGetContent(nodep); + if (!mem) { + RETURN_FALSE; + } + + RETURN_STRING(mem,1); +} +/* }}} */ + /* End of Methods DomNode }}} */ Index: php4/ext/domxml/php_domxml.h diff -u php4/ext/domxml/php_domxml.h:1.38 php4/ext/domxml/php_domxml.h:1.39 --- php4/ext/domxml/php_domxml.h:1.38 Fri Jan 18 02:58:47 2002 +++ php4/ext/domxml/php_domxml.h Fri Jan 18 06:04:10 2002 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_domxml.h,v 1.38 2002/01/18 07:58:47 chregu Exp $ */ +/* $Id: php_domxml.h,v 1.39 2002/01/18 11:04:10 chregu Exp $ */ #ifndef PHP_DOMXML_H #define PHP_DOMXML_H @@ -118,6 +118,7 @@ PHP_FUNCTION(domxml_node_replace_node); PHP_FUNCTION(domxml_node_new_child); PHP_FUNCTION(domxml_node_set_content); +PHP_FUNCTION(domxml_node_get_content); PHP_FUNCTION(domxml_node_text_concat); PHP_FUNCTION(domxml_node_set_name); PHP_FUNCTION(domxml_node_name);

« previous php.cvs (#9085) next »