* 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 */
| 1775 | * Returns 0 in case of success, -1 in case of failure |
| 1776 | */ |
| 1777 | static int |
| 1778 | xmlXIncludeLoadFallback(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 | * * |
no test coverage detected