• Home
  • Raw
  • Download

Lines Matching refs:ctxt

90 xmlXIncludeDoProcess(xmlXIncludeCtxtPtr ctxt, xmlDocPtr doc, xmlNodePtr tree);
106 xmlXIncludeErrMemory(xmlXIncludeCtxtPtr ctxt, xmlNodePtr node, in xmlXIncludeErrMemory() argument
109 if (ctxt != NULL) in xmlXIncludeErrMemory()
110 ctxt->nbErrors++; in xmlXIncludeErrMemory()
111 __xmlRaiseError(NULL, NULL, NULL, ctxt, node, XML_FROM_XINCLUDE, in xmlXIncludeErrMemory()
127 xmlXIncludeErr(xmlXIncludeCtxtPtr ctxt, xmlNodePtr node, int error, in xmlXIncludeErr() argument
130 if (ctxt != NULL) in xmlXIncludeErr()
131 ctxt->nbErrors++; in xmlXIncludeErr()
132 __xmlRaiseError(NULL, NULL, NULL, ctxt, node, XML_FROM_XINCLUDE, in xmlXIncludeErr()
149 xmlXIncludeWarn(xmlXIncludeCtxtPtr ctxt, xmlNodePtr node, int error,
152 __xmlRaiseError(NULL, NULL, NULL, ctxt, node, XML_FROM_XINCLUDE,
170 xmlXIncludeGetProp(xmlXIncludeCtxtPtr ctxt, xmlNodePtr cur, in xmlXIncludeGetProp() argument
177 if (ctxt->legacy != 0) { in xmlXIncludeGetProp()
223 xmlXIncludeNewRef(xmlXIncludeCtxtPtr ctxt, const xmlChar *URI, in xmlXIncludeNewRef() argument
232 xmlXIncludeErrMemory(ctxt, ref, "growing XInclude context"); in xmlXIncludeNewRef()
246 if (ctxt->incMax == 0) { in xmlXIncludeNewRef()
247 ctxt->incMax = 4; in xmlXIncludeNewRef()
248 ctxt->incTab = (xmlXIncludeRefPtr *) xmlMalloc(ctxt->incMax * in xmlXIncludeNewRef()
249 sizeof(ctxt->incTab[0])); in xmlXIncludeNewRef()
250 if (ctxt->incTab == NULL) { in xmlXIncludeNewRef()
251 xmlXIncludeErrMemory(ctxt, ref, "growing XInclude context"); in xmlXIncludeNewRef()
256 if (ctxt->incNr >= ctxt->incMax) { in xmlXIncludeNewRef()
257 ctxt->incMax *= 2; in xmlXIncludeNewRef()
258 ctxt->incTab = (xmlXIncludeRefPtr *) xmlRealloc(ctxt->incTab, in xmlXIncludeNewRef()
259 ctxt->incMax * sizeof(ctxt->incTab[0])); in xmlXIncludeNewRef()
260 if (ctxt->incTab == NULL) { in xmlXIncludeNewRef()
261 xmlXIncludeErrMemory(ctxt, ref, "growing XInclude context"); in xmlXIncludeNewRef()
266 ctxt->incTab[ctxt->incNr++] = ret; in xmlXIncludeNewRef()
313 xmlXIncludeURLPush(xmlXIncludeCtxtPtr ctxt, in xmlXIncludeURLPush() argument
316 if (ctxt->urlNr > XINCLUDE_MAX_DEPTH) { in xmlXIncludeURLPush()
317 xmlXIncludeErr(ctxt, NULL, XML_XINCLUDE_RECURSION, in xmlXIncludeURLPush()
321 if (ctxt->urlTab == NULL) { in xmlXIncludeURLPush()
322 ctxt->urlMax = 4; in xmlXIncludeURLPush()
323 ctxt->urlNr = 0; in xmlXIncludeURLPush()
324 ctxt->urlTab = (xmlChar * *) xmlMalloc( in xmlXIncludeURLPush()
325 ctxt->urlMax * sizeof(ctxt->urlTab[0])); in xmlXIncludeURLPush()
326 if (ctxt->urlTab == NULL) { in xmlXIncludeURLPush()
327 xmlXIncludeErrMemory(ctxt, NULL, "adding URL"); in xmlXIncludeURLPush()
331 if (ctxt->urlNr >= ctxt->urlMax) { in xmlXIncludeURLPush()
332 ctxt->urlMax *= 2; in xmlXIncludeURLPush()
333 ctxt->urlTab = in xmlXIncludeURLPush()
334 (xmlChar * *) xmlRealloc(ctxt->urlTab, in xmlXIncludeURLPush()
335 ctxt->urlMax * in xmlXIncludeURLPush()
336 sizeof(ctxt->urlTab[0])); in xmlXIncludeURLPush()
337 if (ctxt->urlTab == NULL) { in xmlXIncludeURLPush()
338 xmlXIncludeErrMemory(ctxt, NULL, "adding URL"); in xmlXIncludeURLPush()
342 ctxt->url = ctxt->urlTab[ctxt->urlNr] = xmlStrdup(value); in xmlXIncludeURLPush()
343 return (ctxt->urlNr++); in xmlXIncludeURLPush()
353 xmlXIncludeURLPop(xmlXIncludeCtxtPtr ctxt) in xmlXIncludeURLPop() argument
357 if (ctxt->urlNr <= 0) in xmlXIncludeURLPop()
359 ctxt->urlNr--; in xmlXIncludeURLPop()
360 if (ctxt->urlNr > 0) in xmlXIncludeURLPop()
361 ctxt->url = ctxt->urlTab[ctxt->urlNr - 1]; in xmlXIncludeURLPop()
363 ctxt->url = NULL; in xmlXIncludeURLPop()
364 ret = ctxt->urlTab[ctxt->urlNr]; in xmlXIncludeURLPop()
365 ctxt->urlTab[ctxt->urlNr] = NULL; in xmlXIncludeURLPop()
377 xmlXIncludeFreeContext(xmlXIncludeCtxtPtr ctxt) { in xmlXIncludeFreeContext() argument
383 if (ctxt == NULL) in xmlXIncludeFreeContext()
385 while (ctxt->urlNr > 0) in xmlXIncludeFreeContext()
386 xmlXIncludeURLPop(ctxt); in xmlXIncludeFreeContext()
387 if (ctxt->urlTab != NULL) in xmlXIncludeFreeContext()
388 xmlFree(ctxt->urlTab); in xmlXIncludeFreeContext()
389 for (i = 0;i < ctxt->incNr;i++) { in xmlXIncludeFreeContext()
390 if (ctxt->incTab[i] != NULL) in xmlXIncludeFreeContext()
391 xmlXIncludeFreeRef(ctxt->incTab[i]); in xmlXIncludeFreeContext()
393 if (ctxt->txturlTab != NULL) { in xmlXIncludeFreeContext()
394 for (i = 0;i < ctxt->txtNr;i++) { in xmlXIncludeFreeContext()
395 if (ctxt->txturlTab[i] != NULL) in xmlXIncludeFreeContext()
396 xmlFree(ctxt->txturlTab[i]); in xmlXIncludeFreeContext()
399 if (ctxt->incTab != NULL) in xmlXIncludeFreeContext()
400 xmlFree(ctxt->incTab); in xmlXIncludeFreeContext()
401 if (ctxt->txtTab != NULL) in xmlXIncludeFreeContext()
402 xmlFree(ctxt->txtTab); in xmlXIncludeFreeContext()
403 if (ctxt->txturlTab != NULL) in xmlXIncludeFreeContext()
404 xmlFree(ctxt->txturlTab); in xmlXIncludeFreeContext()
405 if (ctxt->base != NULL) { in xmlXIncludeFreeContext()
406 xmlFree(ctxt->base); in xmlXIncludeFreeContext()
408 xmlFree(ctxt); in xmlXIncludeFreeContext()
419 xmlXIncludeParseFile(xmlXIncludeCtxtPtr ctxt, const char *URL) { in xmlXIncludeParseFile() argument
428 xmlXIncludeErrMemory(ctxt, NULL, "cannot allocate parser context"); in xmlXIncludeParseFile()
435 pctxt->_private = ctxt->_private; in xmlXIncludeParseFile()
441 if ((ctxt->doc != NULL) && (ctxt->doc->dict != NULL)) { in xmlXIncludeParseFile()
444 pctxt->dict = ctxt->doc->dict; in xmlXIncludeParseFile()
448 xmlCtxtUseOptions(pctxt, ctxt->parseFlags | XML_PARSE_DTDLOAD); in xmlXIncludeParseFile()
487 xmlXIncludeAddNode(xmlXIncludeCtxtPtr ctxt, xmlNodePtr cur) { in xmlXIncludeAddNode() argument
500 if (ctxt == NULL) in xmlXIncludeAddNode()
511 href = xmlXIncludeGetProp(ctxt, cur, XINCLUDE_HREF); in xmlXIncludeAddNode()
519 parse = xmlXIncludeGetProp(ctxt, cur, XINCLUDE_PARSE); in xmlXIncludeAddNode()
526 xmlXIncludeErr(ctxt, cur, XML_XINCLUDE_PARSE_VALUE, in xmlXIncludeAddNode()
539 base = xmlNodeGetBase(ctxt->doc, cur); in xmlXIncludeAddNode()
541 URI = xmlBuildURI(href, ctxt->doc->URL); in xmlXIncludeAddNode()
566 xmlXIncludeErr(ctxt, cur, XML_XINCLUDE_HREF_URI, in xmlXIncludeAddNode()
570 fragment = xmlXIncludeGetProp(ctxt, cur, XINCLUDE_PARSE_XPOINTER); in xmlXIncludeAddNode()
577 xmlXIncludeErr(ctxt, cur, XML_XINCLUDE_HREF_URI, in xmlXIncludeAddNode()
586 if (ctxt->legacy != 0) { in xmlXIncludeAddNode()
593 xmlXIncludeErr(ctxt, cur, XML_XINCLUDE_FRAGMENT_ID, in xmlXIncludeAddNode()
608 xmlXIncludeErr(ctxt, cur, XML_XINCLUDE_HREF_URI, in xmlXIncludeAddNode()
620 xmlXIncludeErr(ctxt, cur, XML_XINCLUDE_RECURSION, in xmlXIncludeAddNode()
632 for (i = 0;i < ctxt->urlNr;i++) { in xmlXIncludeAddNode()
633 if (xmlStrEqual(URL, ctxt->urlTab[i])) { in xmlXIncludeAddNode()
634 xmlXIncludeErr(ctxt, cur, XML_XINCLUDE_RECURSION, in xmlXIncludeAddNode()
641 ref = xmlXIncludeNewRef(ctxt, URL, cur); in xmlXIncludeAddNode()
662 xmlXIncludeRecurseDoc(xmlXIncludeCtxtPtr ctxt, xmlDocPtr doc, in xmlXIncludeRecurseDoc() argument
687 newctxt->_private = ctxt->_private; in xmlXIncludeRecurseDoc()
691 newctxt->incMax = ctxt->incMax; in xmlXIncludeRecurseDoc()
692 newctxt->incNr = ctxt->incNr; in xmlXIncludeRecurseDoc()
696 xmlXIncludeErrMemory(ctxt, (xmlNodePtr) doc, "processing doc"); in xmlXIncludeRecurseDoc()
703 newctxt->urlMax = ctxt->urlMax; in xmlXIncludeRecurseDoc()
704 newctxt->urlNr = ctxt->urlNr; in xmlXIncludeRecurseDoc()
705 newctxt->urlTab = ctxt->urlTab; in xmlXIncludeRecurseDoc()
710 newctxt->base = xmlStrdup(ctxt->base); in xmlXIncludeRecurseDoc()
715 newctxt->incBase = ctxt->incNr; in xmlXIncludeRecurseDoc()
716 for (i = 0;i < ctxt->incNr;i++) { in xmlXIncludeRecurseDoc()
717 newctxt->incTab[i] = ctxt->incTab[i]; in xmlXIncludeRecurseDoc()
725 newctxt->parseFlags = ctxt->parseFlags; in xmlXIncludeRecurseDoc()
727 for (i = 0;i < ctxt->incNr;i++) { in xmlXIncludeRecurseDoc()
733 ctxt->urlTab = newctxt->urlTab; in xmlXIncludeRecurseDoc()
734 ctxt->urlMax = newctxt->urlMax; in xmlXIncludeRecurseDoc()
756 xmlXIncludeAddTxt(xmlXIncludeCtxtPtr ctxt, xmlNodePtr txt, const xmlURL url) { in xmlXIncludeAddTxt() argument
760 if (ctxt->txtMax == 0) { in xmlXIncludeAddTxt()
761 ctxt->txtMax = 4; in xmlXIncludeAddTxt()
762 ctxt->txtTab = (xmlNodePtr *) xmlMalloc(ctxt->txtMax * in xmlXIncludeAddTxt()
763 sizeof(ctxt->txtTab[0])); in xmlXIncludeAddTxt()
764 if (ctxt->txtTab == NULL) { in xmlXIncludeAddTxt()
765 xmlXIncludeErrMemory(ctxt, NULL, "processing text"); in xmlXIncludeAddTxt()
768 ctxt->txturlTab = (xmlURL *) xmlMalloc(ctxt->txtMax * in xmlXIncludeAddTxt()
769 sizeof(ctxt->txturlTab[0])); in xmlXIncludeAddTxt()
770 if (ctxt->txturlTab == NULL) { in xmlXIncludeAddTxt()
771 xmlXIncludeErrMemory(ctxt, NULL, "processing text"); in xmlXIncludeAddTxt()
775 if (ctxt->txtNr >= ctxt->txtMax) { in xmlXIncludeAddTxt()
776 ctxt->txtMax *= 2; in xmlXIncludeAddTxt()
777 ctxt->txtTab = (xmlNodePtr *) xmlRealloc(ctxt->txtTab, in xmlXIncludeAddTxt()
778 ctxt->txtMax * sizeof(ctxt->txtTab[0])); in xmlXIncludeAddTxt()
779 if (ctxt->txtTab == NULL) { in xmlXIncludeAddTxt()
780 xmlXIncludeErrMemory(ctxt, NULL, "processing text"); in xmlXIncludeAddTxt()
783 ctxt->txturlTab = (xmlURL *) xmlRealloc(ctxt->txturlTab, in xmlXIncludeAddTxt()
784 ctxt->txtMax * sizeof(ctxt->txturlTab[0])); in xmlXIncludeAddTxt()
785 if (ctxt->txturlTab == NULL) { in xmlXIncludeAddTxt()
786 xmlXIncludeErrMemory(ctxt, NULL, "processing text"); in xmlXIncludeAddTxt()
790 ctxt->txtTab[ctxt->txtNr] = txt; in xmlXIncludeAddTxt()
791 ctxt->txturlTab[ctxt->txtNr] = xmlStrdup(url); in xmlXIncludeAddTxt()
792 ctxt->txtNr++; in xmlXIncludeAddTxt()
802 xmlXIncludeCopyNodeList(xmlXIncludeCtxtPtr ctxt, xmlDocPtr target,
816 xmlXIncludeCopyNode(xmlXIncludeCtxtPtr ctxt, xmlDocPtr target, in xmlXIncludeCopyNode() argument
820 if ((ctxt == NULL) || (target == NULL) || (source == NULL) || in xmlXIncludeCopyNode()
826 result = xmlXIncludeCopyNodeList(ctxt, target, source, elem->children); in xmlXIncludeCopyNode()
843 xmlXIncludeCopyNodeList(xmlXIncludeCtxtPtr ctxt, xmlDocPtr target, in xmlXIncludeCopyNodeList() argument
847 if ((ctxt == NULL) || (target == NULL) || (source == NULL) || in xmlXIncludeCopyNodeList()
852 res = xmlXIncludeCopyNode(ctxt, target, source, cur); in xmlXIncludeCopyNodeList()
908 xmlXIncludeCopyRange(xmlXIncludeCtxtPtr ctxt, xmlDocPtr target, in xmlXIncludeCopyRange() argument
918 if ((ctxt == NULL) || (target == NULL) || (source == NULL) || in xmlXIncludeCopyRange()
1120 xmlXIncludeCopyXPointer(xmlXIncludeCtxtPtr ctxt, xmlDocPtr target, in xmlXIncludeCopyXPointer() argument
1126 source = ctxt->doc; in xmlXIncludeCopyXPointer()
1127 if ((ctxt == NULL) || (target == NULL) || (source == NULL) || in xmlXIncludeCopyXPointer()
1166 tmp = xmlXIncludeCopyNode(ctxt, target, in xmlXIncludeCopyXPointer()
1195 list = last = xmlXIncludeCopyNode(ctxt, target, source, in xmlXIncludeCopyXPointer()
1199 xmlXIncludeCopyNode(ctxt, target, source, in xmlXIncludeCopyXPointer()
1213 list = last = xmlXIncludeCopyXPointer(ctxt, target, source, in xmlXIncludeCopyXPointer()
1217 xmlXIncludeCopyXPointer(ctxt, target, source, in xmlXIncludeCopyXPointer()
1228 return(xmlXIncludeCopyRange(ctxt, target, source, obj)); in xmlXIncludeCopyXPointer()
1248 xmlXIncludeCtxtPtr ctxt; member
1264 xmlXIncludeCtxtPtr ctxt; in xmlXIncludeMergeEntity() local
1268 ctxt = data->ctxt; in xmlXIncludeMergeEntity()
1270 if ((ctxt == NULL) || (doc == NULL)) in xmlXIncludeMergeEntity()
1321 xmlXIncludeErr(ctxt, (xmlNodePtr) ent, XML_XINCLUDE_ENTITY_DEF_MISMATCH, in xmlXIncludeMergeEntity()
1337 xmlXIncludeMergeEntities(xmlXIncludeCtxtPtr ctxt, xmlDocPtr doc, in xmlXIncludeMergeEntities() argument
1342 if (ctxt == NULL) in xmlXIncludeMergeEntities()
1362 data.ctxt = ctxt; in xmlXIncludeMergeEntities()
1372 data.ctxt = ctxt; in xmlXIncludeMergeEntities()
1398 xmlXIncludeLoadDoc(xmlXIncludeCtxtPtr ctxt, const xmlChar *url, int nr) { in xmlXIncludeLoadDoc() argument
1416 xmlXIncludeErr(ctxt, ctxt->incTab[nr]->ref, in xmlXIncludeLoadDoc()
1425 if ((ctxt->incTab != NULL) && (ctxt->incTab[nr] != NULL) && in xmlXIncludeLoadDoc()
1426 (ctxt->incTab[nr]->fragment != NULL)) { in xmlXIncludeLoadDoc()
1428 fragment = xmlStrdup(ctxt->incTab[nr]->fragment); in xmlXIncludeLoadDoc()
1433 if (ctxt->incTab != NULL) in xmlXIncludeLoadDoc()
1434 xmlXIncludeErr(ctxt, ctxt->incTab[nr]->ref, in xmlXIncludeLoadDoc()
1438 xmlXIncludeErr(ctxt, NULL, in xmlXIncludeLoadDoc()
1451 ((ctxt->doc != NULL) && (xmlStrEqual(URL, ctxt->doc->URL)))) { in xmlXIncludeLoadDoc()
1459 for (i = 0; i < ctxt->incNr; i++) { in xmlXIncludeLoadDoc()
1460 if ((xmlStrEqual(URL, ctxt->incTab[i]->URI)) && in xmlXIncludeLoadDoc()
1461 (ctxt->incTab[i]->doc != NULL)) { in xmlXIncludeLoadDoc()
1462 doc = ctxt->incTab[i]->doc; in xmlXIncludeLoadDoc()
1482 saveFlags = ctxt->parseFlags; in xmlXIncludeLoadDoc()
1484 ctxt->parseFlags |= XML_PARSE_NOENT; in xmlXIncludeLoadDoc()
1488 doc = xmlXIncludeParseFile(ctxt, (const char *)URL); in xmlXIncludeLoadDoc()
1490 ctxt->parseFlags = saveFlags; in xmlXIncludeLoadDoc()
1498 ctxt->incTab[nr]->doc = doc; in xmlXIncludeLoadDoc()
1509 for (i = nr + 1; i < ctxt->incNr; i++) { in xmlXIncludeLoadDoc()
1510 if (xmlStrEqual(URL, ctxt->incTab[i]->URI)) { in xmlXIncludeLoadDoc()
1511 ctxt->incTab[nr]->count++; in xmlXIncludeLoadDoc()
1522 xmlXIncludeMergeEntities(ctxt, ctxt->doc, doc); in xmlXIncludeLoadDoc()
1537 xmlXIncludeRecurseDoc(ctxt, doc, URL); in xmlXIncludeLoadDoc()
1548 ctxt->incTab[nr]->inc = xmlCopyNodeList(ctxt->doc->children); in xmlXIncludeLoadDoc()
1550 ctxt->incTab[nr]->inc = xmlXIncludeCopyNodeList(ctxt, ctxt->doc, in xmlXIncludeLoadDoc()
1565 xptrctxt = xmlXPtrNewContext(ctxt->doc, ctxt->incTab[nr]->ref, in xmlXIncludeLoadDoc()
1571 xmlXIncludeErr(ctxt, ctxt->incTab[nr]->ref, in xmlXIncludeLoadDoc()
1580 xmlXIncludeErr(ctxt, ctxt->incTab[nr]->ref, in xmlXIncludeLoadDoc()
1597 xmlXIncludeErr(ctxt, ctxt->incTab[nr]->ref, in xmlXIncludeLoadDoc()
1639 xmlXIncludeErr(ctxt, ctxt->incTab[nr]->ref, in xmlXIncludeLoadDoc()
1646 xmlXIncludeErr(ctxt, ctxt->incTab[nr]->ref, in xmlXIncludeLoadDoc()
1661 xmlXIncludeErr(ctxt, ctxt->incTab[nr]->ref, in xmlXIncludeLoadDoc()
1672 ctxt->incTab[nr]->xptr = xptr; in xmlXIncludeLoadDoc()
1673 ctxt->incTab[nr]->inc = NULL; in xmlXIncludeLoadDoc()
1675 ctxt->incTab[nr]->inc = in xmlXIncludeLoadDoc()
1676 xmlXIncludeCopyXPointer(ctxt, ctxt->doc, doc, xptr); in xmlXIncludeLoadDoc()
1688 (!(ctxt->parseFlags & XML_PARSE_NOBASEFIX)) && in xmlXIncludeLoadDoc()
1698 base = xmlGetNsProp(ctxt->incTab[nr]->ref, BAD_CAST "base", in xmlXIncludeLoadDoc()
1705 curBase = xmlBuildRelativeURI(URL, ctxt->base); in xmlXIncludeLoadDoc()
1707 xmlXIncludeErr(ctxt, ctxt->incTab[nr]->ref, in xmlXIncludeLoadDoc()
1719 node = ctxt->incTab[nr]->inc; in xmlXIncludeLoadDoc()
1748 xmlXIncludeErr(ctxt, in xmlXIncludeLoadDoc()
1749 ctxt->incTab[nr]->ref, in xmlXIncludeLoadDoc()
1768 if ((nr < ctxt->incNr) && (ctxt->incTab[nr]->doc != NULL) && in xmlXIncludeLoadDoc()
1769 (ctxt->incTab[nr]->count <= 1)) { in xmlXIncludeLoadDoc()
1771 printf("freeing %s\n", ctxt->incTab[nr]->doc->URL); in xmlXIncludeLoadDoc()
1773 xmlFreeDoc(ctxt->incTab[nr]->doc); in xmlXIncludeLoadDoc()
1774 ctxt->incTab[nr]->doc = NULL; in xmlXIncludeLoadDoc()
1791 xmlXIncludeLoadTxt(xmlXIncludeCtxtPtr ctxt, const xmlChar *url, int nr) { in xmlXIncludeLoadTxt() argument
1805 xmlXIncludeErr(ctxt, ctxt->incTab[nr]->ref, XML_XINCLUDE_HREF_URI, in xmlXIncludeLoadTxt()
1810 xmlXIncludeErr(ctxt, ctxt->incTab[nr]->ref, XML_XINCLUDE_TEXT_FRAGMENT, in xmlXIncludeLoadTxt()
1819 xmlXIncludeErr(ctxt, ctxt->incTab[nr]->ref, XML_XINCLUDE_HREF_URI, in xmlXIncludeLoadTxt()
1829 xmlXIncludeErr(ctxt, ctxt->incTab[nr]->ref, in xmlXIncludeLoadTxt()
1839 for (i = 0; i < ctxt->txtNr; i++) { in xmlXIncludeLoadTxt()
1840 if (xmlStrEqual(URL, ctxt->txturlTab[i])) { in xmlXIncludeLoadTxt()
1841 node = xmlCopyNode(ctxt->txtTab[i], 1); in xmlXIncludeLoadTxt()
1848 if ((ctxt->incTab[nr] != NULL) && (ctxt->incTab[nr]->ref != NULL)) { in xmlXIncludeLoadTxt()
1849 encoding = xmlGetProp(ctxt->incTab[nr]->ref, XINCLUDE_PARSE_ENCODING); in xmlXIncludeLoadTxt()
1860 xmlXIncludeErr(ctxt, ctxt->incTab[nr]->ref, in xmlXIncludeLoadTxt()
1895 xmlXIncludeErr(ctxt, ctxt->incTab[nr]->ref, in xmlXIncludeLoadTxt()
1909 xmlXIncludeAddTxt(ctxt, node, URL); in xmlXIncludeLoadTxt()
1915 ctxt->incTab[nr]->inc = node; in xmlXIncludeLoadTxt()
1932 xmlXIncludeLoadFallback(xmlXIncludeCtxtPtr ctxt, xmlNodePtr fallback, int nr) { in xmlXIncludeLoadFallback() argument
1936 if ((fallback == NULL) || (ctxt == NULL)) in xmlXIncludeLoadFallback()
1943 newctxt = xmlXIncludeNewContext(ctxt->doc); in xmlXIncludeLoadFallback()
1946 newctxt->_private = ctxt->_private; in xmlXIncludeLoadFallback()
1947 newctxt->base = xmlStrdup(ctxt->base); /* Inherit the base from the existing context */ in xmlXIncludeLoadFallback()
1948 xmlXIncludeSetFlags(newctxt, ctxt->parseFlags); in xmlXIncludeLoadFallback()
1949 ret = xmlXIncludeDoProcess(newctxt, ctxt->doc, fallback->children); in xmlXIncludeLoadFallback()
1950 if (ctxt->nbErrors > 0) in xmlXIncludeLoadFallback()
1956 ctxt->incTab[nr]->inc = xmlDocCopyNodeList(ctxt->doc, in xmlXIncludeLoadFallback()
1959 ctxt->incTab[nr]->inc = NULL; in xmlXIncludeLoadFallback()
1960 ctxt->incTab[nr]->emptyFb = 1; /* flag empty callback */ in xmlXIncludeLoadFallback()
1982 xmlXIncludePreProcessNode(xmlXIncludeCtxtPtr ctxt, xmlNodePtr node) { in xmlXIncludePreProcessNode() argument
1983 xmlXIncludeAddNode(ctxt, node); in xmlXIncludePreProcessNode()
1997 xmlXIncludeLoadNode(xmlXIncludeCtxtPtr ctxt, int nr) { in xmlXIncludeLoadNode() argument
2007 if (ctxt == NULL) in xmlXIncludeLoadNode()
2009 if ((nr < 0) || (nr >= ctxt->incNr)) in xmlXIncludeLoadNode()
2011 cur = ctxt->incTab[nr]->ref; in xmlXIncludeLoadNode()
2018 href = xmlXIncludeGetProp(ctxt, cur, XINCLUDE_HREF); in xmlXIncludeLoadNode()
2024 parse = xmlXIncludeGetProp(ctxt, cur, XINCLUDE_PARSE); in xmlXIncludeLoadNode()
2031 xmlXIncludeErr(ctxt, ctxt->incTab[nr]->ref, in xmlXIncludeLoadNode()
2045 base = xmlNodeGetBase(ctxt->doc, cur); in xmlXIncludeLoadNode()
2047 URI = xmlBuildURI(href, ctxt->doc->URL); in xmlXIncludeLoadNode()
2066 xmlXIncludeErr(ctxt, ctxt->incTab[nr]->ref, in xmlXIncludeLoadNode()
2085 oldBase = ctxt->base; in xmlXIncludeLoadNode()
2086 ctxt->base = base; in xmlXIncludeLoadNode()
2089 ret = xmlXIncludeLoadDoc(ctxt, URI, nr); in xmlXIncludeLoadNode()
2092 ret = xmlXIncludeLoadTxt(ctxt, URI, nr); in xmlXIncludeLoadNode()
2098 ctxt->base = oldBase; in xmlXIncludeLoadNode()
2116 ret = xmlXIncludeLoadFallback(ctxt, children, nr); in xmlXIncludeLoadNode()
2124 xmlXIncludeErr(ctxt, ctxt->incTab[nr]->ref, in xmlXIncludeLoadNode()
2154 xmlXIncludeIncludeNode(xmlXIncludeCtxtPtr ctxt, int nr) { in xmlXIncludeIncludeNode() argument
2157 if (ctxt == NULL) in xmlXIncludeIncludeNode()
2159 if ((nr < 0) || (nr >= ctxt->incNr)) in xmlXIncludeIncludeNode()
2161 cur = ctxt->incTab[nr]->ref; in xmlXIncludeIncludeNode()
2168 if ((ctxt->incTab[nr]->inc == NULL) && in xmlXIncludeIncludeNode()
2169 (ctxt->incTab[nr]->xptr != NULL)) { in xmlXIncludeIncludeNode()
2170 ctxt->incTab[nr]->inc = in xmlXIncludeIncludeNode()
2171 xmlXIncludeCopyXPointer(ctxt, ctxt->doc, ctxt->doc, in xmlXIncludeIncludeNode()
2172 ctxt->incTab[nr]->xptr); in xmlXIncludeIncludeNode()
2173 xmlXPathFreeObject(ctxt->incTab[nr]->xptr); in xmlXIncludeIncludeNode()
2174 ctxt->incTab[nr]->xptr = NULL; in xmlXIncludeIncludeNode()
2176 list = ctxt->incTab[nr]->inc; in xmlXIncludeIncludeNode()
2177 ctxt->incTab[nr]->inc = NULL; in xmlXIncludeIncludeNode()
2193 xmlXIncludeErr(ctxt, ctxt->incTab[nr]->ref, in xmlXIncludeIncludeNode()
2201 if (ctxt->parseFlags & XML_PARSE_NOXINCNODE) { in xmlXIncludeIncludeNode()
2221 xmlXIncludeErr(ctxt, ctxt->incTab[nr]->ref, in xmlXIncludeIncludeNode()
2254 xmlXIncludeTestNode(xmlXIncludeCtxtPtr ctxt, xmlNodePtr node) { in xmlXIncludeTestNode() argument
2264 if (ctxt->legacy == 0) { in xmlXIncludeTestNode()
2266 xmlXIncludeWarn(ctxt, node, XML_XINCLUDE_DEPRECATED_NS, in xmlXIncludeTestNode()
2270 ctxt->legacy = 1; in xmlXIncludeTestNode()
2283 xmlXIncludeErr(ctxt, node, in xmlXIncludeTestNode()
2296 xmlXIncludeErr(ctxt, node, XML_XINCLUDE_FALLBACKS_IN_INCLUDE, in xmlXIncludeTestNode()
2310 xmlXIncludeErr(ctxt, node, in xmlXIncludeTestNode()
2332 xmlXIncludeDoProcess(xmlXIncludeCtxtPtr ctxt, xmlDocPtr doc, xmlNodePtr tree) { in xmlXIncludeDoProcess() argument
2339 if (ctxt == NULL) in xmlXIncludeDoProcess()
2343 ret = xmlXIncludeURLPush(ctxt, doc->URL); in xmlXIncludeDoProcess()
2347 start = ctxt->incNr; in xmlXIncludeDoProcess()
2353 if (xmlXIncludeTestNode(ctxt, cur) == 1) in xmlXIncludeDoProcess()
2354 xmlXIncludePreProcessNode(ctxt, cur); in xmlXIncludeDoProcess()
2362 if (xmlXIncludeTestNode(ctxt, cur)) in xmlXIncludeDoProcess()
2363 xmlXIncludePreProcessNode(ctxt, cur); in xmlXIncludeDoProcess()
2366 if (xmlXIncludeTestNode(ctxt, cur)) in xmlXIncludeDoProcess()
2367 xmlXIncludePreProcessNode(ctxt, cur); in xmlXIncludeDoProcess()
2377 if (xmlXIncludeTestNode(ctxt, cur)) in xmlXIncludeDoProcess()
2378 xmlXIncludePreProcessNode(ctxt, cur); in xmlXIncludeDoProcess()
2388 for (i = start;i < ctxt->incNr; i++) { in xmlXIncludeDoProcess()
2389 xmlXIncludeLoadNode(ctxt, i); in xmlXIncludeDoProcess()
2404 for (i = ctxt->incBase;i < ctxt->incNr; i++) { in xmlXIncludeDoProcess()
2405 if ((ctxt->incTab[i]->inc != NULL) || in xmlXIncludeDoProcess()
2406 (ctxt->incTab[i]->xptr != NULL) || in xmlXIncludeDoProcess()
2407 (ctxt->incTab[i]->emptyFb != 0)) /* (empty fallback) */ in xmlXIncludeDoProcess()
2408 xmlXIncludeIncludeNode(ctxt, i); in xmlXIncludeDoProcess()
2412 xmlXIncludeURLPop(ctxt); in xmlXIncludeDoProcess()
2426 xmlXIncludeSetFlags(xmlXIncludeCtxtPtr ctxt, int flags) { in xmlXIncludeSetFlags() argument
2427 if (ctxt == NULL) in xmlXIncludeSetFlags()
2429 ctxt->parseFlags = flags; in xmlXIncludeSetFlags()
2448 xmlXIncludeCtxtPtr ctxt; in xmlXIncludeProcessTreeFlagsData() local
2454 ctxt = xmlXIncludeNewContext(tree->doc); in xmlXIncludeProcessTreeFlagsData()
2455 if (ctxt == NULL) in xmlXIncludeProcessTreeFlagsData()
2457 ctxt->_private = data; in xmlXIncludeProcessTreeFlagsData()
2458 ctxt->base = xmlStrdup((xmlChar *)tree->doc->URL); in xmlXIncludeProcessTreeFlagsData()
2459 xmlXIncludeSetFlags(ctxt, flags); in xmlXIncludeProcessTreeFlagsData()
2460 ret = xmlXIncludeDoProcess(ctxt, tree->doc, tree); in xmlXIncludeProcessTreeFlagsData()
2461 if ((ret >= 0) && (ctxt->nbErrors > 0)) in xmlXIncludeProcessTreeFlagsData()
2464 xmlXIncludeFreeContext(ctxt); in xmlXIncludeProcessTreeFlagsData()
2533 xmlXIncludeCtxtPtr ctxt; in xmlXIncludeProcessTreeFlags() local
2538 ctxt = xmlXIncludeNewContext(tree->doc); in xmlXIncludeProcessTreeFlags()
2539 if (ctxt == NULL) in xmlXIncludeProcessTreeFlags()
2541 ctxt->base = xmlNodeGetBase(tree->doc, tree); in xmlXIncludeProcessTreeFlags()
2542 xmlXIncludeSetFlags(ctxt, flags); in xmlXIncludeProcessTreeFlags()
2543 ret = xmlXIncludeDoProcess(ctxt, tree->doc, tree); in xmlXIncludeProcessTreeFlags()
2544 if ((ret >= 0) && (ctxt->nbErrors > 0)) in xmlXIncludeProcessTreeFlags()
2547 xmlXIncludeFreeContext(ctxt); in xmlXIncludeProcessTreeFlags()
2577 xmlXIncludeProcessNode(xmlXIncludeCtxtPtr ctxt, xmlNodePtr node) { in xmlXIncludeProcessNode() argument
2580 if ((node == NULL) || (node->doc == NULL) || (ctxt == NULL)) in xmlXIncludeProcessNode()
2582 ret = xmlXIncludeDoProcess(ctxt, node->doc, node); in xmlXIncludeProcessNode()
2583 if ((ret >= 0) && (ctxt->nbErrors > 0)) in xmlXIncludeProcessNode()