Lines Matching refs:node
47 static xmlNodePtr php_sxe_iterator_fetch(php_sxe_object *sxe, xmlNodePtr node, int use_data);
57 static void node_as_zval(php_sxe_object *sxe, xmlNodePtr node, zval *value, SXE_ITER itertype, zend… in node_as_zval() argument
73 php_libxml_increment_node_ptr((php_libxml_node_object *)subnode, node, NULL); in node_as_zval()
79 static void node_as_zval_str(php_sxe_object *sxe, xmlNodePtr node, zval *value, SXE_ITER itertype, … in node_as_zval_str() argument
83 node_as_zval(sxe, node, value, itertype, name_str, ns_str, isprefix); in node_as_zval_str()
90 static xmlNodePtr php_sxe_get_first_node_non_destructive(php_sxe_object *sxe, xmlNodePtr node) in php_sxe_get_first_node_non_destructive() argument
95 return node; in php_sxe_get_first_node_non_destructive()
99 static inline int match_ns(xmlNodePtr node, const zend_string *name, int prefix) /* {{{ */ in match_ns() argument
101 if (name == NULL && (node->ns == NULL || node->ns->prefix == NULL)) { in match_ns()
105 …if (node->ns && xmlStrEqual(prefix ? node->ns->prefix : node->ns->href, name ? BAD_CAST ZSTR_VAL(n… in match_ns()
113 static xmlNodePtr sxe_get_element_by_offset(php_sxe_object *sxe, zend_long offset, xmlNodePtr node,… in sxe_get_element_by_offset() argument
122 return node; in sxe_get_element_by_offset()
127 while (node && nodendx <= offset) { in sxe_get_element_by_offset()
128 if (node->type == XML_ELEMENT_NODE && match_ns(node, sxe->iter.nsprefix, sxe->iter.isprefix)) { in sxe_get_element_by_offset()
130 …sxe->iter.type == SXE_ITER_ELEMENT && xmlStrEqual(node->name, BAD_CAST ZSTR_VAL(sxe->iter.name))))… in sxe_get_element_by_offset()
137 node = node->next; in sxe_get_element_by_offset()
144 return node; in sxe_get_element_by_offset()
148 static xmlNodePtr sxe_find_element_by_name(php_sxe_object *sxe, xmlNodePtr node, const zend_string … in sxe_find_element_by_name() argument
151 while (node) { in sxe_find_element_by_name()
152 if (node->type == XML_ELEMENT_NODE && match_ns(node, sxe->iter.nsprefix, sxe->iter.isprefix)) { in sxe_find_element_by_name()
153 if (xmlStrEqual(node->name, raw_name)) { in sxe_find_element_by_name()
154 return node; in sxe_find_element_by_name()
157 node = node->next; in sxe_find_element_by_name()
162 static xmlNodePtr sxe_get_element_by_name(php_sxe_object *sxe, xmlNodePtr node, char *name, SXE_ITE… in sxe_get_element_by_name() argument
165 xmlNodePtr orgnode = node; in sxe_get_element_by_name()
173 node = php_sxe_get_first_node_non_destructive(sxe, node); in sxe_get_element_by_name()
178 orgnode = sxe_find_element_by_name(sxe, node, sxe->iter.name); in sxe_get_element_by_name()
182 node = orgnode->children; in sxe_get_element_by_name()
185 while (node) { in sxe_get_element_by_name()
186 if (node->type == XML_ELEMENT_NODE && match_ns(node, sxe->iter.nsprefix, sxe->iter.isprefix)) { in sxe_get_element_by_name()
187 if (xmlStrEqual(node->name, (xmlChar *)name)) { in sxe_get_element_by_name()
192 node = node->next; in sxe_get_element_by_name()
204 xmlNodePtr node; in sxe_prop_dim_read() local
241 GET_NODE(sxe, node); in sxe_prop_dim_read()
246 node = php_sxe_get_first_node_non_destructive(sxe, node); in sxe_prop_dim_read()
247 attr = (xmlAttrPtr)node; in sxe_prop_dim_read()
250 node = php_sxe_get_first_node_non_destructive(sxe, node); in sxe_prop_dim_read()
251 attr = node ? node->properties : NULL; in sxe_prop_dim_read()
253 if (!member && node && node->parent && in sxe_prop_dim_read()
254 node->parent->type == XML_DOCUMENT_NODE) { in sxe_prop_dim_read()
263 if (node) { in sxe_prop_dim_read()
290 if (!sxe->node) { in sxe_prop_dim_read()
291 php_libxml_increment_node_ptr((php_libxml_node_object *)sxe, node, NULL); in sxe_prop_dim_read()
295 xmlNodePtr mynode = node; in sxe_prop_dim_read()
298 node = php_sxe_get_first_node_non_destructive(sxe, node); in sxe_prop_dim_read()
305 node = sxe_get_element_by_offset(sxe, Z_LVAL_P(member), node, &cnt); in sxe_prop_dim_read()
307 node = NULL; in sxe_prop_dim_read()
309 if (node) { in sxe_prop_dim_read()
310 node_as_zval(sxe, node, rv, SXE_ITER_NONE, NULL, sxe->iter.nsprefix, sxe->iter.isprefix); in sxe_prop_dim_read()
315 node = xmlNewTextChild(mynode->parent, mynode->ns, mynode->name, NULL); in sxe_prop_dim_read()
316 node_as_zval(sxe, node, rv, SXE_ITER_NONE, NULL, sxe->iter.nsprefix, sxe->iter.isprefix); in sxe_prop_dim_read()
320 if (type != BP_VAR_IS || sxe_find_element_by_name(sxe, node->children, name)) { in sxe_prop_dim_read()
321 node_as_zval(sxe, node, rv, SXE_ITER_ELEMENT, name, sxe->iter.nsprefix, sxe->iter.isprefix); in sxe_prop_dim_read()
356 static void change_node_zval(xmlNodePtr node, zend_string *value) in change_node_zval() argument
358 xmlChar *buffer = xmlEncodeEntitiesReentrant(node->doc, (xmlChar *)ZSTR_VAL(value)); in change_node_zval()
361 xmlNodeSetContent(node, buffer); in change_node_zval()
371 xmlNodePtr node; in sxe_prop_dim_write() local
427 GET_NODE(sxe, node); in sxe_prop_dim_write()
432 node = php_sxe_get_first_node_non_destructive(sxe, node); in sxe_prop_dim_write()
433 attr = (xmlAttrPtr)node; in sxe_prop_dim_write()
436 mynode = node; in sxe_prop_dim_write()
437 node = php_sxe_get_first_node_non_destructive(sxe, node); in sxe_prop_dim_write()
438 attr = node ? node->properties : NULL; in sxe_prop_dim_write()
440 if (!member && node && node->parent && in sxe_prop_dim_write()
441 node->parent->type == XML_DOCUMENT_NODE) { in sxe_prop_dim_write()
449 if (attribs && !node && sxe->iter.type == SXE_ITER_ELEMENT) { in sxe_prop_dim_write()
450 node = xmlNewChild(mynode, mynode->ns, BAD_CAST ZSTR_VAL(sxe->iter.name), NULL); in sxe_prop_dim_write()
451 attr = node->properties; in sxe_prop_dim_write()
455 mynode = node; in sxe_prop_dim_write()
487 if (node) { in sxe_prop_dim_write()
488 php_libxml_invalidate_node_list_cache_from_doc(node->doc); in sxe_prop_dim_write()
518 if (node->type == XML_ATTRIBUTE_NODE) { in sxe_prop_dim_write()
527 newnode = node; in sxe_prop_dim_write()
534 newnode = sxe_get_element_by_offset(sxe, Z_LVAL_P(member), node, &cnt); in sxe_prop_dim_write()
540 node = node->children; in sxe_prop_dim_write()
541 while (node) { in sxe_prop_dim_write()
542 SKIP_TEXT(node); in sxe_prop_dim_write()
544 …if (xmlStrEqual(node->name, (xmlChar *)Z_STRVAL_P(member)) && match_ns(node, sxe->iter.nsprefix, s… in sxe_prop_dim_write()
545 newnode = node; in sxe_prop_dim_write()
550 node = node->next; in sxe_prop_dim_write()
570 if (!node) { in sxe_prop_dim_write()
586 …newnode = (xmlNodePtr)xmlNewProp(node, (xmlChar *)Z_STRVAL_P(member), value_str ? (xmlChar *)ZSTR_… in sxe_prop_dim_write()
624 xmlNodePtr node; in sxe_property_get_adr() local
631 GET_NODE(sxe, node); in sxe_property_get_adr()
632 if (UNEXPECTED(!node)) { in sxe_property_get_adr()
636 node = sxe_get_element_by_name(sxe, node, name, &type); in sxe_property_get_adr()
637 if (node) { in sxe_property_get_adr()
641 if (sxe_prop_dim_write(object, &member, NULL, 1, 0, &node) == &EG(error_zval)) { in sxe_property_get_adr()
646 node_as_zval(sxe, node, &ret, type, NULL, sxe->iter.nsprefix, sxe->iter.isprefix); in sxe_property_get_adr()
662 xmlNodePtr node; in sxe_prop_dim_exists() local
679 GET_NODE(sxe, node); in sxe_prop_dim_exists()
686 node = php_sxe_get_first_node_non_destructive(sxe, node); in sxe_prop_dim_exists()
694 node = php_sxe_get_first_node_non_destructive(sxe, node); in sxe_prop_dim_exists()
695 attr = (xmlAttrPtr)node; in sxe_prop_dim_exists()
698 node = php_sxe_get_first_node_non_destructive(sxe, node); in sxe_prop_dim_exists()
699 attr = node ? node->properties : NULL; in sxe_prop_dim_exists()
703 if (node) { in sxe_prop_dim_exists()
738 node = php_sxe_get_first_node_non_destructive(sxe, node); in sxe_prop_dim_exists()
740 node = sxe_get_element_by_offset(sxe, Z_LVAL_P(member), node, NULL); in sxe_prop_dim_exists()
742 node = sxe_find_element_by_name(sxe, node->children, Z_STR_P(member)); in sxe_prop_dim_exists()
744 if (node) { in sxe_prop_dim_exists()
747 (!node->children || (node->children->type == XML_TEXT_NODE && !node->children->next && in sxe_prop_dim_exists()
748 …(!node->children->content || !node->children->content[0] || xmlStrEqual(node->children->content, (… in sxe_prop_dim_exists()
783 xmlNodePtr node; in sxe_prop_dim_delete() local
801 GET_NODE(sxe, node); in sxe_prop_dim_delete()
808 node = php_sxe_get_first_node_non_destructive(sxe, node); in sxe_prop_dim_delete()
816 node = php_sxe_get_first_node_non_destructive(sxe, node); in sxe_prop_dim_delete()
817 attr = (xmlAttrPtr)node; in sxe_prop_dim_delete()
820 node = php_sxe_get_first_node_non_destructive(sxe, node); in sxe_prop_dim_delete()
821 attr = node ? node->properties : NULL; in sxe_prop_dim_delete()
825 if (node) { in sxe_prop_dim_delete()
826 php_libxml_invalidate_node_list_cache_from_doc(node->doc); in sxe_prop_dim_delete()
859 node = php_sxe_get_first_node_non_destructive(sxe, node); in sxe_prop_dim_delete()
861 node = sxe_get_element_by_offset(sxe, Z_LVAL_P(member), node, NULL); in sxe_prop_dim_delete()
862 if (node) { in sxe_prop_dim_delete()
863 xmlUnlinkNode(node); in sxe_prop_dim_delete()
864 php_libxml_node_free_resource(node); in sxe_prop_dim_delete()
867 node = node->children; in sxe_prop_dim_delete()
868 while (node) { in sxe_prop_dim_delete()
869 nnext = node->next; in sxe_prop_dim_delete()
871 SKIP_TEXT(node); in sxe_prop_dim_delete()
873 …if (xmlStrEqual(node->name, (xmlChar *)Z_STRVAL_P(member)) && match_ns(node, sxe->iter.nsprefix, s… in sxe_prop_dim_delete()
874 xmlUnlinkNode(node); in sxe_prop_dim_delete()
875 php_libxml_node_free_resource(node); in sxe_prop_dim_delete()
879 node = nnext; in sxe_prop_dim_delete()
924 static void get_base_node_value(php_sxe_object *sxe_ref, xmlNodePtr node, zval *value, zend_string … in get_base_node_value() argument
929 if (node->children && node->children->type == XML_TEXT_NODE && !xmlIsBlankNode(node->children)) { in get_base_node_value()
930 contents = xmlNodeListGetString(node->doc, node->children, 1); in get_base_node_value()
943 php_libxml_increment_node_ptr((php_libxml_node_object *)subnode, node, NULL); in get_base_node_value()
977 xmlNodePtr node; in sxe_prop_is_empty() local
985 GET_NODE(sxe, node); in sxe_prop_is_empty()
986 if (!node) { in sxe_prop_is_empty()
991 node = php_sxe_get_first_node_non_destructive(sxe, node); in sxe_prop_is_empty()
993 if (node && node->type != XML_ENTITY_DECL) { in sxe_prop_is_empty()
994 attr = node->properties; in sxe_prop_is_empty()
1004 GET_NODE(sxe, node); in sxe_prop_is_empty()
1005 node = php_sxe_get_first_node_non_destructive(sxe, node); in sxe_prop_is_empty()
1007 if (node && sxe->iter.type != SXE_ITER_ATTRLIST) { in sxe_prop_is_empty()
1008 if (node->type == XML_ATTRIBUTE_NODE) { in sxe_prop_is_empty()
1011 …SXE_ITER_NONE || !node->children || !node->parent || node->children->next || node->children->child… in sxe_prop_is_empty()
1012 node = node->children; in sxe_prop_is_empty()
1014 node = php_sxe_reset_iterator_no_clear_iter_data(sxe, 0); in sxe_prop_is_empty()
1019 while (node) { in sxe_prop_is_empty()
1020 if (node->children != NULL || node->prev != NULL || node->next != NULL) { in sxe_prop_is_empty()
1021 SKIP_TEXT(node); in sxe_prop_is_empty()
1023 if (node->type == XML_TEXT_NODE) { in sxe_prop_is_empty()
1024 const xmlChar *cur = node->content; in sxe_prop_is_empty()
1033 …if (node->type == XML_ELEMENT_NODE && (! match_ns(node, sxe->iter.nsprefix, sxe->iter.isprefix))) { in sxe_prop_is_empty()
1037 if (!node->name) { in sxe_prop_is_empty()
1045 node = php_sxe_iterator_fetch(sxe, node->next, 0); in sxe_prop_is_empty()
1047 node = node->next; in sxe_prop_is_empty()
1063 xmlNodePtr node; in sxe_get_prop_hash() local
1081 GET_NODE(sxe, node); in sxe_get_prop_hash()
1082 if (!node) { in sxe_get_prop_hash()
1087 node = php_sxe_get_first_node_non_destructive(sxe, node); in sxe_get_prop_hash()
1089 if (node && node->type != XML_ENTITY_DECL) { in sxe_get_prop_hash()
1090 attr = node->properties; in sxe_get_prop_hash()
1108 GET_NODE(sxe, node); in sxe_get_prop_hash()
1109 node = php_sxe_get_first_node_non_destructive(sxe, node); in sxe_get_prop_hash()
1111 if (node && sxe->iter.type != SXE_ITER_ATTRLIST) { in sxe_get_prop_hash()
1112 if (node->type == XML_ATTRIBUTE_NODE) { in sxe_get_prop_hash()
1113 ZVAL_STR(&value, sxe_xmlNodeListGetString(node->doc, node->children, 1)); in sxe_get_prop_hash()
1115 node = NULL; in sxe_get_prop_hash()
1117 …_NONE || !node->children || !node->parent || !node->next || node->children->next || node->children… in sxe_get_prop_hash()
1118 node = node->children; in sxe_get_prop_hash()
1120 node = php_sxe_reset_iterator_no_clear_iter_data(sxe, 0); in sxe_get_prop_hash()
1125 while (node) { in sxe_get_prop_hash()
1126 if (node->children != NULL || node->prev != NULL || node->next != NULL || xmlIsBlankNode(node)) { in sxe_get_prop_hash()
1127 SKIP_TEXT(node); in sxe_get_prop_hash()
1129 if (node->type == XML_TEXT_NODE) { in sxe_get_prop_hash()
1130 const xmlChar *cur = node->content; in sxe_get_prop_hash()
1133 ZVAL_STR(&value, sxe_xmlNodeListGetString(node->doc, node, 1)); in sxe_get_prop_hash()
1140 …if (node->type == XML_ELEMENT_NODE && (! match_ns(node, sxe->iter.nsprefix, sxe->iter.isprefix))) { in sxe_get_prop_hash()
1144 name = (char *) node->name; in sxe_get_prop_hash()
1148 namelen = xmlStrlen(node->name); in sxe_get_prop_hash()
1151 get_base_node_value(sxe, node, &value, sxe->iter.nsprefix, sxe->iter.isprefix); in sxe_get_prop_hash()
1159 if (UNEXPECTED(node->type == XML_ENTITY_DECL)) { in sxe_get_prop_hash()
1166 node = php_sxe_iterator_fetch(sxe, node->next, 0); in sxe_get_prop_hash()
1168 node = node->next; in sxe_get_prop_hash()
1210 if (sxe1->node != NULL && sxe2->node != NULL) { in sxe_objects_compare()
1212 if (sxe1->node == sxe2->node) { in sxe_objects_compare()
1218 if (sxe1->node == NULL && sxe2->node == NULL) { in sxe_objects_compare()
1264 sxe->xpath->node = nodeptr; in PHP_METHOD()
1353 xmlNodePtr node; in PHP_METHOD() local
1362 GET_NODE(sxe, node); in PHP_METHOD()
1363 node = php_sxe_get_first_node_non_destructive(sxe, node); in PHP_METHOD()
1365 if (!node) { in PHP_METHOD()
1373 if (node->parent && (XML_DOCUMENT_NODE == node->parent->type)) { in PHP_METHOD()
1376 bytes = sxe->document->handlers->dump_node_to_file(filename, doc, node, false, NULL); in PHP_METHOD()
1386 if (node->parent && (XML_DOCUMENT_NODE == node->parent->type)) { in PHP_METHOD()
1389 …result = sxe->document->handlers->dump_node_to_str(doc, node, false, (const char *) doc->encoding); in PHP_METHOD()
1421 static void sxe_add_namespaces(php_sxe_object *sxe, xmlNodePtr node, bool recursive, zval *return_v… in sxe_add_namespaces() argument
1425 if (node->ns) { in sxe_add_namespaces()
1426 sxe_add_namespace_name(return_value, node->ns); in sxe_add_namespaces()
1429 attr = node->properties; in sxe_add_namespaces()
1438 node = node->children; in sxe_add_namespaces()
1439 while (node) { in sxe_add_namespaces()
1440 if (node->type == XML_ELEMENT_NODE) { in sxe_add_namespaces()
1441 sxe_add_namespaces(sxe, node, recursive, return_value); in sxe_add_namespaces()
1443 node = node->next; in sxe_add_namespaces()
1482 xmlNodePtr node; in PHP_METHOD() local
1491 GET_NODE(sxe, node); in PHP_METHOD()
1492 node = php_sxe_get_first_node_non_destructive(sxe, node); in PHP_METHOD()
1494 if (node) { in PHP_METHOD()
1495 if (node->type == XML_ELEMENT_NODE) { in PHP_METHOD()
1496 sxe_add_namespaces(sxe, node, recursive, return_value); in PHP_METHOD()
1497 } else if (node->type == XML_ATTRIBUTE_NODE && node->ns) { in PHP_METHOD()
1498 sxe_add_namespace_name(return_value, node->ns); in PHP_METHOD()
1504 static void sxe_add_registered_namespaces(php_sxe_object *sxe, xmlNodePtr node, bool recursive, boo… in sxe_add_registered_namespaces() argument
1508 if (node->type == XML_ELEMENT_NODE) { in sxe_add_registered_namespaces()
1509 ns = node->nsDef; in sxe_add_registered_namespaces()
1515 for (const xmlAttr *attr = node->properties; attr; attr = attr->next) { in sxe_add_registered_namespaces()
1529 node = node->children; in sxe_add_registered_namespaces()
1530 while (node) { in sxe_add_registered_namespaces()
1531 sxe_add_registered_namespaces(sxe, node, recursive, include_xmlns_attributes, return_value); in sxe_add_registered_namespaces()
1532 node = node->next; in sxe_add_registered_namespaces()
1544 xmlNodePtr node; in PHP_METHOD() local
1557 node = xmlDocGetRootElement((xmlDocPtr)sxe->document->ptr); in PHP_METHOD()
1559 GET_NODE(sxe, node); in PHP_METHOD()
1562 if (node == NULL) { in PHP_METHOD()
1570 sxe_add_registered_namespaces(sxe, node, recursive, include_xmlns_attributes, return_value); in PHP_METHOD()
1579 xmlNodePtr node; in PHP_METHOD() local
1592 GET_NODE(sxe, node); in PHP_METHOD()
1593 node = php_sxe_get_first_node_non_destructive(sxe, node); in PHP_METHOD()
1594 if (!node) { in PHP_METHOD()
1598 node_as_zval(sxe, node, return_value, SXE_ITER_CHILD, NULL, nsprefix, isprefix); in PHP_METHOD()
1606 xmlNodePtr node; in PHP_METHOD() local
1615 GET_NODE(sxe, node); in PHP_METHOD()
1616 node = php_sxe_get_first_node_non_destructive(sxe, node); in PHP_METHOD()
1617 if (node) { in PHP_METHOD()
1618 namelen = xmlStrlen(node->name); in PHP_METHOD()
1619 RETURN_STRINGL((char*)node->name, namelen); in PHP_METHOD()
1631 xmlNodePtr node; in PHP_METHOD() local
1639 GET_NODE(sxe, node); in PHP_METHOD()
1640 node = php_sxe_get_first_node_non_destructive(sxe, node); in PHP_METHOD()
1641 if (!node) { in PHP_METHOD()
1649 node_as_zval(sxe, node, return_value, SXE_ITER_ATTRLIST, NULL, nsprefix, isprefix); in PHP_METHOD()
1659 xmlNodePtr node, newnode; in PHP_METHOD() local
1674 GET_NODE(sxe, node); in PHP_METHOD()
1681 node = php_sxe_get_first_node_non_destructive(sxe, node); in PHP_METHOD()
1683 if (node == NULL) { in PHP_METHOD()
1688 php_libxml_invalidate_node_list_cache_from_doc(node->doc); in PHP_METHOD()
1695 newnode = xmlNewChild(node, NULL, localname, (xmlChar *)value); in PHP_METHOD()
1702 nsptr = xmlSearchNsByHref(node->doc, node, (xmlChar *)nsuri); in PHP_METHOD()
1725 xmlNodePtr node; in PHP_METHOD() local
1741 GET_NODE(sxe, node); in PHP_METHOD()
1743 node = php_sxe_get_first_node_non_destructive(sxe, node); in PHP_METHOD()
1745 if (node && node->type != XML_ELEMENT_NODE) { in PHP_METHOD()
1746 node = node->parent; in PHP_METHOD()
1749 if (node == NULL) { in PHP_METHOD()
1767 attrp = xmlHasNsProp(node, localname, (xmlChar *)nsuri); in PHP_METHOD()
1774 nsptr = xmlSearchNsByHref(node->doc, node, (xmlChar *)nsuri); in PHP_METHOD()
1776 nsptr = xmlNewNs(node, (xmlChar *)nsuri, prefix); in PHP_METHOD()
1780 attrp = xmlNewNsProp(node, nsptr, localname, (xmlChar *)value); in PHP_METHOD()
1827 xmlNodePtr node; in sxe_object_cast_ex() local
1833 node = php_sxe_get_first_node_non_destructive(sxe, NULL); in sxe_object_cast_ex()
1834 if (node) { in sxe_object_cast_ex()
1843 node = php_sxe_get_first_node_non_destructive(sxe, NULL); in sxe_object_cast_ex()
1844 if (node) { in sxe_object_cast_ex()
1845 contents = xmlNodeListGetString((xmlDocPtr) sxe->document->ptr, node->children, 1); in sxe_object_cast_ex()
1848 if (!sxe->node) { in sxe_object_cast_ex()
1854 if (sxe->node && sxe->node->node) { in sxe_object_cast_ex()
1855 if (sxe->node->node->children) { in sxe_object_cast_ex()
1856 contents = xmlNodeListGetString((xmlDocPtr) sxe->document->ptr, sxe->node->node->children, 1); in sxe_object_cast_ex()
1857 } else if (sxe->node->node->type == XML_COMMENT_NODE || sxe->node->node->type == XML_PI_NODE) { in sxe_object_cast_ex()
1858 contents = sxe->node->node->content; in sxe_object_cast_ex()
1903 xmlNodePtr node = php_sxe_reset_iterator_no_clear_iter_data(sxe, 0); in php_sxe_count_elements_helper() local
1905 while (node) in php_sxe_count_elements_helper()
1908 node = php_sxe_iterator_fetch(sxe, node->next, 0); in php_sxe_count_elements_helper()
2007 if (intern == NULL || intern->node == NULL) { in PHP_METHOD()
2012 curnode = (xmlNodePtr)((php_libxml_node_ptr *)intern->node)->node; in PHP_METHOD()
2033 xmlNodePtr node; in PHP_METHOD() local
2044 GET_NODE(child, node); in PHP_METHOD()
2045 if (node) { in PHP_METHOD()
2046 node = node->children; in PHP_METHOD()
2048 while (node && node->type != XML_ELEMENT_NODE) { in PHP_METHOD()
2049 node = node->next; in PHP_METHOD()
2051 RETURN_BOOL(node ? 1 : 0); in PHP_METHOD()
2081 bool is_root_element = sxe->node && sxe->node->node && sxe->node->node->parent in sxe_object_clone()
2082 …&& (sxe->node->node->parent->type == XML_DOCUMENT_NODE || sxe->node->node->parent->type == XML_HTM… in sxe_object_clone()
2106 if (sxe->node) { in sxe_object_clone()
2110 nodep = xmlDocCopyNode(sxe->node->node, docp, 1); in sxe_object_clone()
2353 static xmlNodePtr php_sxe_iterator_fetch(php_sxe_object *sxe, xmlNodePtr node, int use_data) /* {{{… in php_sxe_iterator_fetch() argument
2360 while (node) { in php_sxe_iterator_fetch()
2361 if (node->type == XML_ATTRIBUTE_NODE) { in php_sxe_iterator_fetch()
2362 …if (xmlStrEqual(node->name, BAD_CAST ZSTR_VAL(sxe->iter.name)) && match_ns(node, prefix, isprefix)… in php_sxe_iterator_fetch()
2366 node = node->next; in php_sxe_iterator_fetch()
2369 while (node) { in php_sxe_iterator_fetch()
2370 if (node->type == XML_ATTRIBUTE_NODE) { in php_sxe_iterator_fetch()
2371 if (match_ns(node, prefix, isprefix)) { in php_sxe_iterator_fetch()
2375 node = node->next; in php_sxe_iterator_fetch()
2379 while (node) { in php_sxe_iterator_fetch()
2380 if (node->type == XML_ELEMENT_NODE) { in php_sxe_iterator_fetch()
2381 …if (xmlStrEqual(node->name, BAD_CAST ZSTR_VAL(sxe->iter.name)) && match_ns(node, prefix, isprefix)… in php_sxe_iterator_fetch()
2385 node = node->next; in php_sxe_iterator_fetch()
2388 while (node) { in php_sxe_iterator_fetch()
2389 if (node->type == XML_ELEMENT_NODE) { in php_sxe_iterator_fetch()
2390 if (match_ns(node, prefix, isprefix)) { in php_sxe_iterator_fetch()
2394 node = node->next; in php_sxe_iterator_fetch()
2398 if (node && use_data) { in php_sxe_iterator_fetch()
2399 node_as_zval(sxe, node, &sxe->iter.data, SXE_ITER_NONE, NULL, prefix, isprefix); in php_sxe_iterator_fetch()
2402 return node; in php_sxe_iterator_fetch()
2408 xmlNodePtr node; in php_sxe_reset_iterator_no_clear_iter_data() local
2409 GET_NODE(sxe, node) in php_sxe_reset_iterator_no_clear_iter_data()
2411 if (node) { in php_sxe_reset_iterator_no_clear_iter_data()
2416 node = node->children; in php_sxe_reset_iterator_no_clear_iter_data()
2419 node = (xmlNodePtr) node->properties; in php_sxe_reset_iterator_no_clear_iter_data()
2424 return php_sxe_iterator_fetch(sxe, node, use_data); in php_sxe_reset_iterator_no_clear_iter_data()
2502 if (intern != NULL && intern->node != NULL) { in php_sxe_iterator_current_key()
2503 curnode = (xmlNodePtr)((php_libxml_node_ptr *)intern->node)->node; in php_sxe_iterator_current_key()
2516 xmlNodePtr node = NULL; in php_sxe_move_forward_iterator() local
2521 GET_NODE(intern, node) in php_sxe_move_forward_iterator()
2526 if (node) { in php_sxe_move_forward_iterator()
2527 php_sxe_iterator_fetch(sxe, node->next, 1); in php_sxe_move_forward_iterator()
2559 xmlNodePtr node; in simplexml_export_node() local
2562 GET_NODE(sxe, node); in simplexml_export_node()
2563 return php_sxe_get_first_node_non_destructive(sxe, node); in simplexml_export_node()
2571 zval *node; in PHP_FUNCTION() local
2577 if (zend_parse_parameters(ZEND_NUM_ARGS(), "o|C!", &node, &ce) == FAILURE) { in PHP_FUNCTION()
2581 nodep = php_libxml_import_node(node); in PHP_FUNCTION()
2605 object = Z_LIBXML_NODE_P(node); in PHP_FUNCTION()