}
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);
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;
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);
}
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;
}
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);
}