• Home
  • Raw
  • Download

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 = value, *end = cur + len; in xmlStringLenGetNodeList() local
1290 q = cur; in xmlStringLenGetNodeList()
1291 while ((cur < end) && (*cur != 0)) { in xmlStringLenGetNodeList()
1292 if (cur[0] == '&') { in xmlStringLenGetNodeList()
1299 if (cur != q) { in xmlStringLenGetNodeList()
1300 if (xmlBufAdd(buf, q, cur - q)) in xmlStringLenGetNodeList()
1303 q = cur; in xmlStringLenGetNodeList()
1304 if ((cur + 2 < end) && (cur[1] == '#') && (cur[2] == 'x')) { in xmlStringLenGetNodeList()
1305 cur += 3; in xmlStringLenGetNodeList()
1306 if (cur < end) in xmlStringLenGetNodeList()
1307 tmp = *cur; in xmlStringLenGetNodeList()
1323 cur++; in xmlStringLenGetNodeList()
1324 if (cur < end) in xmlStringLenGetNodeList()
1325 tmp = *cur; in xmlStringLenGetNodeList()
1330 cur++; in xmlStringLenGetNodeList()
1331 q = cur; in xmlStringLenGetNodeList()
1332 } else if ((cur + 1 < end) && (cur[1] == '#')) { in xmlStringLenGetNodeList()
1333 cur += 2; in xmlStringLenGetNodeList()
1334 if (cur < end) in xmlStringLenGetNodeList()
1335 tmp = *cur; in xmlStringLenGetNodeList()
1347 cur++; in xmlStringLenGetNodeList()
1348 if (cur < end) in xmlStringLenGetNodeList()
1349 tmp = *cur; in xmlStringLenGetNodeList()
1354 cur++; in xmlStringLenGetNodeList()
1355 q = cur; in xmlStringLenGetNodeList()
1360 cur++; in xmlStringLenGetNodeList()
1361 q = cur; in xmlStringLenGetNodeList()
1362 while ((cur < end) && (*cur != 0) && (*cur != ';')) cur++; in xmlStringLenGetNodeList()
1363 if ((cur >= end) || (*cur == 0)) { in xmlStringLenGetNodeList()
1368 if (cur != q) { in xmlStringLenGetNodeList()
1372 val = xmlStrndup(q, cur - q); in xmlStringLenGetNodeList()
1430 cur++; in xmlStringLenGetNodeList()
1431 q = cur; in xmlStringLenGetNodeList()
1445 cur++; in xmlStringLenGetNodeList()
1448 if (cur != q) { in xmlStringLenGetNodeList()
1452 if (xmlBufAdd(buf, q, cur - q)) in xmlStringLenGetNodeList()
1489 const xmlChar *cur = value; in xmlStringGetNodeList() local
1500 q = cur; in xmlStringGetNodeList()
1501 while (*cur != 0) { in xmlStringGetNodeList()
1502 if (cur[0] == '&') { in xmlStringGetNodeList()
1509 if (cur != q) { in xmlStringGetNodeList()
1510 if (xmlBufAdd(buf, q, cur - q)) in xmlStringGetNodeList()
1513 q = cur; in xmlStringGetNodeList()
1514 if ((cur[1] == '#') && (cur[2] == 'x')) { in xmlStringGetNodeList()
1515 cur += 3; in xmlStringGetNodeList()
1516 tmp = *cur; in xmlStringGetNodeList()
1530 cur++; in xmlStringGetNodeList()
1531 tmp = *cur; in xmlStringGetNodeList()
1534 cur++; in xmlStringGetNodeList()
1535 q = cur; in xmlStringGetNodeList()
1536 } else if (cur[1] == '#') { in xmlStringGetNodeList()
1537 cur += 2; in xmlStringGetNodeList()
1538 tmp = *cur; in xmlStringGetNodeList()
1548 cur++; in xmlStringGetNodeList()
1549 tmp = *cur; in xmlStringGetNodeList()
1552 cur++; in xmlStringGetNodeList()
1553 q = cur; in xmlStringGetNodeList()
1558 cur++; in xmlStringGetNodeList()
1559 q = cur; in xmlStringGetNodeList()
1560 while ((*cur != 0) && (*cur != ';')) cur++; in xmlStringGetNodeList()
1561 if (*cur == 0) { in xmlStringGetNodeList()
1566 if (cur != q) { in xmlStringGetNodeList()
1570 val = xmlStrndup(q, cur - q); in xmlStringGetNodeList()
1624 cur++; in xmlStringGetNodeList()
1625 q = cur; in xmlStringGetNodeList()
1639 cur++; in xmlStringGetNodeList()
1641 if ((cur != q) || (ret == NULL)) { in xmlStringGetNodeList()
1645 xmlBufAdd(buf, q, cur - q); in xmlStringGetNodeList()
1841 xmlAttrPtr cur; in xmlNewPropInternal() local
1855 cur = (xmlAttrPtr) xmlMalloc(sizeof(xmlAttr)); in xmlNewPropInternal()
1856 if (cur == NULL) { in xmlNewPropInternal()
1864 memset(cur, 0, sizeof(xmlAttr)); in xmlNewPropInternal()
1865 cur->type = XML_ATTRIBUTE_NODE; in xmlNewPropInternal()
1867 cur->parent = node; in xmlNewPropInternal()
1870 cur->doc = doc; in xmlNewPropInternal()
1872 cur->ns = ns; in xmlNewPropInternal()
1876 cur->name = (xmlChar *) xmlDictLookup(doc->dict, name, -1); in xmlNewPropInternal()
1878 cur->name = xmlStrdup(name); in xmlNewPropInternal()
1880 cur->name = name; in xmlNewPropInternal()
1891 cur->children = xmlNewDocText(doc, value); in xmlNewPropInternal()
1892 cur->last = NULL; in xmlNewPropInternal()
1893 tmp = cur->children; in xmlNewPropInternal()
1895 tmp->parent = (xmlNodePtr) cur; in xmlNewPropInternal()
1897 cur->last = tmp; in xmlNewPropInternal()
1907 node->properties = cur; in xmlNewPropInternal()
1913 prev->next = cur; in xmlNewPropInternal()
1914 cur->prev = prev; in xmlNewPropInternal()
1919 (xmlIsID(node->doc, node, cur) == 1)) in xmlNewPropInternal()
1920 xmlAddID(NULL, node->doc, value, cur); in xmlNewPropInternal()
1923 xmlRegisterNodeDefaultValue((xmlNodePtr) cur); in xmlNewPropInternal()
1924 return (cur); in xmlNewPropInternal()
2014 xmlAttrPtr cur; in xmlNewDocProp() local
2027 cur = (xmlAttrPtr) xmlMalloc(sizeof(xmlAttr)); in xmlNewDocProp()
2028 if (cur == NULL) { in xmlNewDocProp()
2032 memset(cur, 0, sizeof(xmlAttr)); in xmlNewDocProp()
2033 cur->type = XML_ATTRIBUTE_NODE; in xmlNewDocProp()
2036 cur->name = xmlDictLookup(doc->dict, name, -1); in xmlNewDocProp()
2038 cur->name = xmlStrdup(name); in xmlNewDocProp()
2039 cur->doc = doc; in xmlNewDocProp()
2043 cur->children = xmlStringGetNodeList(doc, value); in xmlNewDocProp()
2044 cur->last = NULL; in xmlNewDocProp()
2046 tmp = cur->children; in xmlNewDocProp()
2048 tmp->parent = (xmlNodePtr) cur; in xmlNewDocProp()
2050 cur->last = tmp; in xmlNewDocProp()
2056 xmlRegisterNodeDefaultValue((xmlNodePtr)cur); in xmlNewDocProp()
2057 return(cur); in xmlNewDocProp()
2067 xmlFreePropList(xmlAttrPtr cur) { in xmlFreePropList() argument
2069 if (cur == NULL) return; in xmlFreePropList()
2070 while (cur != NULL) { in xmlFreePropList()
2071 next = cur->next; in xmlFreePropList()
2072 xmlFreeProp(cur); in xmlFreePropList()
2073 cur = next; in xmlFreePropList()
2084 xmlFreeProp(xmlAttrPtr cur) { in xmlFreeProp() argument
2086 if (cur == NULL) return; in xmlFreeProp()
2088 if (cur->doc != NULL) dict = cur->doc->dict; in xmlFreeProp()
2091 xmlDeregisterNodeDefaultValue((xmlNodePtr)cur); in xmlFreeProp()
2094 if ((cur->doc != NULL) && (cur->atype == XML_ATTRIBUTE_ID)) { in xmlFreeProp()
2095 xmlRemoveID(cur->doc, cur); in xmlFreeProp()
2097 if (cur->children != NULL) xmlFreeNodeList(cur->children); in xmlFreeProp()
2098 DICT_FREE(cur->name) in xmlFreeProp()
2099 xmlFree(cur); in xmlFreeProp()
2112 xmlRemoveProp(xmlAttrPtr cur) { in xmlRemoveProp() argument
2114 if (cur == NULL) { in xmlRemoveProp()
2121 if (cur->parent == NULL) { in xmlRemoveProp()
2128 tmp = cur->parent->properties; in xmlRemoveProp()
2129 if (tmp == cur) { in xmlRemoveProp()
2130 cur->parent->properties = cur->next; in xmlRemoveProp()
2131 if (cur->next != NULL) in xmlRemoveProp()
2132 cur->next->prev = NULL; in xmlRemoveProp()
2133 xmlFreeProp(cur); in xmlRemoveProp()
2137 if (tmp->next == cur) { in xmlRemoveProp()
2138 tmp->next = cur->next; in xmlRemoveProp()
2141 xmlFreeProp(cur); in xmlRemoveProp()
2164 xmlNodePtr cur; in xmlNewDocPI() local
2177 cur = (xmlNodePtr) xmlMalloc(sizeof(xmlNode)); in xmlNewDocPI()
2178 if (cur == NULL) { in xmlNewDocPI()
2182 memset(cur, 0, sizeof(xmlNode)); in xmlNewDocPI()
2183 cur->type = XML_PI_NODE; in xmlNewDocPI()
2186 cur->name = xmlDictLookup(doc->dict, name, -1); in xmlNewDocPI()
2188 cur->name = xmlStrdup(name); in xmlNewDocPI()
2190 cur->content = xmlStrdup(content); in xmlNewDocPI()
2192 cur->doc = doc; in xmlNewDocPI()
2195 xmlRegisterNodeDefaultValue((xmlNodePtr)cur); in xmlNewDocPI()
2196 return(cur); in xmlNewDocPI()
2226 xmlNodePtr cur; in xmlNewNode() local
2239 cur = (xmlNodePtr) xmlMalloc(sizeof(xmlNode)); in xmlNewNode()
2240 if (cur == NULL) { in xmlNewNode()
2244 memset(cur, 0, sizeof(xmlNode)); in xmlNewNode()
2245 cur->type = XML_ELEMENT_NODE; in xmlNewNode()
2247 cur->name = xmlStrdup(name); in xmlNewNode()
2248 cur->ns = ns; in xmlNewNode()
2251 xmlRegisterNodeDefaultValue(cur); in xmlNewNode()
2252 return(cur); in xmlNewNode()
2268 xmlNodePtr cur; in xmlNewNodeEatName() local
2281 cur = (xmlNodePtr) xmlMalloc(sizeof(xmlNode)); in xmlNewNodeEatName()
2282 if (cur == NULL) { in xmlNewNodeEatName()
2287 memset(cur, 0, sizeof(xmlNode)); in xmlNewNodeEatName()
2288 cur->type = XML_ELEMENT_NODE; in xmlNewNodeEatName()
2290 cur->name = name; in xmlNewNodeEatName()
2291 cur->ns = ns; in xmlNewNodeEatName()
2294 xmlRegisterNodeDefaultValue((xmlNodePtr)cur); in xmlNewNodeEatName()
2295 return(cur); in xmlNewNodeEatName()
2317 xmlNodePtr cur; in xmlNewDocNode() local
2320 cur = xmlNewNodeEatName(ns, (xmlChar *) in xmlNewDocNode()
2323 cur = xmlNewNode(ns, name); in xmlNewDocNode()
2324 if (cur != NULL) { in xmlNewDocNode()
2325 cur->doc = doc; in xmlNewDocNode()
2327 cur->children = xmlStringGetNodeList(doc, content); in xmlNewDocNode()
2328 UPDATE_LAST_CHILD_AND_PARENT(cur) in xmlNewDocNode()
2332 return(cur); in xmlNewDocNode()
2354 xmlNodePtr cur; in xmlNewDocNodeEatName() local
2356 cur = xmlNewNodeEatName(ns, name); in xmlNewDocNodeEatName()
2357 if (cur != NULL) { in xmlNewDocNodeEatName()
2358 cur->doc = doc; in xmlNewDocNodeEatName()
2360 cur->children = xmlStringGetNodeList(doc, content); in xmlNewDocNodeEatName()
2361 UPDATE_LAST_CHILD_AND_PARENT(cur) in xmlNewDocNodeEatName()
2369 return(cur); in xmlNewDocNodeEatName()
2388 xmlNodePtr cur; in xmlNewDocRawNode() local
2390 cur = xmlNewDocNode(doc, ns, name, NULL); in xmlNewDocRawNode()
2391 if (cur != NULL) { in xmlNewDocRawNode()
2392 cur->doc = doc; in xmlNewDocRawNode()
2394 cur->children = xmlNewDocText(doc, content); in xmlNewDocRawNode()
2395 UPDATE_LAST_CHILD_AND_PARENT(cur) in xmlNewDocRawNode()
2398 return(cur); in xmlNewDocRawNode()
2410 xmlNodePtr cur; in xmlNewDocFragment() local
2415 cur = (xmlNodePtr) xmlMalloc(sizeof(xmlNode)); in xmlNewDocFragment()
2416 if (cur == NULL) { in xmlNewDocFragment()
2420 memset(cur, 0, sizeof(xmlNode)); in xmlNewDocFragment()
2421 cur->type = XML_DOCUMENT_FRAG_NODE; in xmlNewDocFragment()
2423 cur->doc = doc; in xmlNewDocFragment()
2426 xmlRegisterNodeDefaultValue(cur); in xmlNewDocFragment()
2427 return(cur); in xmlNewDocFragment()
2440 xmlNodePtr cur; in xmlNewText() local
2445 cur = (xmlNodePtr) xmlMalloc(sizeof(xmlNode)); in xmlNewText()
2446 if (cur == NULL) { in xmlNewText()
2450 memset(cur, 0, sizeof(xmlNode)); in xmlNewText()
2451 cur->type = XML_TEXT_NODE; in xmlNewText()
2453 cur->name = xmlStringText; in xmlNewText()
2455 cur->content = xmlStrdup(content); in xmlNewText()
2459 xmlRegisterNodeDefaultValue(cur); in xmlNewText()
2460 return(cur); in xmlNewText()
2486 xmlNodePtr cur, prev; in xmlNewTextChild() local
2509 cur = xmlNewDocRawNode(parent->doc, parent->ns, name, content); in xmlNewTextChild()
2511 cur = xmlNewDocRawNode(parent->doc, ns, name, content); in xmlNewTextChild()
2515 cur = xmlNewDocRawNode((xmlDocPtr) parent, NULL, name, content); in xmlNewTextChild()
2517 cur = xmlNewDocRawNode((xmlDocPtr) parent, ns, name, content); in xmlNewTextChild()
2519 cur = xmlNewDocRawNode( parent->doc, ns, name, content); in xmlNewTextChild()
2523 if (cur == NULL) return(NULL); in xmlNewTextChild()
2528 cur->type = XML_ELEMENT_NODE; in xmlNewTextChild()
2529 cur->parent = parent; in xmlNewTextChild()
2530 cur->doc = parent->doc; in xmlNewTextChild()
2532 parent->children = cur; in xmlNewTextChild()
2533 parent->last = cur; in xmlNewTextChild()
2536 prev->next = cur; in xmlNewTextChild()
2537 cur->prev = prev; in xmlNewTextChild()
2538 parent->last = cur; in xmlNewTextChild()
2541 return(cur); in xmlNewTextChild()
2555 xmlNodePtr cur; in xmlNewCharRef() local
2563 cur = (xmlNodePtr) xmlMalloc(sizeof(xmlNode)); in xmlNewCharRef()
2564 if (cur == NULL) { in xmlNewCharRef()
2568 memset(cur, 0, sizeof(xmlNode)); in xmlNewCharRef()
2569 cur->type = XML_ENTITY_REF_NODE; in xmlNewCharRef()
2571 cur->doc = doc; in xmlNewCharRef()
2577 cur->name = xmlStrndup(name, len - 1); in xmlNewCharRef()
2579 cur->name = xmlStrndup(name, len); in xmlNewCharRef()
2581 cur->name = xmlStrdup(name); in xmlNewCharRef()
2584 xmlRegisterNodeDefaultValue(cur); in xmlNewCharRef()
2585 return(cur); in xmlNewCharRef()
2598 xmlNodePtr cur; in xmlNewReference() local
2607 cur = (xmlNodePtr) xmlMalloc(sizeof(xmlNode)); in xmlNewReference()
2608 if (cur == NULL) { in xmlNewReference()
2612 memset(cur, 0, sizeof(xmlNode)); in xmlNewReference()
2613 cur->type = XML_ENTITY_REF_NODE; in xmlNewReference()
2615 cur->doc = (xmlDoc *)doc; in xmlNewReference()
2621 cur->name = xmlStrndup(name, len - 1); in xmlNewReference()
2623 cur->name = xmlStrndup(name, len); in xmlNewReference()
2625 cur->name = xmlStrdup(name); in xmlNewReference()
2627 ent = xmlGetDocEntity(doc, cur->name); in xmlNewReference()
2629 cur->content = ent->content; in xmlNewReference()
2635 cur->children = (xmlNodePtr) ent; in xmlNewReference()
2636 cur->last = (xmlNodePtr) ent; in xmlNewReference()
2640 xmlRegisterNodeDefaultValue(cur); in xmlNewReference()
2641 return(cur); in xmlNewReference()
2654 xmlNodePtr cur; in xmlNewDocText() local
2656 cur = xmlNewText(content); in xmlNewDocText()
2657 if (cur != NULL) cur->doc = (xmlDoc *)doc; in xmlNewDocText()
2658 return(cur); in xmlNewDocText()
2671 xmlNodePtr cur; in xmlNewTextLen() local
2676 cur = (xmlNodePtr) xmlMalloc(sizeof(xmlNode)); in xmlNewTextLen()
2677 if (cur == NULL) { in xmlNewTextLen()
2681 memset(cur, 0, sizeof(xmlNode)); in xmlNewTextLen()
2682 cur->type = XML_TEXT_NODE; in xmlNewTextLen()
2684 cur->name = xmlStringText; in xmlNewTextLen()
2686 cur->content = xmlStrndup(content, len); in xmlNewTextLen()
2690 xmlRegisterNodeDefaultValue(cur); in xmlNewTextLen()
2691 return(cur); in xmlNewTextLen()
2706 xmlNodePtr cur; in xmlNewDocTextLen() local
2708 cur = xmlNewTextLen(content, len); in xmlNewDocTextLen()
2709 if (cur != NULL) cur->doc = doc; in xmlNewDocTextLen()
2710 return(cur); in xmlNewDocTextLen()
2722 xmlNodePtr cur; in xmlNewComment() local
2727 cur = (xmlNodePtr) xmlMalloc(sizeof(xmlNode)); in xmlNewComment()
2728 if (cur == NULL) { in xmlNewComment()
2732 memset(cur, 0, sizeof(xmlNode)); in xmlNewComment()
2733 cur->type = XML_COMMENT_NODE; in xmlNewComment()
2735 cur->name = xmlStringComment; in xmlNewComment()
2737 cur->content = xmlStrdup(content); in xmlNewComment()
2741 xmlRegisterNodeDefaultValue(cur); in xmlNewComment()
2742 return(cur); in xmlNewComment()
2756 xmlNodePtr cur; in xmlNewCDataBlock() local
2761 cur = (xmlNodePtr) xmlMalloc(sizeof(xmlNode)); in xmlNewCDataBlock()
2762 if (cur == NULL) { in xmlNewCDataBlock()
2766 memset(cur, 0, sizeof(xmlNode)); in xmlNewCDataBlock()
2767 cur->type = XML_CDATA_SECTION_NODE; in xmlNewCDataBlock()
2768 cur->doc = doc; in xmlNewCDataBlock()
2771 cur->content = xmlStrndup(content, len); in xmlNewCDataBlock()
2775 xmlRegisterNodeDefaultValue(cur); in xmlNewCDataBlock()
2776 return(cur); in xmlNewCDataBlock()
2789 xmlNodePtr cur; in xmlNewDocComment() local
2791 cur = xmlNewComment(content); in xmlNewDocComment()
2792 if (cur != NULL) cur->doc = doc; in xmlNewDocComment()
2793 return(cur); in xmlNewDocComment()
2852 xmlNodePtr cur; in xmlSetListDoc() local
2856 cur = list; in xmlSetListDoc()
2857 while (cur != NULL) { in xmlSetListDoc()
2858 if (cur->doc != doc) in xmlSetListDoc()
2859 xmlSetTreeDoc(cur, doc); in xmlSetListDoc()
2860 cur = cur->next; in xmlSetListDoc()
2885 xmlNodePtr cur, prev; in xmlNewChild() local
2908 cur = xmlNewDocNode(parent->doc, parent->ns, name, content); in xmlNewChild()
2910 cur = xmlNewDocNode(parent->doc, ns, name, content); in xmlNewChild()
2914 cur = xmlNewDocNode((xmlDocPtr) parent, NULL, name, content); in xmlNewChild()
2916 cur = xmlNewDocNode((xmlDocPtr) parent, ns, name, content); in xmlNewChild()
2918 cur = xmlNewDocNode( parent->doc, ns, name, content); in xmlNewChild()
2922 if (cur == NULL) return(NULL); in xmlNewChild()
2927 cur->type = XML_ELEMENT_NODE; in xmlNewChild()
2928 cur->parent = parent; in xmlNewChild()
2929 cur->doc = parent->doc; in xmlNewChild()
2931 parent->children = cur; in xmlNewChild()
2932 parent->last = cur; in xmlNewChild()
2935 prev->next = cur; in xmlNewChild()
2936 cur->prev = prev; in xmlNewChild()
2937 parent->last = cur; in xmlNewChild()
2940 return(cur); in xmlNewChild()
2958 xmlAddPropSibling(xmlNodePtr prev, xmlNodePtr cur, xmlNodePtr prop) { in xmlAddPropSibling() argument
2961 if ((cur == NULL) || (cur->type != XML_ATTRIBUTE_NODE) || in xmlAddPropSibling()
2968 attr = xmlHasNsProp(cur->parent, prop->name, NULL); in xmlAddPropSibling()
2970 attr = xmlHasNsProp(cur->parent, prop->name, prop->ns->href); in xmlAddPropSibling()
2972 if (prop->doc != cur->doc) { in xmlAddPropSibling()
2973 xmlSetTreeDoc(prop, cur->doc); in xmlAddPropSibling()
2975 prop->parent = cur->parent; in xmlAddPropSibling()
2983 prop->next = cur; in xmlAddPropSibling()
2984 cur->prev = prop; in xmlAddPropSibling()
3010 xmlAddNextSibling(xmlNodePtr cur, xmlNodePtr elem) { in xmlAddNextSibling() argument
3011 if ((cur == NULL) || (cur->type == XML_NAMESPACE_DECL)) { in xmlAddNextSibling()
3026 if (cur == elem) { in xmlAddNextSibling()
3037 if (cur->type == XML_TEXT_NODE) { in xmlAddNextSibling()
3038 xmlNodeAddContent(cur, elem->content); in xmlAddNextSibling()
3040 return(cur); in xmlAddNextSibling()
3042 if ((cur->next != NULL) && (cur->next->type == XML_TEXT_NODE) && in xmlAddNextSibling()
3043 (cur->name == cur->next->name)) { in xmlAddNextSibling()
3047 tmp = xmlStrcat(tmp, cur->next->content); in xmlAddNextSibling()
3048 xmlNodeSetContent(cur->next, tmp); in xmlAddNextSibling()
3051 return(cur->next); in xmlAddNextSibling()
3054 return xmlAddPropSibling(cur, cur, elem); in xmlAddNextSibling()
3057 if (elem->doc != cur->doc) { in xmlAddNextSibling()
3058 xmlSetTreeDoc(elem, cur->doc); in xmlAddNextSibling()
3060 elem->parent = cur->parent; in xmlAddNextSibling()
3061 elem->prev = cur; in xmlAddNextSibling()
3062 elem->next = cur->next; in xmlAddNextSibling()
3063 cur->next = elem; in xmlAddNextSibling()
3066 if ((elem->parent != NULL) && (elem->parent->last == cur)) in xmlAddNextSibling()
3088 xmlAddPrevSibling(xmlNodePtr cur, xmlNodePtr elem) { in xmlAddPrevSibling() argument
3089 if ((cur == NULL) || (cur->type == XML_NAMESPACE_DECL)) { in xmlAddPrevSibling()
3104 if (cur == elem) { in xmlAddPrevSibling()
3115 if (cur->type == XML_TEXT_NODE) { in xmlAddPrevSibling()
3119 tmp = xmlStrcat(tmp, cur->content); in xmlAddPrevSibling()
3120 xmlNodeSetContent(cur, tmp); in xmlAddPrevSibling()
3123 return(cur); in xmlAddPrevSibling()
3125 if ((cur->prev != NULL) && (cur->prev->type == XML_TEXT_NODE) && in xmlAddPrevSibling()
3126 (cur->name == cur->prev->name)) { in xmlAddPrevSibling()
3127 xmlNodeAddContent(cur->prev, elem->content); in xmlAddPrevSibling()
3129 return(cur->prev); in xmlAddPrevSibling()
3132 return xmlAddPropSibling(cur->prev, cur, elem); in xmlAddPrevSibling()
3135 if (elem->doc != cur->doc) { in xmlAddPrevSibling()
3136 xmlSetTreeDoc(elem, cur->doc); in xmlAddPrevSibling()
3138 elem->parent = cur->parent; in xmlAddPrevSibling()
3139 elem->next = cur; in xmlAddPrevSibling()
3140 elem->prev = cur->prev; in xmlAddPrevSibling()
3141 cur->prev = elem; in xmlAddPrevSibling()
3144 if ((elem->parent != NULL) && (elem->parent->children == cur)) { in xmlAddPrevSibling()
3164 xmlAddSibling(xmlNodePtr cur, xmlNodePtr elem) { in xmlAddSibling() argument
3167 if ((cur == NULL) || (cur->type == XML_NAMESPACE_DECL)) { in xmlAddSibling()
3183 if (cur == elem) { in xmlAddSibling()
3195 if ((cur->type != XML_ATTRIBUTE_NODE) && (cur->parent != NULL) && in xmlAddSibling()
3196 (cur->parent->children != NULL) && in xmlAddSibling()
3197 (cur->parent->last != NULL) && in xmlAddSibling()
3198 (cur->parent->last->next == NULL)) { in xmlAddSibling()
3199 cur = cur->parent->last; in xmlAddSibling()
3201 while (cur->next != NULL) cur = cur->next; in xmlAddSibling()
3206 if ((cur->type == XML_TEXT_NODE) && (elem->type == XML_TEXT_NODE) && in xmlAddSibling()
3207 (cur->name == elem->name)) { in xmlAddSibling()
3208 xmlNodeAddContent(cur, elem->content); in xmlAddSibling()
3210 return(cur); in xmlAddSibling()
3212 return xmlAddPropSibling(cur, cur, elem); in xmlAddSibling()
3215 if (elem->doc != cur->doc) { in xmlAddSibling()
3216 xmlSetTreeDoc(elem, cur->doc); in xmlAddSibling()
3218 parent = cur->parent; in xmlAddSibling()
3219 elem->prev = cur; in xmlAddSibling()
3222 cur->next = elem; in xmlAddSibling()
3240 xmlAddChildList(xmlNodePtr parent, xmlNodePtr cur) { in xmlAddChildList() argument
3251 if ((cur == NULL) || (cur->type == XML_NAMESPACE_DECL)) { in xmlAddChildList()
3259 if ((cur->doc != NULL) && (parent->doc != NULL) && in xmlAddChildList()
3260 (cur->doc != parent->doc)) { in xmlAddChildList()
3272 parent->children = cur; in xmlAddChildList()
3277 if ((cur->type == XML_TEXT_NODE) && in xmlAddChildList()
3279 (cur->name == parent->last->name)) { in xmlAddChildList()
3280 xmlNodeAddContent(parent->last, cur->content); in xmlAddChildList()
3284 if (cur->next == NULL) { in xmlAddChildList()
3285 xmlFreeNode(cur); in xmlAddChildList()
3288 prev = cur; in xmlAddChildList()
3289 cur = cur->next; in xmlAddChildList()
3293 prev->next = cur; in xmlAddChildList()
3294 cur->prev = prev; in xmlAddChildList()
3296 while (cur->next != NULL) { in xmlAddChildList()
3297 cur->parent = parent; in xmlAddChildList()
3298 if (cur->doc != parent->doc) { in xmlAddChildList()
3299 xmlSetTreeDoc(cur, parent->doc); in xmlAddChildList()
3301 cur = cur->next; in xmlAddChildList()
3303 cur->parent = parent; in xmlAddChildList()
3305 if (cur->doc != parent->doc) { in xmlAddChildList()
3306 xmlSetTreeDoc(cur, parent->doc); in xmlAddChildList()
3308 parent->last = cur; in xmlAddChildList()
3310 return(cur); in xmlAddChildList()
3326 xmlAddChild(xmlNodePtr parent, xmlNodePtr cur) { in xmlAddChild() argument
3337 if ((cur == NULL) || (cur->type == XML_NAMESPACE_DECL)) { in xmlAddChild()
3345 if (parent == cur) { in xmlAddChild()
3356 if (cur->type == XML_TEXT_NODE) { in xmlAddChild()
3359 (parent->name == cur->name)) { in xmlAddChild()
3360 xmlNodeAddContent(parent, cur->content); in xmlAddChild()
3361 xmlFreeNode(cur); in xmlAddChild()
3365 (parent->last->name == cur->name) && in xmlAddChild()
3366 (parent->last != cur)) { in xmlAddChild()
3367 xmlNodeAddContent(parent->last, cur->content); in xmlAddChild()
3368 xmlFreeNode(cur); in xmlAddChild()
3376 prev = cur->parent; in xmlAddChild()
3377 cur->parent = parent; in xmlAddChild()
3378 if (cur->doc != parent->doc) { in xmlAddChild()
3379 xmlSetTreeDoc(cur, parent->doc); in xmlAddChild()
3385 return(cur); in xmlAddChild()
3392 (parent != cur)) { in xmlAddChild()
3393 xmlNodeAddContent(parent, cur->content); in xmlAddChild()
3394 xmlFreeNode(cur); in xmlAddChild()
3397 if (cur->type == XML_ATTRIBUTE_NODE) { in xmlAddChild()
3404 if (cur->ns == NULL) in xmlAddChild()
3405 lastattr = xmlHasNsProp(parent, cur->name, NULL); in xmlAddChild()
3407 lastattr = xmlHasNsProp(parent, cur->name, cur->ns->href); in xmlAddChild()
3408 …if ((lastattr != NULL) && (lastattr != (xmlAttrPtr) cur) && (lastattr->type != XML_ATTRIBUTE_DECL)… in xmlAddChild()
3413 if (lastattr == (xmlAttrPtr) cur) in xmlAddChild()
3414 return(cur); in xmlAddChild()
3418 parent->properties = (xmlAttrPtr) cur; in xmlAddChild()
3425 lastattr->next = (xmlAttrPtr) cur; in xmlAddChild()
3426 ((xmlAttrPtr) cur)->prev = lastattr; in xmlAddChild()
3430 parent->children = cur; in xmlAddChild()
3431 parent->last = cur; in xmlAddChild()
3434 prev->next = cur; in xmlAddChild()
3435 cur->prev = prev; in xmlAddChild()
3436 parent->last = cur; in xmlAddChild()
3439 return(cur); in xmlAddChild()
3481 xmlNodePtr cur = NULL; in xmlChildElementCount() local
3491 cur = parent->children; in xmlChildElementCount()
3496 while (cur != NULL) { in xmlChildElementCount()
3497 if (cur->type == XML_ELEMENT_NODE) in xmlChildElementCount()
3499 cur = cur->next; in xmlChildElementCount()
3517 xmlNodePtr cur = NULL; in xmlFirstElementChild() local
3527 cur = parent->children; in xmlFirstElementChild()
3532 while (cur != NULL) { in xmlFirstElementChild()
3533 if (cur->type == XML_ELEMENT_NODE) in xmlFirstElementChild()
3534 return(cur); in xmlFirstElementChild()
3535 cur = cur->next; in xmlFirstElementChild()
3553 xmlNodePtr cur = NULL; in xmlLastElementChild() local
3563 cur = parent->last; in xmlLastElementChild()
3568 while (cur != NULL) { in xmlLastElementChild()
3569 if (cur->type == XML_ELEMENT_NODE) in xmlLastElementChild()
3570 return(cur); in xmlLastElementChild()
3571 cur = cur->prev; in xmlLastElementChild()
3665 xmlFreeNodeList(xmlNodePtr cur) { in xmlFreeNodeList() argument
3669 if (cur == NULL) return; in xmlFreeNodeList()
3670 if (cur->type == XML_NAMESPACE_DECL) { in xmlFreeNodeList()
3671 xmlFreeNsList((xmlNsPtr) cur); in xmlFreeNodeList()
3674 if ((cur->type == XML_DOCUMENT_NODE) || in xmlFreeNodeList()
3676 (cur->type == XML_DOCB_DOCUMENT_NODE) || in xmlFreeNodeList()
3678 (cur->type == XML_HTML_DOCUMENT_NODE)) { in xmlFreeNodeList()
3679 xmlFreeDoc((xmlDocPtr) cur); in xmlFreeNodeList()
3682 if (cur->doc != NULL) dict = cur->doc->dict; in xmlFreeNodeList()
3683 while (cur != NULL) { in xmlFreeNodeList()
3684 next = cur->next; in xmlFreeNodeList()
3685 if (cur->type != XML_DTD_NODE) { in xmlFreeNodeList()
3688 xmlDeregisterNodeDefaultValue(cur); in xmlFreeNodeList()
3690 if ((cur->children != NULL) && in xmlFreeNodeList()
3691 (cur->type != XML_ENTITY_REF_NODE)) in xmlFreeNodeList()
3692 xmlFreeNodeList(cur->children); in xmlFreeNodeList()
3693 if (((cur->type == XML_ELEMENT_NODE) || in xmlFreeNodeList()
3694 (cur->type == XML_XINCLUDE_START) || in xmlFreeNodeList()
3695 (cur->type == XML_XINCLUDE_END)) && in xmlFreeNodeList()
3696 (cur->properties != NULL)) in xmlFreeNodeList()
3697 xmlFreePropList(cur->properties); in xmlFreeNodeList()
3698 if ((cur->type != XML_ELEMENT_NODE) && in xmlFreeNodeList()
3699 (cur->type != XML_XINCLUDE_START) && in xmlFreeNodeList()
3700 (cur->type != XML_XINCLUDE_END) && in xmlFreeNodeList()
3701 (cur->type != XML_ENTITY_REF_NODE) && in xmlFreeNodeList()
3702 (cur->content != (xmlChar *) &(cur->properties))) { in xmlFreeNodeList()
3703 DICT_FREE(cur->content) in xmlFreeNodeList()
3705 if (((cur->type == XML_ELEMENT_NODE) || in xmlFreeNodeList()
3706 (cur->type == XML_XINCLUDE_START) || in xmlFreeNodeList()
3707 (cur->type == XML_XINCLUDE_END)) && in xmlFreeNodeList()
3708 (cur->nsDef != NULL)) in xmlFreeNodeList()
3709 xmlFreeNsList(cur->nsDef); in xmlFreeNodeList()
3717 if ((cur->name != NULL) && in xmlFreeNodeList()
3718 (cur->type != XML_TEXT_NODE) && in xmlFreeNodeList()
3719 (cur->type != XML_COMMENT_NODE)) in xmlFreeNodeList()
3720 DICT_FREE(cur->name) in xmlFreeNodeList()
3721 xmlFree(cur); in xmlFreeNodeList()
3723 cur = next; in xmlFreeNodeList()
3735 xmlFreeNode(xmlNodePtr cur) { in xmlFreeNode() argument
3738 if (cur == NULL) return; in xmlFreeNode()
3741 if (cur->type == XML_DTD_NODE) { in xmlFreeNode()
3742 xmlFreeDtd((xmlDtdPtr) cur); in xmlFreeNode()
3745 if (cur->type == XML_NAMESPACE_DECL) { in xmlFreeNode()
3746 xmlFreeNs((xmlNsPtr) cur); in xmlFreeNode()
3749 if (cur->type == XML_ATTRIBUTE_NODE) { in xmlFreeNode()
3750 xmlFreeProp((xmlAttrPtr) cur); in xmlFreeNode()
3755 xmlDeregisterNodeDefaultValue(cur); in xmlFreeNode()
3757 if (cur->doc != NULL) dict = cur->doc->dict; in xmlFreeNode()
3759 if (cur->type == XML_ENTITY_DECL) { in xmlFreeNode()
3760 xmlEntityPtr ent = (xmlEntityPtr) cur; in xmlFreeNode()
3764 if ((cur->children != NULL) && in xmlFreeNode()
3765 (cur->type != XML_ENTITY_REF_NODE)) in xmlFreeNode()
3766 xmlFreeNodeList(cur->children); in xmlFreeNode()
3767 if (((cur->type == XML_ELEMENT_NODE) || in xmlFreeNode()
3768 (cur->type == XML_XINCLUDE_START) || in xmlFreeNode()
3769 (cur->type == XML_XINCLUDE_END)) && in xmlFreeNode()
3770 (cur->properties != NULL)) in xmlFreeNode()
3771 xmlFreePropList(cur->properties); in xmlFreeNode()
3772 if ((cur->type != XML_ELEMENT_NODE) && in xmlFreeNode()
3773 (cur->content != NULL) && in xmlFreeNode()
3774 (cur->type != XML_ENTITY_REF_NODE) && in xmlFreeNode()
3775 (cur->type != XML_XINCLUDE_END) && in xmlFreeNode()
3776 (cur->type != XML_XINCLUDE_START) && in xmlFreeNode()
3777 (cur->content != (xmlChar *) &(cur->properties))) { in xmlFreeNode()
3778 DICT_FREE(cur->content) in xmlFreeNode()
3786 if ((cur->name != NULL) && in xmlFreeNode()
3787 (cur->type != XML_TEXT_NODE) && in xmlFreeNode()
3788 (cur->type != XML_COMMENT_NODE)) in xmlFreeNode()
3789 DICT_FREE(cur->name) in xmlFreeNode()
3791 if (((cur->type == XML_ELEMENT_NODE) || in xmlFreeNode()
3792 (cur->type == XML_XINCLUDE_START) || in xmlFreeNode()
3793 (cur->type == XML_XINCLUDE_END)) && in xmlFreeNode()
3794 (cur->nsDef != NULL)) in xmlFreeNode()
3795 xmlFreeNsList(cur->nsDef); in xmlFreeNode()
3796 xmlFree(cur); in xmlFreeNode()
3810 xmlUnlinkNode(xmlNodePtr cur) { in xmlUnlinkNode() argument
3811 if (cur == NULL) { in xmlUnlinkNode()
3818 if (cur->type == XML_NAMESPACE_DECL) in xmlUnlinkNode()
3820 if (cur->type == XML_DTD_NODE) { in xmlUnlinkNode()
3822 doc = cur->doc; in xmlUnlinkNode()
3824 if (doc->intSubset == (xmlDtdPtr) cur) in xmlUnlinkNode()
3826 if (doc->extSubset == (xmlDtdPtr) cur) in xmlUnlinkNode()
3830 if (cur->type == XML_ENTITY_DECL) { in xmlUnlinkNode()
3832 doc = cur->doc; in xmlUnlinkNode()
3835 if (xmlHashLookup(doc->intSubset->entities, cur->name) == cur) in xmlUnlinkNode()
3836 xmlHashRemoveEntry(doc->intSubset->entities, cur->name, in xmlUnlinkNode()
3838 if (xmlHashLookup(doc->intSubset->pentities, cur->name) == cur) in xmlUnlinkNode()
3839 xmlHashRemoveEntry(doc->intSubset->pentities, cur->name, in xmlUnlinkNode()
3843 if (xmlHashLookup(doc->extSubset->entities, cur->name) == cur) in xmlUnlinkNode()
3844 xmlHashRemoveEntry(doc->extSubset->entities, cur->name, in xmlUnlinkNode()
3846 if (xmlHashLookup(doc->extSubset->pentities, cur->name) == cur) in xmlUnlinkNode()
3847 xmlHashRemoveEntry(doc->extSubset->pentities, cur->name, in xmlUnlinkNode()
3852 if (cur->parent != NULL) { in xmlUnlinkNode()
3854 parent = cur->parent; in xmlUnlinkNode()
3855 if (cur->type == XML_ATTRIBUTE_NODE) { in xmlUnlinkNode()
3856 if (parent->properties == (xmlAttrPtr) cur) in xmlUnlinkNode()
3857 parent->properties = ((xmlAttrPtr) cur)->next; in xmlUnlinkNode()
3859 if (parent->children == cur) in xmlUnlinkNode()
3860 parent->children = cur->next; in xmlUnlinkNode()
3861 if (parent->last == cur) in xmlUnlinkNode()
3862 parent->last = cur->prev; in xmlUnlinkNode()
3864 cur->parent = NULL; in xmlUnlinkNode()
3866 if (cur->next != NULL) in xmlUnlinkNode()
3867 cur->next->prev = cur->prev; in xmlUnlinkNode()
3868 if (cur->prev != NULL) in xmlUnlinkNode()
3869 cur->prev->next = cur->next; in xmlUnlinkNode()
3870 cur->next = cur->prev = NULL; in xmlUnlinkNode()
3886 xmlReplaceNode(xmlNodePtr old, xmlNodePtr cur) { in xmlReplaceNode() argument
3887 if (old == cur) return(NULL); in xmlReplaceNode()
3896 if ((cur == NULL) || (cur->type == XML_NAMESPACE_DECL)) { in xmlReplaceNode()
3900 if (cur == old) { in xmlReplaceNode()
3903 if ((old->type==XML_ATTRIBUTE_NODE) && (cur->type!=XML_ATTRIBUTE_NODE)) { in xmlReplaceNode()
3910 if ((cur->type==XML_ATTRIBUTE_NODE) && (old->type!=XML_ATTRIBUTE_NODE)) { in xmlReplaceNode()
3917 xmlUnlinkNode(cur); in xmlReplaceNode()
3918 xmlSetTreeDoc(cur, old->doc); in xmlReplaceNode()
3919 cur->parent = old->parent; in xmlReplaceNode()
3920 cur->next = old->next; in xmlReplaceNode()
3921 if (cur->next != NULL) in xmlReplaceNode()
3922 cur->next->prev = cur; in xmlReplaceNode()
3923 cur->prev = old->prev; in xmlReplaceNode()
3924 if (cur->prev != NULL) in xmlReplaceNode()
3925 cur->prev->next = cur; in xmlReplaceNode()
3926 if (cur->parent != NULL) { in xmlReplaceNode()
3927 if (cur->type == XML_ATTRIBUTE_NODE) { in xmlReplaceNode()
3928 if (cur->parent->properties == (xmlAttrPtr)old) in xmlReplaceNode()
3929 cur->parent->properties = ((xmlAttrPtr) cur); in xmlReplaceNode()
3931 if (cur->parent->children == old) in xmlReplaceNode()
3932 cur->parent->children = cur; in xmlReplaceNode()
3933 if (cur->parent->last == old) in xmlReplaceNode()
3934 cur->parent->last = cur; in xmlReplaceNode()
3958 xmlCopyNamespace(xmlNsPtr cur) { in xmlCopyNamespace() argument
3961 if (cur == NULL) return(NULL); in xmlCopyNamespace()
3962 switch (cur->type) { in xmlCopyNamespace()
3964 ret = xmlNewNs(NULL, cur->href, cur->prefix); in xmlCopyNamespace()
3969 "xmlCopyNamespace: invalid type %d\n", cur->type); in xmlCopyNamespace()
3985 xmlCopyNamespaceList(xmlNsPtr cur) { in xmlCopyNamespaceList() argument
3989 while (cur != NULL) { in xmlCopyNamespaceList()
3990 q = xmlCopyNamespace(cur); in xmlCopyNamespaceList()
3997 cur = cur->next; in xmlCopyNamespaceList()
4006 xmlCopyPropInternal(xmlDocPtr doc, xmlNodePtr target, xmlAttrPtr cur) { in xmlCopyPropInternal() argument
4009 if (cur == NULL) return(NULL); in xmlCopyPropInternal()
4013 ret = xmlNewDocProp(target->doc, cur->name, NULL); in xmlCopyPropInternal()
4015 ret = xmlNewDocProp(doc, cur->name, NULL); in xmlCopyPropInternal()
4016 else if (cur->parent != NULL) in xmlCopyPropInternal()
4017 ret = xmlNewDocProp(cur->parent->doc, cur->name, NULL); in xmlCopyPropInternal()
4018 else if (cur->children != NULL) in xmlCopyPropInternal()
4019 ret = xmlNewDocProp(cur->children->doc, cur->name, NULL); in xmlCopyPropInternal()
4021 ret = xmlNewDocProp(NULL, cur->name, NULL); in xmlCopyPropInternal()
4025 if ((cur->ns != NULL) && (target != NULL)) { in xmlCopyPropInternal()
4028 ns = xmlSearchNs(target->doc, target, cur->ns->prefix); in xmlCopyPropInternal()
4035 ns = xmlSearchNs(cur->doc, cur->parent, cur->ns->prefix); in xmlCopyPropInternal()
4056 if (xmlStrEqual(ns->href, cur->ns->href)) { in xmlCopyPropInternal()
4064 ret->ns = xmlNewReconciliedNs(target->doc, target, cur->ns); in xmlCopyPropInternal()
4071 if (cur->children != NULL) { in xmlCopyPropInternal()
4074 ret->children = xmlStaticCopyNodeList(cur->children, ret->doc, (xmlNodePtr) ret); in xmlCopyPropInternal()
4087 if ((target!= NULL) && (cur!= NULL) && in xmlCopyPropInternal()
4088 (target->doc != NULL) && (cur->doc != NULL) && in xmlCopyPropInternal()
4089 (cur->doc->ids != NULL) && (cur->parent != NULL)) { in xmlCopyPropInternal()
4090 if (xmlIsID(cur->doc, cur->parent, cur)) { in xmlCopyPropInternal()
4093 id = xmlNodeListGetString(cur->doc, cur->children, 1); in xmlCopyPropInternal()
4113 xmlCopyProp(xmlNodePtr target, xmlAttrPtr cur) { in xmlCopyProp() argument
4114 return xmlCopyPropInternal(NULL, target, cur); in xmlCopyProp()
4127 xmlCopyPropList(xmlNodePtr target, xmlAttrPtr cur) { in xmlCopyPropList() argument
4133 while (cur != NULL) { in xmlCopyPropList()
4134 q = xmlCopyProp(target, cur); in xmlCopyPropList()
4144 cur = cur->next; in xmlCopyPropList()
4441 xmlNodePtr cur, p = NULL, q; in xmlCopyDtd() local
4462 cur = dtd->children; in xmlCopyDtd()
4463 while (cur != NULL) { in xmlCopyDtd()
4466 if (cur->type == XML_ENTITY_DECL) { in xmlCopyDtd()
4467 xmlEntityPtr tmp = (xmlEntityPtr) cur; in xmlCopyDtd()
4482 } else if (cur->type == XML_ELEMENT_DECL) { in xmlCopyDtd()
4483 xmlElementPtr tmp = (xmlElementPtr) cur; in xmlCopyDtd()
4486 } else if (cur->type == XML_ATTRIBUTE_DECL) { in xmlCopyDtd()
4487 xmlAttributePtr tmp = (xmlAttributePtr) cur; in xmlCopyDtd()
4490 } else if (cur->type == XML_COMMENT_NODE) { in xmlCopyDtd()
4491 q = xmlCopyNode(cur, 0); in xmlCopyDtd()
4495 cur = cur->next; in xmlCopyDtd()
4509 cur = cur->next; in xmlCopyDtd()
4662 const xmlNode *cur, *tmp, *next; in xmlGetNodePath() local
4688 cur = node; in xmlGetNodePath()
4693 if ((cur->type == XML_DOCUMENT_NODE) || in xmlGetNodePath()
4694 (cur->type == XML_HTML_DOCUMENT_NODE)) { in xmlGetNodePath()
4699 } else if (cur->type == XML_ELEMENT_NODE) { in xmlGetNodePath()
4702 name = (const char *) cur->name; in xmlGetNodePath()
4703 if (cur->ns) { in xmlGetNodePath()
4704 if (cur->ns->prefix != NULL) { in xmlGetNodePath()
4706 (char *)cur->ns->prefix, (char *)cur->name); in xmlGetNodePath()
4718 next = cur->parent; in xmlGetNodePath()
4724 tmp = cur->prev; in xmlGetNodePath()
4728 (xmlStrEqual(cur->name, tmp->name) && in xmlGetNodePath()
4729 ((tmp->ns == cur->ns) || in xmlGetNodePath()
4730 ((tmp->ns != NULL) && (cur->ns != NULL) && in xmlGetNodePath()
4731 (xmlStrEqual(cur->ns->prefix, tmp->ns->prefix))))))) in xmlGetNodePath()
4736 tmp = cur->next; in xmlGetNodePath()
4740 (xmlStrEqual(cur->name, tmp->name) && in xmlGetNodePath()
4741 ((tmp->ns == cur->ns) || in xmlGetNodePath()
4742 ((tmp->ns != NULL) && (cur->ns != NULL) && in xmlGetNodePath()
4743 (xmlStrEqual(cur->ns->prefix, tmp->ns->prefix))))))) in xmlGetNodePath()
4751 } else if (cur->type == XML_COMMENT_NODE) { in xmlGetNodePath()
4754 next = cur->parent; in xmlGetNodePath()
4759 tmp = cur->prev; in xmlGetNodePath()
4766 tmp = cur->next; in xmlGetNodePath()
4776 } else if ((cur->type == XML_TEXT_NODE) || in xmlGetNodePath()
4777 (cur->type == XML_CDATA_SECTION_NODE)) { in xmlGetNodePath()
4780 next = cur->parent; in xmlGetNodePath()
4785 tmp = cur->prev; in xmlGetNodePath()
4797 tmp = cur->next; in xmlGetNodePath()
4809 } else if (cur->type == XML_PI_NODE) { in xmlGetNodePath()
4812 "processing-instruction('%s')", (char *)cur->name); in xmlGetNodePath()
4816 next = cur->parent; in xmlGetNodePath()
4821 tmp = cur->prev; in xmlGetNodePath()
4824 (xmlStrEqual(cur->name, tmp->name))) in xmlGetNodePath()
4829 tmp = cur->next; in xmlGetNodePath()
4832 (xmlStrEqual(cur->name, tmp->name))) in xmlGetNodePath()
4841 } else if (cur->type == XML_ATTRIBUTE_NODE) { in xmlGetNodePath()
4843 name = (const char *) (((xmlAttrPtr) cur)->name); in xmlGetNodePath()
4844 if (cur->ns) { in xmlGetNodePath()
4845 if (cur->ns->prefix != NULL) in xmlGetNodePath()
4847 (char *)cur->ns->prefix, (char *)cur->name); in xmlGetNodePath()
4850 (char *)cur->name); in xmlGetNodePath()
4854 next = ((xmlAttrPtr) cur)->parent; in xmlGetNodePath()
4856 next = cur->parent; in xmlGetNodePath()
4889 cur = next; in xmlGetNodePath()
4890 } while (cur != NULL); in xmlGetNodePath()
4971 xmlNodeSetLang(xmlNodePtr cur, const xmlChar *lang) { in xmlNodeSetLang() argument
4974 if (cur == NULL) return; in xmlNodeSetLang()
4975 switch(cur->type) { in xmlNodeSetLang()
5002 ns = xmlSearchNsByHref(cur->doc, cur, XML_XML_NAMESPACE); in xmlNodeSetLang()
5005 xmlSetNsProp(cur, ns, BAD_CAST "lang", lang); in xmlNodeSetLang()
5020 xmlNodeGetLang(const xmlNode *cur) { in xmlNodeGetLang() argument
5023 if ((cur == NULL) || (cur->type == XML_NAMESPACE_DECL)) in xmlNodeGetLang()
5025 while (cur != NULL) { in xmlNodeGetLang()
5026 lang = xmlGetNsProp(cur, BAD_CAST "lang", XML_XML_NAMESPACE); in xmlNodeGetLang()
5029 cur = cur->parent; in xmlNodeGetLang()
5045 xmlNodeSetSpacePreserve(xmlNodePtr cur, int val) { in xmlNodeSetSpacePreserve() argument
5048 if (cur == NULL) return; in xmlNodeSetSpacePreserve()
5049 switch(cur->type) { in xmlNodeSetSpacePreserve()
5076 ns = xmlSearchNsByHref(cur->doc, cur, XML_XML_NAMESPACE); in xmlNodeSetSpacePreserve()
5081 xmlSetNsProp(cur, ns, BAD_CAST "space", BAD_CAST "default"); in xmlNodeSetSpacePreserve()
5084 xmlSetNsProp(cur, ns, BAD_CAST "space", BAD_CAST "preserve"); in xmlNodeSetSpacePreserve()
5101 xmlNodeGetSpacePreserve(const xmlNode *cur) { in xmlNodeGetSpacePreserve() argument
5104 if ((cur == NULL) || (cur->type != XML_ELEMENT_NODE)) in xmlNodeGetSpacePreserve()
5106 while (cur != NULL) { in xmlNodeGetSpacePreserve()
5107 space = xmlGetNsProp(cur, BAD_CAST "space", XML_XML_NAMESPACE); in xmlNodeGetSpacePreserve()
5119 cur = cur->parent; in xmlNodeGetSpacePreserve()
5133 xmlNodeSetName(xmlNodePtr cur, const xmlChar *name) { in xmlNodeSetName() argument
5138 if (cur == NULL) return; in xmlNodeSetName()
5140 switch(cur->type) { in xmlNodeSetName()
5167 doc = cur->doc; in xmlNodeSetName()
5173 if ((cur->name != NULL) && (!xmlDictOwns(dict, cur->name))) in xmlNodeSetName()
5174 freeme = cur->name; in xmlNodeSetName()
5175 cur->name = xmlDictLookup(dict, name, -1); in xmlNodeSetName()
5177 if (cur->name != NULL) in xmlNodeSetName()
5178 freeme = cur->name; in xmlNodeSetName()
5179 cur->name = xmlStrdup(name); in xmlNodeSetName()
5197 xmlNodeSetBase(xmlNodePtr cur, const xmlChar* uri) { in xmlNodeSetBase() argument
5201 if (cur == NULL) return; in xmlNodeSetBase()
5202 switch(cur->type) { in xmlNodeSetBase()
5228 xmlDocPtr doc = (xmlDocPtr) cur; in xmlNodeSetBase()
5240 ns = xmlSearchNsByHref(cur->doc, cur, XML_XML_NAMESPACE); in xmlNodeSetBase()
5245 xmlSetNsProp(cur, ns, BAD_CAST "base", fixed); in xmlNodeSetBase()
5248 xmlSetNsProp(cur, ns, BAD_CAST "base", uri); in xmlNodeSetBase()
5271 xmlNodeGetBase(const xmlDoc *doc, const xmlNode *cur) { in xmlNodeGetBase() argument
5275 if ((cur == NULL) && (doc == NULL)) in xmlNodeGetBase()
5277 if ((cur != NULL) && (cur->type == XML_NAMESPACE_DECL)) in xmlNodeGetBase()
5279 if (doc == NULL) doc = cur->doc; in xmlNodeGetBase()
5281 cur = doc->children; in xmlNodeGetBase()
5282 while ((cur != NULL) && (cur->name != NULL)) { in xmlNodeGetBase()
5283 if (cur->type != XML_ELEMENT_NODE) { in xmlNodeGetBase()
5284 cur = cur->next; in xmlNodeGetBase()
5287 if (!xmlStrcasecmp(cur->name, BAD_CAST "html")) { in xmlNodeGetBase()
5288 cur = cur->children; in xmlNodeGetBase()
5291 if (!xmlStrcasecmp(cur->name, BAD_CAST "head")) { in xmlNodeGetBase()
5292 cur = cur->children; in xmlNodeGetBase()
5295 if (!xmlStrcasecmp(cur->name, BAD_CAST "base")) { in xmlNodeGetBase()
5296 return(xmlGetProp(cur, BAD_CAST "href")); in xmlNodeGetBase()
5298 cur = cur->next; in xmlNodeGetBase()
5302 while (cur != NULL) { in xmlNodeGetBase()
5303 if (cur->type == XML_ENTITY_DECL) { in xmlNodeGetBase()
5304 xmlEntityPtr ent = (xmlEntityPtr) cur; in xmlNodeGetBase()
5307 if (cur->type == XML_ELEMENT_NODE) { in xmlNodeGetBase()
5308 base = xmlGetNsProp(cur, BAD_CAST "base", XML_XML_NAMESPACE); in xmlNodeGetBase()
5330 cur = cur->parent; in xmlNodeGetBase()
5356 xmlNodeBufGetContent(xmlBufferPtr buffer, const xmlNode *cur) in xmlNodeBufGetContent() argument
5361 if ((cur == NULL) || (buffer == NULL)) return(-1); in xmlNodeBufGetContent()
5363 ret = xmlBufGetNodeContent(buf, cur); in xmlNodeBufGetContent()
5384 xmlBufGetNodeContent(xmlBufPtr buf, const xmlNode *cur) in xmlBufGetNodeContent() argument
5386 if ((cur == NULL) || (buf == NULL)) return(-1); in xmlBufGetNodeContent()
5387 switch (cur->type) { in xmlBufGetNodeContent()
5390 xmlBufCat(buf, cur->content); in xmlBufGetNodeContent()
5394 const xmlNode *tmp = cur; in xmlBufGetNodeContent()
5418 if (tmp == cur) in xmlBufGetNodeContent()
5430 if (tmp == cur) { in xmlBufGetNodeContent()
5443 xmlAttrPtr attr = (xmlAttrPtr) cur; in xmlBufGetNodeContent()
5457 xmlBufCat(buf, cur->content); in xmlBufGetNodeContent()
5464 ent = xmlGetDocEntity(cur->doc, cur->name); in xmlBufGetNodeContent()
5492 cur = cur->children; in xmlBufGetNodeContent()
5493 while (cur!= NULL) { in xmlBufGetNodeContent()
5494 if ((cur->type == XML_ELEMENT_NODE) || in xmlBufGetNodeContent()
5495 (cur->type == XML_TEXT_NODE) || in xmlBufGetNodeContent()
5496 (cur->type == XML_CDATA_SECTION_NODE)) { in xmlBufGetNodeContent()
5497 xmlBufGetNodeContent(buf, cur); in xmlBufGetNodeContent()
5499 cur = cur->next; in xmlBufGetNodeContent()
5503 xmlBufCat(buf, ((xmlNsPtr) cur)->href); in xmlBufGetNodeContent()
5525 xmlNodeGetContent(const xmlNode *cur) in xmlNodeGetContent() argument
5527 if (cur == NULL) in xmlNodeGetContent()
5529 switch (cur->type) { in xmlNodeGetContent()
5538 xmlBufGetNodeContent(buf, cur); in xmlNodeGetContent()
5544 return(xmlGetPropNodeValueInternal((xmlAttrPtr) cur)); in xmlNodeGetContent()
5547 if (cur->content != NULL) in xmlNodeGetContent()
5548 return (xmlStrdup(cur->content)); in xmlNodeGetContent()
5556 ent = xmlGetDocEntity(cur->doc, cur->name); in xmlNodeGetContent()
5564 xmlBufGetNodeContent(buf, cur); in xmlNodeGetContent()
5589 xmlBufGetNodeContent(buf, (xmlNodePtr) cur); in xmlNodeGetContent()
5598 tmp = xmlStrdup(((xmlNsPtr) cur)->href); in xmlNodeGetContent()
5612 if (cur->content != NULL) in xmlNodeGetContent()
5613 return (xmlStrdup(cur->content)); in xmlNodeGetContent()
5630 xmlNodeSetContent(xmlNodePtr cur, const xmlChar *content) { in xmlNodeSetContent() argument
5631 if (cur == NULL) { in xmlNodeSetContent()
5638 switch (cur->type) { in xmlNodeSetContent()
5642 if (cur->children != NULL) xmlFreeNodeList(cur->children); in xmlNodeSetContent()
5643 cur->children = xmlStringGetNodeList(cur->doc, content); in xmlNodeSetContent()
5644 UPDATE_LAST_CHILD_AND_PARENT(cur) in xmlNodeSetContent()
5652 if ((cur->content != NULL) && in xmlNodeSetContent()
5653 (cur->content != (xmlChar *) &(cur->properties))) { in xmlNodeSetContent()
5654 if (!((cur->doc != NULL) && (cur->doc->dict != NULL) && in xmlNodeSetContent()
5655 (xmlDictOwns(cur->doc->dict, cur->content)))) in xmlNodeSetContent()
5656 xmlFree(cur->content); in xmlNodeSetContent()
5658 if (cur->children != NULL) xmlFreeNodeList(cur->children); in xmlNodeSetContent()
5659 cur->last = cur->children = NULL; in xmlNodeSetContent()
5661 cur->content = xmlStrdup(content); in xmlNodeSetContent()
5663 cur->content = NULL; in xmlNodeSetContent()
5664 cur->properties = NULL; in xmlNodeSetContent()
5665 cur->nsDef = NULL; in xmlNodeSetContent()
5707 xmlNodeSetContentLen(xmlNodePtr cur, const xmlChar *content, int len) { in xmlNodeSetContentLen() argument
5708 if (cur == NULL) { in xmlNodeSetContentLen()
5715 switch (cur->type) { in xmlNodeSetContentLen()
5719 if (cur->children != NULL) xmlFreeNodeList(cur->children); in xmlNodeSetContentLen()
5720 cur->children = xmlStringLenGetNodeList(cur->doc, content, len); in xmlNodeSetContentLen()
5721 UPDATE_LAST_CHILD_AND_PARENT(cur) in xmlNodeSetContentLen()
5730 if ((cur->content != NULL) && in xmlNodeSetContentLen()
5731 (cur->content != (xmlChar *) &(cur->properties))) { in xmlNodeSetContentLen()
5732 if (!((cur->doc != NULL) && (cur->doc->dict != NULL) && in xmlNodeSetContentLen()
5733 (xmlDictOwns(cur->doc->dict, cur->content)))) in xmlNodeSetContentLen()
5734 xmlFree(cur->content); in xmlNodeSetContentLen()
5736 if (cur->children != NULL) xmlFreeNodeList(cur->children); in xmlNodeSetContentLen()
5737 cur->children = cur->last = NULL; in xmlNodeSetContentLen()
5739 cur->content = xmlStrndup(content, len); in xmlNodeSetContentLen()
5741 cur->content = NULL; in xmlNodeSetContentLen()
5742 cur->properties = NULL; in xmlNodeSetContentLen()
5743 cur->nsDef = NULL; in xmlNodeSetContentLen()
5781 xmlNodeAddContentLen(xmlNodePtr cur, const xmlChar *content, int len) { in xmlNodeAddContentLen() argument
5782 if (cur == NULL) { in xmlNodeAddContentLen()
5790 switch (cur->type) { in xmlNodeAddContentLen()
5795 last = cur->last; in xmlNodeAddContentLen()
5798 tmp = xmlAddChild(cur, newNode); in xmlNodeAddContentLen()
5817 if ((cur->content == (xmlChar *) &(cur->properties)) || in xmlNodeAddContentLen()
5818 ((cur->doc != NULL) && (cur->doc->dict != NULL) && in xmlNodeAddContentLen()
5819 xmlDictOwns(cur->doc->dict, cur->content))) { in xmlNodeAddContentLen()
5820 cur->content = xmlStrncatNew(cur->content, content, len); in xmlNodeAddContentLen()
5821 cur->properties = NULL; in xmlNodeAddContentLen()
5822 cur->nsDef = NULL; in xmlNodeAddContentLen()
5825 cur->content = xmlStrncat(cur->content, content, len); in xmlNodeAddContentLen()
5856 xmlNodeAddContent(xmlNodePtr cur, const xmlChar *content) { in xmlNodeAddContent() argument
5859 if (cur == NULL) { in xmlNodeAddContent()
5868 xmlNodeAddContentLen(cur, content, len); in xmlNodeAddContent()
5907 xmlNsPtr cur; in xmlGetNsList() local
5918 cur = node->nsDef; in xmlGetNsList()
5919 while (cur != NULL) { in xmlGetNsList()
5931 if ((cur->prefix == ret[i]->prefix) || in xmlGetNsList()
5932 (xmlStrEqual(cur->prefix, ret[i]->prefix))) in xmlGetNsList()
5947 ret[nbns++] = cur; in xmlGetNsList()
5951 cur = cur->next; in xmlGetNsList()
6011 xmlNsPtr cur; in xmlSearchNs() local
6023 cur = (xmlNsPtr) xmlMalloc(sizeof(xmlNs)); in xmlSearchNs()
6024 if (cur == NULL) { in xmlSearchNs()
6028 memset(cur, 0, sizeof(xmlNs)); in xmlSearchNs()
6029 cur->type = XML_LOCAL_NAMESPACE; in xmlSearchNs()
6030 cur->href = xmlStrdup(XML_XML_NAMESPACE); in xmlSearchNs()
6031 cur->prefix = xmlStrdup((const xmlChar *)"xml"); in xmlSearchNs()
6032 cur->next = node->nsDef; in xmlSearchNs()
6033 node->nsDef = cur; in xmlSearchNs()
6034 return(cur); in xmlSearchNs()
6055 cur = node->nsDef; in xmlSearchNs()
6056 while (cur != NULL) { in xmlSearchNs()
6057 if ((cur->prefix == NULL) && (nameSpace == NULL) && in xmlSearchNs()
6058 (cur->href != NULL)) in xmlSearchNs()
6059 return(cur); in xmlSearchNs()
6060 if ((cur->prefix != NULL) && (nameSpace != NULL) && in xmlSearchNs()
6061 (cur->href != NULL) && in xmlSearchNs()
6062 (xmlStrEqual(cur->prefix, nameSpace))) in xmlSearchNs()
6063 return(cur); in xmlSearchNs()
6064 cur = cur->next; in xmlSearchNs()
6067 cur = node->ns; in xmlSearchNs()
6068 if (cur != NULL) { in xmlSearchNs()
6069 if ((cur->prefix == NULL) && (nameSpace == NULL) && in xmlSearchNs()
6070 (cur->href != NULL)) in xmlSearchNs()
6071 return(cur); in xmlSearchNs()
6072 if ((cur->prefix != NULL) && (nameSpace != NULL) && in xmlSearchNs()
6073 (cur->href != NULL) && in xmlSearchNs()
6074 (xmlStrEqual(cur->prefix, nameSpace))) in xmlSearchNs()
6075 return(cur); in xmlSearchNs()
6140 xmlNsPtr cur; in xmlSearchNsByHref() local
6156 cur = (xmlNsPtr) xmlMalloc(sizeof(xmlNs)); in xmlSearchNsByHref()
6157 if (cur == NULL) { in xmlSearchNsByHref()
6161 memset(cur, 0, sizeof(xmlNs)); in xmlSearchNsByHref()
6162 cur->type = XML_LOCAL_NAMESPACE; in xmlSearchNsByHref()
6163 cur->href = xmlStrdup(XML_XML_NAMESPACE); in xmlSearchNsByHref()
6164 cur->prefix = xmlStrdup((const xmlChar *) "xml"); in xmlSearchNsByHref()
6165 cur->next = node->nsDef; in xmlSearchNsByHref()
6166 node->nsDef = cur; in xmlSearchNsByHref()
6167 return (cur); in xmlSearchNsByHref()
6189 cur = node->nsDef; in xmlSearchNsByHref()
6190 while (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()
6197 cur = cur->next; in xmlSearchNsByHref()
6200 cur = node->ns; in xmlSearchNsByHref()
6201 if (cur != NULL) { in xmlSearchNsByHref()
6202 if ((cur->href != NULL) && (href != NULL) && in xmlSearchNsByHref()
6203 (xmlStrEqual(cur->href, href))) { in xmlSearchNsByHref()
6204 if (((!is_attr) || (cur->prefix != NULL)) && in xmlSearchNsByHref()
6205 (xmlNsInScope(doc, orig, node, cur->prefix) == 1)) in xmlSearchNsByHref()
6206 return (cur); in xmlSearchNsByHref()
6552 xmlNsPtr *nsList, *cur; in xmlGetPropNodeInternal() local
6564 cur = nsList; in xmlGetPropNodeInternal()
6565 while (*cur != NULL) { in xmlGetPropNodeInternal()
6566 if (xmlStrEqual((*cur)->href, nsName)) { in xmlGetPropNodeInternal()
6568 name, (*cur)->prefix); in xmlGetPropNodeInternal()
6573 name, (*cur)->prefix); in xmlGetPropNodeInternal()
6578 cur++; in xmlGetPropNodeInternal()
6951 const xmlChar *cur; in xmlIsBlankNode() local
6958 cur = node->content; in xmlIsBlankNode()
6959 while (*cur != 0) { in xmlIsBlankNode()
6960 if (!IS_BLANK_CH(*cur)) return(0); in xmlIsBlankNode()
6961 cur++; in xmlIsBlankNode()
7637 const char *cur; in xmlBufferCCat() local
7649 for (cur = str;*cur != 0;cur++) { in xmlBufferCCat()
7656 buf->content[buf->use++] = *cur; in xmlBufferCCat()
7706 const xmlChar *cur, *base; in xmlBufferWriteQuotedString() local
7717 base = cur = string; in xmlBufferWriteQuotedString()
7718 while(*cur != 0){ in xmlBufferWriteQuotedString()
7719 if(*cur == '"'){ in xmlBufferWriteQuotedString()
7720 if (base != cur) in xmlBufferWriteQuotedString()
7721 xmlBufferAdd(buf, base, cur - base); in xmlBufferWriteQuotedString()
7723 cur++; in xmlBufferWriteQuotedString()
7724 base = cur; in xmlBufferWriteQuotedString()
7727 cur++; in xmlBufferWriteQuotedString()
7730 if (base != cur) in xmlBufferWriteQuotedString()
7731 xmlBufferAdd(buf, base, cur - base); in xmlBufferWriteQuotedString()
7853 xmlNsMapItemPtr cur, tmp; in xmlDOMWrapNsMapFree() local
7857 cur = nsmap->pool; in xmlDOMWrapNsMapFree()
7858 while (cur != NULL) { in xmlDOMWrapNsMapFree()
7859 tmp = cur; in xmlDOMWrapNsMapFree()
7860 cur = cur->next; in xmlDOMWrapNsMapFree()
7863 cur = nsmap->first; in xmlDOMWrapNsMapFree()
7864 while (cur != NULL) { in xmlDOMWrapNsMapFree()
7865 tmp = cur; in xmlDOMWrapNsMapFree()
7866 cur = cur->next; in xmlDOMWrapNsMapFree()
8084 xmlNodePtr cur; in xmlDOMWrapNSNormGatherInScopeNs() local
8096 cur = node; in xmlDOMWrapNSNormGatherInScopeNs()
8097 while ((cur != NULL) && (cur != (xmlNodePtr) cur->doc)) { in xmlDOMWrapNSNormGatherInScopeNs()
8098 if (cur->type == XML_ELEMENT_NODE) { in xmlDOMWrapNSNormGatherInScopeNs()
8099 if (cur->nsDef != NULL) { in xmlDOMWrapNSNormGatherInScopeNs()
8100 ns = cur->nsDef; in xmlDOMWrapNSNormGatherInScopeNs()
8128 cur = cur->parent; in xmlDOMWrapNSNormGatherInScopeNs()
8158 xmlDictOwns(sourceDoc->dict, cur->content)) { \
8160 cur->content = (xmlChar *) \
8161 xmlDictLookup(destDoc->dict, cur->content, -1); \
8163 cur->content = xmlStrdup(BAD_CAST cur->content); \
8355 xmlNodePtr cur, prev = NULL, out = NULL; in xmlSearchNsByNamespaceStrict() local
8370 cur = node; in xmlSearchNsByNamespaceStrict()
8372 if (cur->type == XML_ELEMENT_NODE) { in xmlSearchNsByNamespaceStrict()
8373 if (cur->nsDef != NULL) { in xmlSearchNsByNamespaceStrict()
8374 for (ns = cur->nsDef; ns != NULL; ns = ns->next) { in xmlSearchNsByNamespaceStrict()
8429 prev = cur; in xmlSearchNsByNamespaceStrict()
8431 } else if ((cur->type == XML_ENTITY_NODE) || in xmlSearchNsByNamespaceStrict()
8432 (cur->type == XML_ENTITY_DECL)) in xmlSearchNsByNamespaceStrict()
8434 cur = cur->parent; in xmlSearchNsByNamespaceStrict()
8435 } while ((cur != NULL) && (cur->doc != (xmlDocPtr) cur)); in xmlSearchNsByNamespaceStrict()
8457 xmlNodePtr cur; in xmlSearchNsByPrefixStrict() local
8473 cur = node; in xmlSearchNsByPrefixStrict()
8475 if (cur->type == XML_ELEMENT_NODE) { in xmlSearchNsByPrefixStrict()
8476 if (cur->nsDef != NULL) { in xmlSearchNsByPrefixStrict()
8477 ns = cur->nsDef; in xmlSearchNsByPrefixStrict()
8494 } else if ((cur->type == XML_ENTITY_NODE) || in xmlSearchNsByPrefixStrict()
8495 (cur->type == XML_ENTITY_DECL)) in xmlSearchNsByPrefixStrict()
8497 cur = cur->parent; in xmlSearchNsByPrefixStrict()
8498 } while ((cur != NULL) && (cur->doc != (xmlDocPtr) cur)); in xmlSearchNsByPrefixStrict()
8746 xmlNodePtr cur, curElem = NULL; in xmlDOMWrapReconcileNamespaces() local
8761 cur = elem; in xmlDOMWrapReconcileNamespaces()
8763 switch (cur->type) { in xmlDOMWrapReconcileNamespaces()
8766 curElem = cur; in xmlDOMWrapReconcileNamespaces()
8771 if (cur->nsDef != NULL) { in xmlDOMWrapReconcileNamespaces()
8773 ns = cur->nsDef; in xmlDOMWrapReconcileNamespaces()
8813 cur->nsDef = ns->next; in xmlDOMWrapReconcileNamespaces()
8823 if ((cur->ns != NULL) && adoptns && (cur->ns == ns)) in xmlDOMWrapReconcileNamespaces()
8856 if (cur->ns == NULL) in xmlDOMWrapReconcileNamespaces()
8873 if (cur->ns == listRedund[j]) { in xmlDOMWrapReconcileNamespaces()
8874 cur->ns = listRedund[++j]; in xmlDOMWrapReconcileNamespaces()
8888 (cur->ns == mi->oldNs)) { in xmlDOMWrapReconcileNamespaces()
8890 cur->ns = mi->newNs; in xmlDOMWrapReconcileNamespaces()
8899 cur->ns, &ns, in xmlDOMWrapReconcileNamespaces()
8902 (cur->type == XML_ATTRIBUTE_NODE) ? 1 : 0) == -1) in xmlDOMWrapReconcileNamespaces()
8904 cur->ns = ns; in xmlDOMWrapReconcileNamespaces()
8907 if ((cur->type == XML_ELEMENT_NODE) && in xmlDOMWrapReconcileNamespaces()
8908 (cur->properties != NULL)) { in xmlDOMWrapReconcileNamespaces()
8912 cur = (xmlNodePtr) cur->properties; in xmlDOMWrapReconcileNamespaces()
8920 if ((cur->type == XML_ELEMENT_NODE) && in xmlDOMWrapReconcileNamespaces()
8921 (cur->children != NULL)) { in xmlDOMWrapReconcileNamespaces()
8925 cur = cur->children; in xmlDOMWrapReconcileNamespaces()
8929 if (cur == elem) in xmlDOMWrapReconcileNamespaces()
8931 if (cur->type == XML_ELEMENT_NODE) { in xmlDOMWrapReconcileNamespaces()
8951 if (cur->next != NULL) in xmlDOMWrapReconcileNamespaces()
8952 cur = cur->next; in xmlDOMWrapReconcileNamespaces()
8954 if (cur->type == XML_ATTRIBUTE_NODE) { in xmlDOMWrapReconcileNamespaces()
8955 cur = cur->parent; in xmlDOMWrapReconcileNamespaces()
8958 cur = cur->parent; in xmlDOMWrapReconcileNamespaces()
8961 } while (cur != NULL); in xmlDOMWrapReconcileNamespaces()
9010 xmlNodePtr cur, curElem = NULL; in xmlDOMWrapAdoptBranch() local
9047 cur = node; in xmlDOMWrapAdoptBranch()
9048 if ((cur != NULL) && (cur->type == XML_NAMESPACE_DECL)) in xmlDOMWrapAdoptBranch()
9051 while (cur != NULL) { in xmlDOMWrapAdoptBranch()
9055 if (cur->doc != sourceDoc) { in xmlDOMWrapAdoptBranch()
9062 if (cur->next == NULL) in xmlDOMWrapAdoptBranch()
9065 cur = cur->next; in xmlDOMWrapAdoptBranch()
9066 if ((cur->type == XML_XINCLUDE_END) || in xmlDOMWrapAdoptBranch()
9067 (cur->doc == node->doc)) in xmlDOMWrapAdoptBranch()
9069 } while (cur->next != NULL); in xmlDOMWrapAdoptBranch()
9071 if (cur->doc != node->doc) in xmlDOMWrapAdoptBranch()
9074 cur->doc = destDoc; in xmlDOMWrapAdoptBranch()
9075 switch (cur->type) { in xmlDOMWrapAdoptBranch()
9083 curElem = cur; in xmlDOMWrapAdoptBranch()
9093 if ((cur->nsDef) && in xmlDOMWrapAdoptBranch()
9105 for (ns = cur->nsDef; ns != NULL; ns = ns->next) { in xmlDOMWrapAdoptBranch()
9137 if (cur->ns == NULL) in xmlDOMWrapAdoptBranch()
9155 (cur->ns == mi->oldNs)) { in xmlDOMWrapAdoptBranch()
9157 cur->ns = mi->newNs; in xmlDOMWrapAdoptBranch()
9169 ns = ctxt->getNsForNodeFunc(ctxt, cur, in xmlDOMWrapAdoptBranch()
9170 cur->ns->href, cur->ns->prefix); in xmlDOMWrapAdoptBranch()
9176 cur->ns, ns, XML_TREE_NSMAP_CUSTOM) == NULL) in xmlDOMWrapAdoptBranch()
9178 cur->ns = ns; in xmlDOMWrapAdoptBranch()
9186 cur->ns, &ns, in xmlDOMWrapAdoptBranch()
9190 (cur->type == XML_ATTRIBUTE_NODE) ? 1 : 0) == -1) in xmlDOMWrapAdoptBranch()
9192 cur->ns = ns; in xmlDOMWrapAdoptBranch()
9199 XML_TREE_ADOPT_STR(cur->name) in xmlDOMWrapAdoptBranch()
9200 if (cur->type == XML_ELEMENT_NODE) { in xmlDOMWrapAdoptBranch()
9201 cur->psvi = NULL; in xmlDOMWrapAdoptBranch()
9202 cur->line = 0; in xmlDOMWrapAdoptBranch()
9203 cur->extra = 0; in xmlDOMWrapAdoptBranch()
9207 if (cur->properties != NULL) { in xmlDOMWrapAdoptBranch()
9211 cur = (xmlNodePtr) cur->properties; in xmlDOMWrapAdoptBranch()
9219 (((xmlAttrPtr) cur)->atype == XML_ATTRIBUTE_ID)) in xmlDOMWrapAdoptBranch()
9221 xmlRemoveID(sourceDoc, (xmlAttrPtr) cur); in xmlDOMWrapAdoptBranch()
9223 ((xmlAttrPtr) cur)->atype = 0; in xmlDOMWrapAdoptBranch()
9224 ((xmlAttrPtr) cur)->psvi = NULL; in xmlDOMWrapAdoptBranch()
9233 XML_TREE_ADOPT_STR_2(cur->content) in xmlDOMWrapAdoptBranch()
9239 cur->content = NULL; in xmlDOMWrapAdoptBranch()
9240 cur->children = NULL; in xmlDOMWrapAdoptBranch()
9241 cur->last = NULL; in xmlDOMWrapAdoptBranch()
9247 ent = xmlGetDocEntity(destDoc, cur->name); in xmlDOMWrapAdoptBranch()
9249 cur->content = ent->content; in xmlDOMWrapAdoptBranch()
9250 cur->children = (xmlNodePtr) ent; in xmlDOMWrapAdoptBranch()
9251 cur->last = (xmlNodePtr) ent; in xmlDOMWrapAdoptBranch()
9256 XML_TREE_ADOPT_STR(cur->name) in xmlDOMWrapAdoptBranch()
9257 XML_TREE_ADOPT_STR_2(cur->content) in xmlDOMWrapAdoptBranch()
9267 if (cur->children != NULL) { in xmlDOMWrapAdoptBranch()
9268 cur = cur->children; in xmlDOMWrapAdoptBranch()
9273 if (cur == node) in xmlDOMWrapAdoptBranch()
9275 if ((cur->type == XML_ELEMENT_NODE) || in xmlDOMWrapAdoptBranch()
9276 (cur->type == XML_XINCLUDE_START) || in xmlDOMWrapAdoptBranch()
9277 (cur->type == XML_XINCLUDE_END)) in xmlDOMWrapAdoptBranch()
9301 if (cur->next != NULL) in xmlDOMWrapAdoptBranch()
9302 cur = cur->next; in xmlDOMWrapAdoptBranch()
9303 else if ((cur->type == XML_ATTRIBUTE_NODE) && in xmlDOMWrapAdoptBranch()
9304 (cur->parent->children != NULL)) in xmlDOMWrapAdoptBranch()
9306 cur = cur->parent->children; in xmlDOMWrapAdoptBranch()
9308 cur = cur->parent; in xmlDOMWrapAdoptBranch()
9380 xmlNodePtr cur, curElem = NULL; in xmlDOMWrapCloneNode() local
9429 cur = node; in xmlDOMWrapCloneNode()
9430 if ((cur != NULL) && (cur->type == XML_NAMESPACE_DECL)) in xmlDOMWrapCloneNode()
9433 while (cur != NULL) { in xmlDOMWrapCloneNode()
9434 if (cur->doc != sourceDoc) { in xmlDOMWrapCloneNode()
9445 switch (cur->type) { in xmlDOMWrapCloneNode()
9515 clone->type = cur->type; in xmlDOMWrapCloneNode()
9521 if (cur->name == xmlStringText) in xmlDOMWrapCloneNode()
9523 else if (cur->name == xmlStringTextNoenc) in xmlDOMWrapCloneNode()
9530 else if (cur->name == xmlStringComment) in xmlDOMWrapCloneNode()
9532 else if (cur->name != NULL) { in xmlDOMWrapCloneNode()
9533 DICT_CONST_COPY(cur->name, clone->name); in xmlDOMWrapCloneNode()
9536 switch (cur->type) { in xmlDOMWrapCloneNode()
9544 curElem = cur; in xmlDOMWrapCloneNode()
9549 if (cur->nsDef != NULL) { in xmlDOMWrapCloneNode()
9565 for (ns = cur->nsDef; ns != NULL; ns = ns->next) { in xmlDOMWrapCloneNode()
9632 DICT_COPY(cur->content, clone->content); in xmlDOMWrapCloneNode()
9644 ent = xmlGetDocEntity(destDoc, cur->name); in xmlDOMWrapCloneNode()
9656 clone->content = cur->content; in xmlDOMWrapCloneNode()
9657 clone->children = cur->children; in xmlDOMWrapCloneNode()
9658 clone->last = cur->last; in xmlDOMWrapCloneNode()
9662 DICT_COPY(cur->content, clone->content); in xmlDOMWrapCloneNode()
9665 DICT_COPY(cur->content, clone->content); in xmlDOMWrapCloneNode()
9671 if (cur->ns == NULL) in xmlDOMWrapCloneNode()
9696 (cur->ns == mi->oldNs)) { in xmlDOMWrapCloneNode()
9712 ns = ctxt->getNsForNodeFunc(ctxt, cur, in xmlDOMWrapCloneNode()
9713 cur->ns->href, cur->ns->prefix); in xmlDOMWrapCloneNode()
9718 cur->ns, ns, XML_TREE_NSMAP_CUSTOM) == NULL) in xmlDOMWrapCloneNode()
9728 cur->ns, &ns, in xmlDOMWrapCloneNode()
9733 (cur->type == XML_ATTRIBUTE_NODE) ? 1 : 0) == -1) in xmlDOMWrapCloneNode()
9752 idVal = xmlNodeListGetString(cur->doc, cur->children, 1); in xmlDOMWrapCloneNode()
9754 if (xmlAddID(NULL, destDoc, idVal, (xmlAttrPtr) cur) == NULL) { in xmlDOMWrapCloneNode()
9770 if ((cur->type == XML_ELEMENT_NODE) && (cur->properties != NULL)) { in xmlDOMWrapCloneNode()
9773 cur = (xmlNodePtr) cur->properties; in xmlDOMWrapCloneNode()
9780 if (cur->children != NULL) { in xmlDOMWrapCloneNode()
9781 if (deep || (cur->type == XML_ATTRIBUTE_NODE)) { in xmlDOMWrapCloneNode()
9784 cur = cur->children; in xmlDOMWrapCloneNode()
9794 if (cur == node) in xmlDOMWrapCloneNode()
9796 if ((cur->type == XML_ELEMENT_NODE) || in xmlDOMWrapCloneNode()
9797 (cur->type == XML_XINCLUDE_START) || in xmlDOMWrapCloneNode()
9798 (cur->type == XML_XINCLUDE_END)) { in xmlDOMWrapCloneNode()
9821 if (cur->next != NULL) { in xmlDOMWrapCloneNode()
9823 cur = cur->next; in xmlDOMWrapCloneNode()
9824 } else if (cur->type != XML_ATTRIBUTE_NODE) { in xmlDOMWrapCloneNode()
9836 cur = cur->parent; in xmlDOMWrapCloneNode()
9845 cur = cur->parent; in xmlDOMWrapCloneNode()
9904 xmlNodePtr cur; in xmlDOMWrapAdoptAttr() local
9950 cur = attr->children; in xmlDOMWrapAdoptAttr()
9951 if ((cur != NULL) && (cur->type == XML_NAMESPACE_DECL)) in xmlDOMWrapAdoptAttr()
9953 while (cur != NULL) { in xmlDOMWrapAdoptAttr()
9954 cur->doc = destDoc; in xmlDOMWrapAdoptAttr()
9955 switch (cur->type) { in xmlDOMWrapAdoptAttr()
9958 XML_TREE_ADOPT_STR_2(cur->content) in xmlDOMWrapAdoptAttr()
9964 cur->content = NULL; in xmlDOMWrapAdoptAttr()
9965 cur->children = NULL; in xmlDOMWrapAdoptAttr()
9966 cur->last = NULL; in xmlDOMWrapAdoptAttr()
9972 ent = xmlGetDocEntity(destDoc, cur->name); in xmlDOMWrapAdoptAttr()
9974 cur->content = ent->content; in xmlDOMWrapAdoptAttr()
9975 cur->children = (xmlNodePtr) ent; in xmlDOMWrapAdoptAttr()
9976 cur->last = (xmlNodePtr) ent; in xmlDOMWrapAdoptAttr()
9983 if (cur->children != NULL) { in xmlDOMWrapAdoptAttr()
9984 cur = cur->children; in xmlDOMWrapAdoptAttr()
9988 if (cur == (xmlNodePtr) attr) in xmlDOMWrapAdoptAttr()
9990 if (cur->next != NULL) in xmlDOMWrapAdoptAttr()
9991 cur = cur->next; in xmlDOMWrapAdoptAttr()
9993 cur = cur->parent; in xmlDOMWrapAdoptAttr()
10083 xmlNodePtr cur = node; in xmlDOMWrapAdoptNode() local
10086 cur->doc = destDoc; in xmlDOMWrapAdoptNode()