cvs: php4 /ext/domxml php_domxml.c

From: Date: Sat, 17 Aug 2002 11:47:22 +0000
Subject: cvs: php4 /ext/domxml php_domxml.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-13430@lists.php.net to get a copy of this message
chregu Sat Aug 17 07:47:22 2002 EDT Modified files: /php4/ext/domxml php_domxml.c Log: More W3C conformance stuff (they returned all false before..) - DomNode->attributes() returns NULL, if not found. - DomNode->first_child() returns NULL, if not found - DomNode->last_child() returns NULL, if not found. - DomNode->namespace_uri() returns NULL, if not found. Index: php4/ext/domxml/php_domxml.c diff -u php4/ext/domxml/php_domxml.c:1.195 php4/ext/domxml/php_domxml.c:1.196 --- php4/ext/domxml/php_domxml.c:1.195 Fri Aug 16 04:42:41 2002 +++ php4/ext/domxml/php_domxml.c Sat Aug 17 07:47:21 2002 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_domxml.c,v 1.195 2002/08/16 08:42:41 chregu Exp $ */ +/* $Id: php_domxml.c,v 1.196 2002/08/17 11:47:21 chregu Exp $ */ /* TODO * - Support Notation Nodes @@ -2073,7 +2073,7 @@ first = nodep->children; if (!first) { - RETURN_FALSE; + return; } DOMXML_RET_OBJ(rv, first, &ret); @@ -2094,7 +2094,7 @@ last = nodep->last; if (!last) { - RETURN_FALSE; + return; } DOMXML_RET_OBJ(rv, last, &ret); @@ -2247,7 +2247,8 @@ ns = nodep->ns; if (!ns) { - RETURN_EMPTY_STRING(); + /* return NULL if no ns is given...*/ + return; } if (ns->href) { @@ -2565,17 +2566,22 @@ { zval *id, *attrs; xmlNode *nodep; + int ret; #ifdef oldstyle_for_libxml_1_8_7 xmlAttr *attr; #endif DOMXML_PARAM_NONE(nodep, id, le_domxmlnodep); - - if (node_attributes(&attrs, nodep TSRMLS_CC) < 0) + ret = node_attributes(&attrs, nodep TSRMLS_CC); + if ( ret == -1) { RETURN_FALSE; + } - *return_value = *attrs; - FREE_ZVAL(attrs); + if ( ret > -1) { + *return_value = *attrs; + FREE_ZVAL(attrs); + } + #ifdef oldstyle_for_libxml_1_8_7 attr = nodep->properties; @@ -4532,7 +4538,7 @@ return -1; attr = nodep->properties; if (!attr) - return -1; + return -2; /* create an php array for the children */ MAKE_STD_ZVAL(*attributes);

« previous php.cvs (#13430) next »