MCPcopy Create free account
hub / github.com/Kitware/VTK / xmlXIncludeLoadFallback

Function xmlXIncludeLoadFallback

ThirdParty/libxml2/vtklibxml2/xinclude.c:1777–1800  ·  view source on GitHub ↗

* xmlXIncludeLoadFallback: * @ctxt: the XInclude context * @fallback: the fallback node * @ref: an XMLXincludeRefPtr * * Load the content of the fallback node, and store the result * in the XInclude context * * Returns 0 in case of success, -1 in case of failure */

Source from the content-addressed store, hash-verified

1775 * Returns 0 in case of success, -1 in case of failure
1776 */
1777static int
1778xmlXIncludeLoadFallback(xmlXIncludeCtxtPtr ctxt, xmlNodePtr fallback,
1779 xmlXIncludeRefPtr ref) {
1780 int ret = 0;
1781 int oldNbErrors;
1782
1783 if ((fallback == NULL) || (fallback->type == XML_NAMESPACE_DECL) ||
1784 (ctxt == NULL))
1785 return(-1);
1786 if (fallback->children != NULL) {
1787 /*
1788 * It's possible that the fallback also has 'includes'
1789 * (Bug 129969), so we re-process the fallback just in case
1790 */
1791 oldNbErrors = ctxt->nbErrors;
1792 ref->inc = xmlXIncludeCopyNode(ctxt, fallback, 1, ref->base);
1793 if (ctxt->nbErrors > oldNbErrors)
1794 ret = -1;
1795 } else {
1796 ref->inc = NULL;
1797 }
1798 ref->fallback = 1;
1799 return(ret);
1800}
1801
1802/************************************************************************
1803 * *

Callers 1

xmlXIncludeLoadNodeFunction · 0.85

Calls 1

xmlXIncludeCopyNodeFunction · 0.85

Tested by

no test coverage detected