* xmlXIncludeFreeContext: * @ctxt: the XInclude context * * Free an XInclude context */
| 265 | * Free an XInclude context |
| 266 | */ |
| 267 | void |
| 268 | xmlXIncludeFreeContext(xmlXIncludeCtxtPtr ctxt) { |
| 269 | int i; |
| 270 | |
| 271 | if (ctxt == NULL) |
| 272 | return; |
| 273 | if (ctxt->urlTab != NULL) { |
| 274 | for (i = 0; i < ctxt->urlNr; i++) { |
| 275 | xmlFreeDoc(ctxt->urlTab[i].doc); |
| 276 | xmlFree(ctxt->urlTab[i].url); |
| 277 | } |
| 278 | xmlFree(ctxt->urlTab); |
| 279 | } |
| 280 | for (i = 0;i < ctxt->incNr;i++) { |
| 281 | if (ctxt->incTab[i] != NULL) |
| 282 | xmlXIncludeFreeRef(ctxt->incTab[i]); |
| 283 | } |
| 284 | if (ctxt->incTab != NULL) |
| 285 | xmlFree(ctxt->incTab); |
| 286 | if (ctxt->txtTab != NULL) { |
| 287 | for (i = 0;i < ctxt->txtNr;i++) { |
| 288 | xmlFree(ctxt->txtTab[i].text); |
| 289 | xmlFree(ctxt->txtTab[i].url); |
| 290 | } |
| 291 | xmlFree(ctxt->txtTab); |
| 292 | } |
| 293 | if (ctxt->xpctxt != NULL) |
| 294 | xmlXPathFreeContext(ctxt->xpctxt); |
| 295 | xmlFree(ctxt); |
| 296 | } |
| 297 | |
| 298 | /** |
| 299 | * xmlXIncludeParseFile: |