rrichards               Wed Jan 14 14:00:18 2004 EDT

  Modified files:              
    /php-src/ext/simplexml      simplexml.c 
  Log:
  test user define namespace aliases
  
Index: php-src/ext/simplexml/simplexml.c
diff -u php-src/ext/simplexml/simplexml.c:1.104 php-src/ext/simplexml/simplexml.c:1.105
--- php-src/ext/simplexml/simplexml.c:1.104     Tue Jan 13 16:28:40 2004
+++ php-src/ext/simplexml/simplexml.c   Wed Jan 14 14:00:16 2004
@@ -17,7 +17,7 @@
   +----------------------------------------------------------------------+
 */
 
-/* $Id: simplexml.c,v 1.104 2004/01/13 21:28:40 rrichards Exp $ */
+/* $Id: simplexml.c,v 1.105 2004/01/14 19:00:16 rrichards Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -165,7 +165,9 @@
                        }
                        attr = node->properties;
                        while (attr) {
-                               if (!xmlStrcmp(attr->name, localname) && (prefix==NULL 
|| (attr->ns && !xmlStrcmp(attr->ns->prefix, prefix)))) {
+                               if (!xmlStrcmp(attr->name, localname) && (prefix==NULL 
|| 
+                                       (attr->ns && (!xmlStrcmp(attr->ns->prefix, 
prefix) || match_ns(sxe, (xmlNodePtr) attr, prefix))))) {
+
                                        APPEND_PREV_ELEMENT(counter, value);
                                        
                                        MAKE_STD_ZVAL(value);
@@ -292,7 +294,7 @@
        xmlNodePtr      node;
        xmlNodePtr      newnode = NULL;
        xmlNodePtr              tempnode;
-       xmlAttrPtr      attr = NULL;
+       xmlAttrPtr      attrptr, attr = NULL;
        int             counter = 0;
        int             is_attr = 0;
        zval            tmp_zv, trim_zv;
@@ -335,15 +337,17 @@
                        if (localname == NULL) {
                                localname = (xmlChar *)name;
                        }
-                       attr = node->properties;
-                       while (attr) {
-                               if (!xmlStrcmp(attr->name, localname) && (prefix==NULL 
|| (attr->ns && !xmlStrcmp(attr->ns->prefix, prefix)))) {
+                       attrptr = node->properties;
+                       while (attrptr) {
+                               if (!xmlStrcmp(attrptr->name, localname) && 
(prefix==NULL || 
+                                       (attrptr->ns && 
(!xmlStrcmp(attrptr->ns->prefix, prefix) || match_ns(sxe, (xmlNodePtr) attrptr, 
prefix))))) {
+
+                                       attr = attrptr;
                                        is_attr = 1;
                                        ++counter;
-                                       break;
                                }
        
-                               attr = attr->next;
+                               attrptr = attrptr->next;
                        }
                        if (prefix) {
                                xmlFree(prefix);
@@ -440,7 +444,9 @@
                        }
                        attr = node->properties;
                        while (attr) {
-                               if (!xmlStrcmp(attr->name, localname) && (prefix==NULL 
|| (attr->ns && !xmlStrcmp(attr->ns->prefix, prefix)))) {
+                               if (!xmlStrcmp(attr->name, localname) && (prefix==NULL 
|| 
+                                       (attr->ns && (!xmlStrcmp(attr->ns->prefix, 
prefix) || match_ns(sxe, (xmlNodePtr) attr, prefix))))) {
+
                                        exists = 1;
                                        break;
                                }
@@ -523,7 +529,9 @@
                        attr = node->properties;
                        while (attr) {
                                anext = attr->next;
-                               if (!xmlStrcmp(attr->name, localname) && (prefix==NULL 
|| (attr->ns && !xmlStrcmp(attr->ns->prefix, prefix)))) {
+                               if (!xmlStrcmp(attr->name, localname) && (prefix==NULL 
|| 
+                                       (attr->ns && (!xmlStrcmp(attr->ns->prefix, 
prefix) || match_ns(sxe, (xmlNodePtr) attr, prefix))))) {
+
                                        xmlUnlinkNode((xmlNodePtr) attr);
                                        php_libxml_node_free_resource((xmlNodePtr) 
attr TSRMLS_CC);
                                }
@@ -1574,7 +1582,7 @@
 {
        php_info_print_table_start();
        php_info_print_table_header(2, "Simplexml support", "enabled");
-       php_info_print_table_row(2, "Revision", "$Revision: 1.104 $");
+       php_info_print_table_row(2, "Revision", "$Revision: 1.105 $");
        php_info_print_table_row(2, "Schema support", 
 #ifdef LIBXML_SCHEMAS_ENABLED
                "enabled");

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to