Lines Matching refs:cur
374 const xmlChar *cur = value; in xmlValidateNCName() local
384 while (IS_BLANK_CH(*cur)) cur++; in xmlValidateNCName()
385 if (((*cur >= 'a') && (*cur <= 'z')) || ((*cur >= 'A') && (*cur <= 'Z')) || in xmlValidateNCName()
386 (*cur == '_')) in xmlValidateNCName()
387 cur++; in xmlValidateNCName()
390 while (((*cur >= 'a') && (*cur <= 'z')) || in xmlValidateNCName()
391 ((*cur >= 'A') && (*cur <= 'Z')) || in xmlValidateNCName()
392 ((*cur >= '0') && (*cur <= '9')) || in xmlValidateNCName()
393 (*cur == '_') || (*cur == '-') || (*cur == '.')) in xmlValidateNCName()
394 cur++; in xmlValidateNCName()
396 while (IS_BLANK_CH(*cur)) cur++; in xmlValidateNCName()
397 if (*cur == 0) in xmlValidateNCName()
404 cur = value; in xmlValidateNCName()
405 c = CUR_SCHAR(cur, l); in xmlValidateNCName()
408 cur += l; in xmlValidateNCName()
409 c = CUR_SCHAR(cur, l); in xmlValidateNCName()
414 cur += l; in xmlValidateNCName()
415 c = CUR_SCHAR(cur, l); in xmlValidateNCName()
419 cur += l; in xmlValidateNCName()
420 c = CUR_SCHAR(cur, l); in xmlValidateNCName()
424 cur += l; in xmlValidateNCName()
425 c = CUR_SCHAR(cur, l); in xmlValidateNCName()
448 const xmlChar *cur = value; in xmlValidateQName() local
457 while (IS_BLANK_CH(*cur)) cur++; in xmlValidateQName()
458 if (((*cur >= 'a') && (*cur <= 'z')) || ((*cur >= 'A') && (*cur <= 'Z')) || in xmlValidateQName()
459 (*cur == '_')) in xmlValidateQName()
460 cur++; in xmlValidateQName()
463 while (((*cur >= 'a') && (*cur <= 'z')) || in xmlValidateQName()
464 ((*cur >= 'A') && (*cur <= 'Z')) || in xmlValidateQName()
465 ((*cur >= '0') && (*cur <= '9')) || in xmlValidateQName()
466 (*cur == '_') || (*cur == '-') || (*cur == '.')) in xmlValidateQName()
467 cur++; in xmlValidateQName()
468 if (*cur == ':') { in xmlValidateQName()
469 cur++; in xmlValidateQName()
470 if (((*cur >= 'a') && (*cur <= 'z')) || in xmlValidateQName()
471 ((*cur >= 'A') && (*cur <= 'Z')) || in xmlValidateQName()
472 (*cur == '_')) in xmlValidateQName()
473 cur++; in xmlValidateQName()
476 while (((*cur >= 'a') && (*cur <= 'z')) || in xmlValidateQName()
477 ((*cur >= 'A') && (*cur <= 'Z')) || in xmlValidateQName()
478 ((*cur >= '0') && (*cur <= '9')) || in xmlValidateQName()
479 (*cur == '_') || (*cur == '-') || (*cur == '.')) in xmlValidateQName()
480 cur++; in xmlValidateQName()
483 while (IS_BLANK_CH(*cur)) cur++; in xmlValidateQName()
484 if (*cur == 0) in xmlValidateQName()
491 cur = value; in xmlValidateQName()
492 c = CUR_SCHAR(cur, l); in xmlValidateQName()
495 cur += l; in xmlValidateQName()
496 c = CUR_SCHAR(cur, l); in xmlValidateQName()
501 cur += l; in xmlValidateQName()
502 c = CUR_SCHAR(cur, l); in xmlValidateQName()
506 cur += l; in xmlValidateQName()
507 c = CUR_SCHAR(cur, l); in xmlValidateQName()
510 cur += l; in xmlValidateQName()
511 c = CUR_SCHAR(cur, l); in xmlValidateQName()
514 cur += l; in xmlValidateQName()
515 c = CUR_SCHAR(cur, l); in xmlValidateQName()
519 cur += l; in xmlValidateQName()
520 c = CUR_SCHAR(cur, l); in xmlValidateQName()
525 cur += l; in xmlValidateQName()
526 c = CUR_SCHAR(cur, l); in xmlValidateQName()
546 const xmlChar *cur = value; in xmlValidateName() local
555 while (IS_BLANK_CH(*cur)) cur++; in xmlValidateName()
556 if (((*cur >= 'a') && (*cur <= 'z')) || ((*cur >= 'A') && (*cur <= 'Z')) || in xmlValidateName()
557 (*cur == '_') || (*cur == ':')) in xmlValidateName()
558 cur++; in xmlValidateName()
561 while (((*cur >= 'a') && (*cur <= 'z')) || in xmlValidateName()
562 ((*cur >= 'A') && (*cur <= 'Z')) || in xmlValidateName()
563 ((*cur >= '0') && (*cur <= '9')) || in xmlValidateName()
564 (*cur == '_') || (*cur == '-') || (*cur == '.') || (*cur == ':')) in xmlValidateName()
565 cur++; in xmlValidateName()
567 while (IS_BLANK_CH(*cur)) cur++; in xmlValidateName()
568 if (*cur == 0) in xmlValidateName()
575 cur = value; in xmlValidateName()
576 c = CUR_SCHAR(cur, l); in xmlValidateName()
579 cur += l; in xmlValidateName()
580 c = CUR_SCHAR(cur, l); in xmlValidateName()
585 cur += l; in xmlValidateName()
586 c = CUR_SCHAR(cur, l); in xmlValidateName()
589 cur += l; in xmlValidateName()
590 c = CUR_SCHAR(cur, l); in xmlValidateName()
594 cur += l; in xmlValidateName()
595 c = CUR_SCHAR(cur, l); in xmlValidateName()
615 const xmlChar *cur = value; in xmlValidateNMToken() local
624 while (IS_BLANK_CH(*cur)) cur++; in xmlValidateNMToken()
625 if (((*cur >= 'a') && (*cur <= 'z')) || in xmlValidateNMToken()
626 ((*cur >= 'A') && (*cur <= 'Z')) || in xmlValidateNMToken()
627 ((*cur >= '0') && (*cur <= '9')) || in xmlValidateNMToken()
628 (*cur == '_') || (*cur == '-') || (*cur == '.') || (*cur == ':')) in xmlValidateNMToken()
629 cur++; in xmlValidateNMToken()
632 while (((*cur >= 'a') && (*cur <= 'z')) || in xmlValidateNMToken()
633 ((*cur >= 'A') && (*cur <= 'Z')) || in xmlValidateNMToken()
634 ((*cur >= '0') && (*cur <= '9')) || in xmlValidateNMToken()
635 (*cur == '_') || (*cur == '-') || (*cur == '.') || (*cur == ':')) in xmlValidateNMToken()
636 cur++; in xmlValidateNMToken()
638 while (IS_BLANK_CH(*cur)) cur++; in xmlValidateNMToken()
639 if (*cur == 0) in xmlValidateNMToken()
646 cur = value; in xmlValidateNMToken()
647 c = CUR_SCHAR(cur, l); in xmlValidateNMToken()
650 cur += l; in xmlValidateNMToken()
651 c = CUR_SCHAR(cur, l); in xmlValidateNMToken()
657 cur += l; in xmlValidateNMToken()
658 c = CUR_SCHAR(cur, l); in xmlValidateNMToken()
661 cur += l; in xmlValidateNMToken()
662 c = CUR_SCHAR(cur, l); in xmlValidateNMToken()
666 cur += l; in xmlValidateNMToken()
667 c = CUR_SCHAR(cur, l); in xmlValidateNMToken()
735 xmlNsPtr cur; in xmlNewNs() local
757 cur = (xmlNsPtr) xmlMalloc(sizeof(xmlNs)); in xmlNewNs()
758 if (cur == NULL) { in xmlNewNs()
762 memset(cur, 0, sizeof(xmlNs)); in xmlNewNs()
763 cur->type = XML_LOCAL_NAMESPACE; in xmlNewNs()
766 cur->href = xmlStrdup(href); in xmlNewNs()
768 cur->prefix = xmlStrdup(prefix); in xmlNewNs()
776 node->nsDef = cur; in xmlNewNs()
780 if (((prev->prefix == NULL) && (cur->prefix == NULL)) || in xmlNewNs()
781 (xmlStrEqual(prev->prefix, cur->prefix))) { in xmlNewNs()
782 xmlFreeNs(cur); in xmlNewNs()
787 if (((prev->prefix == NULL) && (cur->prefix == NULL)) || in xmlNewNs()
788 (xmlStrEqual(prev->prefix, cur->prefix))) { in xmlNewNs()
789 xmlFreeNs(cur); in xmlNewNs()
793 prev->next = cur; in xmlNewNs()
796 return(cur); in xmlNewNs()
827 xmlFreeNs(xmlNsPtr cur) { in xmlFreeNs() argument
828 if (cur == NULL) { in xmlFreeNs()
835 if (cur->href != NULL) xmlFree((char *) cur->href); in xmlFreeNs()
836 if (cur->prefix != NULL) xmlFree((char *) cur->prefix); in xmlFreeNs()
837 xmlFree(cur); in xmlFreeNs()
847 xmlFreeNsList(xmlNsPtr cur) { in xmlFreeNsList() argument
849 if (cur == NULL) { in xmlFreeNsList()
856 while (cur != NULL) { in xmlFreeNsList()
857 next = cur->next; in xmlFreeNsList()
858 xmlFreeNs(cur); in xmlFreeNsList()
859 cur = next; in xmlFreeNsList()
878 xmlDtdPtr cur; in xmlNewDtd() local
893 cur = (xmlDtdPtr) xmlMalloc(sizeof(xmlDtd)); in xmlNewDtd()
894 if (cur == NULL) { in xmlNewDtd()
898 memset(cur, 0 , sizeof(xmlDtd)); in xmlNewDtd()
899 cur->type = XML_DTD_NODE; in xmlNewDtd()
902 cur->name = xmlStrdup(name); in xmlNewDtd()
904 cur->ExternalID = xmlStrdup(ExternalID); in xmlNewDtd()
906 cur->SystemID = xmlStrdup(SystemID); in xmlNewDtd()
908 doc->extSubset = cur; in xmlNewDtd()
909 cur->doc = doc; in xmlNewDtd()
912 xmlRegisterNodeDefaultValue((xmlNodePtr)cur); in xmlNewDtd()
913 return(cur); in xmlNewDtd()
926 xmlNodePtr cur; in xmlGetIntSubset() local
930 cur = doc->children; in xmlGetIntSubset()
931 while (cur != NULL) { in xmlGetIntSubset()
932 if (cur->type == XML_DTD_NODE) in xmlGetIntSubset()
933 return((xmlDtdPtr) cur); in xmlGetIntSubset()
934 cur = cur->next; in xmlGetIntSubset()
952 xmlDtdPtr cur; in xmlCreateIntSubset() local
967 cur = (xmlDtdPtr) xmlMalloc(sizeof(xmlDtd)); in xmlCreateIntSubset()
968 if (cur == NULL) { in xmlCreateIntSubset()
972 memset(cur, 0, sizeof(xmlDtd)); in xmlCreateIntSubset()
973 cur->type = XML_DTD_NODE; in xmlCreateIntSubset()
976 cur->name = xmlStrdup(name); in xmlCreateIntSubset()
977 if (cur->name == NULL) { in xmlCreateIntSubset()
979 xmlFree(cur); in xmlCreateIntSubset()
984 cur->ExternalID = xmlStrdup(ExternalID); in xmlCreateIntSubset()
985 if (cur->ExternalID == NULL) { in xmlCreateIntSubset()
987 if (cur->name != NULL) in xmlCreateIntSubset()
988 xmlFree((char *)cur->name); in xmlCreateIntSubset()
989 xmlFree(cur); in xmlCreateIntSubset()
994 cur->SystemID = xmlStrdup(SystemID); in xmlCreateIntSubset()
995 if (cur->SystemID == NULL) { in xmlCreateIntSubset()
997 if (cur->name != NULL) in xmlCreateIntSubset()
998 xmlFree((char *)cur->name); in xmlCreateIntSubset()
999 if (cur->ExternalID != NULL) in xmlCreateIntSubset()
1000 xmlFree((char *)cur->ExternalID); in xmlCreateIntSubset()
1001 xmlFree(cur); in xmlCreateIntSubset()
1006 doc->intSubset = cur; in xmlCreateIntSubset()
1007 cur->parent = doc; in xmlCreateIntSubset()
1008 cur->doc = doc; in xmlCreateIntSubset()
1010 doc->children = (xmlNodePtr) cur; in xmlCreateIntSubset()
1011 doc->last = (xmlNodePtr) cur; in xmlCreateIntSubset()
1017 prev->prev = (xmlNodePtr) cur; in xmlCreateIntSubset()
1018 cur->next = prev; in xmlCreateIntSubset()
1019 doc->children = (xmlNodePtr) cur; in xmlCreateIntSubset()
1027 cur->prev = doc->last; in xmlCreateIntSubset()
1028 cur->prev->next = (xmlNodePtr) cur; in xmlCreateIntSubset()
1029 cur->next = NULL; in xmlCreateIntSubset()
1030 doc->last = (xmlNodePtr) cur; in xmlCreateIntSubset()
1032 cur->next = next; in xmlCreateIntSubset()
1033 cur->prev = next->prev; in xmlCreateIntSubset()
1034 if (cur->prev == NULL) in xmlCreateIntSubset()
1035 doc->children = (xmlNodePtr) cur; in xmlCreateIntSubset()
1037 cur->prev->next = (xmlNodePtr) cur; in xmlCreateIntSubset()
1038 next->prev = (xmlNodePtr) cur; in xmlCreateIntSubset()
1045 xmlRegisterNodeDefaultValue((xmlNodePtr)cur); in xmlCreateIntSubset()
1046 return(cur); in xmlCreateIntSubset()
1104 xmlFreeDtd(xmlDtdPtr cur) { in xmlFreeDtd() argument
1107 if (cur == NULL) { in xmlFreeDtd()
1110 if (cur->doc != NULL) dict = cur->doc->dict; in xmlFreeDtd()
1113 xmlDeregisterNodeDefaultValue((xmlNodePtr)cur); in xmlFreeDtd()
1115 if (cur->children != NULL) { in xmlFreeDtd()
1116 xmlNodePtr next, c = cur->children; in xmlFreeDtd()
1134 DICT_FREE(cur->name) in xmlFreeDtd()
1135 DICT_FREE(cur->SystemID) in xmlFreeDtd()
1136 DICT_FREE(cur->ExternalID) in xmlFreeDtd()
1138 if (cur->notations != NULL) in xmlFreeDtd()
1139 xmlFreeNotationTable((xmlNotationTablePtr) cur->notations); in xmlFreeDtd()
1141 if (cur->elements != NULL) in xmlFreeDtd()
1142 xmlFreeElementTable((xmlElementTablePtr) cur->elements); in xmlFreeDtd()
1143 if (cur->attributes != NULL) in xmlFreeDtd()
1144 xmlFreeAttributeTable((xmlAttributeTablePtr) cur->attributes); in xmlFreeDtd()
1145 if (cur->entities != NULL) in xmlFreeDtd()
1146 xmlFreeEntitiesTable((xmlEntitiesTablePtr) cur->entities); in xmlFreeDtd()
1147 if (cur->pentities != NULL) in xmlFreeDtd()
1148 xmlFreeEntitiesTable((xmlEntitiesTablePtr) cur->pentities); in xmlFreeDtd()
1150 xmlFree(cur); in xmlFreeDtd()
1163 xmlDocPtr cur; in xmlNewDoc() local
1171 cur = (xmlDocPtr) xmlMalloc(sizeof(xmlDoc)); in xmlNewDoc()
1172 if (cur == NULL) { in xmlNewDoc()
1176 memset(cur, 0, sizeof(xmlDoc)); in xmlNewDoc()
1177 cur->type = XML_DOCUMENT_NODE; in xmlNewDoc()
1179 cur->version = xmlStrdup(version); in xmlNewDoc()
1180 if (cur->version == NULL) { in xmlNewDoc()
1182 xmlFree(cur); in xmlNewDoc()
1185 cur->standalone = -1; in xmlNewDoc()
1186 cur->compression = -1; /* not initialized */ in xmlNewDoc()
1187 cur->doc = cur; in xmlNewDoc()
1188 cur->parseFlags = 0; in xmlNewDoc()
1189 cur->properties = XML_DOC_USERBUILT; in xmlNewDoc()
1195 cur->charset = XML_CHAR_ENCODING_UTF8; in xmlNewDoc()
1198 xmlRegisterNodeDefaultValue((xmlNodePtr)cur); in xmlNewDoc()
1199 return(cur); in xmlNewDoc()
1209 xmlFreeDoc(xmlDocPtr cur) { in xmlFreeDoc() argument
1213 if (cur == NULL) { in xmlFreeDoc()
1222 xmlDebugCheckDocument(stderr, cur); in xmlFreeDoc()
1226 if (cur != NULL) dict = cur->dict; in xmlFreeDoc()
1229 xmlDeregisterNodeDefaultValue((xmlNodePtr)cur); in xmlFreeDoc()
1234 if (cur->ids != NULL) xmlFreeIDTable((xmlIDTablePtr) cur->ids); in xmlFreeDoc()
1235 cur->ids = NULL; in xmlFreeDoc()
1236 if (cur->refs != NULL) xmlFreeRefTable((xmlRefTablePtr) cur->refs); in xmlFreeDoc()
1237 cur->refs = NULL; in xmlFreeDoc()
1238 extSubset = cur->extSubset; in xmlFreeDoc()
1239 intSubset = cur->intSubset; in xmlFreeDoc()
1243 xmlUnlinkNode((xmlNodePtr) cur->extSubset); in xmlFreeDoc()
1244 cur->extSubset = NULL; in xmlFreeDoc()
1248 xmlUnlinkNode((xmlNodePtr) cur->intSubset); in xmlFreeDoc()
1249 cur->intSubset = NULL; in xmlFreeDoc()
1253 if (cur->children != NULL) xmlFreeNodeList(cur->children); in xmlFreeDoc()
1254 if (cur->oldNs != NULL) xmlFreeNsList(cur->oldNs); in xmlFreeDoc()
1256 DICT_FREE(cur->version) in xmlFreeDoc()
1257 DICT_FREE(cur->name) in xmlFreeDoc()
1258 DICT_FREE(cur->encoding) in xmlFreeDoc()
1259 DICT_FREE(cur->URL) in xmlFreeDoc()
1260 xmlFree(cur); in xmlFreeDoc()
1279 const xmlChar *cur, *end; in xmlStringLenGetNodeList() local
1285 cur = value; in xmlStringLenGetNodeList()
1286 end = cur + len; in xmlStringLenGetNodeList()
1292 q = cur; in xmlStringLenGetNodeList()
1293 while ((cur < end) && (*cur != 0)) { in xmlStringLenGetNodeList()
1294 if (cur[0] == '&') { in xmlStringLenGetNodeList()
1301 if (cur != q) { in xmlStringLenGetNodeList()
1302 if (xmlBufAdd(buf, q, cur - q)) in xmlStringLenGetNodeList()
1305 q = cur; in xmlStringLenGetNodeList()
1306 if ((cur + 2 < end) && (cur[1] == '#') && (cur[2] == 'x')) { in xmlStringLenGetNodeList()
1307 cur += 3; in xmlStringLenGetNodeList()
1308 if (cur < end) in xmlStringLenGetNodeList()
1309 tmp = *cur; in xmlStringLenGetNodeList()
1335 cur++; in xmlStringLenGetNodeList()
1336 if (cur < end) in xmlStringLenGetNodeList()
1337 tmp = *cur; in xmlStringLenGetNodeList()
1342 cur++; in xmlStringLenGetNodeList()
1343 q = cur; in xmlStringLenGetNodeList()
1344 } else if ((cur + 1 < end) && (cur[1] == '#')) { in xmlStringLenGetNodeList()
1345 cur += 2; in xmlStringLenGetNodeList()
1346 if (cur < end) in xmlStringLenGetNodeList()
1347 tmp = *cur; in xmlStringLenGetNodeList()
1360 cur++; in xmlStringLenGetNodeList()
1361 if (cur < end) in xmlStringLenGetNodeList()
1362 tmp = *cur; in xmlStringLenGetNodeList()
1367 cur++; in xmlStringLenGetNodeList()
1368 q = cur; in xmlStringLenGetNodeList()
1373 cur++; in xmlStringLenGetNodeList()
1374 q = cur; in xmlStringLenGetNodeList()
1375 while ((cur < end) && (*cur != 0) && (*cur != ';')) cur++; in xmlStringLenGetNodeList()
1376 if ((cur >= end) || (*cur == 0)) { in xmlStringLenGetNodeList()
1381 if (cur != q) { in xmlStringLenGetNodeList()
1385 val = xmlStrndup(q, cur - q); in xmlStringLenGetNodeList()
1443 cur++; in xmlStringLenGetNodeList()
1444 q = cur; in xmlStringLenGetNodeList()
1458 cur++; in xmlStringLenGetNodeList()
1461 if (cur != q) { in xmlStringLenGetNodeList()
1465 if (xmlBufAdd(buf, q, cur - q)) in xmlStringLenGetNodeList()
1502 const xmlChar *cur = value; in xmlStringGetNodeList() local
1513 q = cur; in xmlStringGetNodeList()
1514 while (*cur != 0) { in xmlStringGetNodeList()
1515 if (cur[0] == '&') { in xmlStringGetNodeList()
1522 if (cur != q) { in xmlStringGetNodeList()
1523 if (xmlBufAdd(buf, q, cur - q)) in xmlStringGetNodeList()
1526 q = cur; in xmlStringGetNodeList()
1527 if ((cur[1] == '#') && (cur[2] == 'x')) { in xmlStringGetNodeList()
1528 cur += 3; in xmlStringGetNodeList()
1529 tmp = *cur; in xmlStringGetNodeList()
1544 cur++; in xmlStringGetNodeList()
1545 tmp = *cur; in xmlStringGetNodeList()
1548 cur++; in xmlStringGetNodeList()
1549 q = cur; in xmlStringGetNodeList()
1550 } else if (cur[1] == '#') { in xmlStringGetNodeList()
1551 cur += 2; in xmlStringGetNodeList()
1552 tmp = *cur; in xmlStringGetNodeList()
1563 cur++; in xmlStringGetNodeList()
1564 tmp = *cur; in xmlStringGetNodeList()
1567 cur++; in xmlStringGetNodeList()
1568 q = cur; in xmlStringGetNodeList()
1573 cur++; in xmlStringGetNodeList()
1574 q = cur; in xmlStringGetNodeList()
1575 while ((*cur != 0) && (*cur != ';')) cur++; in xmlStringGetNodeList()
1576 if (*cur == 0) { in xmlStringGetNodeList()
1581 if (cur != q) { in xmlStringGetNodeList()
1585 val = xmlStrndup(q, cur - q); in xmlStringGetNodeList()
1643 cur++; in xmlStringGetNodeList()
1644 q = cur; in xmlStringGetNodeList()
1658 cur++; in xmlStringGetNodeList()
1660 if ((cur != q) || (ret == NULL)) { in xmlStringGetNodeList()
1664 xmlBufAdd(buf, q, cur - q); in xmlStringGetNodeList()
1864 xmlAttrPtr cur; in xmlNewPropInternal() local
1878 cur = (xmlAttrPtr) xmlMalloc(sizeof(xmlAttr)); in xmlNewPropInternal()
1879 if (cur == NULL) { in xmlNewPropInternal()
1887 memset(cur, 0, sizeof(xmlAttr)); in xmlNewPropInternal()
1888 cur->type = XML_ATTRIBUTE_NODE; in xmlNewPropInternal()
1890 cur->parent = node; in xmlNewPropInternal()
1893 cur->doc = doc; in xmlNewPropInternal()
1895 cur->ns = ns; in xmlNewPropInternal()
1899 cur->name = (xmlChar *) xmlDictLookup(doc->dict, name, -1); in xmlNewPropInternal()
1901 cur->name = xmlStrdup(name); in xmlNewPropInternal()
1903 cur->name = name; in xmlNewPropInternal()
1908 cur->children = xmlNewDocText(doc, value); in xmlNewPropInternal()
1909 cur->last = NULL; in xmlNewPropInternal()
1910 tmp = cur->children; in xmlNewPropInternal()
1912 tmp->parent = (xmlNodePtr) cur; in xmlNewPropInternal()
1914 cur->last = tmp; in xmlNewPropInternal()
1924 node->properties = cur; in xmlNewPropInternal()
1930 prev->next = cur; in xmlNewPropInternal()
1931 cur->prev = prev; in xmlNewPropInternal()
1936 (xmlIsID(node->doc, node, cur) == 1)) in xmlNewPropInternal()
1937 xmlAddID(NULL, node->doc, value, cur); in xmlNewPropInternal()
1940 xmlRegisterNodeDefaultValue((xmlNodePtr) cur); in xmlNewPropInternal()
1941 return (cur); in xmlNewPropInternal()
2036 xmlAttrPtr cur; in xmlNewDocProp() local
2049 cur = (xmlAttrPtr) xmlMalloc(sizeof(xmlAttr)); in xmlNewDocProp()
2050 if (cur == NULL) { in xmlNewDocProp()
2054 memset(cur, 0, sizeof(xmlAttr)); in xmlNewDocProp()
2055 cur->type = XML_ATTRIBUTE_NODE; in xmlNewDocProp()
2058 cur->name = xmlDictLookup(doc->dict, name, -1); in xmlNewDocProp()
2060 cur->name = xmlStrdup(name); in xmlNewDocProp()
2061 cur->doc = doc; in xmlNewDocProp()
2065 cur->children = xmlStringGetNodeList(doc, value); in xmlNewDocProp()
2066 cur->last = NULL; in xmlNewDocProp()
2068 tmp = cur->children; in xmlNewDocProp()
2070 tmp->parent = (xmlNodePtr) cur; in xmlNewDocProp()
2072 cur->last = tmp; in xmlNewDocProp()
2078 xmlRegisterNodeDefaultValue((xmlNodePtr)cur); in xmlNewDocProp()
2079 return(cur); in xmlNewDocProp()
2089 xmlFreePropList(xmlAttrPtr cur) { in xmlFreePropList() argument
2091 if (cur == NULL) return; in xmlFreePropList()
2092 while (cur != NULL) { in xmlFreePropList()
2093 next = cur->next; in xmlFreePropList()
2094 xmlFreeProp(cur); in xmlFreePropList()
2095 cur = next; in xmlFreePropList()
2106 xmlFreeProp(xmlAttrPtr cur) { in xmlFreeProp() argument
2108 if (cur == NULL) return; in xmlFreeProp()
2110 if (cur->doc != NULL) dict = cur->doc->dict; in xmlFreeProp()
2113 xmlDeregisterNodeDefaultValue((xmlNodePtr)cur); in xmlFreeProp()
2116 if ((cur->doc != NULL) && (cur->atype == XML_ATTRIBUTE_ID)) { in xmlFreeProp()
2117 xmlRemoveID(cur->doc, cur); in xmlFreeProp()
2119 if (cur->children != NULL) xmlFreeNodeList(cur->children); in xmlFreeProp()
2120 DICT_FREE(cur->name) in xmlFreeProp()
2121 xmlFree(cur); in xmlFreeProp()
2134 xmlRemoveProp(xmlAttrPtr cur) { in xmlRemoveProp() argument
2136 if (cur == NULL) { in xmlRemoveProp()
2143 if (cur->parent == NULL) { in xmlRemoveProp()
2150 tmp = cur->parent->properties; in xmlRemoveProp()
2151 if (tmp == cur) { in xmlRemoveProp()
2152 cur->parent->properties = cur->next; in xmlRemoveProp()
2153 if (cur->next != NULL) in xmlRemoveProp()
2154 cur->next->prev = NULL; in xmlRemoveProp()
2155 xmlFreeProp(cur); in xmlRemoveProp()
2159 if (tmp->next == cur) { in xmlRemoveProp()
2160 tmp->next = cur->next; in xmlRemoveProp()
2163 xmlFreeProp(cur); in xmlRemoveProp()
2186 xmlNodePtr cur; in xmlNewDocPI() local
2199 cur = (xmlNodePtr) xmlMalloc(sizeof(xmlNode)); in xmlNewDocPI()
2200 if (cur == NULL) { in xmlNewDocPI()
2204 memset(cur, 0, sizeof(xmlNode)); in xmlNewDocPI()
2205 cur->type = XML_PI_NODE; in xmlNewDocPI()
2208 cur->name = xmlDictLookup(doc->dict, name, -1); in xmlNewDocPI()
2210 cur->name = xmlStrdup(name); in xmlNewDocPI()
2212 cur->content = xmlStrdup(content); in xmlNewDocPI()
2214 cur->doc = doc; in xmlNewDocPI()
2217 xmlRegisterNodeDefaultValue((xmlNodePtr)cur); in xmlNewDocPI()
2218 return(cur); in xmlNewDocPI()
2248 xmlNodePtr cur; in xmlNewNode() local
2261 cur = (xmlNodePtr) xmlMalloc(sizeof(xmlNode)); in xmlNewNode()
2262 if (cur == NULL) { in xmlNewNode()
2266 memset(cur, 0, sizeof(xmlNode)); in xmlNewNode()
2267 cur->type = XML_ELEMENT_NODE; in xmlNewNode()
2269 cur->name = xmlStrdup(name); in xmlNewNode()
2270 cur->ns = ns; in xmlNewNode()
2273 xmlRegisterNodeDefaultValue(cur); in xmlNewNode()
2274 return(cur); in xmlNewNode()
2290 xmlNodePtr cur; in xmlNewNodeEatName() local
2303 cur = (xmlNodePtr) xmlMalloc(sizeof(xmlNode)); in xmlNewNodeEatName()
2304 if (cur == NULL) { in xmlNewNodeEatName()
2309 memset(cur, 0, sizeof(xmlNode)); in xmlNewNodeEatName()
2310 cur->type = XML_ELEMENT_NODE; in xmlNewNodeEatName()
2312 cur->name = name; in xmlNewNodeEatName()
2313 cur->ns = ns; in xmlNewNodeEatName()
2316 xmlRegisterNodeDefaultValue((xmlNodePtr)cur); in xmlNewNodeEatName()
2317 return(cur); in xmlNewNodeEatName()
2339 xmlNodePtr cur; in xmlNewDocNode() local
2342 cur = xmlNewNodeEatName(ns, (xmlChar *) in xmlNewDocNode()
2345 cur = xmlNewNode(ns, name); in xmlNewDocNode()
2346 if (cur != NULL) { in xmlNewDocNode()
2347 cur->doc = doc; in xmlNewDocNode()
2349 cur->children = xmlStringGetNodeList(doc, content); in xmlNewDocNode()
2350 UPDATE_LAST_CHILD_AND_PARENT(cur) in xmlNewDocNode()
2354 return(cur); in xmlNewDocNode()
2376 xmlNodePtr cur; in xmlNewDocNodeEatName() local
2378 cur = xmlNewNodeEatName(ns, name); in xmlNewDocNodeEatName()
2379 if (cur != NULL) { in xmlNewDocNodeEatName()
2380 cur->doc = doc; in xmlNewDocNodeEatName()
2382 cur->children = xmlStringGetNodeList(doc, content); in xmlNewDocNodeEatName()
2383 UPDATE_LAST_CHILD_AND_PARENT(cur) in xmlNewDocNodeEatName()
2391 return(cur); in xmlNewDocNodeEatName()
2410 xmlNodePtr cur; in xmlNewDocRawNode() local
2412 cur = xmlNewDocNode(doc, ns, name, NULL); in xmlNewDocRawNode()
2413 if (cur != NULL) { in xmlNewDocRawNode()
2414 cur->doc = doc; in xmlNewDocRawNode()
2416 cur->children = xmlNewDocText(doc, content); in xmlNewDocRawNode()
2417 UPDATE_LAST_CHILD_AND_PARENT(cur) in xmlNewDocRawNode()
2420 return(cur); in xmlNewDocRawNode()
2432 xmlNodePtr cur; in xmlNewDocFragment() local
2437 cur = (xmlNodePtr) xmlMalloc(sizeof(xmlNode)); in xmlNewDocFragment()
2438 if (cur == NULL) { in xmlNewDocFragment()
2442 memset(cur, 0, sizeof(xmlNode)); in xmlNewDocFragment()
2443 cur->type = XML_DOCUMENT_FRAG_NODE; in xmlNewDocFragment()
2445 cur->doc = doc; in xmlNewDocFragment()
2448 xmlRegisterNodeDefaultValue(cur); in xmlNewDocFragment()
2449 return(cur); in xmlNewDocFragment()
2462 xmlNodePtr cur; in xmlNewText() local
2467 cur = (xmlNodePtr) xmlMalloc(sizeof(xmlNode)); in xmlNewText()
2468 if (cur == NULL) { in xmlNewText()
2472 memset(cur, 0, sizeof(xmlNode)); in xmlNewText()
2473 cur->type = XML_TEXT_NODE; in xmlNewText()
2475 cur->name = xmlStringText; in xmlNewText()
2477 cur->content = xmlStrdup(content); in xmlNewText()
2481 xmlRegisterNodeDefaultValue(cur); in xmlNewText()
2482 return(cur); in xmlNewText()
2508 xmlNodePtr cur, prev; in xmlNewTextChild() local
2531 cur = xmlNewDocRawNode(parent->doc, parent->ns, name, content); in xmlNewTextChild()
2533 cur = xmlNewDocRawNode(parent->doc, ns, name, content); in xmlNewTextChild()
2537 cur = xmlNewDocRawNode((xmlDocPtr) parent, NULL, name, content); in xmlNewTextChild()
2539 cur = xmlNewDocRawNode((xmlDocPtr) parent, ns, name, content); in xmlNewTextChild()
2541 cur = xmlNewDocRawNode( parent->doc, ns, name, content); in xmlNewTextChild()
2545 if (cur == NULL) return(NULL); in xmlNewTextChild()
2550 cur->type = XML_ELEMENT_NODE; in xmlNewTextChild()
2551 cur->parent = parent; in xmlNewTextChild()
2552 cur->doc = parent->doc; in xmlNewTextChild()
2554 parent->children = cur; in xmlNewTextChild()
2555 parent->last = cur; in xmlNewTextChild()
2558 prev->next = cur; in xmlNewTextChild()
2559 cur->prev = prev; in xmlNewTextChild()
2560 parent->last = cur; in xmlNewTextChild()
2563 return(cur); in xmlNewTextChild()
2577 xmlNodePtr cur; in xmlNewCharRef() local
2585 cur = (xmlNodePtr) xmlMalloc(sizeof(xmlNode)); in xmlNewCharRef()
2586 if (cur == NULL) { in xmlNewCharRef()
2590 memset(cur, 0, sizeof(xmlNode)); in xmlNewCharRef()
2591 cur->type = XML_ENTITY_REF_NODE; in xmlNewCharRef()
2593 cur->doc = doc; in xmlNewCharRef()
2599 cur->name = xmlStrndup(name, len - 1); in xmlNewCharRef()
2601 cur->name = xmlStrndup(name, len); in xmlNewCharRef()
2603 cur->name = xmlStrdup(name); in xmlNewCharRef()
2606 xmlRegisterNodeDefaultValue(cur); in xmlNewCharRef()
2607 return(cur); in xmlNewCharRef()
2620 xmlNodePtr cur; in xmlNewReference() local
2629 cur = (xmlNodePtr) xmlMalloc(sizeof(xmlNode)); in xmlNewReference()
2630 if (cur == NULL) { in xmlNewReference()
2634 memset(cur, 0, sizeof(xmlNode)); in xmlNewReference()
2635 cur->type = XML_ENTITY_REF_NODE; in xmlNewReference()
2637 cur->doc = (xmlDoc *)doc; in xmlNewReference()
2643 cur->name = xmlStrndup(name, len - 1); in xmlNewReference()
2645 cur->name = xmlStrndup(name, len); in xmlNewReference()
2647 cur->name = xmlStrdup(name); in xmlNewReference()
2649 ent = xmlGetDocEntity(doc, cur->name); in xmlNewReference()
2651 cur->content = ent->content; in xmlNewReference()
2657 cur->children = (xmlNodePtr) ent; in xmlNewReference()
2658 cur->last = (xmlNodePtr) ent; in xmlNewReference()
2662 xmlRegisterNodeDefaultValue(cur); in xmlNewReference()
2663 return(cur); in xmlNewReference()
2676 xmlNodePtr cur; in xmlNewDocText() local
2678 cur = xmlNewText(content); in xmlNewDocText()
2679 if (cur != NULL) cur->doc = (xmlDoc *)doc; in xmlNewDocText()
2680 return(cur); in xmlNewDocText()
2693 xmlNodePtr cur; in xmlNewTextLen() local
2698 cur = (xmlNodePtr) xmlMalloc(sizeof(xmlNode)); in xmlNewTextLen()
2699 if (cur == NULL) { in xmlNewTextLen()
2703 memset(cur, 0, sizeof(xmlNode)); in xmlNewTextLen()
2704 cur->type = XML_TEXT_NODE; in xmlNewTextLen()
2706 cur->name = xmlStringText; in xmlNewTextLen()
2708 cur->content = xmlStrndup(content, len); in xmlNewTextLen()
2712 xmlRegisterNodeDefaultValue(cur); in xmlNewTextLen()
2713 return(cur); in xmlNewTextLen()
2728 xmlNodePtr cur; in xmlNewDocTextLen() local
2730 cur = xmlNewTextLen(content, len); in xmlNewDocTextLen()
2731 if (cur != NULL) cur->doc = doc; in xmlNewDocTextLen()
2732 return(cur); in xmlNewDocTextLen()
2744 xmlNodePtr cur; in xmlNewComment() local
2749 cur = (xmlNodePtr) xmlMalloc(sizeof(xmlNode)); in xmlNewComment()
2750 if (cur == NULL) { in xmlNewComment()
2754 memset(cur, 0, sizeof(xmlNode)); in xmlNewComment()
2755 cur->type = XML_COMMENT_NODE; in xmlNewComment()
2757 cur->name = xmlStringComment; in xmlNewComment()
2759 cur->content = xmlStrdup(content); in xmlNewComment()
2763 xmlRegisterNodeDefaultValue(cur); in xmlNewComment()
2764 return(cur); in xmlNewComment()
2778 xmlNodePtr cur; in xmlNewCDataBlock() local
2783 cur = (xmlNodePtr) xmlMalloc(sizeof(xmlNode)); in xmlNewCDataBlock()
2784 if (cur == NULL) { in xmlNewCDataBlock()
2788 memset(cur, 0, sizeof(xmlNode)); in xmlNewCDataBlock()
2789 cur->type = XML_CDATA_SECTION_NODE; in xmlNewCDataBlock()
2790 cur->doc = doc; in xmlNewCDataBlock()
2793 cur->content = xmlStrndup(content, len); in xmlNewCDataBlock()
2797 xmlRegisterNodeDefaultValue(cur); in xmlNewCDataBlock()
2798 return(cur); in xmlNewCDataBlock()
2811 xmlNodePtr cur; in xmlNewDocComment() local
2813 cur = xmlNewComment(content); in xmlNewDocComment()
2814 if (cur != NULL) cur->doc = doc; in xmlNewDocComment()
2815 return(cur); in xmlNewDocComment()
2881 xmlNodePtr cur; in xmlSetListDoc() local
2885 cur = list; in xmlSetListDoc()
2886 while (cur != NULL) { in xmlSetListDoc()
2887 if (cur->doc != doc) in xmlSetListDoc()
2888 xmlSetTreeDoc(cur, doc); in xmlSetListDoc()
2889 cur = cur->next; in xmlSetListDoc()
2914 xmlNodePtr cur, prev; in xmlNewChild() local
2937 cur = xmlNewDocNode(parent->doc, parent->ns, name, content); in xmlNewChild()
2939 cur = xmlNewDocNode(parent->doc, ns, name, content); in xmlNewChild()
2943 cur = xmlNewDocNode((xmlDocPtr) parent, NULL, name, content); in xmlNewChild()
2945 cur = xmlNewDocNode((xmlDocPtr) parent, ns, name, content); in xmlNewChild()
2947 cur = xmlNewDocNode( parent->doc, ns, name, content); in xmlNewChild()
2951 if (cur == NULL) return(NULL); in xmlNewChild()
2956 cur->type = XML_ELEMENT_NODE; in xmlNewChild()
2957 cur->parent = parent; in xmlNewChild()
2958 cur->doc = parent->doc; in xmlNewChild()
2960 parent->children = cur; in xmlNewChild()
2961 parent->last = cur; in xmlNewChild()
2964 prev->next = cur; in xmlNewChild()
2965 cur->prev = prev; in xmlNewChild()
2966 parent->last = cur; in xmlNewChild()
2969 return(cur); in xmlNewChild()
2987 xmlAddPropSibling(xmlNodePtr prev, xmlNodePtr cur, xmlNodePtr prop) { in xmlAddPropSibling() argument
2990 if ((cur == NULL) || (cur->type != XML_ATTRIBUTE_NODE) || in xmlAddPropSibling()
2997 attr = xmlHasNsProp(cur->parent, prop->name, NULL); in xmlAddPropSibling()
2999 attr = xmlHasNsProp(cur->parent, prop->name, prop->ns->href); in xmlAddPropSibling()
3001 if (prop->doc != cur->doc) { in xmlAddPropSibling()
3002 xmlSetTreeDoc(prop, cur->doc); in xmlAddPropSibling()
3004 prop->parent = cur->parent; in xmlAddPropSibling()
3012 prop->next = cur; in xmlAddPropSibling()
3013 cur->prev = prop; in xmlAddPropSibling()
3039 xmlAddNextSibling(xmlNodePtr cur, xmlNodePtr elem) { in xmlAddNextSibling() argument
3040 if ((cur == NULL) || (cur->type == XML_NAMESPACE_DECL)) { in xmlAddNextSibling()
3055 if (cur == elem) { in xmlAddNextSibling()
3066 if (cur->type == XML_TEXT_NODE) { in xmlAddNextSibling()
3067 xmlNodeAddContent(cur, elem->content); in xmlAddNextSibling()
3069 return(cur); in xmlAddNextSibling()
3071 if ((cur->next != NULL) && (cur->next->type == XML_TEXT_NODE) && in xmlAddNextSibling()
3072 (cur->name == cur->next->name)) { in xmlAddNextSibling()
3076 tmp = xmlStrcat(tmp, cur->next->content); in xmlAddNextSibling()
3077 xmlNodeSetContent(cur->next, tmp); in xmlAddNextSibling()
3080 return(cur->next); in xmlAddNextSibling()
3083 return xmlAddPropSibling(cur, cur, elem); in xmlAddNextSibling()
3086 if (elem->doc != cur->doc) { in xmlAddNextSibling()
3087 xmlSetTreeDoc(elem, cur->doc); in xmlAddNextSibling()
3089 elem->parent = cur->parent; in xmlAddNextSibling()
3090 elem->prev = cur; in xmlAddNextSibling()
3091 elem->next = cur->next; in xmlAddNextSibling()
3092 cur->next = elem; in xmlAddNextSibling()
3095 if ((elem->parent != NULL) && (elem->parent->last == cur)) in xmlAddNextSibling()
3117 xmlAddPrevSibling(xmlNodePtr cur, xmlNodePtr elem) { in xmlAddPrevSibling() argument
3118 if ((cur == NULL) || (cur->type == XML_NAMESPACE_DECL)) { in xmlAddPrevSibling()
3133 if (cur == elem) { in xmlAddPrevSibling()
3144 if (cur->type == XML_TEXT_NODE) { in xmlAddPrevSibling()
3148 tmp = xmlStrcat(tmp, cur->content); in xmlAddPrevSibling()
3149 xmlNodeSetContent(cur, tmp); in xmlAddPrevSibling()
3152 return(cur); in xmlAddPrevSibling()
3154 if ((cur->prev != NULL) && (cur->prev->type == XML_TEXT_NODE) && in xmlAddPrevSibling()
3155 (cur->name == cur->prev->name)) { in xmlAddPrevSibling()
3156 xmlNodeAddContent(cur->prev, elem->content); in xmlAddPrevSibling()
3158 return(cur->prev); in xmlAddPrevSibling()
3161 return xmlAddPropSibling(cur->prev, cur, elem); in xmlAddPrevSibling()
3164 if (elem->doc != cur->doc) { in xmlAddPrevSibling()
3165 xmlSetTreeDoc(elem, cur->doc); in xmlAddPrevSibling()
3167 elem->parent = cur->parent; in xmlAddPrevSibling()
3168 elem->next = cur; in xmlAddPrevSibling()
3169 elem->prev = cur->prev; in xmlAddPrevSibling()
3170 cur->prev = elem; in xmlAddPrevSibling()
3173 if ((elem->parent != NULL) && (elem->parent->children == cur)) { in xmlAddPrevSibling()
3193 xmlAddSibling(xmlNodePtr cur, xmlNodePtr elem) { in xmlAddSibling() argument
3196 if ((cur == NULL) || (cur->type == XML_NAMESPACE_DECL)) { in xmlAddSibling()
3212 if (cur == elem) { in xmlAddSibling()
3224 if ((cur->type != XML_ATTRIBUTE_NODE) && (cur->parent != NULL) && in xmlAddSibling()
3225 (cur->parent->children != NULL) && in xmlAddSibling()
3226 (cur->parent->last != NULL) && in xmlAddSibling()
3227 (cur->parent->last->next == NULL)) { in xmlAddSibling()
3228 cur = cur->parent->last; in xmlAddSibling()
3230 while (cur->next != NULL) cur = cur->next; in xmlAddSibling()
3235 if ((cur->type == XML_TEXT_NODE) && (elem->type == XML_TEXT_NODE) && in xmlAddSibling()
3236 (cur->name == elem->name)) { in xmlAddSibling()
3237 xmlNodeAddContent(cur, elem->content); in xmlAddSibling()
3239 return(cur); in xmlAddSibling()
3241 return xmlAddPropSibling(cur, cur, elem); in xmlAddSibling()
3244 if (elem->doc != cur->doc) { in xmlAddSibling()
3245 xmlSetTreeDoc(elem, cur->doc); in xmlAddSibling()
3247 parent = cur->parent; in xmlAddSibling()
3248 elem->prev = cur; in xmlAddSibling()
3251 cur->next = elem; in xmlAddSibling()
3269 xmlAddChildList(xmlNodePtr parent, xmlNodePtr cur) { in xmlAddChildList() argument
3280 if ((cur == NULL) || (cur->type == XML_NAMESPACE_DECL)) { in xmlAddChildList()
3288 if ((cur->doc != NULL) && (parent->doc != NULL) && in xmlAddChildList()
3289 (cur->doc != parent->doc)) { in xmlAddChildList()
3301 parent->children = cur; in xmlAddChildList()
3306 if ((cur->type == XML_TEXT_NODE) && in xmlAddChildList()
3308 (cur->name == parent->last->name)) { in xmlAddChildList()
3309 xmlNodeAddContent(parent->last, cur->content); in xmlAddChildList()
3313 if (cur->next == NULL) { in xmlAddChildList()
3314 xmlFreeNode(cur); in xmlAddChildList()
3317 prev = cur; in xmlAddChildList()
3318 cur = cur->next; in xmlAddChildList()
3322 prev->next = cur; in xmlAddChildList()
3323 cur->prev = prev; in xmlAddChildList()
3325 while (cur->next != NULL) { in xmlAddChildList()
3326 cur->parent = parent; in xmlAddChildList()
3327 if (cur->doc != parent->doc) { in xmlAddChildList()
3328 xmlSetTreeDoc(cur, parent->doc); in xmlAddChildList()
3330 cur = cur->next; in xmlAddChildList()
3332 cur->parent = parent; in xmlAddChildList()
3334 if (cur->doc != parent->doc) { in xmlAddChildList()
3335 xmlSetTreeDoc(cur, parent->doc); in xmlAddChildList()
3337 parent->last = cur; in xmlAddChildList()
3339 return(cur); in xmlAddChildList()
3355 xmlAddChild(xmlNodePtr parent, xmlNodePtr cur) { in xmlAddChild() argument
3366 if ((cur == NULL) || (cur->type == XML_NAMESPACE_DECL)) { in xmlAddChild()
3374 if (parent == cur) { in xmlAddChild()
3385 if (cur->type == XML_TEXT_NODE) { in xmlAddChild()
3388 (parent->name == cur->name)) { in xmlAddChild()
3389 xmlNodeAddContent(parent, cur->content); in xmlAddChild()
3390 xmlFreeNode(cur); in xmlAddChild()
3394 (parent->last->name == cur->name) && in xmlAddChild()
3395 (parent->last != cur)) { in xmlAddChild()
3396 xmlNodeAddContent(parent->last, cur->content); in xmlAddChild()
3397 xmlFreeNode(cur); in xmlAddChild()
3405 prev = cur->parent; in xmlAddChild()
3406 cur->parent = parent; in xmlAddChild()
3407 if (cur->doc != parent->doc) { in xmlAddChild()
3408 xmlSetTreeDoc(cur, parent->doc); in xmlAddChild()
3414 return(cur); in xmlAddChild()
3421 (parent != cur)) { in xmlAddChild()
3422 xmlNodeAddContent(parent, cur->content); in xmlAddChild()
3423 xmlFreeNode(cur); in xmlAddChild()
3426 if (cur->type == XML_ATTRIBUTE_NODE) { in xmlAddChild()
3433 if (cur->ns == NULL) in xmlAddChild()
3434 lastattr = xmlHasNsProp(parent, cur->name, NULL); in xmlAddChild()
3436 lastattr = xmlHasNsProp(parent, cur->name, cur->ns->href); in xmlAddChild()
3437 …if ((lastattr != NULL) && (lastattr != (xmlAttrPtr) cur) && (lastattr->type != XML_ATTRIBUTE_DECL)… in xmlAddChild()
3442 if (lastattr == (xmlAttrPtr) cur) in xmlAddChild()
3443 return(cur); in xmlAddChild()
3447 parent->properties = (xmlAttrPtr) cur; in xmlAddChild()
3454 lastattr->next = (xmlAttrPtr) cur; in xmlAddChild()
3455 ((xmlAttrPtr) cur)->prev = lastattr; in xmlAddChild()
3459 parent->children = cur; in xmlAddChild()
3460 parent->last = cur; in xmlAddChild()
3463 prev->next = cur; in xmlAddChild()
3464 cur->prev = prev; in xmlAddChild()
3465 parent->last = cur; in xmlAddChild()
3468 return(cur); in xmlAddChild()
3510 xmlNodePtr cur = NULL; in xmlChildElementCount() local
3520 cur = parent->children; in xmlChildElementCount()
3525 while (cur != NULL) { in xmlChildElementCount()
3526 if (cur->type == XML_ELEMENT_NODE) in xmlChildElementCount()
3528 cur = cur->next; in xmlChildElementCount()
3546 xmlNodePtr cur = NULL; in xmlFirstElementChild() local
3556 cur = parent->children; in xmlFirstElementChild()
3561 while (cur != NULL) { in xmlFirstElementChild()
3562 if (cur->type == XML_ELEMENT_NODE) in xmlFirstElementChild()
3563 return(cur); in xmlFirstElementChild()
3564 cur = cur->next; in xmlFirstElementChild()
3582 xmlNodePtr cur = NULL; in xmlLastElementChild() local
3592 cur = parent->last; in xmlLastElementChild()
3597 while (cur != NULL) { in xmlLastElementChild()
3598 if (cur->type == XML_ELEMENT_NODE) in xmlLastElementChild()
3599 return(cur); in xmlLastElementChild()
3600 cur = cur->prev; in xmlLastElementChild()
3694 xmlFreeNodeList(xmlNodePtr cur) { in xmlFreeNodeList() argument
3700 if (cur == NULL) return; in xmlFreeNodeList()
3701 if (cur->type == XML_NAMESPACE_DECL) { in xmlFreeNodeList()
3702 xmlFreeNsList((xmlNsPtr) cur); in xmlFreeNodeList()
3705 if ((cur->type == XML_DOCUMENT_NODE) || in xmlFreeNodeList()
3707 (cur->type == XML_DOCB_DOCUMENT_NODE) || in xmlFreeNodeList()
3709 (cur->type == XML_HTML_DOCUMENT_NODE)) { in xmlFreeNodeList()
3710 xmlFreeDoc((xmlDocPtr) cur); in xmlFreeNodeList()
3713 if (cur->doc != NULL) dict = cur->doc->dict; in xmlFreeNodeList()
3715 while ((cur->children != NULL) && in xmlFreeNodeList()
3716 (cur->type != XML_DOCUMENT_NODE) && in xmlFreeNodeList()
3718 (cur->type != XML_DOCB_DOCUMENT_NODE) && in xmlFreeNodeList()
3720 (cur->type != XML_HTML_DOCUMENT_NODE) && in xmlFreeNodeList()
3721 (cur->type != XML_DTD_NODE) && in xmlFreeNodeList()
3722 (cur->type != XML_ENTITY_REF_NODE)) { in xmlFreeNodeList()
3723 cur = cur->children; in xmlFreeNodeList()
3727 next = cur->next; in xmlFreeNodeList()
3728 parent = cur->parent; in xmlFreeNodeList()
3729 if ((cur->type == XML_DOCUMENT_NODE) || in xmlFreeNodeList()
3731 (cur->type == XML_DOCB_DOCUMENT_NODE) || in xmlFreeNodeList()
3733 (cur->type == XML_HTML_DOCUMENT_NODE)) { in xmlFreeNodeList()
3734 xmlFreeDoc((xmlDocPtr) cur); in xmlFreeNodeList()
3735 } else if (cur->type != XML_DTD_NODE) { in xmlFreeNodeList()
3738 xmlDeregisterNodeDefaultValue(cur); in xmlFreeNodeList()
3740 if (((cur->type == XML_ELEMENT_NODE) || in xmlFreeNodeList()
3741 (cur->type == XML_XINCLUDE_START) || in xmlFreeNodeList()
3742 (cur->type == XML_XINCLUDE_END)) && in xmlFreeNodeList()
3743 (cur->properties != NULL)) in xmlFreeNodeList()
3744 xmlFreePropList(cur->properties); in xmlFreeNodeList()
3745 if ((cur->type != XML_ELEMENT_NODE) && in xmlFreeNodeList()
3746 (cur->type != XML_XINCLUDE_START) && in xmlFreeNodeList()
3747 (cur->type != XML_XINCLUDE_END) && in xmlFreeNodeList()
3748 (cur->type != XML_ENTITY_REF_NODE) && in xmlFreeNodeList()
3749 (cur->content != (xmlChar *) &(cur->properties))) { in xmlFreeNodeList()
3750 DICT_FREE(cur->content) in xmlFreeNodeList()
3752 if (((cur->type == XML_ELEMENT_NODE) || in xmlFreeNodeList()
3753 (cur->type == XML_XINCLUDE_START) || in xmlFreeNodeList()
3754 (cur->type == XML_XINCLUDE_END)) && in xmlFreeNodeList()
3755 (cur->nsDef != NULL)) in xmlFreeNodeList()
3756 xmlFreeNsList(cur->nsDef); in xmlFreeNodeList()
3764 if ((cur->name != NULL) && in xmlFreeNodeList()
3765 (cur->type != XML_TEXT_NODE) && in xmlFreeNodeList()
3766 (cur->type != XML_COMMENT_NODE)) in xmlFreeNodeList()
3767 DICT_FREE(cur->name) in xmlFreeNodeList()
3768 xmlFree(cur); in xmlFreeNodeList()
3772 cur = next; in xmlFreeNodeList()
3777 cur = parent; in xmlFreeNodeList()
3778 cur->children = NULL; in xmlFreeNodeList()
3791 xmlFreeNode(xmlNodePtr cur) { in xmlFreeNode() argument
3794 if (cur == NULL) return; in xmlFreeNode()
3797 if (cur->type == XML_DTD_NODE) { in xmlFreeNode()
3798 xmlFreeDtd((xmlDtdPtr) cur); in xmlFreeNode()
3801 if (cur->type == XML_NAMESPACE_DECL) { in xmlFreeNode()
3802 xmlFreeNs((xmlNsPtr) cur); in xmlFreeNode()
3805 if (cur->type == XML_ATTRIBUTE_NODE) { in xmlFreeNode()
3806 xmlFreeProp((xmlAttrPtr) cur); in xmlFreeNode()
3811 xmlDeregisterNodeDefaultValue(cur); in xmlFreeNode()
3813 if (cur->doc != NULL) dict = cur->doc->dict; in xmlFreeNode()
3815 if (cur->type == XML_ENTITY_DECL) { in xmlFreeNode()
3816 xmlEntityPtr ent = (xmlEntityPtr) cur; in xmlFreeNode()
3820 if ((cur->children != NULL) && in xmlFreeNode()
3821 (cur->type != XML_ENTITY_REF_NODE)) in xmlFreeNode()
3822 xmlFreeNodeList(cur->children); in xmlFreeNode()
3823 if (((cur->type == XML_ELEMENT_NODE) || in xmlFreeNode()
3824 (cur->type == XML_XINCLUDE_START) || in xmlFreeNode()
3825 (cur->type == XML_XINCLUDE_END)) && in xmlFreeNode()
3826 (cur->properties != NULL)) in xmlFreeNode()
3827 xmlFreePropList(cur->properties); in xmlFreeNode()
3828 if ((cur->type != XML_ELEMENT_NODE) && in xmlFreeNode()
3829 (cur->content != NULL) && in xmlFreeNode()
3830 (cur->type != XML_ENTITY_REF_NODE) && in xmlFreeNode()
3831 (cur->type != XML_XINCLUDE_END) && in xmlFreeNode()
3832 (cur->type != XML_XINCLUDE_START) && in xmlFreeNode()
3833 (cur->content != (xmlChar *) &(cur->properties))) { in xmlFreeNode()
3834 DICT_FREE(cur->content) in xmlFreeNode()
3842 if ((cur->name != NULL) && in xmlFreeNode()
3843 (cur->type != XML_TEXT_NODE) && in xmlFreeNode()
3844 (cur->type != XML_COMMENT_NODE)) in xmlFreeNode()
3845 DICT_FREE(cur->name) in xmlFreeNode()
3847 if (((cur->type == XML_ELEMENT_NODE) || in xmlFreeNode()
3848 (cur->type == XML_XINCLUDE_START) || in xmlFreeNode()
3849 (cur->type == XML_XINCLUDE_END)) && in xmlFreeNode()
3850 (cur->nsDef != NULL)) in xmlFreeNode()
3851 xmlFreeNsList(cur->nsDef); in xmlFreeNode()
3852 xmlFree(cur); in xmlFreeNode()
3866 xmlUnlinkNode(xmlNodePtr cur) { in xmlUnlinkNode() argument
3867 if (cur == NULL) { in xmlUnlinkNode()
3874 if (cur->type == XML_NAMESPACE_DECL) in xmlUnlinkNode()
3876 if (cur->type == XML_DTD_NODE) { in xmlUnlinkNode()
3878 doc = cur->doc; in xmlUnlinkNode()
3880 if (doc->intSubset == (xmlDtdPtr) cur) in xmlUnlinkNode()
3882 if (doc->extSubset == (xmlDtdPtr) cur) in xmlUnlinkNode()
3886 if (cur->type == XML_ENTITY_DECL) { in xmlUnlinkNode()
3888 doc = cur->doc; in xmlUnlinkNode()
3891 if (xmlHashLookup(doc->intSubset->entities, cur->name) == cur) in xmlUnlinkNode()
3892 xmlHashRemoveEntry(doc->intSubset->entities, cur->name, in xmlUnlinkNode()
3894 if (xmlHashLookup(doc->intSubset->pentities, cur->name) == cur) in xmlUnlinkNode()
3895 xmlHashRemoveEntry(doc->intSubset->pentities, cur->name, in xmlUnlinkNode()
3899 if (xmlHashLookup(doc->extSubset->entities, cur->name) == cur) in xmlUnlinkNode()
3900 xmlHashRemoveEntry(doc->extSubset->entities, cur->name, in xmlUnlinkNode()
3902 if (xmlHashLookup(doc->extSubset->pentities, cur->name) == cur) in xmlUnlinkNode()
3903 xmlHashRemoveEntry(doc->extSubset->pentities, cur->name, in xmlUnlinkNode()
3908 if (cur->parent != NULL) { in xmlUnlinkNode()
3910 parent = cur->parent; in xmlUnlinkNode()
3911 if (cur->type == XML_ATTRIBUTE_NODE) { in xmlUnlinkNode()
3912 if (parent->properties == (xmlAttrPtr) cur) in xmlUnlinkNode()
3913 parent->properties = ((xmlAttrPtr) cur)->next; in xmlUnlinkNode()
3915 if (parent->children == cur) in xmlUnlinkNode()
3916 parent->children = cur->next; in xmlUnlinkNode()
3917 if (parent->last == cur) in xmlUnlinkNode()
3918 parent->last = cur->prev; in xmlUnlinkNode()
3920 cur->parent = NULL; in xmlUnlinkNode()
3922 if (cur->next != NULL) in xmlUnlinkNode()
3923 cur->next->prev = cur->prev; in xmlUnlinkNode()
3924 if (cur->prev != NULL) in xmlUnlinkNode()
3925 cur->prev->next = cur->next; in xmlUnlinkNode()
3926 cur->next = cur->prev = NULL; in xmlUnlinkNode()
3942 xmlReplaceNode(xmlNodePtr old, xmlNodePtr cur) { in xmlReplaceNode() argument
3943 if (old == cur) return(NULL); in xmlReplaceNode()
3952 if ((cur == NULL) || (cur->type == XML_NAMESPACE_DECL)) { in xmlReplaceNode()
3956 if (cur == old) { in xmlReplaceNode()
3959 if ((old->type==XML_ATTRIBUTE_NODE) && (cur->type!=XML_ATTRIBUTE_NODE)) { in xmlReplaceNode()
3966 if ((cur->type==XML_ATTRIBUTE_NODE) && (old->type!=XML_ATTRIBUTE_NODE)) { in xmlReplaceNode()
3973 xmlUnlinkNode(cur); in xmlReplaceNode()
3974 xmlSetTreeDoc(cur, old->doc); in xmlReplaceNode()
3975 cur->parent = old->parent; in xmlReplaceNode()
3976 cur->next = old->next; in xmlReplaceNode()
3977 if (cur->next != NULL) in xmlReplaceNode()
3978 cur->next->prev = cur; in xmlReplaceNode()
3979 cur->prev = old->prev; in xmlReplaceNode()
3980 if (cur->prev != NULL) in xmlReplaceNode()
3981 cur->prev->next = cur; in xmlReplaceNode()
3982 if (cur->parent != NULL) { in xmlReplaceNode()
3983 if (cur->type == XML_ATTRIBUTE_NODE) { in xmlReplaceNode()
3984 if (cur->parent->properties == (xmlAttrPtr)old) in xmlReplaceNode()
3985 cur->parent->properties = ((xmlAttrPtr) cur); in xmlReplaceNode()
3987 if (cur->parent->children == old) in xmlReplaceNode()
3988 cur->parent->children = cur; in xmlReplaceNode()
3989 if (cur->parent->last == old) in xmlReplaceNode()
3990 cur->parent->last = cur; in xmlReplaceNode()
4014 xmlCopyNamespace(xmlNsPtr cur) { in xmlCopyNamespace() argument
4017 if (cur == NULL) return(NULL); in xmlCopyNamespace()
4018 switch (cur->type) { in xmlCopyNamespace()
4020 ret = xmlNewNs(NULL, cur->href, cur->prefix); in xmlCopyNamespace()
4025 "xmlCopyNamespace: invalid type %d\n", cur->type); in xmlCopyNamespace()
4041 xmlCopyNamespaceList(xmlNsPtr cur) { in xmlCopyNamespaceList() argument
4045 while (cur != NULL) { in xmlCopyNamespaceList()
4046 q = xmlCopyNamespace(cur); in xmlCopyNamespaceList()
4053 cur = cur->next; in xmlCopyNamespaceList()
4062 xmlCopyPropInternal(xmlDocPtr doc, xmlNodePtr target, xmlAttrPtr cur) { in xmlCopyPropInternal() argument
4065 if (cur == NULL) return(NULL); in xmlCopyPropInternal()
4069 ret = xmlNewDocProp(target->doc, cur->name, NULL); in xmlCopyPropInternal()
4071 ret = xmlNewDocProp(doc, cur->name, NULL); in xmlCopyPropInternal()
4072 else if (cur->parent != NULL) in xmlCopyPropInternal()
4073 ret = xmlNewDocProp(cur->parent->doc, cur->name, NULL); in xmlCopyPropInternal()
4074 else if (cur->children != NULL) in xmlCopyPropInternal()
4075 ret = xmlNewDocProp(cur->children->doc, cur->name, NULL); in xmlCopyPropInternal()
4077 ret = xmlNewDocProp(NULL, cur->name, NULL); in xmlCopyPropInternal()
4081 if ((cur->ns != NULL) && (target != NULL)) { in xmlCopyPropInternal()
4084 ns = xmlSearchNs(target->doc, target, cur->ns->prefix); in xmlCopyPropInternal()
4091 ns = xmlSearchNs(cur->doc, cur->parent, cur->ns->prefix); in xmlCopyPropInternal()
4112 if (xmlStrEqual(ns->href, cur->ns->href)) { in xmlCopyPropInternal()
4120 ret->ns = xmlNewReconciledNs(target->doc, target, cur->ns); in xmlCopyPropInternal()
4127 if (cur->children != NULL) { in xmlCopyPropInternal()
4130 ret->children = xmlStaticCopyNodeList(cur->children, ret->doc, (xmlNodePtr) ret); in xmlCopyPropInternal()
4143 if ((target!= NULL) && (cur!= NULL) && in xmlCopyPropInternal()
4144 (target->doc != NULL) && (cur->doc != NULL) && in xmlCopyPropInternal()
4145 (cur->doc->ids != NULL) && (cur->parent != NULL)) { in xmlCopyPropInternal()
4146 if (xmlIsID(cur->doc, cur->parent, cur)) { in xmlCopyPropInternal()
4149 id = xmlNodeListGetString(cur->doc, cur->children, 1); in xmlCopyPropInternal()
4169 xmlCopyProp(xmlNodePtr target, xmlAttrPtr cur) { in xmlCopyProp() argument
4170 return xmlCopyPropInternal(NULL, target, cur); in xmlCopyProp()
4183 xmlCopyPropList(xmlNodePtr target, xmlAttrPtr cur) { in xmlCopyPropList() argument
4189 while (cur != NULL) { in xmlCopyPropList()
4190 q = xmlCopyProp(target, cur); in xmlCopyPropList()
4200 cur = cur->next; in xmlCopyPropList()
4501 xmlNodePtr cur, p = NULL, q; in xmlCopyDtd() local
4522 cur = dtd->children; in xmlCopyDtd()
4523 while (cur != NULL) { in xmlCopyDtd()
4526 if (cur->type == XML_ENTITY_DECL) { in xmlCopyDtd()
4527 xmlEntityPtr tmp = (xmlEntityPtr) cur; in xmlCopyDtd()
4542 } else if (cur->type == XML_ELEMENT_DECL) { in xmlCopyDtd()
4543 xmlElementPtr tmp = (xmlElementPtr) cur; in xmlCopyDtd()
4546 } else if (cur->type == XML_ATTRIBUTE_DECL) { in xmlCopyDtd()
4547 xmlAttributePtr tmp = (xmlAttributePtr) cur; in xmlCopyDtd()
4550 } else if (cur->type == XML_COMMENT_NODE) { in xmlCopyDtd()
4551 q = xmlCopyNode(cur, 0); in xmlCopyDtd()
4555 cur = cur->next; in xmlCopyDtd()
4569 cur = cur->next; in xmlCopyDtd()
4723 const xmlNode *cur, *tmp, *next; in xmlGetNodePath() local
4749 cur = node; in xmlGetNodePath()
4754 if ((cur->type == XML_DOCUMENT_NODE) || in xmlGetNodePath()
4755 (cur->type == XML_HTML_DOCUMENT_NODE)) { in xmlGetNodePath()
4760 } else if (cur->type == XML_ELEMENT_NODE) { in xmlGetNodePath()
4763 name = (const char *) cur->name; in xmlGetNodePath()
4764 if (cur->ns) { in xmlGetNodePath()
4765 if (cur->ns->prefix != NULL) { in xmlGetNodePath()
4767 (char *)cur->ns->prefix, (char *)cur->name); in xmlGetNodePath()
4779 next = cur->parent; in xmlGetNodePath()
4785 tmp = cur->prev; in xmlGetNodePath()
4789 (xmlStrEqual(cur->name, tmp->name) && in xmlGetNodePath()
4790 ((tmp->ns == cur->ns) || in xmlGetNodePath()
4791 ((tmp->ns != NULL) && (cur->ns != NULL) && in xmlGetNodePath()
4792 (xmlStrEqual(cur->ns->prefix, tmp->ns->prefix))))))) in xmlGetNodePath()
4797 tmp = cur->next; in xmlGetNodePath()
4801 (xmlStrEqual(cur->name, tmp->name) && in xmlGetNodePath()
4802 ((tmp->ns == cur->ns) || in xmlGetNodePath()
4803 ((tmp->ns != NULL) && (cur->ns != NULL) && in xmlGetNodePath()
4804 (xmlStrEqual(cur->ns->prefix, tmp->ns->prefix))))))) in xmlGetNodePath()
4812 } else if (cur->type == XML_COMMENT_NODE) { in xmlGetNodePath()
4815 next = cur->parent; in xmlGetNodePath()
4820 tmp = cur->prev; in xmlGetNodePath()
4827 tmp = cur->next; in xmlGetNodePath()
4837 } else if ((cur->type == XML_TEXT_NODE) || in xmlGetNodePath()
4838 (cur->type == XML_CDATA_SECTION_NODE)) { in xmlGetNodePath()
4841 next = cur->parent; in xmlGetNodePath()
4846 tmp = cur->prev; in xmlGetNodePath()
4858 tmp = cur->next; in xmlGetNodePath()
4870 } else if (cur->type == XML_PI_NODE) { in xmlGetNodePath()
4873 "processing-instruction('%s')", (char *)cur->name); in xmlGetNodePath()
4877 next = cur->parent; in xmlGetNodePath()
4882 tmp = cur->prev; in xmlGetNodePath()
4885 (xmlStrEqual(cur->name, tmp->name))) in xmlGetNodePath()
4890 tmp = cur->next; in xmlGetNodePath()
4893 (xmlStrEqual(cur->name, tmp->name))) in xmlGetNodePath()
4902 } else if (cur->type == XML_ATTRIBUTE_NODE) { in xmlGetNodePath()
4904 name = (const char *) (((xmlAttrPtr) cur)->name); in xmlGetNodePath()
4905 if (cur->ns) { in xmlGetNodePath()
4906 if (cur->ns->prefix != NULL) in xmlGetNodePath()
4908 (char *)cur->ns->prefix, (char *)cur->name); in xmlGetNodePath()
4911 (char *)cur->name); in xmlGetNodePath()
4915 next = ((xmlAttrPtr) cur)->parent; in xmlGetNodePath()
4952 cur = next; in xmlGetNodePath()
4953 } while (cur != NULL); in xmlGetNodePath()
5034 xmlNodeSetLang(xmlNodePtr cur, const xmlChar *lang) { in xmlNodeSetLang() argument
5037 if (cur == NULL) return; in xmlNodeSetLang()
5038 switch(cur->type) { in xmlNodeSetLang()
5065 ns = xmlSearchNsByHref(cur->doc, cur, XML_XML_NAMESPACE); in xmlNodeSetLang()
5068 xmlSetNsProp(cur, ns, BAD_CAST "lang", lang); in xmlNodeSetLang()
5083 xmlNodeGetLang(const xmlNode *cur) { in xmlNodeGetLang() argument
5086 if ((cur == NULL) || (cur->type == XML_NAMESPACE_DECL)) in xmlNodeGetLang()
5088 while (cur != NULL) { in xmlNodeGetLang()
5089 lang = xmlGetNsProp(cur, BAD_CAST "lang", XML_XML_NAMESPACE); in xmlNodeGetLang()
5092 cur = cur->parent; in xmlNodeGetLang()
5108 xmlNodeSetSpacePreserve(xmlNodePtr cur, int val) { in xmlNodeSetSpacePreserve() argument
5111 if (cur == NULL) return; in xmlNodeSetSpacePreserve()
5112 switch(cur->type) { in xmlNodeSetSpacePreserve()
5139 ns = xmlSearchNsByHref(cur->doc, cur, XML_XML_NAMESPACE); in xmlNodeSetSpacePreserve()
5144 xmlSetNsProp(cur, ns, BAD_CAST "space", BAD_CAST "default"); in xmlNodeSetSpacePreserve()
5147 xmlSetNsProp(cur, ns, BAD_CAST "space", BAD_CAST "preserve"); in xmlNodeSetSpacePreserve()
5164 xmlNodeGetSpacePreserve(const xmlNode *cur) { in xmlNodeGetSpacePreserve() argument
5167 if ((cur == NULL) || (cur->type != XML_ELEMENT_NODE)) in xmlNodeGetSpacePreserve()
5169 while (cur != NULL) { in xmlNodeGetSpacePreserve()
5170 space = xmlGetNsProp(cur, BAD_CAST "space", XML_XML_NAMESPACE); in xmlNodeGetSpacePreserve()
5182 cur = cur->parent; in xmlNodeGetSpacePreserve()
5196 xmlNodeSetName(xmlNodePtr cur, const xmlChar *name) { in xmlNodeSetName() argument
5201 if (cur == NULL) return; in xmlNodeSetName()
5203 switch(cur->type) { in xmlNodeSetName()
5230 doc = cur->doc; in xmlNodeSetName()
5236 if ((cur->name != NULL) && (!xmlDictOwns(dict, cur->name))) in xmlNodeSetName()
5237 freeme = cur->name; in xmlNodeSetName()
5238 cur->name = xmlDictLookup(dict, name, -1); in xmlNodeSetName()
5240 if (cur->name != NULL) in xmlNodeSetName()
5241 freeme = cur->name; in xmlNodeSetName()
5242 cur->name = xmlStrdup(name); in xmlNodeSetName()
5260 xmlNodeSetBase(xmlNodePtr cur, const xmlChar* uri) { in xmlNodeSetBase() argument
5264 if (cur == NULL) return; in xmlNodeSetBase()
5265 switch(cur->type) { in xmlNodeSetBase()
5291 xmlDocPtr doc = (xmlDocPtr) cur; in xmlNodeSetBase()
5303 ns = xmlSearchNsByHref(cur->doc, cur, XML_XML_NAMESPACE); in xmlNodeSetBase()
5308 xmlSetNsProp(cur, ns, BAD_CAST "base", fixed); in xmlNodeSetBase()
5311 xmlSetNsProp(cur, ns, BAD_CAST "base", uri); in xmlNodeSetBase()
5334 xmlNodeGetBase(const xmlDoc *doc, const xmlNode *cur) { in xmlNodeGetBase() argument
5338 if ((cur == NULL) && (doc == NULL)) in xmlNodeGetBase()
5340 if ((cur != NULL) && (cur->type == XML_NAMESPACE_DECL)) in xmlNodeGetBase()
5342 if (doc == NULL) doc = cur->doc; in xmlNodeGetBase()
5344 cur = doc->children; in xmlNodeGetBase()
5345 while ((cur != NULL) && (cur->name != NULL)) { in xmlNodeGetBase()
5346 if (cur->type != XML_ELEMENT_NODE) { in xmlNodeGetBase()
5347 cur = cur->next; in xmlNodeGetBase()
5350 if (!xmlStrcasecmp(cur->name, BAD_CAST "html")) { in xmlNodeGetBase()
5351 cur = cur->children; in xmlNodeGetBase()
5354 if (!xmlStrcasecmp(cur->name, BAD_CAST "head")) { in xmlNodeGetBase()
5355 cur = cur->children; in xmlNodeGetBase()
5358 if (!xmlStrcasecmp(cur->name, BAD_CAST "base")) { in xmlNodeGetBase()
5359 return(xmlGetProp(cur, BAD_CAST "href")); in xmlNodeGetBase()
5361 cur = cur->next; in xmlNodeGetBase()
5365 while (cur != NULL) { in xmlNodeGetBase()
5366 if (cur->type == XML_ENTITY_DECL) { in xmlNodeGetBase()
5367 xmlEntityPtr ent = (xmlEntityPtr) cur; in xmlNodeGetBase()
5370 if (cur->type == XML_ELEMENT_NODE) { in xmlNodeGetBase()
5371 base = xmlGetNsProp(cur, BAD_CAST "base", XML_XML_NAMESPACE); in xmlNodeGetBase()
5393 cur = cur->parent; in xmlNodeGetBase()
5419 xmlNodeBufGetContent(xmlBufferPtr buffer, const xmlNode *cur) in xmlNodeBufGetContent() argument
5424 if ((cur == NULL) || (buffer == NULL)) return(-1); in xmlNodeBufGetContent()
5426 ret = xmlBufGetNodeContent(buf, cur); in xmlNodeBufGetContent()
5447 xmlBufGetNodeContent(xmlBufPtr buf, const xmlNode *cur) in xmlBufGetNodeContent() argument
5449 if ((cur == NULL) || (buf == NULL)) return(-1); in xmlBufGetNodeContent()
5450 switch (cur->type) { in xmlBufGetNodeContent()
5453 xmlBufCat(buf, cur->content); in xmlBufGetNodeContent()
5457 const xmlNode *tmp = cur; in xmlBufGetNodeContent()
5481 if (tmp == cur) in xmlBufGetNodeContent()
5493 if (tmp == cur) { in xmlBufGetNodeContent()
5506 xmlAttrPtr attr = (xmlAttrPtr) cur; in xmlBufGetNodeContent()
5520 xmlBufCat(buf, cur->content); in xmlBufGetNodeContent()
5527 ent = xmlGetDocEntity(cur->doc, cur->name); in xmlBufGetNodeContent()
5555 cur = cur->children; in xmlBufGetNodeContent()
5556 while (cur!= NULL) { in xmlBufGetNodeContent()
5557 if ((cur->type == XML_ELEMENT_NODE) || in xmlBufGetNodeContent()
5558 (cur->type == XML_TEXT_NODE) || in xmlBufGetNodeContent()
5559 (cur->type == XML_CDATA_SECTION_NODE)) { in xmlBufGetNodeContent()
5560 xmlBufGetNodeContent(buf, cur); in xmlBufGetNodeContent()
5562 cur = cur->next; in xmlBufGetNodeContent()
5566 xmlBufCat(buf, ((xmlNsPtr) cur)->href); in xmlBufGetNodeContent()
5588 xmlNodeGetContent(const xmlNode *cur) in xmlNodeGetContent() argument
5590 if (cur == NULL) in xmlNodeGetContent()
5592 switch (cur->type) { in xmlNodeGetContent()
5601 xmlBufGetNodeContent(buf, cur); in xmlNodeGetContent()
5607 return(xmlGetPropNodeValueInternal((xmlAttrPtr) cur)); in xmlNodeGetContent()
5610 if (cur->content != NULL) in xmlNodeGetContent()
5611 return (xmlStrdup(cur->content)); in xmlNodeGetContent()
5619 ent = xmlGetDocEntity(cur->doc, cur->name); in xmlNodeGetContent()
5627 xmlBufGetNodeContent(buf, cur); in xmlNodeGetContent()
5652 xmlBufGetNodeContent(buf, (xmlNodePtr) cur); in xmlNodeGetContent()
5661 tmp = xmlStrdup(((xmlNsPtr) cur)->href); in xmlNodeGetContent()
5675 if (cur->content != NULL) in xmlNodeGetContent()
5676 return (xmlStrdup(cur->content)); in xmlNodeGetContent()
5693 xmlNodeSetContent(xmlNodePtr cur, const xmlChar *content) { in xmlNodeSetContent() argument
5694 if (cur == NULL) { in xmlNodeSetContent()
5701 switch (cur->type) { in xmlNodeSetContent()
5705 if (cur->children != NULL) xmlFreeNodeList(cur->children); in xmlNodeSetContent()
5706 cur->children = xmlStringGetNodeList(cur->doc, content); in xmlNodeSetContent()
5707 UPDATE_LAST_CHILD_AND_PARENT(cur) in xmlNodeSetContent()
5715 if ((cur->content != NULL) && in xmlNodeSetContent()
5716 (cur->content != (xmlChar *) &(cur->properties))) { in xmlNodeSetContent()
5717 if (!((cur->doc != NULL) && (cur->doc->dict != NULL) && in xmlNodeSetContent()
5718 (xmlDictOwns(cur->doc->dict, cur->content)))) in xmlNodeSetContent()
5719 xmlFree(cur->content); in xmlNodeSetContent()
5721 if (cur->children != NULL) xmlFreeNodeList(cur->children); in xmlNodeSetContent()
5722 cur->last = cur->children = NULL; in xmlNodeSetContent()
5724 cur->content = xmlStrdup(content); in xmlNodeSetContent()
5726 cur->content = NULL; in xmlNodeSetContent()
5727 cur->properties = NULL; in xmlNodeSetContent()
5728 cur->nsDef = NULL; in xmlNodeSetContent()
5770 xmlNodeSetContentLen(xmlNodePtr cur, const xmlChar *content, int len) { in xmlNodeSetContentLen() argument
5771 if (cur == NULL) { in xmlNodeSetContentLen()
5778 switch (cur->type) { in xmlNodeSetContentLen()
5782 if (cur->children != NULL) xmlFreeNodeList(cur->children); in xmlNodeSetContentLen()
5783 cur->children = xmlStringLenGetNodeList(cur->doc, content, len); in xmlNodeSetContentLen()
5784 UPDATE_LAST_CHILD_AND_PARENT(cur) in xmlNodeSetContentLen()
5793 if ((cur->content != NULL) && in xmlNodeSetContentLen()
5794 (cur->content != (xmlChar *) &(cur->properties))) { in xmlNodeSetContentLen()
5795 if (!((cur->doc != NULL) && (cur->doc->dict != NULL) && in xmlNodeSetContentLen()
5796 (xmlDictOwns(cur->doc->dict, cur->content)))) in xmlNodeSetContentLen()
5797 xmlFree(cur->content); in xmlNodeSetContentLen()
5799 if (cur->children != NULL) xmlFreeNodeList(cur->children); in xmlNodeSetContentLen()
5800 cur->children = cur->last = NULL; in xmlNodeSetContentLen()
5802 cur->content = xmlStrndup(content, len); in xmlNodeSetContentLen()
5804 cur->content = NULL; in xmlNodeSetContentLen()
5805 cur->properties = NULL; in xmlNodeSetContentLen()
5806 cur->nsDef = NULL; in xmlNodeSetContentLen()
5844 xmlNodeAddContentLen(xmlNodePtr cur, const xmlChar *content, int len) { in xmlNodeAddContentLen() argument
5845 if (cur == NULL) { in xmlNodeAddContentLen()
5853 switch (cur->type) { in xmlNodeAddContentLen()
5858 last = cur->last; in xmlNodeAddContentLen()
5861 tmp = xmlAddChild(cur, newNode); in xmlNodeAddContentLen()
5880 if ((cur->content == (xmlChar *) &(cur->properties)) || in xmlNodeAddContentLen()
5881 ((cur->doc != NULL) && (cur->doc->dict != NULL) && in xmlNodeAddContentLen()
5882 xmlDictOwns(cur->doc->dict, cur->content))) { in xmlNodeAddContentLen()
5883 cur->content = xmlStrncatNew(cur->content, content, len); in xmlNodeAddContentLen()
5884 cur->properties = NULL; in xmlNodeAddContentLen()
5885 cur->nsDef = NULL; in xmlNodeAddContentLen()
5888 cur->content = xmlStrncat(cur->content, content, len); in xmlNodeAddContentLen()
5919 xmlNodeAddContent(xmlNodePtr cur, const xmlChar *content) { in xmlNodeAddContent() argument
5922 if (cur == NULL) { in xmlNodeAddContent()
5931 xmlNodeAddContentLen(cur, content, len); in xmlNodeAddContent()
5970 xmlNsPtr cur; in xmlGetNsList() local
5981 cur = node->nsDef; in xmlGetNsList()
5982 while (cur != NULL) { in xmlGetNsList()
5994 if ((cur->prefix == ret[i]->prefix) || in xmlGetNsList()
5995 (xmlStrEqual(cur->prefix, ret[i]->prefix))) in xmlGetNsList()
6010 ret[nbns++] = cur; in xmlGetNsList()
6014 cur = cur->next; in xmlGetNsList()
6074 xmlNsPtr cur; in xmlSearchNs() local
6086 cur = (xmlNsPtr) xmlMalloc(sizeof(xmlNs)); in xmlSearchNs()
6087 if (cur == NULL) { in xmlSearchNs()
6091 memset(cur, 0, sizeof(xmlNs)); in xmlSearchNs()
6092 cur->type = XML_LOCAL_NAMESPACE; in xmlSearchNs()
6093 cur->href = xmlStrdup(XML_XML_NAMESPACE); in xmlSearchNs()
6094 cur->prefix = xmlStrdup((const xmlChar *)"xml"); in xmlSearchNs()
6095 cur->next = node->nsDef; in xmlSearchNs()
6096 node->nsDef = cur; in xmlSearchNs()
6097 return(cur); in xmlSearchNs()
6118 cur = node->nsDef; in xmlSearchNs()
6119 while (cur != NULL) { in xmlSearchNs()
6120 if ((cur->prefix == NULL) && (nameSpace == NULL) && in xmlSearchNs()
6121 (cur->href != NULL)) in xmlSearchNs()
6122 return(cur); in xmlSearchNs()
6123 if ((cur->prefix != NULL) && (nameSpace != NULL) && in xmlSearchNs()
6124 (cur->href != NULL) && in xmlSearchNs()
6125 (xmlStrEqual(cur->prefix, nameSpace))) in xmlSearchNs()
6126 return(cur); in xmlSearchNs()
6127 cur = cur->next; in xmlSearchNs()
6130 cur = node->ns; in xmlSearchNs()
6131 if (cur != NULL) { in xmlSearchNs()
6132 if ((cur->prefix == NULL) && (nameSpace == NULL) && in xmlSearchNs()
6133 (cur->href != NULL)) in xmlSearchNs()
6134 return(cur); in xmlSearchNs()
6135 if ((cur->prefix != NULL) && (nameSpace != NULL) && in xmlSearchNs()
6136 (cur->href != NULL) && in xmlSearchNs()
6137 (xmlStrEqual(cur->prefix, nameSpace))) in xmlSearchNs()
6138 return(cur); in xmlSearchNs()
6203 xmlNsPtr cur; in xmlSearchNsByHref() local
6219 cur = (xmlNsPtr) xmlMalloc(sizeof(xmlNs)); in xmlSearchNsByHref()
6220 if (cur == NULL) { in xmlSearchNsByHref()
6224 memset(cur, 0, sizeof(xmlNs)); in xmlSearchNsByHref()
6225 cur->type = XML_LOCAL_NAMESPACE; in xmlSearchNsByHref()
6226 cur->href = xmlStrdup(XML_XML_NAMESPACE); in xmlSearchNsByHref()
6227 cur->prefix = xmlStrdup((const xmlChar *) "xml"); in xmlSearchNsByHref()
6228 cur->next = node->nsDef; in xmlSearchNsByHref()
6229 node->nsDef = cur; in xmlSearchNsByHref()
6230 return (cur); in xmlSearchNsByHref()
6252 cur = node->nsDef; in xmlSearchNsByHref()
6253 while (cur != NULL) { in xmlSearchNsByHref()
6254 if ((cur->href != NULL) && (href != NULL) && in xmlSearchNsByHref()
6255 (xmlStrEqual(cur->href, href))) { in xmlSearchNsByHref()
6256 if (((!is_attr) || (cur->prefix != NULL)) && in xmlSearchNsByHref()
6257 (xmlNsInScope(doc, orig, node, cur->prefix) == 1)) in xmlSearchNsByHref()
6258 return (cur); in xmlSearchNsByHref()
6260 cur = cur->next; in xmlSearchNsByHref()
6263 cur = node->ns; in xmlSearchNsByHref()
6264 if (cur != NULL) { in xmlSearchNsByHref()
6265 if ((cur->href != NULL) && (href != NULL) && in xmlSearchNsByHref()
6266 (xmlStrEqual(cur->href, href))) { in xmlSearchNsByHref()
6267 if (((!is_attr) || (cur->prefix != NULL)) && in xmlSearchNsByHref()
6268 (xmlNsInScope(doc, orig, node, cur->prefix) == 1)) in xmlSearchNsByHref()
6269 return (cur); in xmlSearchNsByHref()
6625 xmlNsPtr *nsList, *cur; in xmlGetPropNodeInternal() local
6637 cur = nsList; in xmlGetPropNodeInternal()
6638 while (*cur != NULL) { in xmlGetPropNodeInternal()
6639 if (xmlStrEqual((*cur)->href, nsName)) { in xmlGetPropNodeInternal()
6641 name, (*cur)->prefix); in xmlGetPropNodeInternal()
6646 name, (*cur)->prefix); in xmlGetPropNodeInternal()
6651 cur++; in xmlGetPropNodeInternal()
7018 const xmlChar *cur; in xmlIsBlankNode() local
7025 cur = node->content; in xmlIsBlankNode()
7026 while (*cur != 0) { in xmlIsBlankNode()
7027 if (!IS_BLANK_CH(*cur)) return(0); in xmlIsBlankNode()
7028 cur++; in xmlIsBlankNode()
7760 const xmlChar *cur, *base; in xmlBufferWriteQuotedString() local
7771 base = cur = string; in xmlBufferWriteQuotedString()
7772 while(*cur != 0){ in xmlBufferWriteQuotedString()
7773 if(*cur == '"'){ in xmlBufferWriteQuotedString()
7774 if (base != cur) in xmlBufferWriteQuotedString()
7775 xmlBufferAdd(buf, base, cur - base); in xmlBufferWriteQuotedString()
7777 cur++; in xmlBufferWriteQuotedString()
7778 base = cur; in xmlBufferWriteQuotedString()
7781 cur++; in xmlBufferWriteQuotedString()
7784 if (base != cur) in xmlBufferWriteQuotedString()
7785 xmlBufferAdd(buf, base, cur - base); in xmlBufferWriteQuotedString()
7907 xmlNsMapItemPtr cur, tmp; in xmlDOMWrapNsMapFree() local
7911 cur = nsmap->pool; in xmlDOMWrapNsMapFree()
7912 while (cur != NULL) { in xmlDOMWrapNsMapFree()
7913 tmp = cur; in xmlDOMWrapNsMapFree()
7914 cur = cur->next; in xmlDOMWrapNsMapFree()
7917 cur = nsmap->first; in xmlDOMWrapNsMapFree()
7918 while (cur != NULL) { in xmlDOMWrapNsMapFree()
7919 tmp = cur; in xmlDOMWrapNsMapFree()
7920 cur = cur->next; in xmlDOMWrapNsMapFree()
8138 xmlNodePtr cur; in xmlDOMWrapNSNormGatherInScopeNs() local
8150 cur = node; in xmlDOMWrapNSNormGatherInScopeNs()
8151 while ((cur != NULL) && (cur != (xmlNodePtr) cur->doc)) { in xmlDOMWrapNSNormGatherInScopeNs()
8152 if (cur->type == XML_ELEMENT_NODE) { in xmlDOMWrapNSNormGatherInScopeNs()
8153 if (cur->nsDef != NULL) { in xmlDOMWrapNSNormGatherInScopeNs()
8154 ns = cur->nsDef; in xmlDOMWrapNSNormGatherInScopeNs()
8182 cur = cur->parent; in xmlDOMWrapNSNormGatherInScopeNs()
8212 xmlDictOwns(sourceDoc->dict, cur->content)) { \
8214 cur->content = (xmlChar *) \
8215 xmlDictLookup(destDoc->dict, cur->content, -1); \
8217 cur->content = xmlStrdup(BAD_CAST cur->content); \
8409 xmlNodePtr cur, prev = NULL, out = NULL; in xmlSearchNsByNamespaceStrict() local
8424 cur = node; in xmlSearchNsByNamespaceStrict()
8426 if (cur->type == XML_ELEMENT_NODE) { in xmlSearchNsByNamespaceStrict()
8427 if (cur->nsDef != NULL) { in xmlSearchNsByNamespaceStrict()
8428 for (ns = cur->nsDef; ns != NULL; ns = ns->next) { in xmlSearchNsByNamespaceStrict()
8483 prev = cur; in xmlSearchNsByNamespaceStrict()
8485 } else if ((cur->type == XML_ENTITY_NODE) || in xmlSearchNsByNamespaceStrict()
8486 (cur->type == XML_ENTITY_DECL)) in xmlSearchNsByNamespaceStrict()
8488 cur = cur->parent; in xmlSearchNsByNamespaceStrict()
8489 } while ((cur != NULL) && (cur->doc != (xmlDocPtr) cur)); in xmlSearchNsByNamespaceStrict()
8511 xmlNodePtr cur; in xmlSearchNsByPrefixStrict() local
8527 cur = node; in xmlSearchNsByPrefixStrict()
8529 if (cur->type == XML_ELEMENT_NODE) { in xmlSearchNsByPrefixStrict()
8530 if (cur->nsDef != NULL) { in xmlSearchNsByPrefixStrict()
8531 ns = cur->nsDef; in xmlSearchNsByPrefixStrict()
8548 } else if ((cur->type == XML_ENTITY_NODE) || in xmlSearchNsByPrefixStrict()
8549 (cur->type == XML_ENTITY_DECL)) in xmlSearchNsByPrefixStrict()
8551 cur = cur->parent; in xmlSearchNsByPrefixStrict()
8552 } while ((cur != NULL) && (cur->doc != (xmlDocPtr) cur)); in xmlSearchNsByPrefixStrict()
8800 xmlNodePtr cur, curElem = NULL; in xmlDOMWrapReconcileNamespaces() local
8815 cur = elem; in xmlDOMWrapReconcileNamespaces()
8817 switch (cur->type) { in xmlDOMWrapReconcileNamespaces()
8820 curElem = cur; in xmlDOMWrapReconcileNamespaces()
8825 if (cur->nsDef != NULL) { in xmlDOMWrapReconcileNamespaces()
8827 ns = cur->nsDef; in xmlDOMWrapReconcileNamespaces()
8867 cur->nsDef = ns->next; in xmlDOMWrapReconcileNamespaces()
8877 if ((cur->ns != NULL) && adoptns && (cur->ns == ns)) in xmlDOMWrapReconcileNamespaces()
8910 if (cur->ns == NULL) in xmlDOMWrapReconcileNamespaces()
8927 if (cur->ns == listRedund[j]) { in xmlDOMWrapReconcileNamespaces()
8928 cur->ns = listRedund[++j]; in xmlDOMWrapReconcileNamespaces()
8942 (cur->ns == mi->oldNs)) { in xmlDOMWrapReconcileNamespaces()
8944 cur->ns = mi->newNs; in xmlDOMWrapReconcileNamespaces()
8953 cur->ns, &ns, in xmlDOMWrapReconcileNamespaces()
8956 (cur->type == XML_ATTRIBUTE_NODE) ? 1 : 0) == -1) in xmlDOMWrapReconcileNamespaces()
8958 cur->ns = ns; in xmlDOMWrapReconcileNamespaces()
8961 if ((cur->type == XML_ELEMENT_NODE) && in xmlDOMWrapReconcileNamespaces()
8962 (cur->properties != NULL)) { in xmlDOMWrapReconcileNamespaces()
8966 cur = (xmlNodePtr) cur->properties; in xmlDOMWrapReconcileNamespaces()
8974 if ((cur->type == XML_ELEMENT_NODE) && in xmlDOMWrapReconcileNamespaces()
8975 (cur->children != NULL)) { in xmlDOMWrapReconcileNamespaces()
8979 cur = cur->children; in xmlDOMWrapReconcileNamespaces()
8983 if (cur == elem) in xmlDOMWrapReconcileNamespaces()
8985 if (cur->type == XML_ELEMENT_NODE) { in xmlDOMWrapReconcileNamespaces()
9005 if (cur->next != NULL) in xmlDOMWrapReconcileNamespaces()
9006 cur = cur->next; in xmlDOMWrapReconcileNamespaces()
9008 if (cur->type == XML_ATTRIBUTE_NODE) { in xmlDOMWrapReconcileNamespaces()
9009 cur = cur->parent; in xmlDOMWrapReconcileNamespaces()
9012 cur = cur->parent; in xmlDOMWrapReconcileNamespaces()
9015 } while (cur != NULL); in xmlDOMWrapReconcileNamespaces()
9064 xmlNodePtr cur, curElem = NULL; in xmlDOMWrapAdoptBranch() local
9101 cur = node; in xmlDOMWrapAdoptBranch()
9102 if ((cur != NULL) && (cur->type == XML_NAMESPACE_DECL)) in xmlDOMWrapAdoptBranch()
9105 while (cur != NULL) { in xmlDOMWrapAdoptBranch()
9109 if (cur->doc != sourceDoc) { in xmlDOMWrapAdoptBranch()
9116 if (cur->next == NULL) in xmlDOMWrapAdoptBranch()
9119 cur = cur->next; in xmlDOMWrapAdoptBranch()
9120 if ((cur->type == XML_XINCLUDE_END) || in xmlDOMWrapAdoptBranch()
9121 (cur->doc == node->doc)) in xmlDOMWrapAdoptBranch()
9123 } while (cur->next != NULL); in xmlDOMWrapAdoptBranch()
9125 if (cur->doc != node->doc) in xmlDOMWrapAdoptBranch()
9128 cur->doc = destDoc; in xmlDOMWrapAdoptBranch()
9129 switch (cur->type) { in xmlDOMWrapAdoptBranch()
9137 curElem = cur; in xmlDOMWrapAdoptBranch()
9147 if ((cur->nsDef) && in xmlDOMWrapAdoptBranch()
9159 for (ns = cur->nsDef; ns != NULL; ns = ns->next) { in xmlDOMWrapAdoptBranch()
9191 if (cur->ns == NULL) in xmlDOMWrapAdoptBranch()
9209 (cur->ns == mi->oldNs)) { in xmlDOMWrapAdoptBranch()
9211 cur->ns = mi->newNs; in xmlDOMWrapAdoptBranch()
9223 ns = ctxt->getNsForNodeFunc(ctxt, cur, in xmlDOMWrapAdoptBranch()
9224 cur->ns->href, cur->ns->prefix); in xmlDOMWrapAdoptBranch()
9230 cur->ns, ns, XML_TREE_NSMAP_CUSTOM) == NULL) in xmlDOMWrapAdoptBranch()
9232 cur->ns = ns; in xmlDOMWrapAdoptBranch()
9240 cur->ns, &ns, in xmlDOMWrapAdoptBranch()
9244 (cur->type == XML_ATTRIBUTE_NODE) ? 1 : 0) == -1) in xmlDOMWrapAdoptBranch()
9246 cur->ns = ns; in xmlDOMWrapAdoptBranch()
9253 XML_TREE_ADOPT_STR(cur->name) in xmlDOMWrapAdoptBranch()
9254 if (cur->type == XML_ELEMENT_NODE) { in xmlDOMWrapAdoptBranch()
9255 cur->psvi = NULL; in xmlDOMWrapAdoptBranch()
9256 cur->line = 0; in xmlDOMWrapAdoptBranch()
9257 cur->extra = 0; in xmlDOMWrapAdoptBranch()
9261 if (cur->properties != NULL) { in xmlDOMWrapAdoptBranch()
9265 cur = (xmlNodePtr) cur->properties; in xmlDOMWrapAdoptBranch()
9273 (((xmlAttrPtr) cur)->atype == XML_ATTRIBUTE_ID)) in xmlDOMWrapAdoptBranch()
9275 xmlRemoveID(sourceDoc, (xmlAttrPtr) cur); in xmlDOMWrapAdoptBranch()
9277 ((xmlAttrPtr) cur)->atype = 0; in xmlDOMWrapAdoptBranch()
9278 ((xmlAttrPtr) cur)->psvi = NULL; in xmlDOMWrapAdoptBranch()
9287 XML_TREE_ADOPT_STR_2(cur->content) in xmlDOMWrapAdoptBranch()
9293 cur->content = NULL; in xmlDOMWrapAdoptBranch()
9294 cur->children = NULL; in xmlDOMWrapAdoptBranch()
9295 cur->last = NULL; in xmlDOMWrapAdoptBranch()
9301 ent = xmlGetDocEntity(destDoc, cur->name); in xmlDOMWrapAdoptBranch()
9303 cur->content = ent->content; in xmlDOMWrapAdoptBranch()
9304 cur->children = (xmlNodePtr) ent; in xmlDOMWrapAdoptBranch()
9305 cur->last = (xmlNodePtr) ent; in xmlDOMWrapAdoptBranch()
9310 XML_TREE_ADOPT_STR(cur->name) in xmlDOMWrapAdoptBranch()
9311 XML_TREE_ADOPT_STR_2(cur->content) in xmlDOMWrapAdoptBranch()
9321 if (cur->children != NULL) { in xmlDOMWrapAdoptBranch()
9322 cur = cur->children; in xmlDOMWrapAdoptBranch()
9327 if (cur == node) in xmlDOMWrapAdoptBranch()
9329 if ((cur->type == XML_ELEMENT_NODE) || in xmlDOMWrapAdoptBranch()
9330 (cur->type == XML_XINCLUDE_START) || in xmlDOMWrapAdoptBranch()
9331 (cur->type == XML_XINCLUDE_END)) in xmlDOMWrapAdoptBranch()
9355 if (cur->next != NULL) in xmlDOMWrapAdoptBranch()
9356 cur = cur->next; in xmlDOMWrapAdoptBranch()
9357 else if ((cur->type == XML_ATTRIBUTE_NODE) && in xmlDOMWrapAdoptBranch()
9358 (cur->parent->children != NULL)) in xmlDOMWrapAdoptBranch()
9360 cur = cur->parent->children; in xmlDOMWrapAdoptBranch()
9362 cur = cur->parent; in xmlDOMWrapAdoptBranch()
9434 xmlNodePtr cur, curElem = NULL; in xmlDOMWrapCloneNode() local
9483 cur = node; in xmlDOMWrapCloneNode()
9484 if ((cur != NULL) && (cur->type == XML_NAMESPACE_DECL)) in xmlDOMWrapCloneNode()
9487 while (cur != NULL) { in xmlDOMWrapCloneNode()
9488 if (cur->doc != sourceDoc) { in xmlDOMWrapCloneNode()
9499 switch (cur->type) { in xmlDOMWrapCloneNode()
9569 clone->type = cur->type; in xmlDOMWrapCloneNode()
9575 if (cur->name == xmlStringText) in xmlDOMWrapCloneNode()
9577 else if (cur->name == xmlStringTextNoenc) in xmlDOMWrapCloneNode()
9584 else if (cur->name == xmlStringComment) in xmlDOMWrapCloneNode()
9586 else if (cur->name != NULL) { in xmlDOMWrapCloneNode()
9587 DICT_CONST_COPY(cur->name, clone->name); in xmlDOMWrapCloneNode()
9590 switch (cur->type) { in xmlDOMWrapCloneNode()
9598 curElem = cur; in xmlDOMWrapCloneNode()
9603 if (cur->nsDef != NULL) { in xmlDOMWrapCloneNode()
9619 for (ns = cur->nsDef; ns != NULL; ns = ns->next) { in xmlDOMWrapCloneNode()
9686 DICT_COPY(cur->content, clone->content); in xmlDOMWrapCloneNode()
9698 ent = xmlGetDocEntity(destDoc, cur->name); in xmlDOMWrapCloneNode()
9710 clone->content = cur->content; in xmlDOMWrapCloneNode()
9711 clone->children = cur->children; in xmlDOMWrapCloneNode()
9712 clone->last = cur->last; in xmlDOMWrapCloneNode()
9716 DICT_COPY(cur->content, clone->content); in xmlDOMWrapCloneNode()
9719 DICT_COPY(cur->content, clone->content); in xmlDOMWrapCloneNode()
9725 if (cur->ns == NULL) in xmlDOMWrapCloneNode()
9750 (cur->ns == mi->oldNs)) { in xmlDOMWrapCloneNode()
9766 ns = ctxt->getNsForNodeFunc(ctxt, cur, in xmlDOMWrapCloneNode()
9767 cur->ns->href, cur->ns->prefix); in xmlDOMWrapCloneNode()
9772 cur->ns, ns, XML_TREE_NSMAP_CUSTOM) == NULL) in xmlDOMWrapCloneNode()
9782 cur->ns, &ns, in xmlDOMWrapCloneNode()
9787 (cur->type == XML_ATTRIBUTE_NODE) ? 1 : 0) == -1) in xmlDOMWrapCloneNode()
9806 idVal = xmlNodeListGetString(cur->doc, cur->children, 1); in xmlDOMWrapCloneNode()
9808 if (xmlAddID(NULL, destDoc, idVal, (xmlAttrPtr) cur) == NULL) { in xmlDOMWrapCloneNode()
9824 if ((cur->type == XML_ELEMENT_NODE) && (cur->properties != NULL)) { in xmlDOMWrapCloneNode()
9827 cur = (xmlNodePtr) cur->properties; in xmlDOMWrapCloneNode()
9834 if (cur->children != NULL) { in xmlDOMWrapCloneNode()
9835 if (deep || (cur->type == XML_ATTRIBUTE_NODE)) { in xmlDOMWrapCloneNode()
9838 cur = cur->children; in xmlDOMWrapCloneNode()
9848 if (cur == node) in xmlDOMWrapCloneNode()
9850 if ((cur->type == XML_ELEMENT_NODE) || in xmlDOMWrapCloneNode()
9851 (cur->type == XML_XINCLUDE_START) || in xmlDOMWrapCloneNode()
9852 (cur->type == XML_XINCLUDE_END)) { in xmlDOMWrapCloneNode()
9875 if (cur->next != NULL) { in xmlDOMWrapCloneNode()
9877 cur = cur->next; in xmlDOMWrapCloneNode()
9878 } else if (cur->type != XML_ATTRIBUTE_NODE) { in xmlDOMWrapCloneNode()
9890 cur = cur->parent; in xmlDOMWrapCloneNode()
9899 cur = cur->parent; in xmlDOMWrapCloneNode()
9958 xmlNodePtr cur; in xmlDOMWrapAdoptAttr() local
10004 cur = attr->children; in xmlDOMWrapAdoptAttr()
10005 if ((cur != NULL) && (cur->type == XML_NAMESPACE_DECL)) in xmlDOMWrapAdoptAttr()
10007 while (cur != NULL) { in xmlDOMWrapAdoptAttr()
10008 cur->doc = destDoc; in xmlDOMWrapAdoptAttr()
10009 switch (cur->type) { in xmlDOMWrapAdoptAttr()
10012 XML_TREE_ADOPT_STR_2(cur->content) in xmlDOMWrapAdoptAttr()
10018 cur->content = NULL; in xmlDOMWrapAdoptAttr()
10019 cur->children = NULL; in xmlDOMWrapAdoptAttr()
10020 cur->last = NULL; in xmlDOMWrapAdoptAttr()
10026 ent = xmlGetDocEntity(destDoc, cur->name); in xmlDOMWrapAdoptAttr()
10028 cur->content = ent->content; in xmlDOMWrapAdoptAttr()
10029 cur->children = (xmlNodePtr) ent; in xmlDOMWrapAdoptAttr()
10030 cur->last = (xmlNodePtr) ent; in xmlDOMWrapAdoptAttr()
10037 if (cur->children != NULL) { in xmlDOMWrapAdoptAttr()
10038 cur = cur->children; in xmlDOMWrapAdoptAttr()
10042 if (cur == (xmlNodePtr) attr) in xmlDOMWrapAdoptAttr()
10044 if (cur->next != NULL) in xmlDOMWrapAdoptAttr()
10045 cur = cur->next; in xmlDOMWrapAdoptAttr()
10047 cur = cur->parent; in xmlDOMWrapAdoptAttr()
10137 xmlNodePtr cur = node; in xmlDOMWrapAdoptNode() local
10140 cur->doc = destDoc; in xmlDOMWrapAdoptNode()