Lines Matching refs:cur

368     const xmlChar *cur = value;  in xmlValidateNCName()  local
378 while (IS_BLANK_CH(*cur)) cur++; in xmlValidateNCName()
379 if (((*cur >= 'a') && (*cur <= 'z')) || ((*cur >= 'A') && (*cur <= 'Z')) || in xmlValidateNCName()
380 (*cur == '_')) in xmlValidateNCName()
381 cur++; in xmlValidateNCName()
384 while (((*cur >= 'a') && (*cur <= 'z')) || in xmlValidateNCName()
385 ((*cur >= 'A') && (*cur <= 'Z')) || in xmlValidateNCName()
386 ((*cur >= '0') && (*cur <= '9')) || in xmlValidateNCName()
387 (*cur == '_') || (*cur == '-') || (*cur == '.')) in xmlValidateNCName()
388 cur++; in xmlValidateNCName()
390 while (IS_BLANK_CH(*cur)) cur++; in xmlValidateNCName()
391 if (*cur == 0) in xmlValidateNCName()
398 cur = value; in xmlValidateNCName()
399 c = CUR_SCHAR(cur, l); in xmlValidateNCName()
402 cur += l; in xmlValidateNCName()
403 c = CUR_SCHAR(cur, l); in xmlValidateNCName()
408 cur += l; in xmlValidateNCName()
409 c = CUR_SCHAR(cur, l); in xmlValidateNCName()
413 cur += l; in xmlValidateNCName()
414 c = CUR_SCHAR(cur, l); in xmlValidateNCName()
418 cur += l; in xmlValidateNCName()
419 c = CUR_SCHAR(cur, l); in xmlValidateNCName()
442 const xmlChar *cur = value; in xmlValidateQName() local
451 while (IS_BLANK_CH(*cur)) cur++; in xmlValidateQName()
452 if (((*cur >= 'a') && (*cur <= 'z')) || ((*cur >= 'A') && (*cur <= 'Z')) || in xmlValidateQName()
453 (*cur == '_')) in xmlValidateQName()
454 cur++; in xmlValidateQName()
457 while (((*cur >= 'a') && (*cur <= 'z')) || in xmlValidateQName()
458 ((*cur >= 'A') && (*cur <= 'Z')) || in xmlValidateQName()
459 ((*cur >= '0') && (*cur <= '9')) || in xmlValidateQName()
460 (*cur == '_') || (*cur == '-') || (*cur == '.')) in xmlValidateQName()
461 cur++; in xmlValidateQName()
462 if (*cur == ':') { in xmlValidateQName()
463 cur++; in xmlValidateQName()
464 if (((*cur >= 'a') && (*cur <= 'z')) || in xmlValidateQName()
465 ((*cur >= 'A') && (*cur <= 'Z')) || in xmlValidateQName()
466 (*cur == '_')) in xmlValidateQName()
467 cur++; in xmlValidateQName()
470 while (((*cur >= 'a') && (*cur <= 'z')) || in xmlValidateQName()
471 ((*cur >= 'A') && (*cur <= 'Z')) || in xmlValidateQName()
472 ((*cur >= '0') && (*cur <= '9')) || in xmlValidateQName()
473 (*cur == '_') || (*cur == '-') || (*cur == '.')) in xmlValidateQName()
474 cur++; in xmlValidateQName()
477 while (IS_BLANK_CH(*cur)) cur++; in xmlValidateQName()
478 if (*cur == 0) in xmlValidateQName()
485 cur = value; in xmlValidateQName()
486 c = CUR_SCHAR(cur, l); in xmlValidateQName()
489 cur += l; in xmlValidateQName()
490 c = CUR_SCHAR(cur, l); in xmlValidateQName()
495 cur += l; in xmlValidateQName()
496 c = CUR_SCHAR(cur, l); in xmlValidateQName()
500 cur += l; in xmlValidateQName()
501 c = CUR_SCHAR(cur, l); in xmlValidateQName()
504 cur += l; in xmlValidateQName()
505 c = CUR_SCHAR(cur, l); in xmlValidateQName()
508 cur += l; in xmlValidateQName()
509 c = CUR_SCHAR(cur, l); in xmlValidateQName()
513 cur += l; in xmlValidateQName()
514 c = CUR_SCHAR(cur, l); in xmlValidateQName()
519 cur += l; in xmlValidateQName()
520 c = CUR_SCHAR(cur, l); in xmlValidateQName()
540 const xmlChar *cur = value; in xmlValidateName() local
549 while (IS_BLANK_CH(*cur)) cur++; in xmlValidateName()
550 if (((*cur >= 'a') && (*cur <= 'z')) || ((*cur >= 'A') && (*cur <= 'Z')) || in xmlValidateName()
551 (*cur == '_') || (*cur == ':')) in xmlValidateName()
552 cur++; in xmlValidateName()
555 while (((*cur >= 'a') && (*cur <= 'z')) || in xmlValidateName()
556 ((*cur >= 'A') && (*cur <= 'Z')) || in xmlValidateName()
557 ((*cur >= '0') && (*cur <= '9')) || in xmlValidateName()
558 (*cur == '_') || (*cur == '-') || (*cur == '.') || (*cur == ':')) in xmlValidateName()
559 cur++; in xmlValidateName()
561 while (IS_BLANK_CH(*cur)) cur++; in xmlValidateName()
562 if (*cur == 0) in xmlValidateName()
569 cur = value; in xmlValidateName()
570 c = CUR_SCHAR(cur, l); in xmlValidateName()
573 cur += l; in xmlValidateName()
574 c = CUR_SCHAR(cur, l); in xmlValidateName()
579 cur += l; in xmlValidateName()
580 c = CUR_SCHAR(cur, l); in xmlValidateName()
583 cur += l; in xmlValidateName()
584 c = CUR_SCHAR(cur, l); in xmlValidateName()
588 cur += l; in xmlValidateName()
589 c = CUR_SCHAR(cur, l); in xmlValidateName()
609 const xmlChar *cur = value; in xmlValidateNMToken() local
618 while (IS_BLANK_CH(*cur)) cur++; in xmlValidateNMToken()
619 if (((*cur >= 'a') && (*cur <= 'z')) || in xmlValidateNMToken()
620 ((*cur >= 'A') && (*cur <= 'Z')) || in xmlValidateNMToken()
621 ((*cur >= '0') && (*cur <= '9')) || in xmlValidateNMToken()
622 (*cur == '_') || (*cur == '-') || (*cur == '.') || (*cur == ':')) in xmlValidateNMToken()
623 cur++; in xmlValidateNMToken()
626 while (((*cur >= 'a') && (*cur <= 'z')) || in xmlValidateNMToken()
627 ((*cur >= 'A') && (*cur <= 'Z')) || in xmlValidateNMToken()
628 ((*cur >= '0') && (*cur <= '9')) || in xmlValidateNMToken()
629 (*cur == '_') || (*cur == '-') || (*cur == '.') || (*cur == ':')) in xmlValidateNMToken()
630 cur++; in xmlValidateNMToken()
632 while (IS_BLANK_CH(*cur)) cur++; in xmlValidateNMToken()
633 if (*cur == 0) in xmlValidateNMToken()
640 cur = value; in xmlValidateNMToken()
641 c = CUR_SCHAR(cur, l); in xmlValidateNMToken()
644 cur += l; in xmlValidateNMToken()
645 c = CUR_SCHAR(cur, l); in xmlValidateNMToken()
651 cur += l; in xmlValidateNMToken()
652 c = CUR_SCHAR(cur, l); in xmlValidateNMToken()
655 cur += l; in xmlValidateNMToken()
656 c = CUR_SCHAR(cur, l); in xmlValidateNMToken()
660 cur += l; in xmlValidateNMToken()
661 c = CUR_SCHAR(cur, l); in xmlValidateNMToken()
729 xmlNsPtr cur; in xmlNewNs() local
751 cur = (xmlNsPtr) xmlMalloc(sizeof(xmlNs)); in xmlNewNs()
752 if (cur == NULL) { in xmlNewNs()
756 memset(cur, 0, sizeof(xmlNs)); in xmlNewNs()
757 cur->type = XML_LOCAL_NAMESPACE; in xmlNewNs()
760 cur->href = xmlStrdup(href); in xmlNewNs()
762 cur->prefix = xmlStrdup(prefix); in xmlNewNs()
770 node->nsDef = cur; in xmlNewNs()
774 if (((prev->prefix == NULL) && (cur->prefix == NULL)) || in xmlNewNs()
775 (xmlStrEqual(prev->prefix, cur->prefix))) { in xmlNewNs()
776 xmlFreeNs(cur); in xmlNewNs()
781 if (((prev->prefix == NULL) && (cur->prefix == NULL)) || in xmlNewNs()
782 (xmlStrEqual(prev->prefix, cur->prefix))) { in xmlNewNs()
783 xmlFreeNs(cur); in xmlNewNs()
787 prev->next = cur; in xmlNewNs()
790 return(cur); in xmlNewNs()
821 xmlFreeNs(xmlNsPtr cur) { in xmlFreeNs() argument
822 if (cur == NULL) { in xmlFreeNs()
829 if (cur->href != NULL) xmlFree((char *) cur->href); in xmlFreeNs()
830 if (cur->prefix != NULL) xmlFree((char *) cur->prefix); in xmlFreeNs()
831 xmlFree(cur); in xmlFreeNs()
841 xmlFreeNsList(xmlNsPtr cur) { in xmlFreeNsList() argument
843 if (cur == NULL) { in xmlFreeNsList()
850 while (cur != NULL) { in xmlFreeNsList()
851 next = cur->next; in xmlFreeNsList()
852 xmlFreeNs(cur); in xmlFreeNsList()
853 cur = next; in xmlFreeNsList()
872 xmlDtdPtr cur; in xmlNewDtd() local
887 cur = (xmlDtdPtr) xmlMalloc(sizeof(xmlDtd)); in xmlNewDtd()
888 if (cur == NULL) { in xmlNewDtd()
892 memset(cur, 0 , sizeof(xmlDtd)); in xmlNewDtd()
893 cur->type = XML_DTD_NODE; in xmlNewDtd()
896 cur->name = xmlStrdup(name); in xmlNewDtd()
898 cur->ExternalID = xmlStrdup(ExternalID); in xmlNewDtd()
900 cur->SystemID = xmlStrdup(SystemID); in xmlNewDtd()
902 doc->extSubset = cur; in xmlNewDtd()
903 cur->doc = doc; in xmlNewDtd()
906 xmlRegisterNodeDefaultValue((xmlNodePtr)cur); in xmlNewDtd()
907 return(cur); in xmlNewDtd()
920 xmlNodePtr cur; in xmlGetIntSubset() local
924 cur = doc->children; in xmlGetIntSubset()
925 while (cur != NULL) { in xmlGetIntSubset()
926 if (cur->type == XML_DTD_NODE) in xmlGetIntSubset()
927 return((xmlDtdPtr) cur); in xmlGetIntSubset()
928 cur = cur->next; in xmlGetIntSubset()
946 xmlDtdPtr cur; in xmlCreateIntSubset() local
961 cur = (xmlDtdPtr) xmlMalloc(sizeof(xmlDtd)); in xmlCreateIntSubset()
962 if (cur == NULL) { in xmlCreateIntSubset()
966 memset(cur, 0, sizeof(xmlDtd)); in xmlCreateIntSubset()
967 cur->type = XML_DTD_NODE; in xmlCreateIntSubset()
970 cur->name = xmlStrdup(name); in xmlCreateIntSubset()
971 if (cur->name == NULL) { in xmlCreateIntSubset()
973 xmlFree(cur); in xmlCreateIntSubset()
978 cur->ExternalID = xmlStrdup(ExternalID); in xmlCreateIntSubset()
979 if (cur->ExternalID == NULL) { in xmlCreateIntSubset()
981 if (cur->name != NULL) in xmlCreateIntSubset()
982 xmlFree((char *)cur->name); in xmlCreateIntSubset()
983 xmlFree(cur); in xmlCreateIntSubset()
988 cur->SystemID = xmlStrdup(SystemID); in xmlCreateIntSubset()
989 if (cur->SystemID == NULL) { in xmlCreateIntSubset()
991 if (cur->name != NULL) in xmlCreateIntSubset()
992 xmlFree((char *)cur->name); in xmlCreateIntSubset()
993 if (cur->ExternalID != NULL) in xmlCreateIntSubset()
994 xmlFree((char *)cur->ExternalID); in xmlCreateIntSubset()
995 xmlFree(cur); in xmlCreateIntSubset()
1000 doc->intSubset = cur; in xmlCreateIntSubset()
1001 cur->parent = doc; in xmlCreateIntSubset()
1002 cur->doc = doc; in xmlCreateIntSubset()
1004 doc->children = (xmlNodePtr) cur; in xmlCreateIntSubset()
1005 doc->last = (xmlNodePtr) cur; in xmlCreateIntSubset()
1011 prev->prev = (xmlNodePtr) cur; in xmlCreateIntSubset()
1012 cur->next = prev; in xmlCreateIntSubset()
1013 doc->children = (xmlNodePtr) cur; in xmlCreateIntSubset()
1021 cur->prev = doc->last; in xmlCreateIntSubset()
1022 cur->prev->next = (xmlNodePtr) cur; in xmlCreateIntSubset()
1023 cur->next = NULL; in xmlCreateIntSubset()
1024 doc->last = (xmlNodePtr) cur; in xmlCreateIntSubset()
1026 cur->next = next; in xmlCreateIntSubset()
1027 cur->prev = next->prev; in xmlCreateIntSubset()
1028 if (cur->prev == NULL) in xmlCreateIntSubset()
1029 doc->children = (xmlNodePtr) cur; in xmlCreateIntSubset()
1031 cur->prev->next = (xmlNodePtr) cur; in xmlCreateIntSubset()
1032 next->prev = (xmlNodePtr) cur; in xmlCreateIntSubset()
1039 xmlRegisterNodeDefaultValue((xmlNodePtr)cur); in xmlCreateIntSubset()
1040 return(cur); in xmlCreateIntSubset()
1098 xmlFreeDtd(xmlDtdPtr cur) { in xmlFreeDtd() argument
1101 if (cur == NULL) { in xmlFreeDtd()
1104 if (cur->doc != NULL) dict = cur->doc->dict; in xmlFreeDtd()
1107 xmlDeregisterNodeDefaultValue((xmlNodePtr)cur); in xmlFreeDtd()
1109 if (cur->children != NULL) { in xmlFreeDtd()
1110 xmlNodePtr next, c = cur->children; in xmlFreeDtd()
1128 DICT_FREE(cur->name) in xmlFreeDtd()
1129 DICT_FREE(cur->SystemID) in xmlFreeDtd()
1130 DICT_FREE(cur->ExternalID) in xmlFreeDtd()
1132 if (cur->notations != NULL) in xmlFreeDtd()
1133 xmlFreeNotationTable((xmlNotationTablePtr) cur->notations); in xmlFreeDtd()
1135 if (cur->elements != NULL) in xmlFreeDtd()
1136 xmlFreeElementTable((xmlElementTablePtr) cur->elements); in xmlFreeDtd()
1137 if (cur->attributes != NULL) in xmlFreeDtd()
1138 xmlFreeAttributeTable((xmlAttributeTablePtr) cur->attributes); in xmlFreeDtd()
1139 if (cur->entities != NULL) in xmlFreeDtd()
1140 xmlFreeEntitiesTable((xmlEntitiesTablePtr) cur->entities); in xmlFreeDtd()
1141 if (cur->pentities != NULL) in xmlFreeDtd()
1142 xmlFreeEntitiesTable((xmlEntitiesTablePtr) cur->pentities); in xmlFreeDtd()
1144 xmlFree(cur); in xmlFreeDtd()
1157 xmlDocPtr cur; in xmlNewDoc() local
1165 cur = (xmlDocPtr) xmlMalloc(sizeof(xmlDoc)); in xmlNewDoc()
1166 if (cur == NULL) { in xmlNewDoc()
1170 memset(cur, 0, sizeof(xmlDoc)); in xmlNewDoc()
1171 cur->type = XML_DOCUMENT_NODE; in xmlNewDoc()
1173 cur->version = xmlStrdup(version); in xmlNewDoc()
1174 if (cur->version == NULL) { in xmlNewDoc()
1176 xmlFree(cur); in xmlNewDoc()
1179 cur->standalone = -1; in xmlNewDoc()
1180 cur->compression = -1; /* not initialized */ in xmlNewDoc()
1181 cur->doc = cur; in xmlNewDoc()
1182 cur->parseFlags = 0; in xmlNewDoc()
1183 cur->properties = XML_DOC_USERBUILT; in xmlNewDoc()
1189 cur->charset = XML_CHAR_ENCODING_UTF8; in xmlNewDoc()
1192 xmlRegisterNodeDefaultValue((xmlNodePtr)cur); in xmlNewDoc()
1193 return(cur); in xmlNewDoc()
1203 xmlFreeDoc(xmlDocPtr cur) { in xmlFreeDoc() argument
1207 if (cur == NULL) { in xmlFreeDoc()
1216 xmlDebugCheckDocument(stderr, cur); in xmlFreeDoc()
1220 if (cur != NULL) dict = cur->dict; in xmlFreeDoc()
1223 xmlDeregisterNodeDefaultValue((xmlNodePtr)cur); in xmlFreeDoc()
1228 if (cur->ids != NULL) xmlFreeIDTable((xmlIDTablePtr) cur->ids); in xmlFreeDoc()
1229 cur->ids = NULL; in xmlFreeDoc()
1230 if (cur->refs != NULL) xmlFreeRefTable((xmlRefTablePtr) cur->refs); in xmlFreeDoc()
1231 cur->refs = NULL; in xmlFreeDoc()
1232 extSubset = cur->extSubset; in xmlFreeDoc()
1233 intSubset = cur->intSubset; in xmlFreeDoc()
1237 xmlUnlinkNode((xmlNodePtr) cur->extSubset); in xmlFreeDoc()
1238 cur->extSubset = NULL; in xmlFreeDoc()
1242 xmlUnlinkNode((xmlNodePtr) cur->intSubset); in xmlFreeDoc()
1243 cur->intSubset = NULL; in xmlFreeDoc()
1247 if (cur->children != NULL) xmlFreeNodeList(cur->children); in xmlFreeDoc()
1248 if (cur->oldNs != NULL) xmlFreeNsList(cur->oldNs); in xmlFreeDoc()
1250 DICT_FREE(cur->version) in xmlFreeDoc()
1251 DICT_FREE(cur->name) in xmlFreeDoc()
1252 DICT_FREE(cur->encoding) in xmlFreeDoc()
1253 DICT_FREE(cur->URL) in xmlFreeDoc()
1254 xmlFree(cur); in xmlFreeDoc()
1273 const xmlChar *cur = value, *end = cur + len; in xmlStringLenGetNodeList() local
1284 q = cur; in xmlStringLenGetNodeList()
1285 while ((cur < end) && (*cur != 0)) { in xmlStringLenGetNodeList()
1286 if (cur[0] == '&') { in xmlStringLenGetNodeList()
1293 if (cur != q) { in xmlStringLenGetNodeList()
1294 if (xmlBufAdd(buf, q, cur - q)) in xmlStringLenGetNodeList()
1297 q = cur; in xmlStringLenGetNodeList()
1298 if ((cur + 2 < end) && (cur[1] == '#') && (cur[2] == 'x')) { in xmlStringLenGetNodeList()
1299 cur += 3; in xmlStringLenGetNodeList()
1300 if (cur < end) in xmlStringLenGetNodeList()
1301 tmp = *cur; in xmlStringLenGetNodeList()
1317 cur++; in xmlStringLenGetNodeList()
1318 if (cur < end) in xmlStringLenGetNodeList()
1319 tmp = *cur; in xmlStringLenGetNodeList()
1324 cur++; in xmlStringLenGetNodeList()
1325 q = cur; in xmlStringLenGetNodeList()
1326 } else if ((cur + 1 < end) && (cur[1] == '#')) { in xmlStringLenGetNodeList()
1327 cur += 2; in xmlStringLenGetNodeList()
1328 if (cur < end) in xmlStringLenGetNodeList()
1329 tmp = *cur; in xmlStringLenGetNodeList()
1341 cur++; in xmlStringLenGetNodeList()
1342 if (cur < end) in xmlStringLenGetNodeList()
1343 tmp = *cur; in xmlStringLenGetNodeList()
1348 cur++; in xmlStringLenGetNodeList()
1349 q = cur; in xmlStringLenGetNodeList()
1354 cur++; in xmlStringLenGetNodeList()
1355 q = cur; in xmlStringLenGetNodeList()
1356 while ((cur < end) && (*cur != 0) && (*cur != ';')) cur++; in xmlStringLenGetNodeList()
1357 if ((cur >= end) || (*cur == 0)) { in xmlStringLenGetNodeList()
1362 if (cur != q) { in xmlStringLenGetNodeList()
1366 val = xmlStrndup(q, cur - q); in xmlStringLenGetNodeList()
1422 cur++; in xmlStringLenGetNodeList()
1423 q = cur; in xmlStringLenGetNodeList()
1437 cur++; in xmlStringLenGetNodeList()
1440 if (cur != q) { in xmlStringLenGetNodeList()
1444 if (xmlBufAdd(buf, q, cur - q)) in xmlStringLenGetNodeList()
1481 const xmlChar *cur = value; in xmlStringGetNodeList() local
1492 q = cur; in xmlStringGetNodeList()
1493 while (*cur != 0) { in xmlStringGetNodeList()
1494 if (cur[0] == '&') { in xmlStringGetNodeList()
1501 if (cur != q) { in xmlStringGetNodeList()
1502 if (xmlBufAdd(buf, q, cur - q)) in xmlStringGetNodeList()
1505 q = cur; in xmlStringGetNodeList()
1506 if ((cur[1] == '#') && (cur[2] == 'x')) { in xmlStringGetNodeList()
1507 cur += 3; in xmlStringGetNodeList()
1508 tmp = *cur; in xmlStringGetNodeList()
1522 cur++; in xmlStringGetNodeList()
1523 tmp = *cur; in xmlStringGetNodeList()
1526 cur++; in xmlStringGetNodeList()
1527 q = cur; in xmlStringGetNodeList()
1528 } else if (cur[1] == '#') { in xmlStringGetNodeList()
1529 cur += 2; in xmlStringGetNodeList()
1530 tmp = *cur; in xmlStringGetNodeList()
1540 cur++; in xmlStringGetNodeList()
1541 tmp = *cur; in xmlStringGetNodeList()
1544 cur++; in xmlStringGetNodeList()
1545 q = cur; in xmlStringGetNodeList()
1550 cur++; in xmlStringGetNodeList()
1551 q = cur; in xmlStringGetNodeList()
1552 while ((*cur != 0) && (*cur != ';')) cur++; in xmlStringGetNodeList()
1553 if (*cur == 0) { in xmlStringGetNodeList()
1558 if (cur != q) { in xmlStringGetNodeList()
1562 val = xmlStrndup(q, cur - q); in xmlStringGetNodeList()
1613 cur++; in xmlStringGetNodeList()
1614 q = cur; in xmlStringGetNodeList()
1628 cur++; in xmlStringGetNodeList()
1630 if ((cur != q) || (ret == NULL)) { in xmlStringGetNodeList()
1634 xmlBufAdd(buf, q, cur - q); in xmlStringGetNodeList()
1830 xmlAttrPtr cur; in xmlNewPropInternal() local
1844 cur = (xmlAttrPtr) xmlMalloc(sizeof(xmlAttr)); in xmlNewPropInternal()
1845 if (cur == NULL) { in xmlNewPropInternal()
1853 memset(cur, 0, sizeof(xmlAttr)); in xmlNewPropInternal()
1854 cur->type = XML_ATTRIBUTE_NODE; in xmlNewPropInternal()
1856 cur->parent = node; in xmlNewPropInternal()
1859 cur->doc = doc; in xmlNewPropInternal()
1861 cur->ns = ns; in xmlNewPropInternal()
1865 cur->name = (xmlChar *) xmlDictLookup(doc->dict, name, -1); in xmlNewPropInternal()
1867 cur->name = xmlStrdup(name); in xmlNewPropInternal()
1869 cur->name = name; in xmlNewPropInternal()
1880 cur->children = xmlNewDocText(doc, value); in xmlNewPropInternal()
1881 cur->last = NULL; in xmlNewPropInternal()
1882 tmp = cur->children; in xmlNewPropInternal()
1884 tmp->parent = (xmlNodePtr) cur; in xmlNewPropInternal()
1886 cur->last = tmp; in xmlNewPropInternal()
1896 node->properties = cur; in xmlNewPropInternal()
1902 prev->next = cur; in xmlNewPropInternal()
1903 cur->prev = prev; in xmlNewPropInternal()
1908 (xmlIsID(node->doc, node, cur) == 1)) in xmlNewPropInternal()
1909 xmlAddID(NULL, node->doc, value, cur); in xmlNewPropInternal()
1912 xmlRegisterNodeDefaultValue((xmlNodePtr) cur); in xmlNewPropInternal()
1913 return (cur); in xmlNewPropInternal()
2003 xmlAttrPtr cur; in xmlNewDocProp() local
2016 cur = (xmlAttrPtr) xmlMalloc(sizeof(xmlAttr)); in xmlNewDocProp()
2017 if (cur == NULL) { in xmlNewDocProp()
2021 memset(cur, 0, sizeof(xmlAttr)); in xmlNewDocProp()
2022 cur->type = XML_ATTRIBUTE_NODE; in xmlNewDocProp()
2025 cur->name = xmlDictLookup(doc->dict, name, -1); in xmlNewDocProp()
2027 cur->name = xmlStrdup(name); in xmlNewDocProp()
2028 cur->doc = doc; in xmlNewDocProp()
2032 cur->children = xmlStringGetNodeList(doc, value); in xmlNewDocProp()
2033 cur->last = NULL; in xmlNewDocProp()
2035 tmp = cur->children; in xmlNewDocProp()
2037 tmp->parent = (xmlNodePtr) cur; in xmlNewDocProp()
2039 cur->last = tmp; in xmlNewDocProp()
2045 xmlRegisterNodeDefaultValue((xmlNodePtr)cur); in xmlNewDocProp()
2046 return(cur); in xmlNewDocProp()
2056 xmlFreePropList(xmlAttrPtr cur) { in xmlFreePropList() argument
2058 if (cur == NULL) return; in xmlFreePropList()
2059 while (cur != NULL) { in xmlFreePropList()
2060 next = cur->next; in xmlFreePropList()
2061 xmlFreeProp(cur); in xmlFreePropList()
2062 cur = next; in xmlFreePropList()
2073 xmlFreeProp(xmlAttrPtr cur) { in xmlFreeProp() argument
2075 if (cur == NULL) return; in xmlFreeProp()
2077 if (cur->doc != NULL) dict = cur->doc->dict; in xmlFreeProp()
2080 xmlDeregisterNodeDefaultValue((xmlNodePtr)cur); in xmlFreeProp()
2083 if ((cur->doc != NULL) && (cur->atype == XML_ATTRIBUTE_ID)) { in xmlFreeProp()
2084 xmlRemoveID(cur->doc, cur); in xmlFreeProp()
2086 if (cur->children != NULL) xmlFreeNodeList(cur->children); in xmlFreeProp()
2087 DICT_FREE(cur->name) in xmlFreeProp()
2088 xmlFree(cur); in xmlFreeProp()
2101 xmlRemoveProp(xmlAttrPtr cur) { in xmlRemoveProp() argument
2103 if (cur == NULL) { in xmlRemoveProp()
2110 if (cur->parent == NULL) { in xmlRemoveProp()
2117 tmp = cur->parent->properties; in xmlRemoveProp()
2118 if (tmp == cur) { in xmlRemoveProp()
2119 cur->parent->properties = cur->next; in xmlRemoveProp()
2120 if (cur->next != NULL) in xmlRemoveProp()
2121 cur->next->prev = NULL; in xmlRemoveProp()
2122 xmlFreeProp(cur); in xmlRemoveProp()
2126 if (tmp->next == cur) { in xmlRemoveProp()
2127 tmp->next = cur->next; in xmlRemoveProp()
2130 xmlFreeProp(cur); in xmlRemoveProp()
2153 xmlNodePtr cur; in xmlNewDocPI() local
2166 cur = (xmlNodePtr) xmlMalloc(sizeof(xmlNode)); in xmlNewDocPI()
2167 if (cur == NULL) { in xmlNewDocPI()
2171 memset(cur, 0, sizeof(xmlNode)); in xmlNewDocPI()
2172 cur->type = XML_PI_NODE; in xmlNewDocPI()
2175 cur->name = xmlDictLookup(doc->dict, name, -1); in xmlNewDocPI()
2177 cur->name = xmlStrdup(name); in xmlNewDocPI()
2179 cur->content = xmlStrdup(content); in xmlNewDocPI()
2181 cur->doc = doc; in xmlNewDocPI()
2184 xmlRegisterNodeDefaultValue((xmlNodePtr)cur); in xmlNewDocPI()
2185 return(cur); in xmlNewDocPI()
2215 xmlNodePtr cur; in xmlNewNode() local
2228 cur = (xmlNodePtr) xmlMalloc(sizeof(xmlNode)); in xmlNewNode()
2229 if (cur == NULL) { in xmlNewNode()
2233 memset(cur, 0, sizeof(xmlNode)); in xmlNewNode()
2234 cur->type = XML_ELEMENT_NODE; in xmlNewNode()
2236 cur->name = xmlStrdup(name); in xmlNewNode()
2237 cur->ns = ns; in xmlNewNode()
2240 xmlRegisterNodeDefaultValue(cur); in xmlNewNode()
2241 return(cur); in xmlNewNode()
2257 xmlNodePtr cur; in xmlNewNodeEatName() local
2270 cur = (xmlNodePtr) xmlMalloc(sizeof(xmlNode)); in xmlNewNodeEatName()
2271 if (cur == NULL) { in xmlNewNodeEatName()
2276 memset(cur, 0, sizeof(xmlNode)); in xmlNewNodeEatName()
2277 cur->type = XML_ELEMENT_NODE; in xmlNewNodeEatName()
2279 cur->name = name; in xmlNewNodeEatName()
2280 cur->ns = ns; in xmlNewNodeEatName()
2283 xmlRegisterNodeDefaultValue((xmlNodePtr)cur); in xmlNewNodeEatName()
2284 return(cur); in xmlNewNodeEatName()
2306 xmlNodePtr cur; in xmlNewDocNode() local
2309 cur = xmlNewNodeEatName(ns, (xmlChar *) in xmlNewDocNode()
2312 cur = xmlNewNode(ns, name); in xmlNewDocNode()
2313 if (cur != NULL) { in xmlNewDocNode()
2314 cur->doc = doc; in xmlNewDocNode()
2316 cur->children = xmlStringGetNodeList(doc, content); in xmlNewDocNode()
2317 UPDATE_LAST_CHILD_AND_PARENT(cur) in xmlNewDocNode()
2321 return(cur); in xmlNewDocNode()
2343 xmlNodePtr cur; in xmlNewDocNodeEatName() local
2345 cur = xmlNewNodeEatName(ns, name); in xmlNewDocNodeEatName()
2346 if (cur != NULL) { in xmlNewDocNodeEatName()
2347 cur->doc = doc; in xmlNewDocNodeEatName()
2349 cur->children = xmlStringGetNodeList(doc, content); in xmlNewDocNodeEatName()
2350 UPDATE_LAST_CHILD_AND_PARENT(cur) in xmlNewDocNodeEatName()
2358 return(cur); in xmlNewDocNodeEatName()
2377 xmlNodePtr cur; in xmlNewDocRawNode() local
2379 cur = xmlNewDocNode(doc, ns, name, NULL); in xmlNewDocRawNode()
2380 if (cur != NULL) { in xmlNewDocRawNode()
2381 cur->doc = doc; in xmlNewDocRawNode()
2383 cur->children = xmlNewDocText(doc, content); in xmlNewDocRawNode()
2384 UPDATE_LAST_CHILD_AND_PARENT(cur) in xmlNewDocRawNode()
2387 return(cur); in xmlNewDocRawNode()
2399 xmlNodePtr cur; in xmlNewDocFragment() local
2404 cur = (xmlNodePtr) xmlMalloc(sizeof(xmlNode)); in xmlNewDocFragment()
2405 if (cur == NULL) { in xmlNewDocFragment()
2409 memset(cur, 0, sizeof(xmlNode)); in xmlNewDocFragment()
2410 cur->type = XML_DOCUMENT_FRAG_NODE; in xmlNewDocFragment()
2412 cur->doc = doc; in xmlNewDocFragment()
2415 xmlRegisterNodeDefaultValue(cur); in xmlNewDocFragment()
2416 return(cur); in xmlNewDocFragment()
2429 xmlNodePtr cur; in xmlNewText() local
2434 cur = (xmlNodePtr) xmlMalloc(sizeof(xmlNode)); in xmlNewText()
2435 if (cur == NULL) { in xmlNewText()
2439 memset(cur, 0, sizeof(xmlNode)); in xmlNewText()
2440 cur->type = XML_TEXT_NODE; in xmlNewText()
2442 cur->name = xmlStringText; in xmlNewText()
2444 cur->content = xmlStrdup(content); in xmlNewText()
2448 xmlRegisterNodeDefaultValue(cur); in xmlNewText()
2449 return(cur); in xmlNewText()
2475 xmlNodePtr cur, prev; in xmlNewTextChild() local
2498 cur = xmlNewDocRawNode(parent->doc, parent->ns, name, content); in xmlNewTextChild()
2500 cur = xmlNewDocRawNode(parent->doc, ns, name, content); in xmlNewTextChild()
2504 cur = xmlNewDocRawNode((xmlDocPtr) parent, NULL, name, content); in xmlNewTextChild()
2506 cur = xmlNewDocRawNode((xmlDocPtr) parent, ns, name, content); in xmlNewTextChild()
2508 cur = xmlNewDocRawNode( parent->doc, ns, name, content); in xmlNewTextChild()
2512 if (cur == NULL) return(NULL); in xmlNewTextChild()
2517 cur->type = XML_ELEMENT_NODE; in xmlNewTextChild()
2518 cur->parent = parent; in xmlNewTextChild()
2519 cur->doc = parent->doc; in xmlNewTextChild()
2521 parent->children = cur; in xmlNewTextChild()
2522 parent->last = cur; in xmlNewTextChild()
2525 prev->next = cur; in xmlNewTextChild()
2526 cur->prev = prev; in xmlNewTextChild()
2527 parent->last = cur; in xmlNewTextChild()
2530 return(cur); in xmlNewTextChild()
2544 xmlNodePtr cur; in xmlNewCharRef() local
2552 cur = (xmlNodePtr) xmlMalloc(sizeof(xmlNode)); in xmlNewCharRef()
2553 if (cur == NULL) { in xmlNewCharRef()
2557 memset(cur, 0, sizeof(xmlNode)); in xmlNewCharRef()
2558 cur->type = XML_ENTITY_REF_NODE; in xmlNewCharRef()
2560 cur->doc = doc; in xmlNewCharRef()
2566 cur->name = xmlStrndup(name, len - 1); in xmlNewCharRef()
2568 cur->name = xmlStrndup(name, len); in xmlNewCharRef()
2570 cur->name = xmlStrdup(name); in xmlNewCharRef()
2573 xmlRegisterNodeDefaultValue(cur); in xmlNewCharRef()
2574 return(cur); in xmlNewCharRef()
2587 xmlNodePtr cur; in xmlNewReference() local
2596 cur = (xmlNodePtr) xmlMalloc(sizeof(xmlNode)); in xmlNewReference()
2597 if (cur == NULL) { in xmlNewReference()
2601 memset(cur, 0, sizeof(xmlNode)); in xmlNewReference()
2602 cur->type = XML_ENTITY_REF_NODE; in xmlNewReference()
2604 cur->doc = (xmlDoc *)doc; in xmlNewReference()
2610 cur->name = xmlStrndup(name, len - 1); in xmlNewReference()
2612 cur->name = xmlStrndup(name, len); in xmlNewReference()
2614 cur->name = xmlStrdup(name); in xmlNewReference()
2616 ent = xmlGetDocEntity(doc, cur->name); in xmlNewReference()
2618 cur->content = ent->content; in xmlNewReference()
2624 cur->children = (xmlNodePtr) ent; in xmlNewReference()
2625 cur->last = (xmlNodePtr) ent; in xmlNewReference()
2629 xmlRegisterNodeDefaultValue(cur); in xmlNewReference()
2630 return(cur); in xmlNewReference()
2643 xmlNodePtr cur; in xmlNewDocText() local
2645 cur = xmlNewText(content); in xmlNewDocText()
2646 if (cur != NULL) cur->doc = (xmlDoc *)doc; in xmlNewDocText()
2647 return(cur); in xmlNewDocText()
2660 xmlNodePtr cur; in xmlNewTextLen() local
2665 cur = (xmlNodePtr) xmlMalloc(sizeof(xmlNode)); in xmlNewTextLen()
2666 if (cur == NULL) { in xmlNewTextLen()
2670 memset(cur, 0, sizeof(xmlNode)); in xmlNewTextLen()
2671 cur->type = XML_TEXT_NODE; in xmlNewTextLen()
2673 cur->name = xmlStringText; in xmlNewTextLen()
2675 cur->content = xmlStrndup(content, len); in xmlNewTextLen()
2679 xmlRegisterNodeDefaultValue(cur); in xmlNewTextLen()
2680 return(cur); in xmlNewTextLen()
2695 xmlNodePtr cur; in xmlNewDocTextLen() local
2697 cur = xmlNewTextLen(content, len); in xmlNewDocTextLen()
2698 if (cur != NULL) cur->doc = doc; in xmlNewDocTextLen()
2699 return(cur); in xmlNewDocTextLen()
2711 xmlNodePtr cur; in xmlNewComment() local
2716 cur = (xmlNodePtr) xmlMalloc(sizeof(xmlNode)); in xmlNewComment()
2717 if (cur == NULL) { in xmlNewComment()
2721 memset(cur, 0, sizeof(xmlNode)); in xmlNewComment()
2722 cur->type = XML_COMMENT_NODE; in xmlNewComment()
2724 cur->name = xmlStringComment; in xmlNewComment()
2726 cur->content = xmlStrdup(content); in xmlNewComment()
2730 xmlRegisterNodeDefaultValue(cur); in xmlNewComment()
2731 return(cur); in xmlNewComment()
2745 xmlNodePtr cur; in xmlNewCDataBlock() local
2750 cur = (xmlNodePtr) xmlMalloc(sizeof(xmlNode)); in xmlNewCDataBlock()
2751 if (cur == NULL) { in xmlNewCDataBlock()
2755 memset(cur, 0, sizeof(xmlNode)); in xmlNewCDataBlock()
2756 cur->type = XML_CDATA_SECTION_NODE; in xmlNewCDataBlock()
2757 cur->doc = doc; in xmlNewCDataBlock()
2760 cur->content = xmlStrndup(content, len); in xmlNewCDataBlock()
2764 xmlRegisterNodeDefaultValue(cur); in xmlNewCDataBlock()
2765 return(cur); in xmlNewCDataBlock()
2778 xmlNodePtr cur; in xmlNewDocComment() local
2780 cur = xmlNewComment(content); in xmlNewDocComment()
2781 if (cur != NULL) cur->doc = doc; in xmlNewDocComment()
2782 return(cur); in xmlNewDocComment()
2841 xmlNodePtr cur; in xmlSetListDoc() local
2845 cur = list; in xmlSetListDoc()
2846 while (cur != NULL) { in xmlSetListDoc()
2847 if (cur->doc != doc) in xmlSetListDoc()
2848 xmlSetTreeDoc(cur, doc); in xmlSetListDoc()
2849 cur = cur->next; in xmlSetListDoc()
2874 xmlNodePtr cur, prev; in xmlNewChild() local
2897 cur = xmlNewDocNode(parent->doc, parent->ns, name, content); in xmlNewChild()
2899 cur = xmlNewDocNode(parent->doc, ns, name, content); in xmlNewChild()
2903 cur = xmlNewDocNode((xmlDocPtr) parent, NULL, name, content); in xmlNewChild()
2905 cur = xmlNewDocNode((xmlDocPtr) parent, ns, name, content); in xmlNewChild()
2907 cur = xmlNewDocNode( parent->doc, ns, name, content); in xmlNewChild()
2911 if (cur == NULL) return(NULL); in xmlNewChild()
2916 cur->type = XML_ELEMENT_NODE; in xmlNewChild()
2917 cur->parent = parent; in xmlNewChild()
2918 cur->doc = parent->doc; in xmlNewChild()
2920 parent->children = cur; in xmlNewChild()
2921 parent->last = cur; in xmlNewChild()
2924 prev->next = cur; in xmlNewChild()
2925 cur->prev = prev; in xmlNewChild()
2926 parent->last = cur; in xmlNewChild()
2929 return(cur); in xmlNewChild()
2947 xmlAddPropSibling(xmlNodePtr prev, xmlNodePtr cur, xmlNodePtr prop) { in xmlAddPropSibling() argument
2950 if ((cur == NULL) || (cur->type != XML_ATTRIBUTE_NODE) || in xmlAddPropSibling()
2957 attr = xmlHasNsProp(cur->parent, prop->name, NULL); in xmlAddPropSibling()
2959 attr = xmlHasNsProp(cur->parent, prop->name, prop->ns->href); in xmlAddPropSibling()
2961 if (prop->doc != cur->doc) { in xmlAddPropSibling()
2962 xmlSetTreeDoc(prop, cur->doc); in xmlAddPropSibling()
2964 prop->parent = cur->parent; in xmlAddPropSibling()
2972 prop->next = cur; in xmlAddPropSibling()
2973 cur->prev = prop; in xmlAddPropSibling()
2999 xmlAddNextSibling(xmlNodePtr cur, xmlNodePtr elem) { in xmlAddNextSibling() argument
3000 if ((cur == NULL) || (cur->type == XML_NAMESPACE_DECL)) { in xmlAddNextSibling()
3015 if (cur == elem) { in xmlAddNextSibling()
3026 if (cur->type == XML_TEXT_NODE) { in xmlAddNextSibling()
3027 xmlNodeAddContent(cur, elem->content); in xmlAddNextSibling()
3029 return(cur); in xmlAddNextSibling()
3031 if ((cur->next != NULL) && (cur->next->type == XML_TEXT_NODE) && in xmlAddNextSibling()
3032 (cur->name == cur->next->name)) { in xmlAddNextSibling()
3036 tmp = xmlStrcat(tmp, cur->next->content); in xmlAddNextSibling()
3037 xmlNodeSetContent(cur->next, tmp); in xmlAddNextSibling()
3040 return(cur->next); in xmlAddNextSibling()
3043 return xmlAddPropSibling(cur, cur, elem); in xmlAddNextSibling()
3046 if (elem->doc != cur->doc) { in xmlAddNextSibling()
3047 xmlSetTreeDoc(elem, cur->doc); in xmlAddNextSibling()
3049 elem->parent = cur->parent; in xmlAddNextSibling()
3050 elem->prev = cur; in xmlAddNextSibling()
3051 elem->next = cur->next; in xmlAddNextSibling()
3052 cur->next = elem; in xmlAddNextSibling()
3055 if ((elem->parent != NULL) && (elem->parent->last == cur)) in xmlAddNextSibling()
3077 xmlAddPrevSibling(xmlNodePtr cur, xmlNodePtr elem) { in xmlAddPrevSibling() argument
3078 if ((cur == NULL) || (cur->type == XML_NAMESPACE_DECL)) { in xmlAddPrevSibling()
3093 if (cur == elem) { in xmlAddPrevSibling()
3104 if (cur->type == XML_TEXT_NODE) { in xmlAddPrevSibling()
3108 tmp = xmlStrcat(tmp, cur->content); in xmlAddPrevSibling()
3109 xmlNodeSetContent(cur, tmp); in xmlAddPrevSibling()
3112 return(cur); in xmlAddPrevSibling()
3114 if ((cur->prev != NULL) && (cur->prev->type == XML_TEXT_NODE) && in xmlAddPrevSibling()
3115 (cur->name == cur->prev->name)) { in xmlAddPrevSibling()
3116 xmlNodeAddContent(cur->prev, elem->content); in xmlAddPrevSibling()
3118 return(cur->prev); in xmlAddPrevSibling()
3121 return xmlAddPropSibling(cur->prev, cur, elem); in xmlAddPrevSibling()
3124 if (elem->doc != cur->doc) { in xmlAddPrevSibling()
3125 xmlSetTreeDoc(elem, cur->doc); in xmlAddPrevSibling()
3127 elem->parent = cur->parent; in xmlAddPrevSibling()
3128 elem->next = cur; in xmlAddPrevSibling()
3129 elem->prev = cur->prev; in xmlAddPrevSibling()
3130 cur->prev = elem; in xmlAddPrevSibling()
3133 if ((elem->parent != NULL) && (elem->parent->children == cur)) { in xmlAddPrevSibling()
3153 xmlAddSibling(xmlNodePtr cur, xmlNodePtr elem) { in xmlAddSibling() argument
3156 if ((cur == NULL) || (cur->type == XML_NAMESPACE_DECL)) { in xmlAddSibling()
3172 if (cur == elem) { in xmlAddSibling()
3184 if ((cur->type != XML_ATTRIBUTE_NODE) && (cur->parent != NULL) && in xmlAddSibling()
3185 (cur->parent->children != NULL) && in xmlAddSibling()
3186 (cur->parent->last != NULL) && in xmlAddSibling()
3187 (cur->parent->last->next == NULL)) { in xmlAddSibling()
3188 cur = cur->parent->last; in xmlAddSibling()
3190 while (cur->next != NULL) cur = cur->next; in xmlAddSibling()
3195 if ((cur->type == XML_TEXT_NODE) && (elem->type == XML_TEXT_NODE) && in xmlAddSibling()
3196 (cur->name == elem->name)) { in xmlAddSibling()
3197 xmlNodeAddContent(cur, elem->content); in xmlAddSibling()
3199 return(cur); in xmlAddSibling()
3201 return xmlAddPropSibling(cur, cur, elem); in xmlAddSibling()
3204 if (elem->doc != cur->doc) { in xmlAddSibling()
3205 xmlSetTreeDoc(elem, cur->doc); in xmlAddSibling()
3207 parent = cur->parent; in xmlAddSibling()
3208 elem->prev = cur; in xmlAddSibling()
3211 cur->next = elem; in xmlAddSibling()
3229 xmlAddChildList(xmlNodePtr parent, xmlNodePtr cur) { in xmlAddChildList() argument
3240 if ((cur == NULL) || (cur->type == XML_NAMESPACE_DECL)) { in xmlAddChildList()
3248 if ((cur->doc != NULL) && (parent->doc != NULL) && in xmlAddChildList()
3249 (cur->doc != parent->doc)) { in xmlAddChildList()
3261 parent->children = cur; in xmlAddChildList()
3266 if ((cur->type == XML_TEXT_NODE) && in xmlAddChildList()
3268 (cur->name == parent->last->name)) { in xmlAddChildList()
3269 xmlNodeAddContent(parent->last, cur->content); in xmlAddChildList()
3273 if (cur->next == NULL) { in xmlAddChildList()
3274 xmlFreeNode(cur); in xmlAddChildList()
3277 prev = cur; in xmlAddChildList()
3278 cur = cur->next; in xmlAddChildList()
3282 prev->next = cur; in xmlAddChildList()
3283 cur->prev = prev; in xmlAddChildList()
3285 while (cur->next != NULL) { in xmlAddChildList()
3286 cur->parent = parent; in xmlAddChildList()
3287 if (cur->doc != parent->doc) { in xmlAddChildList()
3288 xmlSetTreeDoc(cur, parent->doc); in xmlAddChildList()
3290 cur = cur->next; in xmlAddChildList()
3292 cur->parent = parent; in xmlAddChildList()
3294 if (cur->doc != parent->doc) { in xmlAddChildList()
3295 xmlSetTreeDoc(cur, parent->doc); in xmlAddChildList()
3297 parent->last = cur; in xmlAddChildList()
3299 return(cur); in xmlAddChildList()
3315 xmlAddChild(xmlNodePtr parent, xmlNodePtr cur) { in xmlAddChild() argument
3326 if ((cur == NULL) || (cur->type == XML_NAMESPACE_DECL)) { in xmlAddChild()
3334 if (parent == cur) { in xmlAddChild()
3345 if (cur->type == XML_TEXT_NODE) { in xmlAddChild()
3348 (parent->name == cur->name)) { in xmlAddChild()
3349 xmlNodeAddContent(parent, cur->content); in xmlAddChild()
3350 xmlFreeNode(cur); in xmlAddChild()
3354 (parent->last->name == cur->name) && in xmlAddChild()
3355 (parent->last != cur)) { in xmlAddChild()
3356 xmlNodeAddContent(parent->last, cur->content); in xmlAddChild()
3357 xmlFreeNode(cur); in xmlAddChild()
3365 prev = cur->parent; in xmlAddChild()
3366 cur->parent = parent; in xmlAddChild()
3367 if (cur->doc != parent->doc) { in xmlAddChild()
3368 xmlSetTreeDoc(cur, parent->doc); in xmlAddChild()
3374 return(cur); in xmlAddChild()
3381 (parent != cur)) { in xmlAddChild()
3382 xmlNodeAddContent(parent, cur->content); in xmlAddChild()
3383 xmlFreeNode(cur); in xmlAddChild()
3386 if (cur->type == XML_ATTRIBUTE_NODE) { in xmlAddChild()
3393 if (cur->ns == NULL) in xmlAddChild()
3394 lastattr = xmlHasNsProp(parent, cur->name, NULL); in xmlAddChild()
3396 lastattr = xmlHasNsProp(parent, cur->name, cur->ns->href); in xmlAddChild()
3397 …if ((lastattr != NULL) && (lastattr != (xmlAttrPtr) cur) && (lastattr->type != XML_ATTRIBUTE_DECL)… in xmlAddChild()
3402 if (lastattr == (xmlAttrPtr) cur) in xmlAddChild()
3403 return(cur); in xmlAddChild()
3407 parent->properties = (xmlAttrPtr) cur; in xmlAddChild()
3414 lastattr->next = (xmlAttrPtr) cur; in xmlAddChild()
3415 ((xmlAttrPtr) cur)->prev = lastattr; in xmlAddChild()
3419 parent->children = cur; in xmlAddChild()
3420 parent->last = cur; in xmlAddChild()
3423 prev->next = cur; in xmlAddChild()
3424 cur->prev = prev; in xmlAddChild()
3425 parent->last = cur; in xmlAddChild()
3428 return(cur); in xmlAddChild()
3470 xmlNodePtr cur = NULL; in xmlChildElementCount() local
3480 cur = parent->children; in xmlChildElementCount()
3485 while (cur != NULL) { in xmlChildElementCount()
3486 if (cur->type == XML_ELEMENT_NODE) in xmlChildElementCount()
3488 cur = cur->next; in xmlChildElementCount()
3506 xmlNodePtr cur = NULL; in xmlFirstElementChild() local
3516 cur = parent->children; in xmlFirstElementChild()
3521 while (cur != NULL) { in xmlFirstElementChild()
3522 if (cur->type == XML_ELEMENT_NODE) in xmlFirstElementChild()
3523 return(cur); in xmlFirstElementChild()
3524 cur = cur->next; in xmlFirstElementChild()
3542 xmlNodePtr cur = NULL; in xmlLastElementChild() local
3552 cur = parent->last; in xmlLastElementChild()
3557 while (cur != NULL) { in xmlLastElementChild()
3558 if (cur->type == XML_ELEMENT_NODE) in xmlLastElementChild()
3559 return(cur); in xmlLastElementChild()
3560 cur = cur->prev; in xmlLastElementChild()
3654 xmlFreeNodeList(xmlNodePtr cur) { in xmlFreeNodeList() argument
3658 if (cur == NULL) return; in xmlFreeNodeList()
3659 if (cur->type == XML_NAMESPACE_DECL) { in xmlFreeNodeList()
3660 xmlFreeNsList((xmlNsPtr) cur); in xmlFreeNodeList()
3663 if ((cur->type == XML_DOCUMENT_NODE) || in xmlFreeNodeList()
3665 (cur->type == XML_DOCB_DOCUMENT_NODE) || in xmlFreeNodeList()
3667 (cur->type == XML_HTML_DOCUMENT_NODE)) { in xmlFreeNodeList()
3668 xmlFreeDoc((xmlDocPtr) cur); in xmlFreeNodeList()
3671 if (cur->doc != NULL) dict = cur->doc->dict; in xmlFreeNodeList()
3672 while (cur != NULL) { in xmlFreeNodeList()
3673 next = cur->next; in xmlFreeNodeList()
3674 if (cur->type != XML_DTD_NODE) { in xmlFreeNodeList()
3677 xmlDeregisterNodeDefaultValue(cur); in xmlFreeNodeList()
3679 if ((cur->children != NULL) && in xmlFreeNodeList()
3680 (cur->type != XML_ENTITY_REF_NODE)) in xmlFreeNodeList()
3681 xmlFreeNodeList(cur->children); in xmlFreeNodeList()
3682 if (((cur->type == XML_ELEMENT_NODE) || in xmlFreeNodeList()
3683 (cur->type == XML_XINCLUDE_START) || in xmlFreeNodeList()
3684 (cur->type == XML_XINCLUDE_END)) && in xmlFreeNodeList()
3685 (cur->properties != NULL)) in xmlFreeNodeList()
3686 xmlFreePropList(cur->properties); in xmlFreeNodeList()
3687 if ((cur->type != XML_ELEMENT_NODE) && in xmlFreeNodeList()
3688 (cur->type != XML_XINCLUDE_START) && in xmlFreeNodeList()
3689 (cur->type != XML_XINCLUDE_END) && in xmlFreeNodeList()
3690 (cur->type != XML_ENTITY_REF_NODE) && in xmlFreeNodeList()
3691 (cur->content != (xmlChar *) &(cur->properties))) { in xmlFreeNodeList()
3692 DICT_FREE(cur->content) in xmlFreeNodeList()
3694 if (((cur->type == XML_ELEMENT_NODE) || in xmlFreeNodeList()
3695 (cur->type == XML_XINCLUDE_START) || in xmlFreeNodeList()
3696 (cur->type == XML_XINCLUDE_END)) && in xmlFreeNodeList()
3697 (cur->nsDef != NULL)) in xmlFreeNodeList()
3698 xmlFreeNsList(cur->nsDef); in xmlFreeNodeList()
3706 if ((cur->name != NULL) && in xmlFreeNodeList()
3707 (cur->type != XML_TEXT_NODE) && in xmlFreeNodeList()
3708 (cur->type != XML_COMMENT_NODE)) in xmlFreeNodeList()
3709 DICT_FREE(cur->name) in xmlFreeNodeList()
3710 xmlFree(cur); in xmlFreeNodeList()
3712 cur = next; in xmlFreeNodeList()
3724 xmlFreeNode(xmlNodePtr cur) { in xmlFreeNode() argument
3727 if (cur == NULL) return; in xmlFreeNode()
3730 if (cur->type == XML_DTD_NODE) { in xmlFreeNode()
3731 xmlFreeDtd((xmlDtdPtr) cur); in xmlFreeNode()
3734 if (cur->type == XML_NAMESPACE_DECL) { in xmlFreeNode()
3735 xmlFreeNs((xmlNsPtr) cur); in xmlFreeNode()
3738 if (cur->type == XML_ATTRIBUTE_NODE) { in xmlFreeNode()
3739 xmlFreeProp((xmlAttrPtr) cur); in xmlFreeNode()
3744 xmlDeregisterNodeDefaultValue(cur); in xmlFreeNode()
3746 if (cur->doc != NULL) dict = cur->doc->dict; in xmlFreeNode()
3748 if (cur->type == XML_ENTITY_DECL) { in xmlFreeNode()
3749 xmlEntityPtr ent = (xmlEntityPtr) cur; in xmlFreeNode()
3753 if ((cur->children != NULL) && in xmlFreeNode()
3754 (cur->type != XML_ENTITY_REF_NODE)) in xmlFreeNode()
3755 xmlFreeNodeList(cur->children); in xmlFreeNode()
3756 if (((cur->type == XML_ELEMENT_NODE) || in xmlFreeNode()
3757 (cur->type == XML_XINCLUDE_START) || in xmlFreeNode()
3758 (cur->type == XML_XINCLUDE_END)) && in xmlFreeNode()
3759 (cur->properties != NULL)) in xmlFreeNode()
3760 xmlFreePropList(cur->properties); in xmlFreeNode()
3761 if ((cur->type != XML_ELEMENT_NODE) && in xmlFreeNode()
3762 (cur->content != NULL) && in xmlFreeNode()
3763 (cur->type != XML_ENTITY_REF_NODE) && in xmlFreeNode()
3764 (cur->type != XML_XINCLUDE_END) && in xmlFreeNode()
3765 (cur->type != XML_XINCLUDE_START) && in xmlFreeNode()
3766 (cur->content != (xmlChar *) &(cur->properties))) { in xmlFreeNode()
3767 DICT_FREE(cur->content) in xmlFreeNode()
3775 if ((cur->name != NULL) && in xmlFreeNode()
3776 (cur->type != XML_TEXT_NODE) && in xmlFreeNode()
3777 (cur->type != XML_COMMENT_NODE)) in xmlFreeNode()
3778 DICT_FREE(cur->name) in xmlFreeNode()
3780 if (((cur->type == XML_ELEMENT_NODE) || in xmlFreeNode()
3781 (cur->type == XML_XINCLUDE_START) || in xmlFreeNode()
3782 (cur->type == XML_XINCLUDE_END)) && in xmlFreeNode()
3783 (cur->nsDef != NULL)) in xmlFreeNode()
3784 xmlFreeNsList(cur->nsDef); in xmlFreeNode()
3785 xmlFree(cur); in xmlFreeNode()
3799 xmlUnlinkNode(xmlNodePtr cur) { in xmlUnlinkNode() argument
3800 if (cur == NULL) { in xmlUnlinkNode()
3807 if (cur->type == XML_NAMESPACE_DECL) in xmlUnlinkNode()
3809 if (cur->type == XML_DTD_NODE) { in xmlUnlinkNode()
3811 doc = cur->doc; in xmlUnlinkNode()
3813 if (doc->intSubset == (xmlDtdPtr) cur) in xmlUnlinkNode()
3815 if (doc->extSubset == (xmlDtdPtr) cur) in xmlUnlinkNode()
3819 if (cur->type == XML_ENTITY_DECL) { in xmlUnlinkNode()
3821 doc = cur->doc; in xmlUnlinkNode()
3824 if (xmlHashLookup(doc->intSubset->entities, cur->name) == cur) in xmlUnlinkNode()
3825 xmlHashRemoveEntry(doc->intSubset->entities, cur->name, in xmlUnlinkNode()
3827 if (xmlHashLookup(doc->intSubset->pentities, cur->name) == cur) in xmlUnlinkNode()
3828 xmlHashRemoveEntry(doc->intSubset->pentities, cur->name, in xmlUnlinkNode()
3832 if (xmlHashLookup(doc->extSubset->entities, cur->name) == cur) in xmlUnlinkNode()
3833 xmlHashRemoveEntry(doc->extSubset->entities, cur->name, in xmlUnlinkNode()
3835 if (xmlHashLookup(doc->extSubset->pentities, cur->name) == cur) in xmlUnlinkNode()
3836 xmlHashRemoveEntry(doc->extSubset->pentities, cur->name, in xmlUnlinkNode()
3841 if (cur->parent != NULL) { in xmlUnlinkNode()
3843 parent = cur->parent; in xmlUnlinkNode()
3844 if (cur->type == XML_ATTRIBUTE_NODE) { in xmlUnlinkNode()
3845 if (parent->properties == (xmlAttrPtr) cur) in xmlUnlinkNode()
3846 parent->properties = ((xmlAttrPtr) cur)->next; in xmlUnlinkNode()
3848 if (parent->children == cur) in xmlUnlinkNode()
3849 parent->children = cur->next; in xmlUnlinkNode()
3850 if (parent->last == cur) in xmlUnlinkNode()
3851 parent->last = cur->prev; in xmlUnlinkNode()
3853 cur->parent = NULL; in xmlUnlinkNode()
3855 if (cur->next != NULL) in xmlUnlinkNode()
3856 cur->next->prev = cur->prev; in xmlUnlinkNode()
3857 if (cur->prev != NULL) in xmlUnlinkNode()
3858 cur->prev->next = cur->next; in xmlUnlinkNode()
3859 cur->next = cur->prev = NULL; in xmlUnlinkNode()
3875 xmlReplaceNode(xmlNodePtr old, xmlNodePtr cur) { in xmlReplaceNode() argument
3876 if (old == cur) return(NULL); in xmlReplaceNode()
3885 if ((cur == NULL) || (cur->type == XML_NAMESPACE_DECL)) { in xmlReplaceNode()
3889 if (cur == old) { in xmlReplaceNode()
3892 if ((old->type==XML_ATTRIBUTE_NODE) && (cur->type!=XML_ATTRIBUTE_NODE)) { in xmlReplaceNode()
3899 if ((cur->type==XML_ATTRIBUTE_NODE) && (old->type!=XML_ATTRIBUTE_NODE)) { in xmlReplaceNode()
3906 xmlUnlinkNode(cur); in xmlReplaceNode()
3907 xmlSetTreeDoc(cur, old->doc); in xmlReplaceNode()
3908 cur->parent = old->parent; in xmlReplaceNode()
3909 cur->next = old->next; in xmlReplaceNode()
3910 if (cur->next != NULL) in xmlReplaceNode()
3911 cur->next->prev = cur; in xmlReplaceNode()
3912 cur->prev = old->prev; in xmlReplaceNode()
3913 if (cur->prev != NULL) in xmlReplaceNode()
3914 cur->prev->next = cur; in xmlReplaceNode()
3915 if (cur->parent != NULL) { in xmlReplaceNode()
3916 if (cur->type == XML_ATTRIBUTE_NODE) { in xmlReplaceNode()
3917 if (cur->parent->properties == (xmlAttrPtr)old) in xmlReplaceNode()
3918 cur->parent->properties = ((xmlAttrPtr) cur); in xmlReplaceNode()
3920 if (cur->parent->children == old) in xmlReplaceNode()
3921 cur->parent->children = cur; in xmlReplaceNode()
3922 if (cur->parent->last == old) in xmlReplaceNode()
3923 cur->parent->last = cur; in xmlReplaceNode()
3947 xmlCopyNamespace(xmlNsPtr cur) { in xmlCopyNamespace() argument
3950 if (cur == NULL) return(NULL); in xmlCopyNamespace()
3951 switch (cur->type) { in xmlCopyNamespace()
3953 ret = xmlNewNs(NULL, cur->href, cur->prefix); in xmlCopyNamespace()
3958 "xmlCopyNamespace: invalid type %d\n", cur->type); in xmlCopyNamespace()
3974 xmlCopyNamespaceList(xmlNsPtr cur) { in xmlCopyNamespaceList() argument
3978 while (cur != NULL) { in xmlCopyNamespaceList()
3979 q = xmlCopyNamespace(cur); in xmlCopyNamespaceList()
3986 cur = cur->next; in xmlCopyNamespaceList()
3995 xmlCopyPropInternal(xmlDocPtr doc, xmlNodePtr target, xmlAttrPtr cur) { in xmlCopyPropInternal() argument
3998 if (cur == NULL) return(NULL); in xmlCopyPropInternal()
4002 ret = xmlNewDocProp(target->doc, cur->name, NULL); in xmlCopyPropInternal()
4004 ret = xmlNewDocProp(doc, cur->name, NULL); in xmlCopyPropInternal()
4005 else if (cur->parent != NULL) in xmlCopyPropInternal()
4006 ret = xmlNewDocProp(cur->parent->doc, cur->name, NULL); in xmlCopyPropInternal()
4007 else if (cur->children != NULL) in xmlCopyPropInternal()
4008 ret = xmlNewDocProp(cur->children->doc, cur->name, NULL); in xmlCopyPropInternal()
4010 ret = xmlNewDocProp(NULL, cur->name, NULL); in xmlCopyPropInternal()
4014 if ((cur->ns != NULL) && (target != NULL)) { in xmlCopyPropInternal()
4017 ns = xmlSearchNs(target->doc, target, cur->ns->prefix); in xmlCopyPropInternal()
4024 ns = xmlSearchNs(cur->doc, cur->parent, cur->ns->prefix); in xmlCopyPropInternal()
4045 if (xmlStrEqual(ns->href, cur->ns->href)) { in xmlCopyPropInternal()
4053 ret->ns = xmlNewReconciliedNs(target->doc, target, cur->ns); in xmlCopyPropInternal()
4060 if (cur->children != NULL) { in xmlCopyPropInternal()
4063 ret->children = xmlStaticCopyNodeList(cur->children, ret->doc, (xmlNodePtr) ret); in xmlCopyPropInternal()
4076 if ((target!= NULL) && (cur!= NULL) && in xmlCopyPropInternal()
4077 (target->doc != NULL) && (cur->doc != NULL) && in xmlCopyPropInternal()
4078 (cur->doc->ids != NULL) && (cur->parent != NULL)) { in xmlCopyPropInternal()
4079 if (xmlIsID(cur->doc, cur->parent, cur)) { in xmlCopyPropInternal()
4082 id = xmlNodeListGetString(cur->doc, cur->children, 1); in xmlCopyPropInternal()
4102 xmlCopyProp(xmlNodePtr target, xmlAttrPtr cur) { in xmlCopyProp() argument
4103 return xmlCopyPropInternal(NULL, target, cur); in xmlCopyProp()
4116 xmlCopyPropList(xmlNodePtr target, xmlAttrPtr cur) { in xmlCopyPropList() argument
4122 while (cur != NULL) { in xmlCopyPropList()
4123 q = xmlCopyProp(target, cur); in xmlCopyPropList()
4133 cur = cur->next; in xmlCopyPropList()
4430 xmlNodePtr cur, p = NULL, q; in xmlCopyDtd() local
4451 cur = dtd->children; in xmlCopyDtd()
4452 while (cur != NULL) { in xmlCopyDtd()
4455 if (cur->type == XML_ENTITY_DECL) { in xmlCopyDtd()
4456 xmlEntityPtr tmp = (xmlEntityPtr) cur; in xmlCopyDtd()
4471 } else if (cur->type == XML_ELEMENT_DECL) { in xmlCopyDtd()
4472 xmlElementPtr tmp = (xmlElementPtr) cur; in xmlCopyDtd()
4475 } else if (cur->type == XML_ATTRIBUTE_DECL) { in xmlCopyDtd()
4476 xmlAttributePtr tmp = (xmlAttributePtr) cur; in xmlCopyDtd()
4479 } else if (cur->type == XML_COMMENT_NODE) { in xmlCopyDtd()
4480 q = xmlCopyNode(cur, 0); in xmlCopyDtd()
4484 cur = cur->next; in xmlCopyDtd()
4498 cur = cur->next; in xmlCopyDtd()
4651 const xmlNode *cur, *tmp, *next; in xmlGetNodePath() local
4677 cur = node; in xmlGetNodePath()
4682 if ((cur->type == XML_DOCUMENT_NODE) || in xmlGetNodePath()
4683 (cur->type == XML_HTML_DOCUMENT_NODE)) { in xmlGetNodePath()
4688 } else if (cur->type == XML_ELEMENT_NODE) { in xmlGetNodePath()
4691 name = (const char *) cur->name; in xmlGetNodePath()
4692 if (cur->ns) { in xmlGetNodePath()
4693 if (cur->ns->prefix != NULL) { in xmlGetNodePath()
4695 (char *)cur->ns->prefix, (char *)cur->name); in xmlGetNodePath()
4707 next = cur->parent; in xmlGetNodePath()
4713 tmp = cur->prev; in xmlGetNodePath()
4717 (xmlStrEqual(cur->name, tmp->name) && in xmlGetNodePath()
4718 ((tmp->ns == cur->ns) || in xmlGetNodePath()
4719 ((tmp->ns != NULL) && (cur->ns != NULL) && in xmlGetNodePath()
4720 (xmlStrEqual(cur->ns->prefix, tmp->ns->prefix))))))) in xmlGetNodePath()
4725 tmp = cur->next; in xmlGetNodePath()
4729 (xmlStrEqual(cur->name, tmp->name) && in xmlGetNodePath()
4730 ((tmp->ns == cur->ns) || in xmlGetNodePath()
4731 ((tmp->ns != NULL) && (cur->ns != NULL) && in xmlGetNodePath()
4732 (xmlStrEqual(cur->ns->prefix, tmp->ns->prefix))))))) in xmlGetNodePath()
4740 } else if (cur->type == XML_COMMENT_NODE) { in xmlGetNodePath()
4743 next = cur->parent; in xmlGetNodePath()
4748 tmp = cur->prev; in xmlGetNodePath()
4755 tmp = cur->next; in xmlGetNodePath()
4765 } else if ((cur->type == XML_TEXT_NODE) || in xmlGetNodePath()
4766 (cur->type == XML_CDATA_SECTION_NODE)) { in xmlGetNodePath()
4769 next = cur->parent; in xmlGetNodePath()
4774 tmp = cur->prev; in xmlGetNodePath()
4786 tmp = cur->next; in xmlGetNodePath()
4798 } else if (cur->type == XML_PI_NODE) { in xmlGetNodePath()
4801 "processing-instruction('%s')", (char *)cur->name); in xmlGetNodePath()
4805 next = cur->parent; in xmlGetNodePath()
4810 tmp = cur->prev; in xmlGetNodePath()
4813 (xmlStrEqual(cur->name, tmp->name))) in xmlGetNodePath()
4818 tmp = cur->next; in xmlGetNodePath()
4821 (xmlStrEqual(cur->name, tmp->name))) in xmlGetNodePath()
4830 } else if (cur->type == XML_ATTRIBUTE_NODE) { in xmlGetNodePath()
4832 name = (const char *) (((xmlAttrPtr) cur)->name); in xmlGetNodePath()
4833 if (cur->ns) { in xmlGetNodePath()
4834 if (cur->ns->prefix != NULL) in xmlGetNodePath()
4836 (char *)cur->ns->prefix, (char *)cur->name); in xmlGetNodePath()
4839 (char *)cur->name); in xmlGetNodePath()
4843 next = ((xmlAttrPtr) cur)->parent; in xmlGetNodePath()
4845 next = cur->parent; in xmlGetNodePath()
4878 cur = next; in xmlGetNodePath()
4879 } while (cur != NULL); in xmlGetNodePath()
4960 xmlNodeSetLang(xmlNodePtr cur, const xmlChar *lang) { in xmlNodeSetLang() argument
4963 if (cur == NULL) return; in xmlNodeSetLang()
4964 switch(cur->type) { in xmlNodeSetLang()
4991 ns = xmlSearchNsByHref(cur->doc, cur, XML_XML_NAMESPACE); in xmlNodeSetLang()
4994 xmlSetNsProp(cur, ns, BAD_CAST "lang", lang); in xmlNodeSetLang()
5009 xmlNodeGetLang(const xmlNode *cur) { in xmlNodeGetLang() argument
5012 if ((cur == NULL) || (cur->type == XML_NAMESPACE_DECL)) in xmlNodeGetLang()
5014 while (cur != NULL) { in xmlNodeGetLang()
5015 lang = xmlGetNsProp(cur, BAD_CAST "lang", XML_XML_NAMESPACE); in xmlNodeGetLang()
5018 cur = cur->parent; in xmlNodeGetLang()
5034 xmlNodeSetSpacePreserve(xmlNodePtr cur, int val) { in xmlNodeSetSpacePreserve() argument
5037 if (cur == NULL) return; in xmlNodeSetSpacePreserve()
5038 switch(cur->type) { in xmlNodeSetSpacePreserve()
5065 ns = xmlSearchNsByHref(cur->doc, cur, XML_XML_NAMESPACE); in xmlNodeSetSpacePreserve()
5070 xmlSetNsProp(cur, ns, BAD_CAST "space", BAD_CAST "default"); in xmlNodeSetSpacePreserve()
5073 xmlSetNsProp(cur, ns, BAD_CAST "space", BAD_CAST "preserve"); in xmlNodeSetSpacePreserve()
5090 xmlNodeGetSpacePreserve(const xmlNode *cur) { in xmlNodeGetSpacePreserve() argument
5093 if ((cur == NULL) || (cur->type != XML_ELEMENT_NODE)) in xmlNodeGetSpacePreserve()
5095 while (cur != NULL) { in xmlNodeGetSpacePreserve()
5096 space = xmlGetNsProp(cur, BAD_CAST "space", XML_XML_NAMESPACE); in xmlNodeGetSpacePreserve()
5108 cur = cur->parent; in xmlNodeGetSpacePreserve()
5122 xmlNodeSetName(xmlNodePtr cur, const xmlChar *name) { in xmlNodeSetName() argument
5127 if (cur == NULL) return; in xmlNodeSetName()
5129 switch(cur->type) { in xmlNodeSetName()
5156 doc = cur->doc; in xmlNodeSetName()
5162 if ((cur->name != NULL) && (!xmlDictOwns(dict, cur->name))) in xmlNodeSetName()
5163 freeme = cur->name; in xmlNodeSetName()
5164 cur->name = xmlDictLookup(dict, name, -1); in xmlNodeSetName()
5166 if (cur->name != NULL) in xmlNodeSetName()
5167 freeme = cur->name; in xmlNodeSetName()
5168 cur->name = xmlStrdup(name); in xmlNodeSetName()
5186 xmlNodeSetBase(xmlNodePtr cur, const xmlChar* uri) { in xmlNodeSetBase() argument
5190 if (cur == NULL) return; in xmlNodeSetBase()
5191 switch(cur->type) { in xmlNodeSetBase()
5217 xmlDocPtr doc = (xmlDocPtr) cur; in xmlNodeSetBase()
5229 ns = xmlSearchNsByHref(cur->doc, cur, XML_XML_NAMESPACE); in xmlNodeSetBase()
5234 xmlSetNsProp(cur, ns, BAD_CAST "base", fixed); in xmlNodeSetBase()
5237 xmlSetNsProp(cur, ns, BAD_CAST "base", uri); in xmlNodeSetBase()
5260 xmlNodeGetBase(const xmlDoc *doc, const xmlNode *cur) { in xmlNodeGetBase() argument
5264 if ((cur == NULL) && (doc == NULL)) in xmlNodeGetBase()
5266 if ((cur != NULL) && (cur->type == XML_NAMESPACE_DECL)) in xmlNodeGetBase()
5268 if (doc == NULL) doc = cur->doc; in xmlNodeGetBase()
5270 cur = doc->children; in xmlNodeGetBase()
5271 while ((cur != NULL) && (cur->name != NULL)) { in xmlNodeGetBase()
5272 if (cur->type != XML_ELEMENT_NODE) { in xmlNodeGetBase()
5273 cur = cur->next; in xmlNodeGetBase()
5276 if (!xmlStrcasecmp(cur->name, BAD_CAST "html")) { in xmlNodeGetBase()
5277 cur = cur->children; in xmlNodeGetBase()
5280 if (!xmlStrcasecmp(cur->name, BAD_CAST "head")) { in xmlNodeGetBase()
5281 cur = cur->children; in xmlNodeGetBase()
5284 if (!xmlStrcasecmp(cur->name, BAD_CAST "base")) { in xmlNodeGetBase()
5285 return(xmlGetProp(cur, BAD_CAST "href")); in xmlNodeGetBase()
5287 cur = cur->next; in xmlNodeGetBase()
5291 while (cur != NULL) { in xmlNodeGetBase()
5292 if (cur->type == XML_ENTITY_DECL) { in xmlNodeGetBase()
5293 xmlEntityPtr ent = (xmlEntityPtr) cur; in xmlNodeGetBase()
5296 if (cur->type == XML_ELEMENT_NODE) { in xmlNodeGetBase()
5297 base = xmlGetNsProp(cur, BAD_CAST "base", XML_XML_NAMESPACE); in xmlNodeGetBase()
5319 cur = cur->parent; in xmlNodeGetBase()
5345 xmlNodeBufGetContent(xmlBufferPtr buffer, const xmlNode *cur) in xmlNodeBufGetContent() argument
5350 if ((cur == NULL) || (buffer == NULL)) return(-1); in xmlNodeBufGetContent()
5352 ret = xmlBufGetNodeContent(buf, cur); in xmlNodeBufGetContent()
5373 xmlBufGetNodeContent(xmlBufPtr buf, const xmlNode *cur) in xmlBufGetNodeContent() argument
5375 if ((cur == NULL) || (buf == NULL)) return(-1); in xmlBufGetNodeContent()
5376 switch (cur->type) { in xmlBufGetNodeContent()
5379 xmlBufCat(buf, cur->content); in xmlBufGetNodeContent()
5383 const xmlNode *tmp = cur; in xmlBufGetNodeContent()
5407 if (tmp == cur) in xmlBufGetNodeContent()
5419 if (tmp == cur) { in xmlBufGetNodeContent()
5432 xmlAttrPtr attr = (xmlAttrPtr) cur; in xmlBufGetNodeContent()
5446 xmlBufCat(buf, cur->content); in xmlBufGetNodeContent()
5453 ent = xmlGetDocEntity(cur->doc, cur->name); in xmlBufGetNodeContent()
5481 cur = cur->children; in xmlBufGetNodeContent()
5482 while (cur!= NULL) { in xmlBufGetNodeContent()
5483 if ((cur->type == XML_ELEMENT_NODE) || in xmlBufGetNodeContent()
5484 (cur->type == XML_TEXT_NODE) || in xmlBufGetNodeContent()
5485 (cur->type == XML_CDATA_SECTION_NODE)) { in xmlBufGetNodeContent()
5486 xmlBufGetNodeContent(buf, cur); in xmlBufGetNodeContent()
5488 cur = cur->next; in xmlBufGetNodeContent()
5492 xmlBufCat(buf, ((xmlNsPtr) cur)->href); in xmlBufGetNodeContent()
5514 xmlNodeGetContent(const xmlNode *cur) in xmlNodeGetContent() argument
5516 if (cur == NULL) in xmlNodeGetContent()
5518 switch (cur->type) { in xmlNodeGetContent()
5527 xmlBufGetNodeContent(buf, cur); in xmlNodeGetContent()
5533 return(xmlGetPropNodeValueInternal((xmlAttrPtr) cur)); in xmlNodeGetContent()
5536 if (cur->content != NULL) in xmlNodeGetContent()
5537 return (xmlStrdup(cur->content)); in xmlNodeGetContent()
5545 ent = xmlGetDocEntity(cur->doc, cur->name); in xmlNodeGetContent()
5553 xmlBufGetNodeContent(buf, cur); in xmlNodeGetContent()
5578 xmlBufGetNodeContent(buf, (xmlNodePtr) cur); in xmlNodeGetContent()
5587 tmp = xmlStrdup(((xmlNsPtr) cur)->href); in xmlNodeGetContent()
5601 if (cur->content != NULL) in xmlNodeGetContent()
5602 return (xmlStrdup(cur->content)); in xmlNodeGetContent()
5619 xmlNodeSetContent(xmlNodePtr cur, const xmlChar *content) { in xmlNodeSetContent() argument
5620 if (cur == NULL) { in xmlNodeSetContent()
5627 switch (cur->type) { in xmlNodeSetContent()
5631 if (cur->children != NULL) xmlFreeNodeList(cur->children); in xmlNodeSetContent()
5632 cur->children = xmlStringGetNodeList(cur->doc, content); in xmlNodeSetContent()
5633 UPDATE_LAST_CHILD_AND_PARENT(cur) in xmlNodeSetContent()
5641 if ((cur->content != NULL) && in xmlNodeSetContent()
5642 (cur->content != (xmlChar *) &(cur->properties))) { in xmlNodeSetContent()
5643 if (!((cur->doc != NULL) && (cur->doc->dict != NULL) && in xmlNodeSetContent()
5644 (xmlDictOwns(cur->doc->dict, cur->content)))) in xmlNodeSetContent()
5645 xmlFree(cur->content); in xmlNodeSetContent()
5647 if (cur->children != NULL) xmlFreeNodeList(cur->children); in xmlNodeSetContent()
5648 cur->last = cur->children = NULL; in xmlNodeSetContent()
5650 cur->content = xmlStrdup(content); in xmlNodeSetContent()
5652 cur->content = NULL; in xmlNodeSetContent()
5653 cur->properties = NULL; in xmlNodeSetContent()
5654 cur->nsDef = NULL; in xmlNodeSetContent()
5696 xmlNodeSetContentLen(xmlNodePtr cur, const xmlChar *content, int len) { in xmlNodeSetContentLen() argument
5697 if (cur == NULL) { in xmlNodeSetContentLen()
5704 switch (cur->type) { in xmlNodeSetContentLen()
5708 if (cur->children != NULL) xmlFreeNodeList(cur->children); in xmlNodeSetContentLen()
5709 cur->children = xmlStringLenGetNodeList(cur->doc, content, len); in xmlNodeSetContentLen()
5710 UPDATE_LAST_CHILD_AND_PARENT(cur) in xmlNodeSetContentLen()
5719 if ((cur->content != NULL) && in xmlNodeSetContentLen()
5720 (cur->content != (xmlChar *) &(cur->properties))) { in xmlNodeSetContentLen()
5721 if (!((cur->doc != NULL) && (cur->doc->dict != NULL) && in xmlNodeSetContentLen()
5722 (xmlDictOwns(cur->doc->dict, cur->content)))) in xmlNodeSetContentLen()
5723 xmlFree(cur->content); in xmlNodeSetContentLen()
5725 if (cur->children != NULL) xmlFreeNodeList(cur->children); in xmlNodeSetContentLen()
5726 cur->children = cur->last = NULL; in xmlNodeSetContentLen()
5728 cur->content = xmlStrndup(content, len); in xmlNodeSetContentLen()
5730 cur->content = NULL; in xmlNodeSetContentLen()
5731 cur->properties = NULL; in xmlNodeSetContentLen()
5732 cur->nsDef = NULL; in xmlNodeSetContentLen()
5770 xmlNodeAddContentLen(xmlNodePtr cur, const xmlChar *content, int len) { in xmlNodeAddContentLen() argument
5771 if (cur == NULL) { in xmlNodeAddContentLen()
5779 switch (cur->type) { in xmlNodeAddContentLen()
5784 last = cur->last; in xmlNodeAddContentLen()
5787 tmp = xmlAddChild(cur, newNode); in xmlNodeAddContentLen()
5806 if ((cur->content == (xmlChar *) &(cur->properties)) || in xmlNodeAddContentLen()
5807 ((cur->doc != NULL) && (cur->doc->dict != NULL) && in xmlNodeAddContentLen()
5808 xmlDictOwns(cur->doc->dict, cur->content))) { in xmlNodeAddContentLen()
5809 cur->content = xmlStrncatNew(cur->content, content, len); in xmlNodeAddContentLen()
5810 cur->properties = NULL; in xmlNodeAddContentLen()
5811 cur->nsDef = NULL; in xmlNodeAddContentLen()
5814 cur->content = xmlStrncat(cur->content, content, len); in xmlNodeAddContentLen()
5845 xmlNodeAddContent(xmlNodePtr cur, const xmlChar *content) { in xmlNodeAddContent() argument
5848 if (cur == NULL) { in xmlNodeAddContent()
5857 xmlNodeAddContentLen(cur, content, len); in xmlNodeAddContent()
5896 xmlNsPtr cur; in xmlGetNsList() local
5907 cur = node->nsDef; in xmlGetNsList()
5908 while (cur != NULL) { in xmlGetNsList()
5920 if ((cur->prefix == ret[i]->prefix) || in xmlGetNsList()
5921 (xmlStrEqual(cur->prefix, ret[i]->prefix))) in xmlGetNsList()
5936 ret[nbns++] = cur; in xmlGetNsList()
5940 cur = cur->next; in xmlGetNsList()
6000 xmlNsPtr cur; in xmlSearchNs() local
6012 cur = (xmlNsPtr) xmlMalloc(sizeof(xmlNs)); in xmlSearchNs()
6013 if (cur == NULL) { in xmlSearchNs()
6017 memset(cur, 0, sizeof(xmlNs)); in xmlSearchNs()
6018 cur->type = XML_LOCAL_NAMESPACE; in xmlSearchNs()
6019 cur->href = xmlStrdup(XML_XML_NAMESPACE); in xmlSearchNs()
6020 cur->prefix = xmlStrdup((const xmlChar *)"xml"); in xmlSearchNs()
6021 cur->next = node->nsDef; in xmlSearchNs()
6022 node->nsDef = cur; in xmlSearchNs()
6023 return(cur); in xmlSearchNs()
6044 cur = node->nsDef; in xmlSearchNs()
6045 while (cur != NULL) { in xmlSearchNs()
6046 if ((cur->prefix == NULL) && (nameSpace == NULL) && in xmlSearchNs()
6047 (cur->href != NULL)) in xmlSearchNs()
6048 return(cur); in xmlSearchNs()
6049 if ((cur->prefix != NULL) && (nameSpace != NULL) && in xmlSearchNs()
6050 (cur->href != NULL) && in xmlSearchNs()
6051 (xmlStrEqual(cur->prefix, nameSpace))) in xmlSearchNs()
6052 return(cur); in xmlSearchNs()
6053 cur = cur->next; in xmlSearchNs()
6056 cur = node->ns; in xmlSearchNs()
6057 if (cur != NULL) { in xmlSearchNs()
6058 if ((cur->prefix == NULL) && (nameSpace == NULL) && in xmlSearchNs()
6059 (cur->href != NULL)) in xmlSearchNs()
6060 return(cur); in xmlSearchNs()
6061 if ((cur->prefix != NULL) && (nameSpace != NULL) && in xmlSearchNs()
6062 (cur->href != NULL) && in xmlSearchNs()
6063 (xmlStrEqual(cur->prefix, nameSpace))) in xmlSearchNs()
6064 return(cur); in xmlSearchNs()
6129 xmlNsPtr cur; in xmlSearchNsByHref() local
6145 cur = (xmlNsPtr) xmlMalloc(sizeof(xmlNs)); in xmlSearchNsByHref()
6146 if (cur == NULL) { in xmlSearchNsByHref()
6150 memset(cur, 0, sizeof(xmlNs)); in xmlSearchNsByHref()
6151 cur->type = XML_LOCAL_NAMESPACE; in xmlSearchNsByHref()
6152 cur->href = xmlStrdup(XML_XML_NAMESPACE); in xmlSearchNsByHref()
6153 cur->prefix = xmlStrdup((const xmlChar *) "xml"); in xmlSearchNsByHref()
6154 cur->next = node->nsDef; in xmlSearchNsByHref()
6155 node->nsDef = cur; in xmlSearchNsByHref()
6156 return (cur); in xmlSearchNsByHref()
6178 cur = node->nsDef; in xmlSearchNsByHref()
6179 while (cur != NULL) { in xmlSearchNsByHref()
6180 if ((cur->href != NULL) && (href != NULL) && in xmlSearchNsByHref()
6181 (xmlStrEqual(cur->href, href))) { in xmlSearchNsByHref()
6182 if (((!is_attr) || (cur->prefix != NULL)) && in xmlSearchNsByHref()
6183 (xmlNsInScope(doc, orig, node, cur->prefix) == 1)) in xmlSearchNsByHref()
6184 return (cur); in xmlSearchNsByHref()
6186 cur = cur->next; in xmlSearchNsByHref()
6189 cur = node->ns; in xmlSearchNsByHref()
6190 if (cur != NULL) { in xmlSearchNsByHref()
6191 if ((cur->href != NULL) && (href != NULL) && in xmlSearchNsByHref()
6192 (xmlStrEqual(cur->href, href))) { in xmlSearchNsByHref()
6193 if (((!is_attr) || (cur->prefix != NULL)) && in xmlSearchNsByHref()
6194 (xmlNsInScope(doc, orig, node, cur->prefix) == 1)) in xmlSearchNsByHref()
6195 return (cur); in xmlSearchNsByHref()
6541 xmlNsPtr *nsList, *cur; in xmlGetPropNodeInternal() local
6553 cur = nsList; in xmlGetPropNodeInternal()
6554 while (*cur != NULL) { in xmlGetPropNodeInternal()
6555 if (xmlStrEqual((*cur)->href, nsName)) { in xmlGetPropNodeInternal()
6557 name, (*cur)->prefix); in xmlGetPropNodeInternal()
6562 name, (*cur)->prefix); in xmlGetPropNodeInternal()
6567 cur++; in xmlGetPropNodeInternal()
6940 const xmlChar *cur; in xmlIsBlankNode() local
6947 cur = node->content; in xmlIsBlankNode()
6948 while (*cur != 0) { in xmlIsBlankNode()
6949 if (!IS_BLANK_CH(*cur)) return(0); in xmlIsBlankNode()
6950 cur++; in xmlIsBlankNode()
7626 const char *cur; in xmlBufferCCat() local
7638 for (cur = str;*cur != 0;cur++) { in xmlBufferCCat()
7645 buf->content[buf->use++] = *cur; in xmlBufferCCat()
7695 const xmlChar *cur, *base; in xmlBufferWriteQuotedString() local
7706 base = cur = string; in xmlBufferWriteQuotedString()
7707 while(*cur != 0){ in xmlBufferWriteQuotedString()
7708 if(*cur == '"'){ in xmlBufferWriteQuotedString()
7709 if (base != cur) in xmlBufferWriteQuotedString()
7710 xmlBufferAdd(buf, base, cur - base); in xmlBufferWriteQuotedString()
7712 cur++; in xmlBufferWriteQuotedString()
7713 base = cur; in xmlBufferWriteQuotedString()
7716 cur++; in xmlBufferWriteQuotedString()
7719 if (base != cur) in xmlBufferWriteQuotedString()
7720 xmlBufferAdd(buf, base, cur - base); in xmlBufferWriteQuotedString()
7842 xmlNsMapItemPtr cur, tmp; in xmlDOMWrapNsMapFree() local
7846 cur = nsmap->pool; in xmlDOMWrapNsMapFree()
7847 while (cur != NULL) { in xmlDOMWrapNsMapFree()
7848 tmp = cur; in xmlDOMWrapNsMapFree()
7849 cur = cur->next; in xmlDOMWrapNsMapFree()
7852 cur = nsmap->first; in xmlDOMWrapNsMapFree()
7853 while (cur != NULL) { in xmlDOMWrapNsMapFree()
7854 tmp = cur; in xmlDOMWrapNsMapFree()
7855 cur = cur->next; in xmlDOMWrapNsMapFree()
8073 xmlNodePtr cur; in xmlDOMWrapNSNormGatherInScopeNs() local
8085 cur = node; in xmlDOMWrapNSNormGatherInScopeNs()
8086 while ((cur != NULL) && (cur != (xmlNodePtr) cur->doc)) { in xmlDOMWrapNSNormGatherInScopeNs()
8087 if (cur->type == XML_ELEMENT_NODE) { in xmlDOMWrapNSNormGatherInScopeNs()
8088 if (cur->nsDef != NULL) { in xmlDOMWrapNSNormGatherInScopeNs()
8089 ns = cur->nsDef; in xmlDOMWrapNSNormGatherInScopeNs()
8117 cur = cur->parent; in xmlDOMWrapNSNormGatherInScopeNs()
8147 xmlDictOwns(sourceDoc->dict, cur->content)) { \
8149 cur->content = (xmlChar *) \
8150 xmlDictLookup(destDoc->dict, cur->content, -1); \
8152 cur->content = xmlStrdup(BAD_CAST cur->content); \
8344 xmlNodePtr cur, prev = NULL, out = NULL; in xmlSearchNsByNamespaceStrict() local
8359 cur = node; in xmlSearchNsByNamespaceStrict()
8361 if (cur->type == XML_ELEMENT_NODE) { in xmlSearchNsByNamespaceStrict()
8362 if (cur->nsDef != NULL) { in xmlSearchNsByNamespaceStrict()
8363 for (ns = cur->nsDef; ns != NULL; ns = ns->next) { in xmlSearchNsByNamespaceStrict()
8418 prev = cur; in xmlSearchNsByNamespaceStrict()
8420 } else if ((cur->type == XML_ENTITY_NODE) || in xmlSearchNsByNamespaceStrict()
8421 (cur->type == XML_ENTITY_DECL)) in xmlSearchNsByNamespaceStrict()
8423 cur = cur->parent; in xmlSearchNsByNamespaceStrict()
8424 } while ((cur != NULL) && (cur->doc != (xmlDocPtr) cur)); in xmlSearchNsByNamespaceStrict()
8446 xmlNodePtr cur; in xmlSearchNsByPrefixStrict() local
8462 cur = node; in xmlSearchNsByPrefixStrict()
8464 if (cur->type == XML_ELEMENT_NODE) { in xmlSearchNsByPrefixStrict()
8465 if (cur->nsDef != NULL) { in xmlSearchNsByPrefixStrict()
8466 ns = cur->nsDef; in xmlSearchNsByPrefixStrict()
8483 } else if ((cur->type == XML_ENTITY_NODE) || in xmlSearchNsByPrefixStrict()
8484 (cur->type == XML_ENTITY_DECL)) in xmlSearchNsByPrefixStrict()
8486 cur = cur->parent; in xmlSearchNsByPrefixStrict()
8487 } while ((cur != NULL) && (cur->doc != (xmlDocPtr) cur)); in xmlSearchNsByPrefixStrict()
8735 xmlNodePtr cur, curElem = NULL; in xmlDOMWrapReconcileNamespaces() local
8750 cur = elem; in xmlDOMWrapReconcileNamespaces()
8752 switch (cur->type) { in xmlDOMWrapReconcileNamespaces()
8755 curElem = cur; in xmlDOMWrapReconcileNamespaces()
8760 if (cur->nsDef != NULL) { in xmlDOMWrapReconcileNamespaces()
8762 ns = cur->nsDef; in xmlDOMWrapReconcileNamespaces()
8802 cur->nsDef = ns->next; in xmlDOMWrapReconcileNamespaces()
8812 if ((cur->ns != NULL) && adoptns && (cur->ns == ns)) in xmlDOMWrapReconcileNamespaces()
8845 if (cur->ns == NULL) in xmlDOMWrapReconcileNamespaces()
8862 if (cur->ns == listRedund[j]) { in xmlDOMWrapReconcileNamespaces()
8863 cur->ns = listRedund[++j]; in xmlDOMWrapReconcileNamespaces()
8877 (cur->ns == mi->oldNs)) { in xmlDOMWrapReconcileNamespaces()
8879 cur->ns = mi->newNs; in xmlDOMWrapReconcileNamespaces()
8888 cur->ns, &ns, in xmlDOMWrapReconcileNamespaces()
8891 (cur->type == XML_ATTRIBUTE_NODE) ? 1 : 0) == -1) in xmlDOMWrapReconcileNamespaces()
8893 cur->ns = ns; in xmlDOMWrapReconcileNamespaces()
8896 if ((cur->type == XML_ELEMENT_NODE) && in xmlDOMWrapReconcileNamespaces()
8897 (cur->properties != NULL)) { in xmlDOMWrapReconcileNamespaces()
8901 cur = (xmlNodePtr) cur->properties; in xmlDOMWrapReconcileNamespaces()
8909 if ((cur->type == XML_ELEMENT_NODE) && in xmlDOMWrapReconcileNamespaces()
8910 (cur->children != NULL)) { in xmlDOMWrapReconcileNamespaces()
8914 cur = cur->children; in xmlDOMWrapReconcileNamespaces()
8918 if (cur == elem) in xmlDOMWrapReconcileNamespaces()
8920 if (cur->type == XML_ELEMENT_NODE) { in xmlDOMWrapReconcileNamespaces()
8940 if (cur->next != NULL) in xmlDOMWrapReconcileNamespaces()
8941 cur = cur->next; in xmlDOMWrapReconcileNamespaces()
8943 if (cur->type == XML_ATTRIBUTE_NODE) { in xmlDOMWrapReconcileNamespaces()
8944 cur = cur->parent; in xmlDOMWrapReconcileNamespaces()
8947 cur = cur->parent; in xmlDOMWrapReconcileNamespaces()
8950 } while (cur != NULL); in xmlDOMWrapReconcileNamespaces()
8999 xmlNodePtr cur, curElem = NULL; in xmlDOMWrapAdoptBranch() local
9036 cur = node; in xmlDOMWrapAdoptBranch()
9037 if ((cur != NULL) && (cur->type == XML_NAMESPACE_DECL)) in xmlDOMWrapAdoptBranch()
9040 while (cur != NULL) { in xmlDOMWrapAdoptBranch()
9044 if (cur->doc != sourceDoc) { in xmlDOMWrapAdoptBranch()
9051 if (cur->next == NULL) in xmlDOMWrapAdoptBranch()
9054 cur = cur->next; in xmlDOMWrapAdoptBranch()
9055 if ((cur->type == XML_XINCLUDE_END) || in xmlDOMWrapAdoptBranch()
9056 (cur->doc == node->doc)) in xmlDOMWrapAdoptBranch()
9058 } while (cur->next != NULL); in xmlDOMWrapAdoptBranch()
9060 if (cur->doc != node->doc) in xmlDOMWrapAdoptBranch()
9063 cur->doc = destDoc; in xmlDOMWrapAdoptBranch()
9064 switch (cur->type) { in xmlDOMWrapAdoptBranch()
9072 curElem = cur; in xmlDOMWrapAdoptBranch()
9082 if ((cur->nsDef) && in xmlDOMWrapAdoptBranch()
9094 for (ns = cur->nsDef; ns != NULL; ns = ns->next) { in xmlDOMWrapAdoptBranch()
9126 if (cur->ns == NULL) in xmlDOMWrapAdoptBranch()
9144 (cur->ns == mi->oldNs)) { in xmlDOMWrapAdoptBranch()
9146 cur->ns = mi->newNs; in xmlDOMWrapAdoptBranch()
9158 ns = ctxt->getNsForNodeFunc(ctxt, cur, in xmlDOMWrapAdoptBranch()
9159 cur->ns->href, cur->ns->prefix); in xmlDOMWrapAdoptBranch()
9165 cur->ns, ns, XML_TREE_NSMAP_CUSTOM) == NULL) in xmlDOMWrapAdoptBranch()
9167 cur->ns = ns; in xmlDOMWrapAdoptBranch()
9175 cur->ns, &ns, in xmlDOMWrapAdoptBranch()
9179 (cur->type == XML_ATTRIBUTE_NODE) ? 1 : 0) == -1) in xmlDOMWrapAdoptBranch()
9181 cur->ns = ns; in xmlDOMWrapAdoptBranch()
9188 XML_TREE_ADOPT_STR(cur->name) in xmlDOMWrapAdoptBranch()
9189 if (cur->type == XML_ELEMENT_NODE) { in xmlDOMWrapAdoptBranch()
9190 cur->psvi = NULL; in xmlDOMWrapAdoptBranch()
9191 cur->line = 0; in xmlDOMWrapAdoptBranch()
9192 cur->extra = 0; in xmlDOMWrapAdoptBranch()
9196 if (cur->properties != NULL) { in xmlDOMWrapAdoptBranch()
9200 cur = (xmlNodePtr) cur->properties; in xmlDOMWrapAdoptBranch()
9208 (((xmlAttrPtr) cur)->atype == XML_ATTRIBUTE_ID)) in xmlDOMWrapAdoptBranch()
9210 xmlRemoveID(sourceDoc, (xmlAttrPtr) cur); in xmlDOMWrapAdoptBranch()
9212 ((xmlAttrPtr) cur)->atype = 0; in xmlDOMWrapAdoptBranch()
9213 ((xmlAttrPtr) cur)->psvi = NULL; in xmlDOMWrapAdoptBranch()
9222 XML_TREE_ADOPT_STR_2(cur->content) in xmlDOMWrapAdoptBranch()
9228 cur->content = NULL; in xmlDOMWrapAdoptBranch()
9229 cur->children = NULL; in xmlDOMWrapAdoptBranch()
9230 cur->last = NULL; in xmlDOMWrapAdoptBranch()
9236 ent = xmlGetDocEntity(destDoc, cur->name); in xmlDOMWrapAdoptBranch()
9238 cur->content = ent->content; in xmlDOMWrapAdoptBranch()
9239 cur->children = (xmlNodePtr) ent; in xmlDOMWrapAdoptBranch()
9240 cur->last = (xmlNodePtr) ent; in xmlDOMWrapAdoptBranch()
9245 XML_TREE_ADOPT_STR(cur->name) in xmlDOMWrapAdoptBranch()
9246 XML_TREE_ADOPT_STR_2(cur->content) in xmlDOMWrapAdoptBranch()
9256 if (cur->children != NULL) { in xmlDOMWrapAdoptBranch()
9257 cur = cur->children; in xmlDOMWrapAdoptBranch()
9262 if (cur == node) in xmlDOMWrapAdoptBranch()
9264 if ((cur->type == XML_ELEMENT_NODE) || in xmlDOMWrapAdoptBranch()
9265 (cur->type == XML_XINCLUDE_START) || in xmlDOMWrapAdoptBranch()
9266 (cur->type == XML_XINCLUDE_END)) in xmlDOMWrapAdoptBranch()
9290 if (cur->next != NULL) in xmlDOMWrapAdoptBranch()
9291 cur = cur->next; in xmlDOMWrapAdoptBranch()
9292 else if ((cur->type == XML_ATTRIBUTE_NODE) && in xmlDOMWrapAdoptBranch()
9293 (cur->parent->children != NULL)) in xmlDOMWrapAdoptBranch()
9295 cur = cur->parent->children; in xmlDOMWrapAdoptBranch()
9297 cur = cur->parent; in xmlDOMWrapAdoptBranch()
9369 xmlNodePtr cur, curElem = NULL; in xmlDOMWrapCloneNode() local
9418 cur = node; in xmlDOMWrapCloneNode()
9419 if ((cur != NULL) && (cur->type == XML_NAMESPACE_DECL)) in xmlDOMWrapCloneNode()
9422 while (cur != NULL) { in xmlDOMWrapCloneNode()
9423 if (cur->doc != sourceDoc) { in xmlDOMWrapCloneNode()
9434 switch (cur->type) { in xmlDOMWrapCloneNode()
9504 clone->type = cur->type; in xmlDOMWrapCloneNode()
9510 if (cur->name == xmlStringText) in xmlDOMWrapCloneNode()
9512 else if (cur->name == xmlStringTextNoenc) in xmlDOMWrapCloneNode()
9519 else if (cur->name == xmlStringComment) in xmlDOMWrapCloneNode()
9521 else if (cur->name != NULL) { in xmlDOMWrapCloneNode()
9522 DICT_CONST_COPY(cur->name, clone->name); in xmlDOMWrapCloneNode()
9525 switch (cur->type) { in xmlDOMWrapCloneNode()
9533 curElem = cur; in xmlDOMWrapCloneNode()
9538 if (cur->nsDef != NULL) { in xmlDOMWrapCloneNode()
9554 for (ns = cur->nsDef; ns != NULL; ns = ns->next) { in xmlDOMWrapCloneNode()
9621 DICT_COPY(cur->content, clone->content); in xmlDOMWrapCloneNode()
9633 ent = xmlGetDocEntity(destDoc, cur->name); in xmlDOMWrapCloneNode()
9645 clone->content = cur->content; in xmlDOMWrapCloneNode()
9646 clone->children = cur->children; in xmlDOMWrapCloneNode()
9647 clone->last = cur->last; in xmlDOMWrapCloneNode()
9651 DICT_COPY(cur->content, clone->content); in xmlDOMWrapCloneNode()
9654 DICT_COPY(cur->content, clone->content); in xmlDOMWrapCloneNode()
9660 if (cur->ns == NULL) in xmlDOMWrapCloneNode()
9685 (cur->ns == mi->oldNs)) { in xmlDOMWrapCloneNode()
9701 ns = ctxt->getNsForNodeFunc(ctxt, cur, in xmlDOMWrapCloneNode()
9702 cur->ns->href, cur->ns->prefix); in xmlDOMWrapCloneNode()
9707 cur->ns, ns, XML_TREE_NSMAP_CUSTOM) == NULL) in xmlDOMWrapCloneNode()
9717 cur->ns, &ns, in xmlDOMWrapCloneNode()
9722 (cur->type == XML_ATTRIBUTE_NODE) ? 1 : 0) == -1) in xmlDOMWrapCloneNode()
9741 idVal = xmlNodeListGetString(cur->doc, cur->children, 1); in xmlDOMWrapCloneNode()
9743 if (xmlAddID(NULL, destDoc, idVal, (xmlAttrPtr) cur) == NULL) { in xmlDOMWrapCloneNode()
9759 if ((cur->type == XML_ELEMENT_NODE) && (cur->properties != NULL)) { in xmlDOMWrapCloneNode()
9762 cur = (xmlNodePtr) cur->properties; in xmlDOMWrapCloneNode()
9769 if (cur->children != NULL) { in xmlDOMWrapCloneNode()
9770 if (deep || (cur->type == XML_ATTRIBUTE_NODE)) { in xmlDOMWrapCloneNode()
9773 cur = cur->children; in xmlDOMWrapCloneNode()
9783 if (cur == node) in xmlDOMWrapCloneNode()
9785 if ((cur->type == XML_ELEMENT_NODE) || in xmlDOMWrapCloneNode()
9786 (cur->type == XML_XINCLUDE_START) || in xmlDOMWrapCloneNode()
9787 (cur->type == XML_XINCLUDE_END)) { in xmlDOMWrapCloneNode()
9810 if (cur->next != NULL) { in xmlDOMWrapCloneNode()
9812 cur = cur->next; in xmlDOMWrapCloneNode()
9813 } else if (cur->type != XML_ATTRIBUTE_NODE) { in xmlDOMWrapCloneNode()
9825 cur = cur->parent; in xmlDOMWrapCloneNode()
9834 cur = cur->parent; in xmlDOMWrapCloneNode()
9893 xmlNodePtr cur; in xmlDOMWrapAdoptAttr() local
9939 cur = attr->children; in xmlDOMWrapAdoptAttr()
9940 if ((cur != NULL) && (cur->type == XML_NAMESPACE_DECL)) in xmlDOMWrapAdoptAttr()
9942 while (cur != NULL) { in xmlDOMWrapAdoptAttr()
9943 cur->doc = destDoc; in xmlDOMWrapAdoptAttr()
9944 switch (cur->type) { in xmlDOMWrapAdoptAttr()
9947 XML_TREE_ADOPT_STR_2(cur->content) in xmlDOMWrapAdoptAttr()
9953 cur->content = NULL; in xmlDOMWrapAdoptAttr()
9954 cur->children = NULL; in xmlDOMWrapAdoptAttr()
9955 cur->last = NULL; in xmlDOMWrapAdoptAttr()
9961 ent = xmlGetDocEntity(destDoc, cur->name); in xmlDOMWrapAdoptAttr()
9963 cur->content = ent->content; in xmlDOMWrapAdoptAttr()
9964 cur->children = (xmlNodePtr) ent; in xmlDOMWrapAdoptAttr()
9965 cur->last = (xmlNodePtr) ent; in xmlDOMWrapAdoptAttr()
9972 if (cur->children != NULL) { in xmlDOMWrapAdoptAttr()
9973 cur = cur->children; in xmlDOMWrapAdoptAttr()
9977 if (cur == (xmlNodePtr) attr) in xmlDOMWrapAdoptAttr()
9979 if (cur->next != NULL) in xmlDOMWrapAdoptAttr()
9980 cur = cur->next; in xmlDOMWrapAdoptAttr()
9982 cur = cur->parent; in xmlDOMWrapAdoptAttr()
10072 xmlNodePtr cur = node; in xmlDOMWrapAdoptNode() local
10075 cur->doc = destDoc; in xmlDOMWrapAdoptNode()