| 12256 | */ |
| 12257 | |
| 12258 | int |
| 12259 | xmlParseCtxtExternalEntity(xmlParserCtxtPtr ctxt, const xmlChar *URL, |
| 12260 | const xmlChar *ID, xmlNodePtr *listOut) { |
| 12261 | xmlParserInputPtr input; |
| 12262 | xmlNodePtr list; |
| 12263 | |
| 12264 | if (listOut != NULL) |
| 12265 | *listOut = NULL; |
| 12266 | |
| 12267 | if (ctxt == NULL) |
| 12268 | return(XML_ERR_ARGUMENT); |
| 12269 | |
| 12270 | input = xmlLoadExternalEntity((char *)URL, (char *)ID, ctxt); |
| 12271 | if (input == NULL) |
| 12272 | return(ctxt->errNo); |
| 12273 | |
| 12274 | xmlCtxtInitializeLate(ctxt); |
| 12275 | |
| 12276 | list = xmlCtxtParseContent(ctxt, input, /* hasTextDecl */ 1, 1); |
| 12277 | if (listOut != NULL) |
| 12278 | *listOut = list; |
| 12279 | else |
| 12280 | xmlFreeNodeList(list); |
| 12281 | |
| 12282 | xmlFreeInputStream(input); |
| 12283 | return(ctxt->errNo); |
| 12284 | } |
| 12285 | |
| 12286 | #ifdef LIBXML_SAX1_ENABLED |
| 12287 | /** |
no test coverage detected