• Home
  • Raw
  • Download

Lines Matching refs:ctxt

94 xmlXIncludeDoProcess(xmlXIncludeCtxtPtr ctxt, xmlDocPtr doc, xmlNodePtr tree,
111 xmlXIncludeErrMemory(xmlXIncludeCtxtPtr ctxt, xmlNodePtr node, in xmlXIncludeErrMemory() argument
114 if (ctxt != NULL) in xmlXIncludeErrMemory()
115 ctxt->nbErrors++; in xmlXIncludeErrMemory()
116 __xmlRaiseError(NULL, NULL, NULL, ctxt, node, XML_FROM_XINCLUDE, in xmlXIncludeErrMemory()
132 xmlXIncludeErr(xmlXIncludeCtxtPtr ctxt, xmlNodePtr node, int error, in xmlXIncludeErr() argument
135 if (ctxt != NULL) in xmlXIncludeErr()
136 ctxt->nbErrors++; in xmlXIncludeErr()
137 __xmlRaiseError(NULL, NULL, NULL, ctxt, node, XML_FROM_XINCLUDE, in xmlXIncludeErr()
154 xmlXIncludeWarn(xmlXIncludeCtxtPtr ctxt, xmlNodePtr node, int error,
157 __xmlRaiseError(NULL, NULL, NULL, ctxt, node, XML_FROM_XINCLUDE,
175 xmlXIncludeGetProp(xmlXIncludeCtxtPtr ctxt, xmlNodePtr cur, in xmlXIncludeGetProp() argument
182 if (ctxt->legacy != 0) { in xmlXIncludeGetProp()
226 xmlXIncludeNewRef(xmlXIncludeCtxtPtr ctxt, const xmlChar *URI, in xmlXIncludeNewRef() argument
235 xmlXIncludeErrMemory(ctxt, ref, "growing XInclude context"); in xmlXIncludeNewRef()
249 if (ctxt->incMax == 0) { in xmlXIncludeNewRef()
250 ctxt->incMax = 4; in xmlXIncludeNewRef()
251 ctxt->incTab = (xmlXIncludeRefPtr *) xmlMalloc(ctxt->incMax * in xmlXIncludeNewRef()
252 sizeof(ctxt->incTab[0])); in xmlXIncludeNewRef()
253 if (ctxt->incTab == NULL) { in xmlXIncludeNewRef()
254 xmlXIncludeErrMemory(ctxt, ref, "growing XInclude context"); in xmlXIncludeNewRef()
259 if (ctxt->incNr >= ctxt->incMax) { in xmlXIncludeNewRef()
260 ctxt->incMax *= 2; in xmlXIncludeNewRef()
261 ctxt->incTab = (xmlXIncludeRefPtr *) xmlRealloc(ctxt->incTab, in xmlXIncludeNewRef()
262 ctxt->incMax * sizeof(ctxt->incTab[0])); in xmlXIncludeNewRef()
263 if (ctxt->incTab == NULL) { in xmlXIncludeNewRef()
264 xmlXIncludeErrMemory(ctxt, ref, "growing XInclude context"); in xmlXIncludeNewRef()
269 ctxt->incTab[ctxt->incNr++] = ret; in xmlXIncludeNewRef()
316 xmlXIncludeURLPush(xmlXIncludeCtxtPtr ctxt, in xmlXIncludeURLPush() argument
319 if (ctxt->urlNr > XINCLUDE_MAX_DEPTH) { in xmlXIncludeURLPush()
320 xmlXIncludeErr(ctxt, NULL, XML_XINCLUDE_RECURSION, in xmlXIncludeURLPush()
324 if (ctxt->urlTab == NULL) { in xmlXIncludeURLPush()
325 ctxt->urlMax = 4; in xmlXIncludeURLPush()
326 ctxt->urlNr = 0; in xmlXIncludeURLPush()
327 ctxt->urlTab = (xmlChar * *) xmlMalloc( in xmlXIncludeURLPush()
328 ctxt->urlMax * sizeof(ctxt->urlTab[0])); in xmlXIncludeURLPush()
329 if (ctxt->urlTab == NULL) { in xmlXIncludeURLPush()
330 xmlXIncludeErrMemory(ctxt, NULL, "adding URL"); in xmlXIncludeURLPush()
334 if (ctxt->urlNr >= ctxt->urlMax) { in xmlXIncludeURLPush()
335 ctxt->urlMax *= 2; in xmlXIncludeURLPush()
336 ctxt->urlTab = in xmlXIncludeURLPush()
337 (xmlChar * *) xmlRealloc(ctxt->urlTab, in xmlXIncludeURLPush()
338 ctxt->urlMax * in xmlXIncludeURLPush()
339 sizeof(ctxt->urlTab[0])); in xmlXIncludeURLPush()
340 if (ctxt->urlTab == NULL) { in xmlXIncludeURLPush()
341 xmlXIncludeErrMemory(ctxt, NULL, "adding URL"); in xmlXIncludeURLPush()
345 ctxt->url = ctxt->urlTab[ctxt->urlNr] = xmlStrdup(value); in xmlXIncludeURLPush()
346 return (ctxt->urlNr++); in xmlXIncludeURLPush()
356 xmlXIncludeURLPop(xmlXIncludeCtxtPtr ctxt) in xmlXIncludeURLPop() argument
360 if (ctxt->urlNr <= 0) in xmlXIncludeURLPop()
362 ctxt->urlNr--; in xmlXIncludeURLPop()
363 if (ctxt->urlNr > 0) in xmlXIncludeURLPop()
364 ctxt->url = ctxt->urlTab[ctxt->urlNr - 1]; in xmlXIncludeURLPop()
366 ctxt->url = NULL; in xmlXIncludeURLPop()
367 ret = ctxt->urlTab[ctxt->urlNr]; in xmlXIncludeURLPop()
368 ctxt->urlTab[ctxt->urlNr] = NULL; in xmlXIncludeURLPop()
380 xmlXIncludeFreeContext(xmlXIncludeCtxtPtr ctxt) { in xmlXIncludeFreeContext() argument
386 if (ctxt == NULL) in xmlXIncludeFreeContext()
388 while (ctxt->urlNr > 0) in xmlXIncludeFreeContext()
389 xmlXIncludeURLPop(ctxt); in xmlXIncludeFreeContext()
390 if (ctxt->urlTab != NULL) in xmlXIncludeFreeContext()
391 xmlFree(ctxt->urlTab); in xmlXIncludeFreeContext()
392 for (i = 0;i < ctxt->incNr;i++) { in xmlXIncludeFreeContext()
393 if (ctxt->incTab[i] != NULL) in xmlXIncludeFreeContext()
394 xmlXIncludeFreeRef(ctxt->incTab[i]); in xmlXIncludeFreeContext()
396 if (ctxt->incTab != NULL) in xmlXIncludeFreeContext()
397 xmlFree(ctxt->incTab); in xmlXIncludeFreeContext()
398 if (ctxt->txtTab != NULL) { in xmlXIncludeFreeContext()
399 for (i = 0;i < ctxt->txtNr;i++) { in xmlXIncludeFreeContext()
400 if (ctxt->txtTab[i] != NULL) in xmlXIncludeFreeContext()
401 xmlFree(ctxt->txtTab[i]); in xmlXIncludeFreeContext()
403 xmlFree(ctxt->txtTab); in xmlXIncludeFreeContext()
405 if (ctxt->txturlTab != NULL) { in xmlXIncludeFreeContext()
406 for (i = 0;i < ctxt->txtNr;i++) { in xmlXIncludeFreeContext()
407 if (ctxt->txturlTab[i] != NULL) in xmlXIncludeFreeContext()
408 xmlFree(ctxt->txturlTab[i]); in xmlXIncludeFreeContext()
410 xmlFree(ctxt->txturlTab); in xmlXIncludeFreeContext()
412 if (ctxt->base != NULL) { in xmlXIncludeFreeContext()
413 xmlFree(ctxt->base); in xmlXIncludeFreeContext()
415 xmlFree(ctxt); in xmlXIncludeFreeContext()
426 xmlXIncludeParseFile(xmlXIncludeCtxtPtr ctxt, const char *URL) { in xmlXIncludeParseFile() argument
435 xmlXIncludeErrMemory(ctxt, NULL, "cannot allocate parser context"); in xmlXIncludeParseFile()
442 pctxt->_private = ctxt->_private; in xmlXIncludeParseFile()
448 if ((ctxt->doc != NULL) && (ctxt->doc->dict != NULL)) { in xmlXIncludeParseFile()
451 pctxt->dict = ctxt->doc->dict; in xmlXIncludeParseFile()
455 xmlCtxtUseOptions(pctxt, ctxt->parseFlags | XML_PARSE_DTDLOAD); in xmlXIncludeParseFile()
498 xmlXIncludeAddNode(xmlXIncludeCtxtPtr ctxt, xmlNodePtr cur) { in xmlXIncludeAddNode() argument
511 if (ctxt == NULL) in xmlXIncludeAddNode()
522 href = xmlXIncludeGetProp(ctxt, cur, XINCLUDE_HREF); in xmlXIncludeAddNode()
530 parse = xmlXIncludeGetProp(ctxt, cur, XINCLUDE_PARSE); in xmlXIncludeAddNode()
537 xmlXIncludeErr(ctxt, cur, XML_XINCLUDE_PARSE_VALUE, in xmlXIncludeAddNode()
550 base = xmlNodeGetBase(ctxt->doc, cur); in xmlXIncludeAddNode()
552 URI = xmlBuildURI(href, ctxt->doc->URL); in xmlXIncludeAddNode()
577 xmlXIncludeErr(ctxt, cur, XML_XINCLUDE_HREF_URI, in xmlXIncludeAddNode()
581 fragment = xmlXIncludeGetProp(ctxt, cur, XINCLUDE_PARSE_XPOINTER); in xmlXIncludeAddNode()
588 xmlXIncludeErr(ctxt, cur, XML_XINCLUDE_HREF_URI, in xmlXIncludeAddNode()
597 if (ctxt->legacy != 0) { in xmlXIncludeAddNode()
604 xmlXIncludeErr(ctxt, cur, XML_XINCLUDE_FRAGMENT_ID, in xmlXIncludeAddNode()
619 xmlXIncludeErr(ctxt, cur, XML_XINCLUDE_HREF_URI, in xmlXIncludeAddNode()
631 xmlXIncludeErr(ctxt, cur, XML_XINCLUDE_RECURSION, in xmlXIncludeAddNode()
643 for (i = 0;i < ctxt->urlNr;i++) { in xmlXIncludeAddNode()
644 if (xmlStrEqual(URL, ctxt->urlTab[i])) { in xmlXIncludeAddNode()
645 xmlXIncludeErr(ctxt, cur, XML_XINCLUDE_RECURSION, in xmlXIncludeAddNode()
654 ref = xmlXIncludeNewRef(ctxt, URL, cur); in xmlXIncludeAddNode()
675 xmlXIncludeRecurseDoc(xmlXIncludeCtxtPtr ctxt, xmlDocPtr doc, in xmlXIncludeRecurseDoc() argument
700 newctxt->_private = ctxt->_private; in xmlXIncludeRecurseDoc()
704 newctxt->incMax = ctxt->incMax; in xmlXIncludeRecurseDoc()
705 newctxt->incNr = ctxt->incNr; in xmlXIncludeRecurseDoc()
709 xmlXIncludeErrMemory(ctxt, (xmlNodePtr) doc, "processing doc"); in xmlXIncludeRecurseDoc()
716 newctxt->urlMax = ctxt->urlMax; in xmlXIncludeRecurseDoc()
717 newctxt->urlNr = ctxt->urlNr; in xmlXIncludeRecurseDoc()
718 newctxt->urlTab = ctxt->urlTab; in xmlXIncludeRecurseDoc()
723 newctxt->base = xmlStrdup(ctxt->base); in xmlXIncludeRecurseDoc()
728 newctxt->incBase = ctxt->incNr; in xmlXIncludeRecurseDoc()
729 for (i = 0;i < ctxt->incNr;i++) { in xmlXIncludeRecurseDoc()
730 newctxt->incTab[i] = ctxt->incTab[i]; in xmlXIncludeRecurseDoc()
738 newctxt->parseFlags = ctxt->parseFlags; in xmlXIncludeRecurseDoc()
739 newctxt->incTotal = ctxt->incTotal; in xmlXIncludeRecurseDoc()
741 ctxt->incTotal = newctxt->incTotal; in xmlXIncludeRecurseDoc()
742 for (i = 0;i < ctxt->incNr;i++) { in xmlXIncludeRecurseDoc()
748 ctxt->urlTab = newctxt->urlTab; in xmlXIncludeRecurseDoc()
749 ctxt->urlMax = newctxt->urlMax; in xmlXIncludeRecurseDoc()
771 xmlXIncludeAddTxt(xmlXIncludeCtxtPtr ctxt, const xmlChar *txt, in xmlXIncludeAddTxt() argument
776 if (ctxt->txtMax == 0) { in xmlXIncludeAddTxt()
777 ctxt->txtMax = 4; in xmlXIncludeAddTxt()
778 ctxt->txtTab = (xmlChar **) xmlMalloc(ctxt->txtMax * in xmlXIncludeAddTxt()
779 sizeof(ctxt->txtTab[0])); in xmlXIncludeAddTxt()
780 if (ctxt->txtTab == NULL) { in xmlXIncludeAddTxt()
781 xmlXIncludeErrMemory(ctxt, NULL, "processing text"); in xmlXIncludeAddTxt()
784 ctxt->txturlTab = (xmlURL *) xmlMalloc(ctxt->txtMax * in xmlXIncludeAddTxt()
785 sizeof(ctxt->txturlTab[0])); in xmlXIncludeAddTxt()
786 if (ctxt->txturlTab == NULL) { in xmlXIncludeAddTxt()
787 xmlXIncludeErrMemory(ctxt, NULL, "processing text"); in xmlXIncludeAddTxt()
791 if (ctxt->txtNr >= ctxt->txtMax) { in xmlXIncludeAddTxt()
792 ctxt->txtMax *= 2; in xmlXIncludeAddTxt()
793 ctxt->txtTab = (xmlChar **) xmlRealloc(ctxt->txtTab, in xmlXIncludeAddTxt()
794 ctxt->txtMax * sizeof(ctxt->txtTab[0])); in xmlXIncludeAddTxt()
795 if (ctxt->txtTab == NULL) { in xmlXIncludeAddTxt()
796 xmlXIncludeErrMemory(ctxt, NULL, "processing text"); in xmlXIncludeAddTxt()
799 ctxt->txturlTab = (xmlURL *) xmlRealloc(ctxt->txturlTab, in xmlXIncludeAddTxt()
800 ctxt->txtMax * sizeof(ctxt->txturlTab[0])); in xmlXIncludeAddTxt()
801 if (ctxt->txturlTab == NULL) { in xmlXIncludeAddTxt()
802 xmlXIncludeErrMemory(ctxt, NULL, "processing text"); in xmlXIncludeAddTxt()
806 ctxt->txtTab[ctxt->txtNr] = xmlStrdup(txt); in xmlXIncludeAddTxt()
807 ctxt->txturlTab[ctxt->txtNr] = xmlStrdup(url); in xmlXIncludeAddTxt()
808 ctxt->txtNr++; in xmlXIncludeAddTxt()
818 xmlXIncludeCopyNodeList(xmlXIncludeCtxtPtr ctxt, xmlDocPtr target,
832 xmlXIncludeCopyNode(xmlXIncludeCtxtPtr ctxt, xmlDocPtr target, in xmlXIncludeCopyNode() argument
836 if ((ctxt == NULL) || (target == NULL) || (source == NULL) || in xmlXIncludeCopyNode()
842 result = xmlXIncludeCopyNodeList(ctxt, target, source, elem->children); in xmlXIncludeCopyNode()
859 xmlXIncludeCopyNodeList(xmlXIncludeCtxtPtr ctxt, xmlDocPtr target, in xmlXIncludeCopyNodeList() argument
863 if ((ctxt == NULL) || (target == NULL) || (source == NULL) || in xmlXIncludeCopyNodeList()
868 res = xmlXIncludeCopyNode(ctxt, target, source, cur); in xmlXIncludeCopyNodeList()
924 xmlXIncludeCopyRange(xmlXIncludeCtxtPtr ctxt, xmlDocPtr target, in xmlXIncludeCopyRange() argument
934 if ((ctxt == NULL) || (target == NULL) || (source == NULL) || in xmlXIncludeCopyRange()
1137 xmlXIncludeCopyXPointer(xmlXIncludeCtxtPtr ctxt, xmlDocPtr target, in xmlXIncludeCopyXPointer() argument
1143 source = ctxt->doc; in xmlXIncludeCopyXPointer()
1144 if ((ctxt == NULL) || (target == NULL) || (source == NULL) || in xmlXIncludeCopyXPointer()
1183 tmp = xmlXIncludeCopyNode(ctxt, target, in xmlXIncludeCopyXPointer()
1211 list = last = xmlXIncludeCopyNode(ctxt, target, source, in xmlXIncludeCopyXPointer()
1215 xmlXIncludeCopyNode(ctxt, target, source, in xmlXIncludeCopyXPointer()
1230 list = last = xmlXIncludeCopyXPointer(ctxt, target, source, in xmlXIncludeCopyXPointer()
1234 xmlXIncludeCopyXPointer(ctxt, target, source, in xmlXIncludeCopyXPointer()
1244 return(xmlXIncludeCopyRange(ctxt, target, source, obj)); in xmlXIncludeCopyXPointer()
1264 xmlXIncludeCtxtPtr ctxt; member
1282 xmlXIncludeCtxtPtr ctxt; in xmlXIncludeMergeEntity() local
1286 ctxt = data->ctxt; in xmlXIncludeMergeEntity()
1288 if ((ctxt == NULL) || (doc == NULL)) in xmlXIncludeMergeEntity()
1339 xmlXIncludeErr(ctxt, (xmlNodePtr) ent, XML_XINCLUDE_ENTITY_DEF_MISMATCH, in xmlXIncludeMergeEntity()
1355 xmlXIncludeMergeEntities(xmlXIncludeCtxtPtr ctxt, xmlDocPtr doc, in xmlXIncludeMergeEntities() argument
1360 if (ctxt == NULL) in xmlXIncludeMergeEntities()
1380 data.ctxt = ctxt; in xmlXIncludeMergeEntities()
1390 data.ctxt = ctxt; in xmlXIncludeMergeEntities()
1416 xmlXIncludeLoadDoc(xmlXIncludeCtxtPtr ctxt, const xmlChar *url, int nr) { in xmlXIncludeLoadDoc() argument
1434 xmlXIncludeErr(ctxt, ctxt->incTab[nr]->ref, in xmlXIncludeLoadDoc()
1443 if ((ctxt->incTab != NULL) && (ctxt->incTab[nr] != NULL) && in xmlXIncludeLoadDoc()
1444 (ctxt->incTab[nr]->fragment != NULL)) { in xmlXIncludeLoadDoc()
1446 fragment = xmlStrdup(ctxt->incTab[nr]->fragment); in xmlXIncludeLoadDoc()
1451 if (ctxt->incTab != NULL) in xmlXIncludeLoadDoc()
1452 xmlXIncludeErr(ctxt, ctxt->incTab[nr]->ref, in xmlXIncludeLoadDoc()
1456 xmlXIncludeErr(ctxt, NULL, in xmlXIncludeLoadDoc()
1469 ((ctxt->doc != NULL) && (xmlStrEqual(URL, ctxt->doc->URL)))) { in xmlXIncludeLoadDoc()
1470 doc = ctxt->doc; in xmlXIncludeLoadDoc()
1477 for (i = 0; i < ctxt->incNr; i++) { in xmlXIncludeLoadDoc()
1478 if ((xmlStrEqual(URL, ctxt->incTab[i]->URI)) && in xmlXIncludeLoadDoc()
1479 (ctxt->incTab[i]->doc != NULL)) { in xmlXIncludeLoadDoc()
1480 doc = ctxt->incTab[i]->doc; in xmlXIncludeLoadDoc()
1500 saveFlags = ctxt->parseFlags; in xmlXIncludeLoadDoc()
1502 ctxt->parseFlags |= XML_PARSE_NOENT; in xmlXIncludeLoadDoc()
1506 doc = xmlXIncludeParseFile(ctxt, (const char *)URL); in xmlXIncludeLoadDoc()
1508 ctxt->parseFlags = saveFlags; in xmlXIncludeLoadDoc()
1516 ctxt->incTab[nr]->doc = doc; in xmlXIncludeLoadDoc()
1527 for (i = nr + 1; i < ctxt->incNr; i++) { in xmlXIncludeLoadDoc()
1528 if (xmlStrEqual(URL, ctxt->incTab[i]->URI)) { in xmlXIncludeLoadDoc()
1529 ctxt->incTab[nr]->count++; in xmlXIncludeLoadDoc()
1540 xmlXIncludeMergeEntities(ctxt, ctxt->doc, doc); in xmlXIncludeLoadDoc()
1555 xmlXIncludeRecurseDoc(ctxt, doc, URL); in xmlXIncludeLoadDoc()
1562 ctxt->incTab[nr]->inc = xmlXIncludeCopyNodeList(ctxt, ctxt->doc, in xmlXIncludeLoadDoc()
1577 xmlXIncludeErr(ctxt, ctxt->incTab[nr]->ref, in xmlXIncludeLoadDoc()
1586 xmlXIncludeErr(ctxt, ctxt->incTab[nr]->ref, in xmlXIncludeLoadDoc()
1603 xmlXIncludeErr(ctxt, ctxt->incTab[nr]->ref, in xmlXIncludeLoadDoc()
1647 xmlXIncludeErr(ctxt, ctxt->incTab[nr]->ref, in xmlXIncludeLoadDoc()
1654 xmlXIncludeErr(ctxt, ctxt->incTab[nr]->ref, in xmlXIncludeLoadDoc()
1669 xmlXIncludeErr(ctxt, ctxt->incTab[nr]->ref, in xmlXIncludeLoadDoc()
1679 ctxt->incTab[nr]->inc = in xmlXIncludeLoadDoc()
1680 xmlXIncludeCopyXPointer(ctxt, ctxt->doc, doc, xptr); in xmlXIncludeLoadDoc()
1691 (!(ctxt->parseFlags & XML_PARSE_NOBASEFIX)) && in xmlXIncludeLoadDoc()
1701 base = xmlGetNsProp(ctxt->incTab[nr]->ref, BAD_CAST "base", in xmlXIncludeLoadDoc()
1708 curBase = xmlBuildRelativeURI(URL, ctxt->base); in xmlXIncludeLoadDoc()
1710 xmlXIncludeErr(ctxt, ctxt->incTab[nr]->ref, in xmlXIncludeLoadDoc()
1722 node = ctxt->incTab[nr]->inc; in xmlXIncludeLoadDoc()
1751 xmlXIncludeErr(ctxt, in xmlXIncludeLoadDoc()
1752 ctxt->incTab[nr]->ref, in xmlXIncludeLoadDoc()
1771 if ((nr < ctxt->incNr) && (ctxt->incTab[nr]->doc != NULL) && in xmlXIncludeLoadDoc()
1772 (ctxt->incTab[nr]->count <= 1)) { in xmlXIncludeLoadDoc()
1774 printf("freeing %s\n", ctxt->incTab[nr]->doc->URL); in xmlXIncludeLoadDoc()
1776 xmlFreeDoc(ctxt->incTab[nr]->doc); in xmlXIncludeLoadDoc()
1777 ctxt->incTab[nr]->doc = NULL; in xmlXIncludeLoadDoc()
1794 xmlXIncludeLoadTxt(xmlXIncludeCtxtPtr ctxt, const xmlChar *url, int nr) { in xmlXIncludeLoadTxt() argument
1815 xmlXIncludeErr(ctxt, ctxt->incTab[nr]->ref, XML_XINCLUDE_HREF_URI, in xmlXIncludeLoadTxt()
1820 xmlXIncludeErr(ctxt, ctxt->incTab[nr]->ref, XML_XINCLUDE_TEXT_FRAGMENT, in xmlXIncludeLoadTxt()
1829 xmlXIncludeErr(ctxt, ctxt->incTab[nr]->ref, XML_XINCLUDE_HREF_URI, in xmlXIncludeLoadTxt()
1839 xmlXIncludeErr(ctxt, ctxt->incTab[nr]->ref, in xmlXIncludeLoadTxt()
1849 for (i = 0; i < ctxt->txtNr; i++) { in xmlXIncludeLoadTxt()
1850 if (xmlStrEqual(URL, ctxt->txturlTab[i])) { in xmlXIncludeLoadTxt()
1851 node = xmlNewText(ctxt->txtTab[i]); in xmlXIncludeLoadTxt()
1858 if ((ctxt->incTab[nr] != NULL) && (ctxt->incTab[nr]->ref != NULL)) { in xmlXIncludeLoadTxt()
1859 encoding = xmlGetProp(ctxt->incTab[nr]->ref, XINCLUDE_PARSE_ENCODING); in xmlXIncludeLoadTxt()
1870 xmlXIncludeErr(ctxt, ctxt->incTab[nr]->ref, in xmlXIncludeLoadTxt()
1924 xmlXIncludeErr(ctxt, ctxt->incTab[nr]->ref, in xmlXIncludeLoadTxt()
1941 xmlXIncludeAddTxt(ctxt, node->content, URL); in xmlXIncludeLoadTxt()
1948 ctxt->incTab[nr]->inc = node; in xmlXIncludeLoadTxt()
1965 xmlXIncludeLoadFallback(xmlXIncludeCtxtPtr ctxt, xmlNodePtr fallback, int nr) { in xmlXIncludeLoadFallback() argument
1968 int oldNbErrors = ctxt->nbErrors; in xmlXIncludeLoadFallback()
1971 (ctxt == NULL)) in xmlXIncludeLoadFallback()
1978 newctxt = xmlXIncludeNewContext(ctxt->doc); in xmlXIncludeLoadFallback()
1981 newctxt->_private = ctxt->_private; in xmlXIncludeLoadFallback()
1982 newctxt->base = xmlStrdup(ctxt->base); /* Inherit the base from the existing context */ in xmlXIncludeLoadFallback()
1983 xmlXIncludeSetFlags(newctxt, ctxt->parseFlags); in xmlXIncludeLoadFallback()
1984 newctxt->incTotal = ctxt->incTotal; in xmlXIncludeLoadFallback()
1985 if (xmlXIncludeDoProcess(newctxt, ctxt->doc, fallback, 1) < 0) in xmlXIncludeLoadFallback()
1987 ctxt->incTotal = newctxt->incTotal; in xmlXIncludeLoadFallback()
1988 if (ctxt->nbErrors > oldNbErrors) in xmlXIncludeLoadFallback()
1992 ctxt->incTab[nr]->inc = xmlDocCopyNodeList(ctxt->doc, in xmlXIncludeLoadFallback()
1994 if (ctxt->incTab[nr]->inc == NULL) in xmlXIncludeLoadFallback()
1995 ctxt->incTab[nr]->emptyFb = 1; in xmlXIncludeLoadFallback()
1997 ctxt->incTab[nr]->inc = NULL; in xmlXIncludeLoadFallback()
1998 ctxt->incTab[nr]->emptyFb = 1; /* flag empty callback */ in xmlXIncludeLoadFallback()
2000 ctxt->incTab[nr]->fallback = 1; in xmlXIncludeLoadFallback()
2021 xmlXIncludePreProcessNode(xmlXIncludeCtxtPtr ctxt, xmlNodePtr node) { in xmlXIncludePreProcessNode() argument
2022 xmlXIncludeAddNode(ctxt, node); in xmlXIncludePreProcessNode()
2036 xmlXIncludeLoadNode(xmlXIncludeCtxtPtr ctxt, int nr) { in xmlXIncludeLoadNode() argument
2046 if (ctxt == NULL) in xmlXIncludeLoadNode()
2048 if ((nr < 0) || (nr >= ctxt->incNr)) in xmlXIncludeLoadNode()
2050 cur = ctxt->incTab[nr]->ref; in xmlXIncludeLoadNode()
2057 href = xmlXIncludeGetProp(ctxt, cur, XINCLUDE_HREF); in xmlXIncludeLoadNode()
2063 parse = xmlXIncludeGetProp(ctxt, cur, XINCLUDE_PARSE); in xmlXIncludeLoadNode()
2070 xmlXIncludeErr(ctxt, ctxt->incTab[nr]->ref, in xmlXIncludeLoadNode()
2084 base = xmlNodeGetBase(ctxt->doc, cur); in xmlXIncludeLoadNode()
2086 URI = xmlBuildURI(href, ctxt->doc->URL); in xmlXIncludeLoadNode()
2105 xmlXIncludeErr(ctxt, ctxt->incTab[nr]->ref, in xmlXIncludeLoadNode()
2124 oldBase = ctxt->base; in xmlXIncludeLoadNode()
2125 ctxt->base = base; in xmlXIncludeLoadNode()
2128 ret = xmlXIncludeLoadDoc(ctxt, URI, nr); in xmlXIncludeLoadNode()
2131 ret = xmlXIncludeLoadTxt(ctxt, URI, nr); in xmlXIncludeLoadNode()
2137 ctxt->base = oldBase; in xmlXIncludeLoadNode()
2155 ret = xmlXIncludeLoadFallback(ctxt, children, nr); in xmlXIncludeLoadNode()
2162 xmlXIncludeErr(ctxt, ctxt->incTab[nr]->ref, in xmlXIncludeLoadNode()
2192 xmlXIncludeIncludeNode(xmlXIncludeCtxtPtr ctxt, int nr) { in xmlXIncludeIncludeNode() argument
2195 if (ctxt == NULL) in xmlXIncludeIncludeNode()
2197 if ((nr < 0) || (nr >= ctxt->incNr)) in xmlXIncludeIncludeNode()
2199 cur = ctxt->incTab[nr]->ref; in xmlXIncludeIncludeNode()
2203 list = ctxt->incTab[nr]->inc; in xmlXIncludeIncludeNode()
2204 ctxt->incTab[nr]->inc = NULL; in xmlXIncludeIncludeNode()
2205 ctxt->incTab[nr]->emptyFb = 0; in xmlXIncludeIncludeNode()
2221 xmlXIncludeErr(ctxt, ctxt->incTab[nr]->ref, in xmlXIncludeIncludeNode()
2230 if (ctxt->parseFlags & XML_PARSE_NOXINCNODE) { in xmlXIncludeIncludeNode()
2249 if (ctxt->incTab[nr]->fallback) in xmlXIncludeIncludeNode()
2260 xmlXIncludeErr(ctxt, ctxt->incTab[nr]->ref, in xmlXIncludeIncludeNode()
2294 xmlXIncludeTestNode(xmlXIncludeCtxtPtr ctxt, xmlNodePtr node) { in xmlXIncludeTestNode() argument
2304 if (ctxt->legacy == 0) { in xmlXIncludeTestNode()
2306 xmlXIncludeWarn(ctxt, node, XML_XINCLUDE_DEPRECATED_NS, in xmlXIncludeTestNode()
2310 ctxt->legacy = 1; in xmlXIncludeTestNode()
2323 xmlXIncludeErr(ctxt, node, in xmlXIncludeTestNode()
2336 xmlXIncludeErr(ctxt, node, XML_XINCLUDE_FALLBACKS_IN_INCLUDE, in xmlXIncludeTestNode()
2350 xmlXIncludeErr(ctxt, node, in xmlXIncludeTestNode()
2373 xmlXIncludeDoProcess(xmlXIncludeCtxtPtr ctxt, xmlDocPtr doc, xmlNodePtr tree, in xmlXIncludeDoProcess() argument
2383 if (ctxt == NULL) in xmlXIncludeDoProcess()
2387 ret = xmlXIncludeURLPush(ctxt, doc->URL); in xmlXIncludeDoProcess()
2391 start = ctxt->incNr; in xmlXIncludeDoProcess()
2419 if (xmlXIncludeTestNode(ctxt, cur) == 1) { in xmlXIncludeDoProcess()
2425 if (ctxt->incTotal >= 20) in xmlXIncludeDoProcess()
2428 ctxt->incTotal++; in xmlXIncludeDoProcess()
2429 xmlXIncludePreProcessNode(ctxt, cur); in xmlXIncludeDoProcess()
2450 for (i = start;i < ctxt->incNr; i++) { in xmlXIncludeDoProcess()
2451 xmlXIncludeLoadNode(ctxt, i); in xmlXIncludeDoProcess()
2466 for (i = ctxt->incBase;i < ctxt->incNr; i++) { in xmlXIncludeDoProcess()
2467 if ((ctxt->incTab[i]->inc != NULL) || in xmlXIncludeDoProcess()
2468 (ctxt->incTab[i]->emptyFb != 0)) /* (empty fallback) */ in xmlXIncludeDoProcess()
2469 xmlXIncludeIncludeNode(ctxt, i); in xmlXIncludeDoProcess()
2473 xmlXIncludeURLPop(ctxt); in xmlXIncludeDoProcess()
2487 xmlXIncludeSetFlags(xmlXIncludeCtxtPtr ctxt, int flags) { in xmlXIncludeSetFlags() argument
2488 if (ctxt == NULL) in xmlXIncludeSetFlags()
2490 ctxt->parseFlags = flags; in xmlXIncludeSetFlags()
2509 xmlXIncludeCtxtPtr ctxt; in xmlXIncludeProcessTreeFlagsData() local
2516 ctxt = xmlXIncludeNewContext(tree->doc); in xmlXIncludeProcessTreeFlagsData()
2517 if (ctxt == NULL) in xmlXIncludeProcessTreeFlagsData()
2519 ctxt->_private = data; in xmlXIncludeProcessTreeFlagsData()
2520 ctxt->base = xmlStrdup((xmlChar *)tree->doc->URL); in xmlXIncludeProcessTreeFlagsData()
2521 xmlXIncludeSetFlags(ctxt, flags); in xmlXIncludeProcessTreeFlagsData()
2522 ret = xmlXIncludeDoProcess(ctxt, tree->doc, tree, 0); in xmlXIncludeProcessTreeFlagsData()
2523 if ((ret >= 0) && (ctxt->nbErrors > 0)) in xmlXIncludeProcessTreeFlagsData()
2526 xmlXIncludeFreeContext(ctxt); in xmlXIncludeProcessTreeFlagsData()
2595 xmlXIncludeCtxtPtr ctxt; in xmlXIncludeProcessTreeFlags() local
2601 ctxt = xmlXIncludeNewContext(tree->doc); in xmlXIncludeProcessTreeFlags()
2602 if (ctxt == NULL) in xmlXIncludeProcessTreeFlags()
2604 ctxt->base = xmlNodeGetBase(tree->doc, tree); in xmlXIncludeProcessTreeFlags()
2605 xmlXIncludeSetFlags(ctxt, flags); in xmlXIncludeProcessTreeFlags()
2606 ret = xmlXIncludeDoProcess(ctxt, tree->doc, tree, 0); in xmlXIncludeProcessTreeFlags()
2607 if ((ret >= 0) && (ctxt->nbErrors > 0)) in xmlXIncludeProcessTreeFlags()
2610 xmlXIncludeFreeContext(ctxt); in xmlXIncludeProcessTreeFlags()
2640 xmlXIncludeProcessNode(xmlXIncludeCtxtPtr ctxt, xmlNodePtr node) { in xmlXIncludeProcessNode() argument
2644 (node->doc == NULL) || (ctxt == NULL)) in xmlXIncludeProcessNode()
2646 ret = xmlXIncludeDoProcess(ctxt, node->doc, node, 0); in xmlXIncludeProcessNode()
2647 if ((ret >= 0) && (ctxt->nbErrors > 0)) in xmlXIncludeProcessNode()