Lines Matching refs:node

48 static xmlNodePtr php_sxe_iterator_fetch(php_sxe_object *sxe, xmlNodePtr node, int use_data);
58 static void _node_as_zval(php_sxe_object *sxe, xmlNodePtr node, zval *value, SXE_ITER itertype, cha… in _node_as_zval() argument
74 php_libxml_increment_node_ptr((php_libxml_node_object *)subnode, node, NULL); in _node_as_zval()
80 static xmlNodePtr php_sxe_get_first_node(php_sxe_object *sxe, xmlNodePtr node) in php_sxe_get_first_node() argument
85 return node; in php_sxe_get_first_node()
89 static inline int match_ns(php_sxe_object *sxe, xmlNodePtr node, xmlChar *name, int prefix) /* {{{ … in match_ns() argument
91 if (name == NULL && (node->ns == NULL || node->ns->prefix == NULL)) { in match_ns()
95 if (node->ns && xmlStrEqual(prefix ? node->ns->prefix : node->ns->href, name)) { in match_ns()
103 static xmlNodePtr sxe_get_element_by_offset(php_sxe_object *sxe, zend_long offset, xmlNodePtr node,… in sxe_get_element_by_offset() argument
112 return node; in sxe_get_element_by_offset()
117 while (node && nodendx <= offset) { in sxe_get_element_by_offset()
118 SKIP_TEXT(node) in sxe_get_element_by_offset()
119 …if (node->type == XML_ELEMENT_NODE && match_ns(sxe, node, sxe->iter.nsprefix, sxe->iter.isprefix))… in sxe_get_element_by_offset()
121 sxe->iter.type == SXE_ITER_ELEMENT && xmlStrEqual(node->name, sxe->iter.name))) { in sxe_get_element_by_offset()
129 node = node->next; in sxe_get_element_by_offset()
136 return node; in sxe_get_element_by_offset()
140 static xmlNodePtr sxe_find_element_by_name(php_sxe_object *sxe, xmlNodePtr node, xmlChar *name) /* … in sxe_find_element_by_name() argument
142 while (node) { in sxe_find_element_by_name()
143 SKIP_TEXT(node) in sxe_find_element_by_name()
144 …if (node->type == XML_ELEMENT_NODE && match_ns(sxe, node, sxe->iter.nsprefix, sxe->iter.isprefix))… in sxe_find_element_by_name()
145 if (xmlStrEqual(node->name, name)) { in sxe_find_element_by_name()
146 return node; in sxe_find_element_by_name()
150 node = node->next; in sxe_find_element_by_name()
155 static xmlNodePtr sxe_get_element_by_name(php_sxe_object *sxe, xmlNodePtr node, char *name, SXE_ITE… in sxe_get_element_by_name() argument
158 xmlNodePtr orgnode = node; in sxe_get_element_by_name()
166 node = php_sxe_get_first_node(sxe, node); in sxe_get_element_by_name()
171 orgnode = sxe_find_element_by_name(sxe, node, sxe->iter.name); in sxe_get_element_by_name()
175 node = orgnode->children; in sxe_get_element_by_name()
178 while (node) { in sxe_get_element_by_name()
179 SKIP_TEXT(node) in sxe_get_element_by_name()
180 …if (node->type == XML_ELEMENT_NODE && match_ns(sxe, node, sxe->iter.nsprefix, sxe->iter.isprefix))… in sxe_get_element_by_name()
181 if (xmlStrEqual(node->name, (xmlChar *)name)) { in sxe_get_element_by_name()
187 node = node->next; in sxe_get_element_by_name()
199 xmlNodePtr node; in sxe_prop_dim_read() local
236 GET_NODE(sxe, node); in sxe_prop_dim_read()
241 node = php_sxe_get_first_node(sxe, node); in sxe_prop_dim_read()
242 attr = (xmlAttrPtr)node; in sxe_prop_dim_read()
245 node = php_sxe_get_first_node(sxe, node); in sxe_prop_dim_read()
246 attr = node ? node->properties : NULL; in sxe_prop_dim_read()
248 if (!member && node && node->parent && in sxe_prop_dim_read()
249 node->parent->type == XML_DOCUMENT_NODE) { in sxe_prop_dim_read()
258 if (node) { in sxe_prop_dim_read()
285 if (!sxe->node) { in sxe_prop_dim_read()
286 php_libxml_increment_node_ptr((php_libxml_node_object *)sxe, node, NULL); in sxe_prop_dim_read()
290 xmlNodePtr mynode = node; in sxe_prop_dim_read()
293 node = php_sxe_get_first_node(sxe, node); in sxe_prop_dim_read()
300 node = sxe_get_element_by_offset(sxe, Z_LVAL_P(member), node, &cnt); in sxe_prop_dim_read()
302 node = NULL; in sxe_prop_dim_read()
304 if (node) { in sxe_prop_dim_read()
305 _node_as_zval(sxe, node, rv, SXE_ITER_NONE, NULL, sxe->iter.nsprefix, sxe->iter.isprefix); in sxe_prop_dim_read()
310 node = xmlNewTextChild(mynode->parent, mynode->ns, mynode->name, NULL); in sxe_prop_dim_read()
311 _node_as_zval(sxe, node, rv, SXE_ITER_NONE, NULL, sxe->iter.nsprefix, sxe->iter.isprefix); in sxe_prop_dim_read()
315 if (type != BP_VAR_IS || sxe_find_element_by_name(sxe, node->children, (xmlChar *) name)) { in sxe_prop_dim_read()
316 _node_as_zval(sxe, node, rv, SXE_ITER_ELEMENT, name, sxe->iter.nsprefix, sxe->iter.isprefix); in sxe_prop_dim_read()
351 static void change_node_zval(xmlNodePtr node, zend_string *value) in change_node_zval() argument
353 xmlChar *buffer = xmlEncodeEntitiesReentrant(node->doc, (xmlChar *)ZSTR_VAL(value)); in change_node_zval()
356 xmlNodeSetContent(node, buffer); in change_node_zval()
366 xmlNodePtr node; in sxe_prop_dim_write() local
422 GET_NODE(sxe, node); in sxe_prop_dim_write()
427 node = php_sxe_get_first_node(sxe, node); in sxe_prop_dim_write()
428 attr = (xmlAttrPtr)node; in sxe_prop_dim_write()
431 mynode = node; in sxe_prop_dim_write()
432 node = php_sxe_get_first_node(sxe, node); in sxe_prop_dim_write()
433 attr = node ? node->properties : NULL; in sxe_prop_dim_write()
435 if (!member && node && node->parent && in sxe_prop_dim_write()
436 node->parent->type == XML_DOCUMENT_NODE) { in sxe_prop_dim_write()
444 if (attribs && !node && sxe->iter.type == SXE_ITER_ELEMENT) { in sxe_prop_dim_write()
445 node = xmlNewChild(mynode, mynode->ns, sxe->iter.name, NULL); in sxe_prop_dim_write()
446 attr = node->properties; in sxe_prop_dim_write()
450 mynode = node; in sxe_prop_dim_write()
483 if (node) { in sxe_prop_dim_write()
484 php_libxml_invalidate_node_list_cache_from_doc(node->doc); in sxe_prop_dim_write()
514 if (node->type == XML_ATTRIBUTE_NODE) { in sxe_prop_dim_write()
523 newnode = node; in sxe_prop_dim_write()
530 newnode = sxe_get_element_by_offset(sxe, Z_LVAL_P(member), node, &cnt); in sxe_prop_dim_write()
536 node = node->children; in sxe_prop_dim_write()
537 while (node) { in sxe_prop_dim_write()
538 SKIP_TEXT(node); in sxe_prop_dim_write()
540 …if (xmlStrEqual(node->name, (xmlChar *)Z_STRVAL_P(member)) && match_ns(sxe, node, sxe->iter.nspref… in sxe_prop_dim_write()
541 newnode = node; in sxe_prop_dim_write()
546 node = node->next; in sxe_prop_dim_write()
566 if (!node) { in sxe_prop_dim_write()
582 …newnode = (xmlNodePtr)xmlNewProp(node, (xmlChar *)Z_STRVAL_P(member), value_str ? (xmlChar *)ZSTR_… in sxe_prop_dim_write()
620 xmlNodePtr node; in sxe_property_get_adr() local
627 GET_NODE(sxe, node); in sxe_property_get_adr()
628 if (UNEXPECTED(!node)) { in sxe_property_get_adr()
632 node = sxe_get_element_by_name(sxe, node, name, &type); in sxe_property_get_adr()
633 if (node) { in sxe_property_get_adr()
637 if (sxe_prop_dim_write(object, &member, NULL, 1, 0, &node) == &EG(error_zval)) { in sxe_property_get_adr()
643 _node_as_zval(sxe, node, &ret, type, name, sxe->iter.nsprefix, sxe->iter.isprefix); in sxe_property_get_adr()
659 xmlNodePtr node; in sxe_prop_dim_exists() local
676 GET_NODE(sxe, node); in sxe_prop_dim_exists()
683 node = php_sxe_get_first_node(sxe, node); in sxe_prop_dim_exists()
691 node = php_sxe_get_first_node(sxe, node); in sxe_prop_dim_exists()
692 attr = (xmlAttrPtr)node; in sxe_prop_dim_exists()
695 node = php_sxe_get_first_node(sxe, node); in sxe_prop_dim_exists()
696 attr = node ? node->properties : NULL; in sxe_prop_dim_exists()
700 if (node) { in sxe_prop_dim_exists()
735 node = php_sxe_get_first_node(sxe, node); in sxe_prop_dim_exists()
737 node = sxe_get_element_by_offset(sxe, Z_LVAL_P(member), node, NULL); in sxe_prop_dim_exists()
739 node = sxe_find_element_by_name(sxe, node->children, (xmlChar *)Z_STRVAL_P(member)); in sxe_prop_dim_exists()
741 if (node) { in sxe_prop_dim_exists()
744 (!node->children || (node->children->type == XML_TEXT_NODE && !node->children->next && in sxe_prop_dim_exists()
745 …(!node->children->content || !node->children->content[0] || xmlStrEqual(node->children->content, (… in sxe_prop_dim_exists()
780 xmlNodePtr node; in sxe_prop_dim_delete() local
798 GET_NODE(sxe, node); in sxe_prop_dim_delete()
805 node = php_sxe_get_first_node(sxe, node); in sxe_prop_dim_delete()
813 node = php_sxe_get_first_node(sxe, node); in sxe_prop_dim_delete()
814 attr = (xmlAttrPtr)node; in sxe_prop_dim_delete()
817 node = php_sxe_get_first_node(sxe, node); in sxe_prop_dim_delete()
818 attr = node ? node->properties : NULL; in sxe_prop_dim_delete()
822 if (node) { in sxe_prop_dim_delete()
823 php_libxml_invalidate_node_list_cache_from_doc(node->doc); in sxe_prop_dim_delete()
856 node = php_sxe_get_first_node(sxe, node); in sxe_prop_dim_delete()
858 node = sxe_get_element_by_offset(sxe, Z_LVAL_P(member), node, NULL); in sxe_prop_dim_delete()
859 if (node) { in sxe_prop_dim_delete()
860 xmlUnlinkNode(node); in sxe_prop_dim_delete()
861 php_libxml_node_free_resource(node); in sxe_prop_dim_delete()
864 node = node->children; in sxe_prop_dim_delete()
865 while (node) { in sxe_prop_dim_delete()
866 nnext = node->next; in sxe_prop_dim_delete()
868 SKIP_TEXT(node); in sxe_prop_dim_delete()
870 …if (xmlStrEqual(node->name, (xmlChar *)Z_STRVAL_P(member)) && match_ns(sxe, node, sxe->iter.nspref… in sxe_prop_dim_delete()
871 xmlUnlinkNode(node); in sxe_prop_dim_delete()
872 php_libxml_node_free_resource(node); in sxe_prop_dim_delete()
876 node = nnext; in sxe_prop_dim_delete()
921 static void _get_base_node_value(php_sxe_object *sxe_ref, xmlNodePtr node, zval *value, xmlChar *ns… in _get_base_node_value() argument
926 if (node->children && node->children->type == XML_TEXT_NODE && !xmlIsBlankNode(node->children)) { in _get_base_node_value()
927 contents = xmlNodeListGetString(node->doc, node->children, 1); in _get_base_node_value()
940 php_libxml_increment_node_ptr((php_libxml_node_object *)subnode, node, NULL); in _get_base_node_value()
974 xmlNodePtr node; in sxe_prop_is_empty() local
983 GET_NODE(sxe, node); in sxe_prop_is_empty()
984 if (!node) { in sxe_prop_is_empty()
989 node = php_sxe_get_first_node(sxe, node); in sxe_prop_is_empty()
991 if (!node || node->type != XML_ENTITY_DECL) { in sxe_prop_is_empty()
992 attr = node ? (xmlAttrPtr)node->properties : NULL; in sxe_prop_is_empty()
1002 GET_NODE(sxe, node); in sxe_prop_is_empty()
1003 node = php_sxe_get_first_node(sxe, node); in sxe_prop_is_empty()
1006 if (node && sxe->iter.type != SXE_ITER_ATTRLIST) { in sxe_prop_is_empty()
1007 if (node->type == XML_ATTRIBUTE_NODE) { in sxe_prop_is_empty()
1010 …SXE_ITER_NONE || !node->children || !node->parent || node->children->next || node->children->child… in sxe_prop_is_empty()
1011 node = node->children; in sxe_prop_is_empty()
1015 node = php_sxe_reset_iterator(sxe, 0); in sxe_prop_is_empty()
1020 while (node) { in sxe_prop_is_empty()
1021 if (node->children != NULL || node->prev != NULL || node->next != NULL) { in sxe_prop_is_empty()
1022 SKIP_TEXT(node); in sxe_prop_is_empty()
1024 if (node->type == XML_TEXT_NODE) { in sxe_prop_is_empty()
1025 const xmlChar *cur = node->content; in sxe_prop_is_empty()
1034 …if (node->type == XML_ELEMENT_NODE && (! match_ns(sxe, node, sxe->iter.nsprefix, sxe->iter.isprefi… in sxe_prop_is_empty()
1038 if (!node->name) { in sxe_prop_is_empty()
1046 node = php_sxe_iterator_fetch(sxe, node->next, 0); in sxe_prop_is_empty()
1048 node = node->next; in sxe_prop_is_empty()
1071 xmlNodePtr node; in sxe_get_prop_hash() local
1092 GET_NODE(sxe, node); in sxe_get_prop_hash()
1093 if (!node) { in sxe_get_prop_hash()
1098 node = php_sxe_get_first_node(sxe, node); in sxe_get_prop_hash()
1100 if (!node || node->type != XML_ENTITY_DECL) { in sxe_get_prop_hash()
1101 attr = node ? (xmlAttrPtr)node->properties : NULL; in sxe_get_prop_hash()
1119 GET_NODE(sxe, node); in sxe_get_prop_hash()
1120 node = php_sxe_get_first_node(sxe, node); in sxe_get_prop_hash()
1122 if (node && sxe->iter.type != SXE_ITER_ATTRLIST) { in sxe_get_prop_hash()
1123 if (node->type == XML_ATTRIBUTE_NODE) { in sxe_get_prop_hash()
1124 ZVAL_STR(&value, sxe_xmlNodeListGetString(node->doc, node->children, 1)); in sxe_get_prop_hash()
1126 node = NULL; in sxe_get_prop_hash()
1129 …_NONE || !node->children || !node->parent || !node->next || node->children->next || node->children… in sxe_get_prop_hash()
1130 node = node->children; in sxe_get_prop_hash()
1135 node = php_sxe_reset_iterator(sxe, 0); in sxe_get_prop_hash()
1141 while (node) { in sxe_get_prop_hash()
1142 if (node->children != NULL || node->prev != NULL || node->next != NULL || xmlIsBlankNode(node)) { in sxe_get_prop_hash()
1143 SKIP_TEXT(node); in sxe_get_prop_hash()
1145 if (node->type == XML_TEXT_NODE) { in sxe_get_prop_hash()
1146 const xmlChar *cur = node->content; in sxe_get_prop_hash()
1149 ZVAL_STR(&value, sxe_xmlNodeListGetString(node->doc, node, 1)); in sxe_get_prop_hash()
1156 …if (node->type == XML_ELEMENT_NODE && (! match_ns(sxe, node, sxe->iter.nsprefix, sxe->iter.isprefi… in sxe_get_prop_hash()
1160 name = (char *) node->name; in sxe_get_prop_hash()
1164 namelen = xmlStrlen(node->name); in sxe_get_prop_hash()
1167 _get_base_node_value(sxe, node, &value, sxe->iter.nsprefix, sxe->iter.isprefix); in sxe_get_prop_hash()
1175 if (UNEXPECTED(node->type == XML_ENTITY_DECL)) { in sxe_get_prop_hash()
1182 node = php_sxe_iterator_fetch(sxe, node->next, 0); in sxe_get_prop_hash()
1184 node = node->next; in sxe_get_prop_hash()
1233 if (sxe1->node != NULL && sxe2->node != NULL) { in sxe_objects_compare()
1235 if (sxe1->node == sxe2->node) { in sxe_objects_compare()
1241 if (sxe1->node == NULL && sxe2->node == NULL) { in sxe_objects_compare()
1287 sxe->xpath->node = nodeptr; in PHP_METHOD()
1375 xmlNodePtr node; in PHP_METHOD() local
1387 GET_NODE(sxe, node); in PHP_METHOD()
1388 node = php_sxe_get_first_node(sxe, node); in PHP_METHOD()
1390 if (!node) { in PHP_METHOD()
1395 if (node->parent && (XML_DOCUMENT_NODE == node->parent->type)) { in PHP_METHOD()
1410 xmlNodeDumpOutput(outbuf, (xmlDocPtr) sxe->document->ptr, node, 0, 0, NULL); in PHP_METHOD()
1416 if (node->parent && (XML_DOCUMENT_NODE == node->parent->type)) { in PHP_METHOD()
1434 …xmlNodeDumpOutput(outbuf, (xmlDocPtr) sxe->document->ptr, node, 0, 0, (const char *) ((xmlDocPtr) … in PHP_METHOD()
1469 static void sxe_add_namespaces(php_sxe_object *sxe, xmlNodePtr node, bool recursive, zval *return_v… in sxe_add_namespaces() argument
1473 if (node->ns) { in sxe_add_namespaces()
1474 sxe_add_namespace_name(return_value, node->ns); in sxe_add_namespaces()
1477 attr = node->properties; in sxe_add_namespaces()
1486 node = node->children; in sxe_add_namespaces()
1487 while (node) { in sxe_add_namespaces()
1488 if (node->type == XML_ELEMENT_NODE) { in sxe_add_namespaces()
1489 sxe_add_namespaces(sxe, node, recursive, return_value); in sxe_add_namespaces()
1491 node = node->next; in sxe_add_namespaces()
1530 xmlNodePtr node; in PHP_METHOD() local
1539 GET_NODE(sxe, node); in PHP_METHOD()
1540 node = php_sxe_get_first_node(sxe, node); in PHP_METHOD()
1542 if (node) { in PHP_METHOD()
1543 if (node->type == XML_ELEMENT_NODE) { in PHP_METHOD()
1544 sxe_add_namespaces(sxe, node, recursive, return_value); in PHP_METHOD()
1545 } else if (node->type == XML_ATTRIBUTE_NODE && node->ns) { in PHP_METHOD()
1546 sxe_add_namespace_name(return_value, node->ns); in PHP_METHOD()
1552 static void sxe_add_registered_namespaces(php_sxe_object *sxe, xmlNodePtr node, bool recursive, zva… in sxe_add_registered_namespaces() argument
1556 if (node->type == XML_ELEMENT_NODE) { in sxe_add_registered_namespaces()
1557 ns = node->nsDef; in sxe_add_registered_namespaces()
1563 node = node->children; in sxe_add_registered_namespaces()
1564 while (node) { in sxe_add_registered_namespaces()
1565 sxe_add_registered_namespaces(sxe, node, recursive, return_value); in sxe_add_registered_namespaces()
1566 node = node->next; in sxe_add_registered_namespaces()
1578 xmlNodePtr node; in PHP_METHOD() local
1591 node = xmlDocGetRootElement((xmlDocPtr)sxe->document->ptr); in PHP_METHOD()
1593 GET_NODE(sxe, node); in PHP_METHOD()
1596 if (node == NULL) { in PHP_METHOD()
1601 sxe_add_registered_namespaces(sxe, node, recursive, return_value); in PHP_METHOD()
1611 xmlNodePtr node; in PHP_METHOD() local
1624 GET_NODE(sxe, node); in PHP_METHOD()
1625 node = php_sxe_get_first_node(sxe, node); in PHP_METHOD()
1626 if (!node) { in PHP_METHOD()
1630 _node_as_zval(sxe, node, return_value, SXE_ITER_CHILD, NULL, (xmlChar *)nsprefix, isprefix); in PHP_METHOD()
1639 xmlNodePtr node; in PHP_METHOD() local
1648 GET_NODE(sxe, node); in PHP_METHOD()
1649 node = php_sxe_get_first_node(sxe, node); in PHP_METHOD()
1650 if (node) { in PHP_METHOD()
1651 namelen = xmlStrlen(node->name); in PHP_METHOD()
1652 RETURN_STRINGL((char*)node->name, namelen); in PHP_METHOD()
1665 xmlNodePtr node; in PHP_METHOD() local
1673 GET_NODE(sxe, node); in PHP_METHOD()
1674 node = php_sxe_get_first_node(sxe, node); in PHP_METHOD()
1675 if (!node) { in PHP_METHOD()
1683 _node_as_zval(sxe, node, return_value, SXE_ITER_ATTRLIST, NULL, (xmlChar *)nsprefix, isprefix); in PHP_METHOD()
1693 xmlNodePtr node, newnode; in PHP_METHOD() local
1708 GET_NODE(sxe, node); in PHP_METHOD()
1715 node = php_sxe_get_first_node(sxe, node); in PHP_METHOD()
1717 if (node == NULL) { in PHP_METHOD()
1722 php_libxml_invalidate_node_list_cache_from_doc(node->doc); in PHP_METHOD()
1729 newnode = xmlNewChild(node, NULL, localname, (xmlChar *)value); in PHP_METHOD()
1736 nsptr = xmlSearchNsByHref(node->doc, node, (xmlChar *)nsuri); in PHP_METHOD()
1759 xmlNodePtr node; in PHP_METHOD() local
1775 GET_NODE(sxe, node); in PHP_METHOD()
1777 node = php_sxe_get_first_node(sxe, node); in PHP_METHOD()
1779 if (node && node->type != XML_ELEMENT_NODE) { in PHP_METHOD()
1780 node = node->parent; in PHP_METHOD()
1783 if (node == NULL) { in PHP_METHOD()
1800 attrp = xmlHasNsProp(node, localname, (xmlChar *)nsuri); in PHP_METHOD()
1811 nsptr = xmlSearchNsByHref(node->doc, node, (xmlChar *)nsuri); in PHP_METHOD()
1813 nsptr = xmlNewNs(node, (xmlChar *)nsuri, prefix); in PHP_METHOD()
1817 attrp = xmlNewNsProp(node, nsptr, localname, (xmlChar *)value); in PHP_METHOD()
1864 xmlNodePtr node; in sxe_object_cast_ex() local
1870 node = php_sxe_get_first_node(sxe, NULL); in sxe_object_cast_ex()
1871 if (node) { in sxe_object_cast_ex()
1880 node = php_sxe_get_first_node(sxe, NULL); in sxe_object_cast_ex()
1881 if (node) { in sxe_object_cast_ex()
1882 contents = xmlNodeListGetString((xmlDocPtr) sxe->document->ptr, node->children, 1); in sxe_object_cast_ex()
1885 if (!sxe->node) { in sxe_object_cast_ex()
1891 if (sxe->node && sxe->node->node) { in sxe_object_cast_ex()
1892 if (sxe->node->node->children) { in sxe_object_cast_ex()
1893 contents = xmlNodeListGetString((xmlDocPtr) sxe->document->ptr, sxe->node->node->children, 1); in sxe_object_cast_ex()
1894 } else if (sxe->node->node->type == XML_COMMENT_NODE || sxe->node->node->type == XML_PI_NODE) { in sxe_object_cast_ex()
1895 contents = sxe->node->node->content; in sxe_object_cast_ex()
1940 xmlNodePtr node; in php_sxe_count_elements_helper() local
1948 node = php_sxe_reset_iterator(sxe, 0); in php_sxe_count_elements_helper()
1950 while (node) in php_sxe_count_elements_helper()
1953 node = php_sxe_iterator_fetch(sxe, node->next, 0); in php_sxe_count_elements_helper()
2059 if (intern == NULL || intern->node == NULL) { in PHP_METHOD()
2064 curnode = (xmlNodePtr)((php_libxml_node_ptr *)intern->node)->node; in PHP_METHOD()
2085 xmlNodePtr node; in PHP_METHOD() local
2096 GET_NODE(child, node); in PHP_METHOD()
2097 if (node) { in PHP_METHOD()
2098 node = node->children; in PHP_METHOD()
2100 while (node && node->type != XML_ELEMENT_NODE) { in PHP_METHOD()
2101 node = node->next; in PHP_METHOD()
2103 RETURN_BOOL(node ? 1 : 0); in PHP_METHOD()
2133 bool is_root_element = sxe->node && sxe->node->node && sxe->node->node->parent in sxe_object_clone()
2134 …&& (sxe->node->node->parent->type == XML_DOCUMENT_NODE || sxe->node->node->parent->type == XML_HTM… in sxe_object_clone()
2158 if (sxe->node) { in sxe_object_clone()
2162 nodep = xmlDocCopyNode(sxe->node->node, docp, 1); in sxe_object_clone()
2406 static xmlNodePtr php_sxe_iterator_fetch(php_sxe_object *sxe, xmlNodePtr node, int use_data) /* {{{… in php_sxe_iterator_fetch() argument
2413 while (node) { in php_sxe_iterator_fetch()
2414 if (node->type == XML_ATTRIBUTE_NODE) { in php_sxe_iterator_fetch()
2415 if (xmlStrEqual(node->name, sxe->iter.name) && match_ns(sxe, node, prefix, isprefix)) { in php_sxe_iterator_fetch()
2419 node = node->next; in php_sxe_iterator_fetch()
2422 while (node) { in php_sxe_iterator_fetch()
2423 if (node->type == XML_ATTRIBUTE_NODE) { in php_sxe_iterator_fetch()
2424 if (match_ns(sxe, node, prefix, isprefix)) { in php_sxe_iterator_fetch()
2428 node = node->next; in php_sxe_iterator_fetch()
2432 while (node) { in php_sxe_iterator_fetch()
2433 if (node->type == XML_ELEMENT_NODE) { in php_sxe_iterator_fetch()
2434 if (xmlStrEqual(node->name, sxe->iter.name) && match_ns(sxe, node, prefix, isprefix)) { in php_sxe_iterator_fetch()
2438 node = node->next; in php_sxe_iterator_fetch()
2441 while (node) { in php_sxe_iterator_fetch()
2442 if (node->type == XML_ELEMENT_NODE) { in php_sxe_iterator_fetch()
2443 if (match_ns(sxe, node, prefix, isprefix)) { in php_sxe_iterator_fetch()
2447 node = node->next; in php_sxe_iterator_fetch()
2451 if (node && use_data) { in php_sxe_iterator_fetch()
2452 _node_as_zval(sxe, node, &sxe->iter.data, SXE_ITER_NONE, NULL, prefix, isprefix); in php_sxe_iterator_fetch()
2455 return node; in php_sxe_iterator_fetch()
2461 xmlNodePtr node; in php_sxe_reset_iterator_no_clear_iter_data() local
2462 GET_NODE(sxe, node) in php_sxe_reset_iterator_no_clear_iter_data()
2464 if (node) { in php_sxe_reset_iterator_no_clear_iter_data()
2469 node = node->children; in php_sxe_reset_iterator_no_clear_iter_data()
2472 node = (xmlNodePtr) node->properties; in php_sxe_reset_iterator_no_clear_iter_data()
2477 return php_sxe_iterator_fetch(sxe, node, use_data); in php_sxe_reset_iterator_no_clear_iter_data()
2555 if (intern != NULL && intern->node != NULL) { in php_sxe_iterator_current_key()
2556 curnode = (xmlNodePtr)((php_libxml_node_ptr *)intern->node)->node; in php_sxe_iterator_current_key()
2569 xmlNodePtr node = NULL; in php_sxe_move_forward_iterator() local
2574 GET_NODE(intern, node) in php_sxe_move_forward_iterator()
2579 if (node) { in php_sxe_move_forward_iterator()
2580 php_sxe_iterator_fetch(sxe, node->next, 1); in php_sxe_move_forward_iterator()
2612 xmlNodePtr node; in simplexml_export_node() local
2615 GET_NODE(sxe, node); in simplexml_export_node()
2616 return php_sxe_get_first_node(sxe, node); in simplexml_export_node()
2624 zval *node; in PHP_FUNCTION() local
2630 if (zend_parse_parameters(ZEND_NUM_ARGS(), "o|C!", &node, &ce) == FAILURE) { in PHP_FUNCTION()
2634 nodep = php_libxml_import_node(node); in PHP_FUNCTION()
2637 …nt_type_error(1, "must be of type SimpleXMLElement|DOMNode, %s given", zend_zval_value_name(node)); in PHP_FUNCTION()
2658 object = Z_LIBXML_NODE_P(node); in PHP_FUNCTION()