sterling Sun Jun 29 23:08:49 2003 EDT Modified files: /php-src/ext/simplexml simplexml.c Log: satisfy my very first user :) Index: php-src/ext/simplexml/simplexml.c diff -u php-src/ext/simplexml/simplexml.c:1.44 php-src/ext/simplexml/simplexml.c:1.45 --- php-src/ext/simplexml/simplexml.c:1.44 Sat Jun 28 17:38:44 2003 +++ php-src/ext/simplexml/simplexml.c Sun Jun 29 23:08:48 2003 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: simplexml.c,v 1.44 2003/06/28 21:38:44 rrichards Exp $ */ +/* $Id: simplexml.c,v 1.45 2003/06/30 03:08:48 sterling Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -84,7 +84,18 @@ static inline int match_ns(php_sxe_object *sxe, xmlNodePtr node, xmlChar *name) { - if (!xmlStrcmp(node->ns->prefix, name) || !xmlStrcmp((xmlChar *) xmlHashLookup(sxe->nsmap, node->ns->href), name)) { + xmlChar *prefix; + + prefix = xmlHashLookup(sxe->nsmap, node->ns->href); + if (prefix == NULL) { + prefix = node->ns->prefix; + } + + if (prefix == NULL) { + return 0; + } + + if (!xmlStrcmp(prefix, name)) { return 1; } @@ -139,7 +150,7 @@ if (node->ns) { if (node->parent->ns) { if (!xmlStrcmp(node->ns->href, node->parent->ns->href)) { - goto next_iter; + goto this_iter; } } @@ -150,6 +161,7 @@ goto next_iter; } } +this_iter: if (!xmlStrcmp(node->name, name)) { APPEND_PREV_ELEMENT(counter, value); @@ -1048,7 +1060,7 @@ { php_info_print_table_start(); php_info_print_table_header(2, "Simplexml support", "enabled"); - php_info_print_table_row(2, "Revision", "$Revision: 1.44 $"); + php_info_print_table_row(2, "Revision", "$Revision: 1.45 $"); php_info_print_table_end(); }
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php