Lines Matching refs:ctxt
121 xmlXIncludeDoProcess(xmlXIncludeCtxtPtr ctxt, xmlDocPtr doc, xmlNodePtr tree);
137 xmlXIncludeErrMemory(xmlXIncludeCtxtPtr ctxt, xmlNodePtr node, in xmlXIncludeErrMemory() argument
140 if (ctxt != NULL) in xmlXIncludeErrMemory()
141 ctxt->nbErrors++; in xmlXIncludeErrMemory()
142 __xmlRaiseError(NULL, NULL, NULL, ctxt, node, XML_FROM_XINCLUDE, in xmlXIncludeErrMemory()
158 xmlXIncludeErr(xmlXIncludeCtxtPtr ctxt, xmlNodePtr node, int error, in xmlXIncludeErr() argument
161 if (ctxt != NULL) in xmlXIncludeErr()
162 ctxt->nbErrors++; in xmlXIncludeErr()
163 __xmlRaiseError(NULL, NULL, NULL, ctxt, node, XML_FROM_XINCLUDE, in xmlXIncludeErr()
180 xmlXIncludeWarn(xmlXIncludeCtxtPtr ctxt, xmlNodePtr node, int error,
183 __xmlRaiseError(NULL, NULL, NULL, ctxt, node, XML_FROM_XINCLUDE,
201 xmlXIncludeGetProp(xmlXIncludeCtxtPtr ctxt, xmlNodePtr cur, in xmlXIncludeGetProp() argument
208 if (ctxt->legacy != 0) { in xmlXIncludeGetProp()
254 xmlXIncludeNewRef(xmlXIncludeCtxtPtr ctxt, const xmlChar *URI, in xmlXIncludeNewRef() argument
263 xmlXIncludeErrMemory(ctxt, ref, "growing XInclude context"); in xmlXIncludeNewRef()
277 if (ctxt->incMax == 0) { in xmlXIncludeNewRef()
278 ctxt->incMax = 4; in xmlXIncludeNewRef()
279 ctxt->incTab = (xmlXIncludeRefPtr *) xmlMalloc(ctxt->incMax * in xmlXIncludeNewRef()
280 sizeof(ctxt->incTab[0])); in xmlXIncludeNewRef()
281 if (ctxt->incTab == NULL) { in xmlXIncludeNewRef()
282 xmlXIncludeErrMemory(ctxt, ref, "growing XInclude context"); in xmlXIncludeNewRef()
287 if (ctxt->incNr >= ctxt->incMax) { in xmlXIncludeNewRef()
288 ctxt->incMax *= 2; in xmlXIncludeNewRef()
289 ctxt->incTab = (xmlXIncludeRefPtr *) xmlRealloc(ctxt->incTab, in xmlXIncludeNewRef()
290 ctxt->incMax * sizeof(ctxt->incTab[0])); in xmlXIncludeNewRef()
291 if (ctxt->incTab == NULL) { in xmlXIncludeNewRef()
292 xmlXIncludeErrMemory(ctxt, ref, "growing XInclude context"); in xmlXIncludeNewRef()
297 ctxt->incTab[ctxt->incNr++] = ret; in xmlXIncludeNewRef()
344 xmlXIncludeURLPush(xmlXIncludeCtxtPtr ctxt, in xmlXIncludeURLPush() argument
347 if (ctxt->urlNr > XINCLUDE_MAX_DEPTH) { in xmlXIncludeURLPush()
348 xmlXIncludeErr(ctxt, NULL, XML_XINCLUDE_RECURSION, in xmlXIncludeURLPush()
352 if (ctxt->urlTab == NULL) { in xmlXIncludeURLPush()
353 ctxt->urlMax = 4; in xmlXIncludeURLPush()
354 ctxt->urlNr = 0; in xmlXIncludeURLPush()
355 ctxt->urlTab = (xmlChar * *) xmlMalloc( in xmlXIncludeURLPush()
356 ctxt->urlMax * sizeof(ctxt->urlTab[0])); in xmlXIncludeURLPush()
357 if (ctxt->urlTab == NULL) { in xmlXIncludeURLPush()
358 xmlXIncludeErrMemory(ctxt, NULL, "adding URL"); in xmlXIncludeURLPush()
362 if (ctxt->urlNr >= ctxt->urlMax) { in xmlXIncludeURLPush()
363 ctxt->urlMax *= 2; in xmlXIncludeURLPush()
364 ctxt->urlTab = in xmlXIncludeURLPush()
365 (xmlChar * *) xmlRealloc(ctxt->urlTab, in xmlXIncludeURLPush()
366 ctxt->urlMax * in xmlXIncludeURLPush()
367 sizeof(ctxt->urlTab[0])); in xmlXIncludeURLPush()
368 if (ctxt->urlTab == NULL) { in xmlXIncludeURLPush()
369 xmlXIncludeErrMemory(ctxt, NULL, "adding URL"); in xmlXIncludeURLPush()
373 ctxt->url = ctxt->urlTab[ctxt->urlNr] = xmlStrdup(value); in xmlXIncludeURLPush()
374 return (ctxt->urlNr++); in xmlXIncludeURLPush()
384 xmlXIncludeURLPop(xmlXIncludeCtxtPtr ctxt) in xmlXIncludeURLPop() argument
388 if (ctxt->urlNr <= 0) in xmlXIncludeURLPop()
390 ctxt->urlNr--; in xmlXIncludeURLPop()
391 if (ctxt->urlNr > 0) in xmlXIncludeURLPop()
392 ctxt->url = ctxt->urlTab[ctxt->urlNr - 1]; in xmlXIncludeURLPop()
394 ctxt->url = NULL; in xmlXIncludeURLPop()
395 ret = ctxt->urlTab[ctxt->urlNr]; in xmlXIncludeURLPop()
396 ctxt->urlTab[ctxt->urlNr] = NULL; in xmlXIncludeURLPop()
408 xmlXIncludeFreeContext(xmlXIncludeCtxtPtr ctxt) { in xmlXIncludeFreeContext() argument
414 if (ctxt == NULL) in xmlXIncludeFreeContext()
416 while (ctxt->urlNr > 0) in xmlXIncludeFreeContext()
417 xmlXIncludeURLPop(ctxt); in xmlXIncludeFreeContext()
418 if (ctxt->urlTab != NULL) in xmlXIncludeFreeContext()
419 xmlFree(ctxt->urlTab); in xmlXIncludeFreeContext()
420 for (i = 0;i < ctxt->incNr;i++) { in xmlXIncludeFreeContext()
421 if (ctxt->incTab[i] != NULL) in xmlXIncludeFreeContext()
422 xmlXIncludeFreeRef(ctxt->incTab[i]); in xmlXIncludeFreeContext()
424 if (ctxt->txturlTab != NULL) { in xmlXIncludeFreeContext()
425 for (i = 0;i < ctxt->txtNr;i++) { in xmlXIncludeFreeContext()
426 if (ctxt->txturlTab[i] != NULL) in xmlXIncludeFreeContext()
427 xmlFree(ctxt->txturlTab[i]); in xmlXIncludeFreeContext()
430 if (ctxt->incTab != NULL) in xmlXIncludeFreeContext()
431 xmlFree(ctxt->incTab); in xmlXIncludeFreeContext()
432 if (ctxt->txtTab != NULL) in xmlXIncludeFreeContext()
433 xmlFree(ctxt->txtTab); in xmlXIncludeFreeContext()
434 if (ctxt->txturlTab != NULL) in xmlXIncludeFreeContext()
435 xmlFree(ctxt->txturlTab); in xmlXIncludeFreeContext()
436 if (ctxt->base != NULL) { in xmlXIncludeFreeContext()
437 xmlFree(ctxt->base); in xmlXIncludeFreeContext()
439 xmlFree(ctxt); in xmlXIncludeFreeContext()
450 xmlXIncludeParseFile(xmlXIncludeCtxtPtr ctxt, const char *URL) { in xmlXIncludeParseFile() argument
459 xmlXIncludeErrMemory(ctxt, NULL, "cannot allocate parser context"); in xmlXIncludeParseFile()
466 pctxt->_private = ctxt->_private; in xmlXIncludeParseFile()
472 if ((ctxt->doc != NULL) && (ctxt->doc->dict != NULL)) { in xmlXIncludeParseFile()
475 pctxt->dict = ctxt->doc->dict; in xmlXIncludeParseFile()
479 xmlCtxtUseOptions(pctxt, ctxt->parseFlags | XML_PARSE_DTDLOAD); in xmlXIncludeParseFile()
518 xmlXIncludeAddNode(xmlXIncludeCtxtPtr ctxt, xmlNodePtr cur) { in xmlXIncludeAddNode() argument
531 if (ctxt == NULL) in xmlXIncludeAddNode()
542 href = xmlXIncludeGetProp(ctxt, cur, XINCLUDE_HREF); in xmlXIncludeAddNode()
550 parse = xmlXIncludeGetProp(ctxt, cur, XINCLUDE_PARSE); in xmlXIncludeAddNode()
557 xmlXIncludeErr(ctxt, cur, XML_XINCLUDE_PARSE_VALUE, in xmlXIncludeAddNode()
570 base = xmlNodeGetBase(ctxt->doc, cur); in xmlXIncludeAddNode()
572 URI = xmlBuildURI(href, ctxt->doc->URL); in xmlXIncludeAddNode()
597 xmlXIncludeErr(ctxt, cur, XML_XINCLUDE_HREF_URI, in xmlXIncludeAddNode()
601 fragment = xmlXIncludeGetProp(ctxt, cur, XINCLUDE_PARSE_XPOINTER); in xmlXIncludeAddNode()
608 xmlXIncludeErr(ctxt, cur, XML_XINCLUDE_HREF_URI, in xmlXIncludeAddNode()
617 if (ctxt->legacy != 0) { in xmlXIncludeAddNode()
624 xmlXIncludeErr(ctxt, cur, XML_XINCLUDE_FRAGMENT_ID, in xmlXIncludeAddNode()
639 xmlXIncludeErr(ctxt, cur, XML_XINCLUDE_HREF_URI, in xmlXIncludeAddNode()
651 xmlXIncludeErr(ctxt, cur, XML_XINCLUDE_RECURSION, in xmlXIncludeAddNode()
663 for (i = 0;i < ctxt->urlNr;i++) { in xmlXIncludeAddNode()
664 if (xmlStrEqual(URL, ctxt->urlTab[i])) { in xmlXIncludeAddNode()
665 xmlXIncludeErr(ctxt, cur, XML_XINCLUDE_RECURSION, in xmlXIncludeAddNode()
672 ref = xmlXIncludeNewRef(ctxt, URL, cur); in xmlXIncludeAddNode()
693 xmlXIncludeRecurseDoc(xmlXIncludeCtxtPtr ctxt, xmlDocPtr doc, in xmlXIncludeRecurseDoc() argument
718 newctxt->_private = ctxt->_private; in xmlXIncludeRecurseDoc()
722 newctxt->incMax = ctxt->incMax; in xmlXIncludeRecurseDoc()
723 newctxt->incNr = ctxt->incNr; in xmlXIncludeRecurseDoc()
727 xmlXIncludeErrMemory(ctxt, (xmlNodePtr) doc, "processing doc"); in xmlXIncludeRecurseDoc()
734 newctxt->urlMax = ctxt->urlMax; in xmlXIncludeRecurseDoc()
735 newctxt->urlNr = ctxt->urlNr; in xmlXIncludeRecurseDoc()
736 newctxt->urlTab = ctxt->urlTab; in xmlXIncludeRecurseDoc()
741 newctxt->base = xmlStrdup(ctxt->base); in xmlXIncludeRecurseDoc()
746 newctxt->incBase = ctxt->incNr; in xmlXIncludeRecurseDoc()
747 for (i = 0;i < ctxt->incNr;i++) { in xmlXIncludeRecurseDoc()
748 newctxt->incTab[i] = ctxt->incTab[i]; in xmlXIncludeRecurseDoc()
756 newctxt->parseFlags = ctxt->parseFlags; in xmlXIncludeRecurseDoc()
758 for (i = 0;i < ctxt->incNr;i++) { in xmlXIncludeRecurseDoc()
764 ctxt->urlTab = newctxt->urlTab; in xmlXIncludeRecurseDoc()
765 ctxt->urlMax = newctxt->urlMax; in xmlXIncludeRecurseDoc()
787 xmlXIncludeAddTxt(xmlXIncludeCtxtPtr ctxt, xmlNodePtr txt, const xmlURL url) { in xmlXIncludeAddTxt() argument
791 if (ctxt->txtMax == 0) { in xmlXIncludeAddTxt()
792 ctxt->txtMax = 4; in xmlXIncludeAddTxt()
793 ctxt->txtTab = (xmlNodePtr *) xmlMalloc(ctxt->txtMax * in xmlXIncludeAddTxt()
794 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 *) xmlMalloc(ctxt->txtMax * in xmlXIncludeAddTxt()
800 sizeof(ctxt->txturlTab[0])); in xmlXIncludeAddTxt()
801 if (ctxt->txturlTab == NULL) { in xmlXIncludeAddTxt()
802 xmlXIncludeErrMemory(ctxt, NULL, "processing text"); in xmlXIncludeAddTxt()
806 if (ctxt->txtNr >= ctxt->txtMax) { in xmlXIncludeAddTxt()
807 ctxt->txtMax *= 2; in xmlXIncludeAddTxt()
808 ctxt->txtTab = (xmlNodePtr *) xmlRealloc(ctxt->txtTab, in xmlXIncludeAddTxt()
809 ctxt->txtMax * sizeof(ctxt->txtTab[0])); in xmlXIncludeAddTxt()
810 if (ctxt->txtTab == NULL) { in xmlXIncludeAddTxt()
811 xmlXIncludeErrMemory(ctxt, NULL, "processing text"); in xmlXIncludeAddTxt()
814 ctxt->txturlTab = (xmlURL *) xmlRealloc(ctxt->txturlTab, in xmlXIncludeAddTxt()
815 ctxt->txtMax * sizeof(ctxt->txturlTab[0])); in xmlXIncludeAddTxt()
816 if (ctxt->txturlTab == NULL) { in xmlXIncludeAddTxt()
817 xmlXIncludeErrMemory(ctxt, NULL, "processing text"); in xmlXIncludeAddTxt()
821 ctxt->txtTab[ctxt->txtNr] = txt; in xmlXIncludeAddTxt()
822 ctxt->txturlTab[ctxt->txtNr] = xmlStrdup(url); in xmlXIncludeAddTxt()
823 ctxt->txtNr++; in xmlXIncludeAddTxt()
833 xmlXIncludeCopyNodeList(xmlXIncludeCtxtPtr ctxt, xmlDocPtr target,
847 xmlXIncludeCopyNode(xmlXIncludeCtxtPtr ctxt, xmlDocPtr target, in xmlXIncludeCopyNode() argument
851 if ((ctxt == NULL) || (target == NULL) || (source == NULL) || in xmlXIncludeCopyNode()
857 result = xmlXIncludeCopyNodeList(ctxt, target, source, elem->children); in xmlXIncludeCopyNode()
874 xmlXIncludeCopyNodeList(xmlXIncludeCtxtPtr ctxt, xmlDocPtr target, in xmlXIncludeCopyNodeList() argument
878 if ((ctxt == NULL) || (target == NULL) || (source == NULL) || in xmlXIncludeCopyNodeList()
883 res = xmlXIncludeCopyNode(ctxt, target, source, cur); in xmlXIncludeCopyNodeList()
939 xmlXIncludeCopyRange(xmlXIncludeCtxtPtr ctxt, xmlDocPtr target, in xmlXIncludeCopyRange() argument
949 if ((ctxt == NULL) || (target == NULL) || (source == NULL) || in xmlXIncludeCopyRange()
1153 xmlXIncludeCopyXPointer(xmlXIncludeCtxtPtr ctxt, xmlDocPtr target, in xmlXIncludeCopyXPointer() argument
1159 source = ctxt->doc; in xmlXIncludeCopyXPointer()
1160 if ((ctxt == NULL) || (target == NULL) || (source == NULL) || in xmlXIncludeCopyXPointer()
1199 tmp = xmlXIncludeCopyNode(ctxt, target, in xmlXIncludeCopyXPointer()
1228 list = last = xmlXIncludeCopyNode(ctxt, target, source, in xmlXIncludeCopyXPointer()
1232 xmlXIncludeCopyNode(ctxt, target, source, in xmlXIncludeCopyXPointer()
1247 list = last = xmlXIncludeCopyXPointer(ctxt, target, source, in xmlXIncludeCopyXPointer()
1251 xmlXIncludeCopyXPointer(ctxt, target, source, in xmlXIncludeCopyXPointer()
1261 return(xmlXIncludeCopyRange(ctxt, target, source, obj)); in xmlXIncludeCopyXPointer()
1281 xmlXIncludeCtxtPtr ctxt; member
1299 xmlXIncludeCtxtPtr ctxt; in xmlXIncludeMergeEntity() local
1303 ctxt = data->ctxt; in xmlXIncludeMergeEntity()
1305 if ((ctxt == NULL) || (doc == NULL)) in xmlXIncludeMergeEntity()
1356 xmlXIncludeErr(ctxt, (xmlNodePtr) ent, XML_XINCLUDE_ENTITY_DEF_MISMATCH, in xmlXIncludeMergeEntity()
1372 xmlXIncludeMergeEntities(xmlXIncludeCtxtPtr ctxt, xmlDocPtr doc, in xmlXIncludeMergeEntities() argument
1377 if (ctxt == NULL) in xmlXIncludeMergeEntities()
1397 data.ctxt = ctxt; in xmlXIncludeMergeEntities()
1407 data.ctxt = ctxt; in xmlXIncludeMergeEntities()
1433 xmlXIncludeLoadDoc(xmlXIncludeCtxtPtr ctxt, const xmlChar *url, int nr) { in xmlXIncludeLoadDoc() argument
1451 xmlXIncludeErr(ctxt, ctxt->incTab[nr]->ref, in xmlXIncludeLoadDoc()
1460 if ((ctxt->incTab != NULL) && (ctxt->incTab[nr] != NULL) && in xmlXIncludeLoadDoc()
1461 (ctxt->incTab[nr]->fragment != NULL)) { in xmlXIncludeLoadDoc()
1463 fragment = xmlStrdup(ctxt->incTab[nr]->fragment); in xmlXIncludeLoadDoc()
1468 if (ctxt->incTab != NULL) in xmlXIncludeLoadDoc()
1469 xmlXIncludeErr(ctxt, ctxt->incTab[nr]->ref, in xmlXIncludeLoadDoc()
1473 xmlXIncludeErr(ctxt, NULL, in xmlXIncludeLoadDoc()
1486 ((ctxt->doc != NULL) && (xmlStrEqual(URL, ctxt->doc->URL)))) { in xmlXIncludeLoadDoc()
1494 for (i = 0; i < ctxt->incNr; i++) { in xmlXIncludeLoadDoc()
1495 if ((xmlStrEqual(URL, ctxt->incTab[i]->URI)) && in xmlXIncludeLoadDoc()
1496 (ctxt->incTab[i]->doc != NULL)) { in xmlXIncludeLoadDoc()
1497 doc = ctxt->incTab[i]->doc; in xmlXIncludeLoadDoc()
1517 saveFlags = ctxt->parseFlags; in xmlXIncludeLoadDoc()
1519 ctxt->parseFlags |= XML_PARSE_NOENT; in xmlXIncludeLoadDoc()
1523 doc = xmlXIncludeParseFile(ctxt, (const char *)URL); in xmlXIncludeLoadDoc()
1525 ctxt->parseFlags = saveFlags; in xmlXIncludeLoadDoc()
1533 ctxt->incTab[nr]->doc = doc; in xmlXIncludeLoadDoc()
1544 for (i = nr + 1; i < ctxt->incNr; i++) { in xmlXIncludeLoadDoc()
1545 if (xmlStrEqual(URL, ctxt->incTab[i]->URI)) { in xmlXIncludeLoadDoc()
1546 ctxt->incTab[nr]->count++; in xmlXIncludeLoadDoc()
1557 xmlXIncludeMergeEntities(ctxt, ctxt->doc, doc); in xmlXIncludeLoadDoc()
1572 xmlXIncludeRecurseDoc(ctxt, doc, URL); in xmlXIncludeLoadDoc()
1583 ctxt->incTab[nr]->inc = xmlCopyNodeList(ctxt->doc->children); in xmlXIncludeLoadDoc()
1585 ctxt->incTab[nr]->inc = xmlXIncludeCopyNodeList(ctxt, ctxt->doc, in xmlXIncludeLoadDoc()
1600 xptrctxt = xmlXPtrNewContext(ctxt->doc, ctxt->incTab[nr]->ref, in xmlXIncludeLoadDoc()
1606 xmlXIncludeErr(ctxt, ctxt->incTab[nr]->ref, in xmlXIncludeLoadDoc()
1615 xmlXIncludeErr(ctxt, ctxt->incTab[nr]->ref, in xmlXIncludeLoadDoc()
1632 xmlXIncludeErr(ctxt, ctxt->incTab[nr]->ref, in xmlXIncludeLoadDoc()
1674 xmlXIncludeErr(ctxt, ctxt->incTab[nr]->ref, in xmlXIncludeLoadDoc()
1681 xmlXIncludeErr(ctxt, ctxt->incTab[nr]->ref, in xmlXIncludeLoadDoc()
1696 xmlXIncludeErr(ctxt, ctxt->incTab[nr]->ref, in xmlXIncludeLoadDoc()
1707 ctxt->incTab[nr]->xptr = xptr; in xmlXIncludeLoadDoc()
1708 ctxt->incTab[nr]->inc = NULL; in xmlXIncludeLoadDoc()
1710 ctxt->incTab[nr]->inc = in xmlXIncludeLoadDoc()
1711 xmlXIncludeCopyXPointer(ctxt, ctxt->doc, doc, xptr); in xmlXIncludeLoadDoc()
1723 (!(ctxt->parseFlags & XML_PARSE_NOBASEFIX)) && in xmlXIncludeLoadDoc()
1733 base = xmlGetNsProp(ctxt->incTab[nr]->ref, BAD_CAST "base", in xmlXIncludeLoadDoc()
1740 curBase = xmlBuildRelativeURI(URL, ctxt->base); in xmlXIncludeLoadDoc()
1742 xmlXIncludeErr(ctxt, ctxt->incTab[nr]->ref, in xmlXIncludeLoadDoc()
1754 node = ctxt->incTab[nr]->inc; in xmlXIncludeLoadDoc()
1783 xmlXIncludeErr(ctxt, in xmlXIncludeLoadDoc()
1784 ctxt->incTab[nr]->ref, in xmlXIncludeLoadDoc()
1803 if ((nr < ctxt->incNr) && (ctxt->incTab[nr]->doc != NULL) && in xmlXIncludeLoadDoc()
1804 (ctxt->incTab[nr]->count <= 1)) { in xmlXIncludeLoadDoc()
1806 printf("freeing %s\n", ctxt->incTab[nr]->doc->URL); in xmlXIncludeLoadDoc()
1808 xmlFreeDoc(ctxt->incTab[nr]->doc); in xmlXIncludeLoadDoc()
1809 ctxt->incTab[nr]->doc = NULL; in xmlXIncludeLoadDoc()
1826 xmlXIncludeLoadTxt(xmlXIncludeCtxtPtr ctxt, const xmlChar *url, int nr) { in xmlXIncludeLoadTxt() argument
1843 xmlXIncludeErr(ctxt, ctxt->incTab[nr]->ref, XML_XINCLUDE_HREF_URI, in xmlXIncludeLoadTxt()
1848 xmlXIncludeErr(ctxt, ctxt->incTab[nr]->ref, XML_XINCLUDE_TEXT_FRAGMENT, in xmlXIncludeLoadTxt()
1857 xmlXIncludeErr(ctxt, ctxt->incTab[nr]->ref, XML_XINCLUDE_HREF_URI, in xmlXIncludeLoadTxt()
1867 xmlXIncludeErr(ctxt, ctxt->incTab[nr]->ref, in xmlXIncludeLoadTxt()
1877 for (i = 0; i < ctxt->txtNr; i++) { in xmlXIncludeLoadTxt()
1878 if (xmlStrEqual(URL, ctxt->txturlTab[i])) { in xmlXIncludeLoadTxt()
1879 node = xmlCopyNode(ctxt->txtTab[i], 1); in xmlXIncludeLoadTxt()
1886 if ((ctxt->incTab[nr] != NULL) && (ctxt->incTab[nr]->ref != NULL)) { in xmlXIncludeLoadTxt()
1887 encoding = xmlGetProp(ctxt->incTab[nr]->ref, XINCLUDE_PARSE_ENCODING); in xmlXIncludeLoadTxt()
1898 xmlXIncludeErr(ctxt, ctxt->incTab[nr]->ref, in xmlXIncludeLoadTxt()
1952 xmlXIncludeErr(ctxt, ctxt->incTab[nr]->ref, in xmlXIncludeLoadTxt()
1968 xmlXIncludeAddTxt(ctxt, node, URL); in xmlXIncludeLoadTxt()
1975 ctxt->incTab[nr]->inc = node; in xmlXIncludeLoadTxt()
1992 xmlXIncludeLoadFallback(xmlXIncludeCtxtPtr ctxt, xmlNodePtr fallback, int nr) { in xmlXIncludeLoadFallback() argument
1997 (ctxt == NULL)) in xmlXIncludeLoadFallback()
2004 newctxt = xmlXIncludeNewContext(ctxt->doc); in xmlXIncludeLoadFallback()
2007 newctxt->_private = ctxt->_private; in xmlXIncludeLoadFallback()
2008 newctxt->base = xmlStrdup(ctxt->base); /* Inherit the base from the existing context */ in xmlXIncludeLoadFallback()
2009 xmlXIncludeSetFlags(newctxt, ctxt->parseFlags); in xmlXIncludeLoadFallback()
2010 ret = xmlXIncludeDoProcess(newctxt, ctxt->doc, fallback->children); in xmlXIncludeLoadFallback()
2011 if (ctxt->nbErrors > 0) in xmlXIncludeLoadFallback()
2017 ctxt->incTab[nr]->inc = xmlDocCopyNodeList(ctxt->doc, in xmlXIncludeLoadFallback()
2020 ctxt->incTab[nr]->inc = NULL; in xmlXIncludeLoadFallback()
2021 ctxt->incTab[nr]->emptyFb = 1; /* flag empty callback */ in xmlXIncludeLoadFallback()
2043 xmlXIncludePreProcessNode(xmlXIncludeCtxtPtr ctxt, xmlNodePtr node) { in xmlXIncludePreProcessNode() argument
2044 xmlXIncludeAddNode(ctxt, node); in xmlXIncludePreProcessNode()
2058 xmlXIncludeLoadNode(xmlXIncludeCtxtPtr ctxt, int nr) { in xmlXIncludeLoadNode() argument
2068 if (ctxt == NULL) in xmlXIncludeLoadNode()
2070 if ((nr < 0) || (nr >= ctxt->incNr)) in xmlXIncludeLoadNode()
2072 cur = ctxt->incTab[nr]->ref; in xmlXIncludeLoadNode()
2079 href = xmlXIncludeGetProp(ctxt, cur, XINCLUDE_HREF); in xmlXIncludeLoadNode()
2085 parse = xmlXIncludeGetProp(ctxt, cur, XINCLUDE_PARSE); in xmlXIncludeLoadNode()
2092 xmlXIncludeErr(ctxt, ctxt->incTab[nr]->ref, in xmlXIncludeLoadNode()
2106 base = xmlNodeGetBase(ctxt->doc, cur); in xmlXIncludeLoadNode()
2108 URI = xmlBuildURI(href, ctxt->doc->URL); in xmlXIncludeLoadNode()
2127 xmlXIncludeErr(ctxt, ctxt->incTab[nr]->ref, in xmlXIncludeLoadNode()
2146 oldBase = ctxt->base; in xmlXIncludeLoadNode()
2147 ctxt->base = base; in xmlXIncludeLoadNode()
2150 ret = xmlXIncludeLoadDoc(ctxt, URI, nr); in xmlXIncludeLoadNode()
2153 ret = xmlXIncludeLoadTxt(ctxt, URI, nr); in xmlXIncludeLoadNode()
2159 ctxt->base = oldBase; in xmlXIncludeLoadNode()
2177 ret = xmlXIncludeLoadFallback(ctxt, children, nr); in xmlXIncludeLoadNode()
2185 xmlXIncludeErr(ctxt, ctxt->incTab[nr]->ref, in xmlXIncludeLoadNode()
2215 xmlXIncludeIncludeNode(xmlXIncludeCtxtPtr ctxt, int nr) { in xmlXIncludeIncludeNode() argument
2218 if (ctxt == NULL) in xmlXIncludeIncludeNode()
2220 if ((nr < 0) || (nr >= ctxt->incNr)) in xmlXIncludeIncludeNode()
2222 cur = ctxt->incTab[nr]->ref; in xmlXIncludeIncludeNode()
2229 if ((ctxt->incTab[nr]->inc == NULL) && in xmlXIncludeIncludeNode()
2230 (ctxt->incTab[nr]->xptr != NULL)) { in xmlXIncludeIncludeNode()
2231 ctxt->incTab[nr]->inc = in xmlXIncludeIncludeNode()
2232 xmlXIncludeCopyXPointer(ctxt, ctxt->doc, ctxt->doc, in xmlXIncludeIncludeNode()
2233 ctxt->incTab[nr]->xptr); in xmlXIncludeIncludeNode()
2234 xmlXPathFreeObject(ctxt->incTab[nr]->xptr); in xmlXIncludeIncludeNode()
2235 ctxt->incTab[nr]->xptr = NULL; in xmlXIncludeIncludeNode()
2237 list = ctxt->incTab[nr]->inc; in xmlXIncludeIncludeNode()
2238 ctxt->incTab[nr]->inc = NULL; in xmlXIncludeIncludeNode()
2254 xmlXIncludeErr(ctxt, ctxt->incTab[nr]->ref, in xmlXIncludeIncludeNode()
2262 if (ctxt->parseFlags & XML_PARSE_NOXINCNODE) { in xmlXIncludeIncludeNode()
2282 xmlXIncludeErr(ctxt, ctxt->incTab[nr]->ref, in xmlXIncludeIncludeNode()
2315 xmlXIncludeTestNode(xmlXIncludeCtxtPtr ctxt, xmlNodePtr node) { in xmlXIncludeTestNode() argument
2325 if (ctxt->legacy == 0) { in xmlXIncludeTestNode()
2327 xmlXIncludeWarn(ctxt, node, XML_XINCLUDE_DEPRECATED_NS, in xmlXIncludeTestNode()
2331 ctxt->legacy = 1; in xmlXIncludeTestNode()
2344 xmlXIncludeErr(ctxt, node, in xmlXIncludeTestNode()
2357 xmlXIncludeErr(ctxt, node, XML_XINCLUDE_FALLBACKS_IN_INCLUDE, in xmlXIncludeTestNode()
2371 xmlXIncludeErr(ctxt, node, in xmlXIncludeTestNode()
2393 xmlXIncludeDoProcess(xmlXIncludeCtxtPtr ctxt, xmlDocPtr doc, xmlNodePtr tree) { in xmlXIncludeDoProcess() argument
2400 if (ctxt == NULL) in xmlXIncludeDoProcess()
2404 ret = xmlXIncludeURLPush(ctxt, doc->URL); in xmlXIncludeDoProcess()
2408 start = ctxt->incNr; in xmlXIncludeDoProcess()
2414 if (xmlXIncludeTestNode(ctxt, cur) == 1) in xmlXIncludeDoProcess()
2415 xmlXIncludePreProcessNode(ctxt, cur); in xmlXIncludeDoProcess()
2423 if (xmlXIncludeTestNode(ctxt, cur)) in xmlXIncludeDoProcess()
2424 xmlXIncludePreProcessNode(ctxt, cur); in xmlXIncludeDoProcess()
2427 if (xmlXIncludeTestNode(ctxt, cur)) in xmlXIncludeDoProcess()
2428 xmlXIncludePreProcessNode(ctxt, cur); in xmlXIncludeDoProcess()
2438 if (xmlXIncludeTestNode(ctxt, cur)) in xmlXIncludeDoProcess()
2439 xmlXIncludePreProcessNode(ctxt, cur); in xmlXIncludeDoProcess()
2449 for (i = start;i < ctxt->incNr; i++) { in xmlXIncludeDoProcess()
2450 xmlXIncludeLoadNode(ctxt, i); in xmlXIncludeDoProcess()
2465 for (i = ctxt->incBase;i < ctxt->incNr; i++) { in xmlXIncludeDoProcess()
2466 if ((ctxt->incTab[i]->inc != NULL) || in xmlXIncludeDoProcess()
2467 (ctxt->incTab[i]->xptr != 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); 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); 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); in xmlXIncludeProcessNode()
2647 if ((ret >= 0) && (ctxt->nbErrors > 0)) in xmlXIncludeProcessNode()