* xmlXIncludeProcessTreeFlags: * @tree: a node in an XML document * @flags: a set of xmlParserOption used for parsing XML includes * * Implement the XInclude substitution for the given subtree * * Returns 0 if no substitution were done, -1 if some processing failed * or the number of substitutions done. */
| 2390 | * or the number of substitutions done. |
| 2391 | */ |
| 2392 | int |
| 2393 | xmlXIncludeProcessTreeFlags(xmlNodePtr tree, int flags) { |
| 2394 | xmlXIncludeCtxtPtr ctxt; |
| 2395 | int ret = 0; |
| 2396 | |
| 2397 | if ((tree == NULL) || (tree->type == XML_NAMESPACE_DECL) || |
| 2398 | (tree->doc == NULL)) |
| 2399 | return(-1); |
| 2400 | ctxt = xmlXIncludeNewContext(tree->doc); |
| 2401 | if (ctxt == NULL) |
| 2402 | return(-1); |
| 2403 | xmlXIncludeSetFlags(ctxt, flags); |
| 2404 | ret = xmlXIncludeDoProcessRoot(ctxt, tree); |
| 2405 | if ((ret >= 0) && (ctxt->nbErrors > 0)) |
| 2406 | ret = -1; |
| 2407 | |
| 2408 | xmlXIncludeFreeContext(ctxt); |
| 2409 | return(ret); |
| 2410 | } |
| 2411 | |
| 2412 | /** |
| 2413 | * xmlXIncludeProcessTree: |
no test coverage detected