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
328 if (nodep == NULL) { in dom_node_node_value_write()
339 switch (nodep->type) { in dom_node_node_value_write()
342 if (nodep->children) { in dom_node_node_value_write()
343 node_list_unlink(nodep->children); in dom_node_node_value_write()
344 php_libxml_node_free_list((xmlNodePtr) nodep->children); in dom_node_node_value_write()
345 nodep->children = NULL; in dom_node_node_value_write()
351 xmlNodeSetContentLen(nodep, (xmlChar *) ZSTR_VAL(str), ZSTR_LEN(str) + 1); in dom_node_node_value_write()
370 xmlNode *nodep; in dom_node_node_type_read() local
372 nodep = dom_object_get_node(obj); in dom_node_node_type_read()
374 if (nodep == NULL) { in dom_node_node_type_read()
380 if (nodep->type == XML_DTD_NODE) { in dom_node_node_type_read()
383 ZVAL_LONG(retval, nodep->type); in dom_node_node_type_read()
398 xmlNode *nodep, *nodeparent; in dom_node_parent_node_read() local
400 nodep = dom_object_get_node(obj); in dom_node_parent_node_read()
402 if (nodep == NULL) { in dom_node_parent_node_read()
407 nodeparent = nodep->parent; in dom_node_parent_node_read()
426 xmlNode *nodep = dom_object_get_node(obj); in dom_node_child_nodes_read() local
429 if (nodep == NULL) { in dom_node_child_nodes_read()
450 xmlNode *nodep, *first = NULL; in dom_node_first_child_read() local
452 nodep = dom_object_get_node(obj); in dom_node_first_child_read()
454 if (nodep == NULL) { in dom_node_first_child_read()
459 if (dom_node_children_valid(nodep) == SUCCESS) { in dom_node_first_child_read()
460 first = nodep->children; in dom_node_first_child_read()
481 xmlNode *nodep, *last = NULL; in dom_node_last_child_read() local
483 nodep = dom_object_get_node(obj); in dom_node_last_child_read()
485 if (nodep == NULL) { in dom_node_last_child_read()
490 if (dom_node_children_valid(nodep) == SUCCESS) { in dom_node_last_child_read()
491 last = nodep->last; in dom_node_last_child_read()
512 xmlNode *nodep, *prevsib; in dom_node_previous_sibling_read() local
514 nodep = dom_object_get_node(obj); in dom_node_previous_sibling_read()
516 if (nodep == NULL) { in dom_node_previous_sibling_read()
521 prevsib = nodep->prev; in dom_node_previous_sibling_read()
540 xmlNode *nodep, *nextsib; in dom_node_next_sibling_read() local
542 nodep = dom_object_get_node(obj); in dom_node_next_sibling_read()
544 if (nodep == NULL) { in dom_node_next_sibling_read()
549 nextsib = nodep->next; in dom_node_next_sibling_read()
568 xmlNode *nodep = dom_object_get_node(obj); in dom_node_attributes_read() local
571 if (nodep == NULL) { in dom_node_attributes_read()
576 if (nodep->type == XML_ELEMENT_NODE) { in dom_node_attributes_read()
596 xmlNode *nodep = dom_object_get_node(obj); in dom_node_owner_document_read() local
599 if (nodep == NULL) { in dom_node_owner_document_read()
604 if (nodep->type == XML_DOCUMENT_NODE || nodep->type == XML_HTML_DOCUMENT_NODE) { in dom_node_owner_document_read()
609 docp = nodep->doc; in dom_node_owner_document_read()
627 xmlNode *nodep = dom_object_get_node(obj); in dom_node_namespace_uri_read() local
630 if (nodep == NULL) { in dom_node_namespace_uri_read()
635 switch (nodep->type) { in dom_node_namespace_uri_read()
639 if (nodep->ns != NULL) { in dom_node_namespace_uri_read()
640 str = (char *) nodep->ns->href; in dom_node_namespace_uri_read()
666 xmlNode *nodep = dom_object_get_node(obj); in dom_node_prefix_read() local
670 if (nodep == NULL) { in dom_node_prefix_read()
675 switch (nodep->type) { in dom_node_prefix_read()
679 ns = nodep->ns; in dom_node_prefix_read()
701 xmlNode *nodep, *nsnode = NULL; in dom_node_prefix_write() local
706 nodep = dom_object_get_node(obj); in dom_node_prefix_write()
708 if (nodep == NULL) { in dom_node_prefix_write()
713 switch (nodep->type) { in dom_node_prefix_write()
715 nsnode = nodep; in dom_node_prefix_write()
718 nsnode = nodep->parent; in dom_node_prefix_write()
720 nsnode = xmlDocGetRootElement(nodep->doc); in dom_node_prefix_write()
729 if (nsnode && nodep->ns != NULL && !xmlStrEqual(nodep->ns->prefix, (xmlChar *)prefix)) { in dom_node_prefix_write()
730 strURI = (char *) nodep->ns->href; in dom_node_prefix_write()
733 (nodep->type == XML_ATTRIBUTE_NODE && !strcmp(prefix, "xmlns") && in dom_node_prefix_write()
735 (nodep->type == XML_ATTRIBUTE_NODE && !strcmp((char *) nodep->name, "xmlns"))) { in dom_node_prefix_write()
740 … if (xmlStrEqual((xmlChar *)prefix, curns->prefix) && xmlStrEqual(nodep->ns->href, curns->href)) { in dom_node_prefix_write()
747 ns = xmlNewNs(nsnode, nodep->ns->href, (xmlChar *)prefix); in dom_node_prefix_write()
757 xmlSetNs(nodep, ns); in dom_node_prefix_write()
777 xmlNode *nodep = dom_object_get_node(obj); in dom_node_local_name_read() local
779 if (nodep == NULL) { in dom_node_local_name_read()
784 …if (nodep->type == XML_ELEMENT_NODE || nodep->type == XML_ATTRIBUTE_NODE || nodep->type == XML_NAM… in dom_node_local_name_read()
785 ZVAL_STRING(retval, (char *) (nodep->name)); in dom_node_local_name_read()
802 xmlNode *nodep = dom_object_get_node(obj); in dom_node_base_uri_read() local
805 if (nodep == NULL) { in dom_node_base_uri_read()
810 baseuri = xmlNodeGetBase(nodep->doc, nodep); in dom_node_base_uri_read()
830 xmlNode *nodep = dom_object_get_node(obj); in dom_node_text_content_read() local
833 if (nodep == NULL) { in dom_node_text_content_read()
838 str = (char *) xmlNodeGetContent(nodep); in dom_node_text_content_read()
852 xmlNode *nodep = dom_object_get_node(obj); in dom_node_text_content_write() local
855 if (nodep == NULL) { in dom_node_text_content_write()
865 if (nodep->type == XML_ELEMENT_NODE || nodep->type == XML_ATTRIBUTE_NODE) { in dom_node_text_content_write()
866 if (nodep->children) { in dom_node_text_content_write()
867 node_list_unlink(nodep->children); in dom_node_text_content_write()
868 php_libxml_node_free_list((xmlNodePtr) nodep->children); in dom_node_text_content_write()
869 nodep->children = NULL; in dom_node_text_content_write()
874 xmlNodeSetContent(nodep, (xmlChar *) ""); in dom_node_text_content_write()
875 xmlNodeAddContent(nodep, (xmlChar *) ZSTR_VAL(str)); in dom_node_text_content_write()
883 static xmlNodePtr _php_dom_insert_fragment(xmlNodePtr nodep, xmlNodePtr prevsib, xmlNodePtr nextsib… in _php_dom_insert_fragment() argument
891 nodep->children = newchild; in _php_dom_insert_fragment()
897 nodep->last = fragment->last; in _php_dom_insert_fragment()
905 node->parent = nodep; in _php_dom_insert_fragment()
906 if (node->doc != nodep->doc) { in _php_dom_insert_fragment()
907 xmlSetTreeDoc(node, nodep->doc); in _php_dom_insert_fragment()
1097 xmlNodePtr children, newchild, oldchild, nodep; in PHP_FUNCTION() local
1108 DOM_GET_OBJ(nodep, id, xmlNodePtr, intern); in PHP_FUNCTION()
1110 if (dom_node_children_valid(nodep) == FAILURE) { in PHP_FUNCTION()
1117 children = nodep->children; in PHP_FUNCTION()
1124 if (dom_node_is_read_only(nodep) == SUCCESS || in PHP_FUNCTION()
1130 if (newchild->doc != nodep->doc && newchild->doc != NULL) { in PHP_FUNCTION()
1135 if (dom_hierarchy(nodep, newchild) == FAILURE) { in PHP_FUNCTION()
1157 newchild = _php_dom_insert_fragment(nodep, prevsib, nextsib, newchild, intern, newchildobj); in PHP_FUNCTION()
1159 dom_reconcile_ns(nodep->doc, newchild); in PHP_FUNCTION()
1162 if (newchild->doc == NULL && nodep->doc != NULL) { in PHP_FUNCTION()
1163 xmlSetTreeDoc(newchild, nodep->doc); in PHP_FUNCTION()
1168 dom_reconcile_ns(nodep->doc, newchild); in PHP_FUNCTION()
1186 xmlNodePtr children, child, nodep; in PHP_FUNCTION() local
1195 DOM_GET_OBJ(nodep, id, xmlNodePtr, intern); in PHP_FUNCTION()
1197 if (dom_node_children_valid(nodep) == FAILURE) { in PHP_FUNCTION()
1205 if (dom_node_is_read_only(nodep) == SUCCESS || in PHP_FUNCTION()
1211 children = nodep->children; in PHP_FUNCTION()
1238 xmlNodePtr child, nodep, new_child = NULL; in PHP_FUNCTION() local
1247 DOM_GET_OBJ(nodep, id, xmlNodePtr, intern); in PHP_FUNCTION()
1249 if (dom_node_children_valid(nodep) == FAILURE) { in PHP_FUNCTION()
1257 if (dom_node_is_read_only(nodep) == SUCCESS || in PHP_FUNCTION()
1263 if (dom_hierarchy(nodep, child) == FAILURE) { in PHP_FUNCTION()
1268 if (!(child->doc == NULL || child->doc == nodep->doc)) { in PHP_FUNCTION()
1278 if (child->doc == NULL && nodep->doc != NULL) { in PHP_FUNCTION()
1287 if (child->type == XML_TEXT_NODE && nodep->last != NULL && nodep->last->type == XML_TEXT_NODE) { in PHP_FUNCTION()
1288 child->parent = nodep; in PHP_FUNCTION()
1290 xmlSetTreeDoc(child, nodep->doc); in PHP_FUNCTION()
1293 if (nodep->children == NULL) { in PHP_FUNCTION()
1294 nodep->children = child; in PHP_FUNCTION()
1295 nodep->last = child; in PHP_FUNCTION()
1297 child = nodep->last; in PHP_FUNCTION()
1300 nodep->last = new_child; in PHP_FUNCTION()
1306 lastattr = xmlHasProp(nodep, child->name); in PHP_FUNCTION()
1308 lastattr = xmlHasNsProp(nodep, child->name, child->ns->href); in PHP_FUNCTION()
1316 new_child = _php_dom_insert_fragment(nodep, nodep->last, NULL, child, intern, childobj); in PHP_FUNCTION()
1320 new_child = xmlAddChild(nodep, child); in PHP_FUNCTION()
1327 dom_reconcile_ns(nodep->doc, new_child); in PHP_FUNCTION()
1340 xmlNode *nodep; in PHP_FUNCTION() local
1348 DOM_GET_OBJ(nodep, id, xmlNodePtr, intern); in PHP_FUNCTION()
1350 if (dom_node_children_valid(nodep) == FAILURE) { in PHP_FUNCTION()
1354 if (nodep->children) { in PHP_FUNCTION()
1431 xmlNode *nodep; in PHP_FUNCTION() local
1439 DOM_GET_OBJ(nodep, id, xmlNodePtr, intern); in PHP_FUNCTION()
1441 dom_normalize(nodep); in PHP_FUNCTION()
1474 xmlNode *nodep; in PHP_FUNCTION() local
1482 DOM_GET_OBJ(nodep, id, xmlNodePtr, intern); in PHP_FUNCTION()
1484 if (nodep->type != XML_ELEMENT_NODE) in PHP_FUNCTION()
1487 if (nodep->properties) { in PHP_FUNCTION()
1512 xmlNodePtr nodeotherp, nodep; in PHP_FUNCTION() local
1520 DOM_GET_OBJ(nodep, id, xmlNodePtr, intern); in PHP_FUNCTION()
1524 if (nodep == nodeotherp) { in PHP_FUNCTION()
1539 xmlNodePtr nodep, lookupp = NULL; in PHP_FUNCTION() local
1550 DOM_GET_OBJ(nodep, id, xmlNodePtr, intern); in PHP_FUNCTION()
1553 switch (nodep->type) { in PHP_FUNCTION()
1555 lookupp = nodep; in PHP_FUNCTION()
1559 lookupp = xmlDocGetRootElement((xmlDocPtr) nodep); in PHP_FUNCTION()
1569 lookupp = nodep->parent; in PHP_FUNCTION()
1591 xmlNodePtr nodep; in PHP_FUNCTION() local
1602 DOM_GET_OBJ(nodep, id, xmlNodePtr, intern); in PHP_FUNCTION()
1603 if (nodep->type == XML_DOCUMENT_NODE || nodep->type == XML_HTML_DOCUMENT_NODE) { in PHP_FUNCTION()
1604 nodep = xmlDocGetRootElement((xmlDocPtr) nodep); in PHP_FUNCTION()
1607 if (nodep && uri_len > 0) { in PHP_FUNCTION()
1608 nsptr = xmlSearchNs(nodep->doc, nodep, NULL); in PHP_FUNCTION()
1625 xmlNodePtr nodep; in PHP_FUNCTION() local
1636 DOM_GET_OBJ(nodep, id, xmlNodePtr, intern); in PHP_FUNCTION()
1637 if (nodep->type == XML_DOCUMENT_NODE || nodep->type == XML_HTML_DOCUMENT_NODE) { in PHP_FUNCTION()
1638 nodep = xmlDocGetRootElement((xmlDocPtr) nodep); in PHP_FUNCTION()
1639 if (nodep == NULL) { in PHP_FUNCTION()
1644 nsptr = xmlSearchNs(nodep->doc, nodep, (xmlChar *) prefix); in PHP_FUNCTION()
1697 xmlNodePtr nodep; in dom_canonicalization() local
1725 DOM_GET_OBJ(nodep, id, xmlNodePtr, intern); in dom_canonicalization()
1727 docp = nodep->doc; in dom_canonicalization()
1735 if (nodep->type != XML_DOCUMENT_NODE) { in dom_canonicalization()
1737 ctxp->node = nodep; in dom_canonicalization()
1766 ctxp->node = nodep; in dom_canonicalization()
1889 xmlNode *nodep; in PHP_METHOD() local
1893 DOM_GET_THIS_OBJ(nodep, id, xmlNodePtr, intern); in PHP_METHOD()
1895 value = (char *) xmlGetNodePath(nodep); in PHP_METHOD()
1910 xmlNode *nodep; in PHP_METHOD() local
1917 DOM_GET_THIS_OBJ(nodep, id, xmlNodePtr, intern); in PHP_METHOD()
1919 RETURN_LONG(xmlGetLineNo(nodep)); in PHP_METHOD()