Lines Matching refs:node

136 	xmlNodePtr node = fragment->children;  in dom_fragment_assign_parent_node()  local
138 while (node != NULL) { in dom_fragment_assign_parent_node()
139 node->parent = parentNode; in dom_fragment_assign_parent_node()
141 if (node == fragment->last) { in dom_fragment_assign_parent_node()
144 node = node->next; in dom_fragment_assign_parent_node()
149 static bool dom_fragment_common_hierarchy_check_part(xmlNodePtr node, bool *seen_element) in dom_fragment_common_hierarchy_check_part() argument
152 xmlNodePtr iter = node->children; in dom_fragment_common_hierarchy_check_part()
172 bool php_dom_fragment_insertion_hierarchy_check_pre_insertion(xmlNodePtr parent, xmlNodePtr node, x… in php_dom_fragment_insertion_hierarchy_check_pre_insertion() argument
175 if (!dom_fragment_common_hierarchy_check_part(node, &seen_element)) { in php_dom_fragment_insertion_hierarchy_check_pre_insertion()
198 bool php_dom_fragment_insertion_hierarchy_check_replace(xmlNodePtr parent, xmlNodePtr node, xmlNode… in php_dom_fragment_insertion_hierarchy_check_replace() argument
201 if (!dom_fragment_common_hierarchy_check_part(node, &seen_element)) { in php_dom_fragment_insertion_hierarchy_check_replace()
237 …ut_step_1(php_libxml_ref_obj *document, xmlNodePtr parentNode, xmlNodePtr node, xmlNodePtr child, … in dom_is_pre_insert_valid_without_step_1() argument
248 if (node->doc != documentNode) { in dom_is_pre_insert_valid_without_step_1()
262 dom_hierarchy(parentNode, node) != SUCCESS in dom_is_pre_insert_valid_without_step_1()
264 || node->type == XML_ATTRIBUTE_NODE in dom_is_pre_insert_valid_without_step_1()
266 node->type == XML_ENTITY_REF_NODE in dom_is_pre_insert_valid_without_step_1()
267 || node->type == XML_ENTITY_NODE in dom_is_pre_insert_valid_without_step_1()
268 || node->type == XML_NOTATION_NODE in dom_is_pre_insert_valid_without_step_1()
269 || node->type == XML_DOCUMENT_NODE in dom_is_pre_insert_valid_without_step_1()
270 || node->type == XML_HTML_DOCUMENT_NODE in dom_is_pre_insert_valid_without_step_1()
271 || node->type >= XML_ELEMENT_DECL))) { in dom_is_pre_insert_valid_without_step_1()
278 if (parent_is_document && (node->type == XML_TEXT_NODE || node->type == XML_CDATA_SECTION_NODE)) { in dom_is_pre_insert_valid_without_step_1()
284 if (!parent_is_document && node->type == XML_DTD_NODE) { in dom_is_pre_insert_valid_without_step_1()
293 if (node->type == XML_DOCUMENT_FRAG_NODE) { in dom_is_pre_insert_valid_without_step_1()
294 if (!php_dom_fragment_insertion_hierarchy_check_pre_insertion(parentNode, node, child)) { in dom_is_pre_insert_valid_without_step_1()
299 else if (node->type == XML_ELEMENT_NODE) { in dom_is_pre_insert_valid_without_step_1()
311 else if (node->type == XML_DTD_NODE) { in dom_is_pre_insert_valid_without_step_1()
329 static void dom_free_node_after_zval_single_node_creation(xmlNodePtr node) in dom_free_node_after_zval_single_node_creation() argument
334 for (xmlNodePtr child = node->children; child != NULL; child = next) { in dom_free_node_after_zval_single_node_creation()
353 xmlNodePtr node = NULL; in dom_zvals_to_single_node() local
364 node = xmlNewDocTextLen(documentNode, BAD_CAST Z_STRVAL_P(nodes), Z_STRLEN_P(nodes)); in dom_zvals_to_single_node()
365 if (UNEXPECTED(node == NULL)) { in dom_zvals_to_single_node()
368 return node; in dom_zvals_to_single_node()
372 node = xmlNewDocFragment(documentNode); in dom_zvals_to_single_node()
373 if (UNEXPECTED(!node)) { in dom_zvals_to_single_node()
390 if (!dom_is_pre_insert_valid_without_step_1(document, node, newNode, NULL, documentNode)) { in dom_zvals_to_single_node()
406 dom_add_child_without_merging(node, newNode); in dom_zvals_to_single_node()
410 dom_add_child_without_merging(node, newNode); in dom_zvals_to_single_node()
422 dom_add_child_without_merging(node, newNode); in dom_zvals_to_single_node()
427 return node; in dom_zvals_to_single_node()
432 dom_free_node_after_zval_single_node_creation(node); in dom_zvals_to_single_node()
433 xmlFree(node); in dom_zvals_to_single_node()
489 static void dom_insert_node_list_cleanup(xmlNodePtr node) in dom_insert_node_list_cleanup() argument
491 if (node->_private != NULL) { in dom_insert_node_list_cleanup()
495 if (node->type == XML_DOCUMENT_FRAG_NODE) { in dom_insert_node_list_cleanup()
496 dom_free_node_after_zval_single_node_creation(node); in dom_insert_node_list_cleanup()
497 xmlFree(node); /* Don't free the children, now-empty fragment! */ in dom_insert_node_list_cleanup()
498 } else if (node->type == XML_TEXT_NODE) { in dom_insert_node_list_cleanup()
499 ZEND_ASSERT(node->parent == NULL); in dom_insert_node_list_cleanup()
500 xmlFreeNode(node); in dom_insert_node_list_cleanup()
508 static void dom_insert_node_list_unchecked(php_libxml_ref_obj *document, xmlNodePtr node, xmlNodePt… in dom_insert_node_list_unchecked() argument
512 if (node->type == XML_DOCUMENT_FRAG_NODE) { in dom_insert_node_list_unchecked()
515 xmlNodePtr newchild = node->children; in dom_insert_node_list_unchecked()
519 xmlNodePtr last = node->last; in dom_insert_node_list_unchecked()
521 dom_fragment_assign_parent_node(parent, node); in dom_insert_node_list_unchecked()
531 if (node->_private == NULL) { in dom_insert_node_list_unchecked()
532 xmlFree(node); in dom_insert_node_list_unchecked()
534 node->children = NULL; in dom_insert_node_list_unchecked()
535 node->last = NULL; in dom_insert_node_list_unchecked()
540 if (insertion_point == node) { in dom_insert_node_list_unchecked()
541 insertion_point = node->next; in dom_insert_node_list_unchecked()
545 xmlUnlinkNode(node); in dom_insert_node_list_unchecked()
546 php_dom_pre_insert_helper(insertion_point, parent, node, node); in dom_insert_node_list_unchecked()
547 node->parent = parent; in dom_insert_node_list_unchecked()
548 if (parent->doc && node->type == XML_DTD_NODE) { in dom_insert_node_list_unchecked()
549 parent->doc->intSubset = (xmlDtdPtr) node; in dom_insert_node_list_unchecked()
550 node->parent = (xmlNodePtr) parent->doc; in dom_insert_node_list_unchecked()
553 dom_reconcile_ns(parent->doc, node); in dom_insert_node_list_unchecked()
560 bool php_dom_pre_insert(php_libxml_ref_obj *document, xmlNodePtr node, xmlNodePtr parent, xmlNodePt… in php_dom_pre_insert() argument
562 if (UNEXPECTED(node == NULL)) { in php_dom_pre_insert()
567 if (dom_is_pre_insert_valid_without_step_1(document, parent, node, insertion_point, parent->doc)) { in php_dom_pre_insert()
568 dom_insert_node_list_unchecked(document, node, parent, insertion_point); in php_dom_pre_insert()
571 dom_insert_node_list_cleanup(node); in php_dom_pre_insert()
577 void php_dom_node_append(php_libxml_ref_obj *document, xmlNodePtr node, xmlNodePtr parent) in php_dom_node_append() argument
579 php_dom_pre_insert(document, node, parent, NULL); in php_dom_node_append()
594 xmlNodePtr node = dom_zvals_to_single_node(context->document, parentNode, nodes, nodesc); in dom_parent_node_append() local
595 if (UNEXPECTED(node == NULL)) { in dom_parent_node_append()
600 php_dom_node_append(context->document, node, parentNode); in dom_parent_node_append()
620 xmlNodePtr node = dom_zvals_to_single_node(context->document, parentNode, nodes, nodesc); in dom_parent_node_prepend() local
621 if (UNEXPECTED(node == NULL)) { in dom_parent_node_prepend()
626 php_dom_pre_insert(context->document, node, parentNode, parentNode->children); in dom_parent_node_prepend()
759 xmlNodePtr node = dom_zvals_to_single_node(context->document, parentNode, nodes, nodesc); in dom_child_replace_with() local
760 if (UNEXPECTED(node == NULL)) { in dom_child_replace_with()
765 …if (dom_is_pre_insert_valid_without_step_1(context->document, parentNode, node, viable_next_siblin… in dom_child_replace_with()
768 if (child->parent != node) { in dom_child_replace_with()
772 dom_insert_node_list_unchecked(context->document, node, parentNode, viable_next_sibling); in dom_child_replace_with()
774 dom_insert_node_list_cleanup(node); in dom_child_replace_with()
790 xmlNodePtr node = dom_zvals_to_single_node(context->document, thisp, nodes, nodesc); in dom_parent_node_replace_children() local
791 if (UNEXPECTED(node == NULL)) { in dom_parent_node_replace_children()
796 if (dom_is_pre_insert_valid_without_step_1(context->document, thisp, node, NULL, thisp->doc)) { in dom_parent_node_replace_children()
798 php_dom_pre_insert(context->document, node, thisp, NULL); in dom_parent_node_replace_children()
800 dom_insert_node_list_cleanup(node); in dom_parent_node_replace_children()