summaryrefslogtreecommitdiff
path: root/ext/domxml/php_domxml.c
diff options
context:
space:
mode:
authorChristian Stocker <chregu@php.net>2002-07-07 17:19:29 +0000
committerChristian Stocker <chregu@php.net>2002-07-07 17:19:29 +0000
commite5bcd202ce216ca9ab2e898d0522e7be4d97efab (patch)
tree4265c6104270dc043c6afba7fca61412221fb68e /ext/domxml/php_domxml.c
parentafb93a20cbfdb392c793d0300e43758fae0cc18f (diff)
downloadphp-git-e5bcd202ce216ca9ab2e898d0522e7be4d97efab.tar.gz
@ - Added domxml_node_namespace_uri() (Rui Lopes).
Diffstat (limited to 'ext/domxml/php_domxml.c')
-rw-r--r--ext/domxml/php_domxml.c29
1 files changed, 28 insertions, 1 deletions
diff --git a/ext/domxml/php_domxml.c b/ext/domxml/php_domxml.c
index c25d26ed01..0fed77891d 100644
--- a/ext/domxml/php_domxml.c
+++ b/ext/domxml/php_domxml.c
@@ -386,7 +386,8 @@ static zend_function_entry php_domxmlnode_class_functions[] = {
PHP_FALIAS(new_child, domxml_node_new_child, NULL)
PHP_FALIAS(attributes, domxml_node_attributes, NULL)
PHP_FALIAS(has_attributes, domxml_node_has_attributes, NULL)
- PHP_FALIAS(prefix, domxml_node_prefix, NULL)
+ PHP_FALIAS(prefix, domxml_node_prefix, NULL)
+ PHP_FALIAS(namespace_uri, domxml_node_namespace_uri, NULL)
PHP_FALIAS(clone_node, domxml_clone_node, NULL)
/* Non DOM functions start here */
PHP_FALIAS(add_child, domxml_node_append_child, NULL)
@@ -2184,6 +2185,32 @@ PHP_FUNCTION(domxml_node_prefix)
}
/* }}} */
+/* {{{ proto string domxml_node_namespace_uri(void)
+ Returns namespace uri of node */
+PHP_FUNCTION(domxml_node_namespace_uri)
+{
+ zval *id;
+ xmlNode *nodep;
+ xmlNsPtr ns;
+
+ DOMXML_GET_THIS_OBJ(nodep, id, le_domxmlnodep);
+
+ DOMXML_NO_ARGS();
+
+ ns = nodep->ns;
+ if (!ns) {
+ RETURN_EMPTY_STRING();
+ }
+
+ if (ns->href) {
+ RETURN_STRING((char *) (ns->href), 1);
+ } else {
+ RETURN_EMPTY_STRING();
+ }
+}
+/* }}} */
+
+
/* {{{ proto object domxml_node_parent(void)
Returns parent of node */
PHP_FUNCTION(domxml_node_parent)