Lines Matching refs:nodep

160 static void dom_reconcile_ns(xmlDocPtr doc, xmlNodePtr nodep) /* {{{ */  in dom_reconcile_ns()  argument
164 if (nodep->type == XML_ELEMENT_NODE) { in dom_reconcile_ns()
166 if (nodep->nsDef != NULL) { in dom_reconcile_ns()
167 curns = nodep->nsDef; in dom_reconcile_ns()
171 if((nsptr = xmlSearchNsByHref(doc, nodep->parent, curns->href)) && in dom_reconcile_ns()
175 nodep->nsDef = nsdftptr; in dom_reconcile_ns()
187 xmlReconciliateNs(doc, nodep); in dom_reconcile_ns()
199 xmlNode *nodep; in dom_node_node_name_read() local
204 nodep = dom_object_get_node(obj); in dom_node_node_name_read()
206 if (nodep == NULL) { in dom_node_node_name_read()
211 switch (nodep->type) { in dom_node_node_name_read()
214 ns = nodep->ns; in dom_node_node_name_read()
218 qname = xmlStrcat(qname, nodep->name); in dom_node_node_name_read()
221 str = (char *) nodep->name; in dom_node_node_name_read()
225 ns = nodep->ns; in dom_node_node_name_read()
229 qname = xmlStrcat(qname, nodep->name); in dom_node_node_name_read()
232 str = (char *) nodep->name; in dom_node_node_name_read()
241 str = (char *) nodep->name; in dom_node_node_name_read()
286 xmlNode *nodep = dom_object_get_node(obj); in dom_node_node_value_read() local
289 if (nodep == NULL) { in dom_node_node_value_read()
295 switch (nodep->type) { in dom_node_node_value_read()
302 str = (char *) xmlNodeGetContent(nodep); in dom_node_node_value_read()
305 str = (char *) xmlNodeGetContent(nodep->children); in dom_node_node_value_read()
325 xmlNode *nodep = dom_object_get_node(obj); in dom_node_node_value_write() local
327 if (nodep == NULL) { in dom_node_node_value_write()
333 switch (nodep->type) { in dom_node_node_value_write()
336 if (nodep->children) { in dom_node_node_value_write()
337 node_list_unlink(nodep->children); in dom_node_node_value_write()
338 php_libxml_node_free_list((xmlNodePtr) nodep->children); in dom_node_node_value_write()
339 nodep->children = NULL; in dom_node_node_value_write()
347 xmlNodeSetContentLen(nodep, (xmlChar *) ZSTR_VAL(str), ZSTR_LEN(str) + 1); in dom_node_node_value_write()
367 xmlNode *nodep; in dom_node_node_type_read() local
369 nodep = dom_object_get_node(obj); in dom_node_node_type_read()
371 if (nodep == NULL) { in dom_node_node_type_read()
377 if (nodep->type == XML_DTD_NODE) { in dom_node_node_type_read()
380 ZVAL_LONG(retval, nodep->type); in dom_node_node_type_read()
395 xmlNode *nodep, *nodeparent; in dom_node_parent_node_read() local
397 nodep = dom_object_get_node(obj); in dom_node_parent_node_read()
399 if (nodep == NULL) { in dom_node_parent_node_read()
404 nodeparent = nodep->parent; in dom_node_parent_node_read()
423 xmlNode *nodep = dom_object_get_node(obj); in dom_node_child_nodes_read() local
426 if (nodep == NULL) { in dom_node_child_nodes_read()
447 xmlNode *nodep, *first = NULL; in dom_node_first_child_read() local
449 nodep = dom_object_get_node(obj); in dom_node_first_child_read()
451 if (nodep == NULL) { in dom_node_first_child_read()
456 if (dom_node_children_valid(nodep) == SUCCESS) { in dom_node_first_child_read()
457 first = nodep->children; in dom_node_first_child_read()
478 xmlNode *nodep, *last = NULL; in dom_node_last_child_read() local
480 nodep = dom_object_get_node(obj); in dom_node_last_child_read()
482 if (nodep == NULL) { in dom_node_last_child_read()
487 if (dom_node_children_valid(nodep) == SUCCESS) { in dom_node_last_child_read()
488 last = nodep->last; in dom_node_last_child_read()
509 xmlNode *nodep, *prevsib; in dom_node_previous_sibling_read() local
511 nodep = dom_object_get_node(obj); in dom_node_previous_sibling_read()
513 if (nodep == NULL) { in dom_node_previous_sibling_read()
518 prevsib = nodep->prev; in dom_node_previous_sibling_read()
537 xmlNode *nodep, *nextsib; in dom_node_next_sibling_read() local
539 nodep = dom_object_get_node(obj); in dom_node_next_sibling_read()
541 if (nodep == NULL) { in dom_node_next_sibling_read()
546 nextsib = nodep->next; in dom_node_next_sibling_read()
565 xmlNode *nodep = dom_object_get_node(obj); in dom_node_attributes_read() local
568 if (nodep == NULL) { in dom_node_attributes_read()
573 if (nodep->type == XML_ELEMENT_NODE) { in dom_node_attributes_read()
593 xmlNode *nodep = dom_object_get_node(obj); in dom_node_owner_document_read() local
596 if (nodep == NULL) { in dom_node_owner_document_read()
601 if (nodep->type == XML_DOCUMENT_NODE || nodep->type == XML_HTML_DOCUMENT_NODE) { in dom_node_owner_document_read()
606 docp = nodep->doc; in dom_node_owner_document_read()
624 xmlNode *nodep = dom_object_get_node(obj); in dom_node_namespace_uri_read() local
627 if (nodep == NULL) { in dom_node_namespace_uri_read()
632 switch (nodep->type) { in dom_node_namespace_uri_read()
636 if (nodep->ns != NULL) { in dom_node_namespace_uri_read()
637 str = (char *) nodep->ns->href; in dom_node_namespace_uri_read()
663 xmlNode *nodep = dom_object_get_node(obj); in dom_node_prefix_read() local
667 if (nodep == NULL) { in dom_node_prefix_read()
672 switch (nodep->type) { in dom_node_prefix_read()
676 ns = nodep->ns; in dom_node_prefix_read()
698 xmlNode *nodep, *nsnode = NULL; in dom_node_prefix_write() local
703 nodep = dom_object_get_node(obj); in dom_node_prefix_write()
705 if (nodep == NULL) { in dom_node_prefix_write()
710 switch (nodep->type) { in dom_node_prefix_write()
712 nsnode = nodep; in dom_node_prefix_write()
715 nsnode = nodep->parent; in dom_node_prefix_write()
717 nsnode = xmlDocGetRootElement(nodep->doc); in dom_node_prefix_write()
722 if (nsnode && nodep->ns != NULL && !xmlStrEqual(nodep->ns->prefix, (xmlChar *)prefix)) { in dom_node_prefix_write()
723 strURI = (char *) nodep->ns->href; in dom_node_prefix_write()
726 (nodep->type == XML_ATTRIBUTE_NODE && !strcmp(prefix, "xmlns") && in dom_node_prefix_write()
728 (nodep->type == XML_ATTRIBUTE_NODE && !strcmp((char *) nodep->name, "xmlns"))) { in dom_node_prefix_write()
733 … if (xmlStrEqual((xmlChar *)prefix, curns->prefix) && xmlStrEqual(nodep->ns->href, curns->href)) { in dom_node_prefix_write()
740 ns = xmlNewNs(nsnode, nodep->ns->href, (xmlChar *)prefix); in dom_node_prefix_write()
750 xmlSetNs(nodep, ns); in dom_node_prefix_write()
770 xmlNode *nodep = dom_object_get_node(obj); in dom_node_local_name_read() local
772 if (nodep == NULL) { in dom_node_local_name_read()
777 …if (nodep->type == XML_ELEMENT_NODE || nodep->type == XML_ATTRIBUTE_NODE || nodep->type == XML_NAM… in dom_node_local_name_read()
778 ZVAL_STRING(retval, (char *) (nodep->name)); in dom_node_local_name_read()
795 xmlNode *nodep = dom_object_get_node(obj); in dom_node_base_uri_read() local
798 if (nodep == NULL) { in dom_node_base_uri_read()
803 baseuri = xmlNodeGetBase(nodep->doc, nodep); in dom_node_base_uri_read()
823 xmlNode *nodep = dom_object_get_node(obj); in dom_node_text_content_read() local
826 if (nodep == NULL) { in dom_node_text_content_read()
831 str = (char *) xmlNodeGetContent(nodep); in dom_node_text_content_read()
845 xmlNode *nodep = dom_object_get_node(obj); in dom_node_text_content_write() local
848 if (nodep == NULL) { in dom_node_text_content_write()
853 if (nodep->type == XML_ELEMENT_NODE || nodep->type == XML_ATTRIBUTE_NODE) { in dom_node_text_content_write()
854 if (nodep->children) { in dom_node_text_content_write()
855 node_list_unlink(nodep->children); in dom_node_text_content_write()
856 php_libxml_node_free_list((xmlNodePtr) nodep->children); in dom_node_text_content_write()
857 nodep->children = NULL; in dom_node_text_content_write()
863 xmlNodeSetContent(nodep, (xmlChar *) ""); in dom_node_text_content_write()
864 xmlNodeAddContent(nodep, (xmlChar *) ZSTR_VAL(str)); in dom_node_text_content_write()
872 static xmlNodePtr _php_dom_insert_fragment(xmlNodePtr nodep, xmlNodePtr prevsib, xmlNodePtr nextsib… in _php_dom_insert_fragment() argument
880 nodep->children = newchild; in _php_dom_insert_fragment()
886 nodep->last = fragment->last; in _php_dom_insert_fragment()
894 node->parent = nodep; in _php_dom_insert_fragment()
895 if (node->doc != nodep->doc) { in _php_dom_insert_fragment()
896 xmlSetTreeDoc(node, nodep->doc); in _php_dom_insert_fragment()
1085 xmlNodePtr children, newchild, oldchild, nodep; in PHP_FUNCTION() local
1095 DOM_GET_OBJ(nodep, id, xmlNodePtr, intern); in PHP_FUNCTION()
1097 if (dom_node_children_valid(nodep) == FAILURE) { in PHP_FUNCTION()
1104 children = nodep->children; in PHP_FUNCTION()
1111 if (dom_node_is_read_only(nodep) == SUCCESS || in PHP_FUNCTION()
1117 if (newchild->doc != nodep->doc && newchild->doc != NULL) { in PHP_FUNCTION()
1122 if (dom_hierarchy(nodep, newchild) == FAILURE) { in PHP_FUNCTION()
1144 newchild = _php_dom_insert_fragment(nodep, prevsib, nextsib, newchild, intern, newchildobj); in PHP_FUNCTION()
1146 dom_reconcile_ns(nodep->doc, newchild); in PHP_FUNCTION()
1149 if (newchild->doc == NULL && nodep->doc != NULL) { in PHP_FUNCTION()
1150 xmlSetTreeDoc(newchild, nodep->doc); in PHP_FUNCTION()
1155 dom_reconcile_ns(nodep->doc, newchild); in PHP_FUNCTION()
1173 xmlNodePtr children, child, nodep; in PHP_FUNCTION() local
1181 DOM_GET_OBJ(nodep, id, xmlNodePtr, intern); in PHP_FUNCTION()
1183 if (dom_node_children_valid(nodep) == FAILURE) { in PHP_FUNCTION()
1191 if (dom_node_is_read_only(nodep) == SUCCESS || in PHP_FUNCTION()
1197 children = nodep->children; in PHP_FUNCTION()
1224 xmlNodePtr child, nodep, new_child = NULL; in PHP_FUNCTION() local
1232 DOM_GET_OBJ(nodep, id, xmlNodePtr, intern); in PHP_FUNCTION()
1234 if (dom_node_children_valid(nodep) == FAILURE) { in PHP_FUNCTION()
1242 if (dom_node_is_read_only(nodep) == SUCCESS || in PHP_FUNCTION()
1248 if (dom_hierarchy(nodep, child) == FAILURE) { in PHP_FUNCTION()
1253 if (!(child->doc == NULL || child->doc == nodep->doc)) { in PHP_FUNCTION()
1263 if (child->doc == NULL && nodep->doc != NULL) { in PHP_FUNCTION()
1272 if (child->type == XML_TEXT_NODE && nodep->last != NULL && nodep->last->type == XML_TEXT_NODE) { in PHP_FUNCTION()
1273 child->parent = nodep; in PHP_FUNCTION()
1275 xmlSetTreeDoc(child, nodep->doc); in PHP_FUNCTION()
1278 if (nodep->children == NULL) { in PHP_FUNCTION()
1279 nodep->children = child; in PHP_FUNCTION()
1280 nodep->last = child; in PHP_FUNCTION()
1282 child = nodep->last; in PHP_FUNCTION()
1285 nodep->last = new_child; in PHP_FUNCTION()
1291 lastattr = xmlHasProp(nodep, child->name); in PHP_FUNCTION()
1293 lastattr = xmlHasNsProp(nodep, child->name, child->ns->href); in PHP_FUNCTION()
1301 new_child = _php_dom_insert_fragment(nodep, nodep->last, NULL, child, intern, childobj); in PHP_FUNCTION()
1305 new_child = xmlAddChild(nodep, child); in PHP_FUNCTION()
1312 dom_reconcile_ns(nodep->doc, new_child); in PHP_FUNCTION()
1325 xmlNode *nodep; in PHP_FUNCTION() local
1332 DOM_GET_OBJ(nodep, id, xmlNodePtr, intern); in PHP_FUNCTION()
1334 if (dom_node_children_valid(nodep) == FAILURE) { in PHP_FUNCTION()
1338 if (nodep->children) { in PHP_FUNCTION()
1414 xmlNode *nodep; in PHP_FUNCTION() local
1421 DOM_GET_OBJ(nodep, id, xmlNodePtr, intern); in PHP_FUNCTION()
1423 dom_normalize(nodep); in PHP_FUNCTION()
1457 xmlNode *nodep; in PHP_FUNCTION() local
1464 DOM_GET_OBJ(nodep, id, xmlNodePtr, intern); in PHP_FUNCTION()
1466 if (nodep->type != XML_ELEMENT_NODE) in PHP_FUNCTION()
1469 if (nodep->properties) { in PHP_FUNCTION()
1494 xmlNodePtr nodeotherp, nodep; in PHP_FUNCTION() local
1501 DOM_GET_OBJ(nodep, id, xmlNodePtr, intern); in PHP_FUNCTION()
1505 if (nodep == nodeotherp) { in PHP_FUNCTION()
1520 xmlNodePtr nodep, lookupp = NULL; in PHP_FUNCTION() local
1530 DOM_GET_OBJ(nodep, id, xmlNodePtr, intern); in PHP_FUNCTION()
1533 switch (nodep->type) { in PHP_FUNCTION()
1535 lookupp = nodep; in PHP_FUNCTION()
1539 lookupp = xmlDocGetRootElement((xmlDocPtr) nodep); in PHP_FUNCTION()
1549 lookupp = nodep->parent; in PHP_FUNCTION()
1571 xmlNodePtr nodep; in PHP_FUNCTION() local
1581 DOM_GET_OBJ(nodep, id, xmlNodePtr, intern); in PHP_FUNCTION()
1582 if (nodep->type == XML_DOCUMENT_NODE || nodep->type == XML_HTML_DOCUMENT_NODE) { in PHP_FUNCTION()
1583 nodep = xmlDocGetRootElement((xmlDocPtr) nodep); in PHP_FUNCTION()
1586 if (nodep && uri_len > 0) { in PHP_FUNCTION()
1587 nsptr = xmlSearchNs(nodep->doc, nodep, NULL); in PHP_FUNCTION()
1604 xmlNodePtr nodep; in PHP_FUNCTION() local
1614 DOM_GET_OBJ(nodep, id, xmlNodePtr, intern); in PHP_FUNCTION()
1615 if (nodep->type == XML_DOCUMENT_NODE || nodep->type == XML_HTML_DOCUMENT_NODE) { in PHP_FUNCTION()
1616 nodep = xmlDocGetRootElement((xmlDocPtr) nodep); in PHP_FUNCTION()
1617 if (nodep == NULL) { in PHP_FUNCTION()
1622 nsptr = xmlSearchNs(nodep->doc, nodep, (xmlChar *) prefix); in PHP_FUNCTION()
1675 xmlNodePtr nodep; in dom_canonicalization() local
1702 DOM_GET_OBJ(nodep, id, xmlNodePtr, intern); in dom_canonicalization()
1704 docp = nodep->doc; in dom_canonicalization()
1712 if (nodep->type != XML_DOCUMENT_NODE) { in dom_canonicalization()
1714 ctxp->node = nodep; in dom_canonicalization()
1743 ctxp->node = nodep; in dom_canonicalization()
1866 xmlNode *nodep; in PHP_METHOD() local
1870 DOM_GET_THIS_OBJ(nodep, id, xmlNodePtr, intern); in PHP_METHOD()
1872 value = (char *) xmlGetNodePath(nodep); in PHP_METHOD()
1887 xmlNode *nodep; in PHP_METHOD() local
1894 DOM_GET_THIS_OBJ(nodep, id, xmlNodePtr, intern); in PHP_METHOD()
1896 RETURN_LONG(xmlGetLineNo(nodep)); in PHP_METHOD()