From: Christian Stocker Date: Fri, 18 Jan 2002 11:04:10 +0000 (+0000) Subject: @- Added function domxml_node_get_content() (chregu) X-Git-Tag: PRE_ISSET_PATCH~170 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=afb8248e91222d3d407ba1cb1b755d73859667e3;p=php @- Added function domxml_node_get_content() (chregu) --- diff --git a/ext/domxml/php_domxml.c b/ext/domxml/php_domxml.c index 53e2280f89..0e41d88305 100644 --- a/ext/domxml/php_domxml.c +++ b/ext/domxml/php_domxml.c @@ -188,11 +188,11 @@ static zend_function_entry domxml_functions[] = { 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 @@ static zend_function_entry php_domxmlnode_class_functions[] = { 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) @@ -2025,6 +2026,30 @@ PHP_FUNCTION(domxml_node_set_content) } /* }}} */ +/* {{{ 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 }}} */ diff --git a/ext/domxml/php_domxml.h b/ext/domxml/php_domxml.h index e58e1d3a81..57913628b4 100644 --- a/ext/domxml/php_domxml.h +++ b/ext/domxml/php_domxml.h @@ -118,6 +118,7 @@ PHP_FUNCTION(domxml_node_unlink_node); 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);