* xmlCreateEntityParserCtxt: * @URL: the entity URL * @ID: the entity PUBLIC ID * @base: a possible base for the target URI * * DEPRECATED: Don't use. * * Create a parser context for an external entity * Automatic support for ZLIB/Compress compressed document is provided * by default if found at compile-time. * * Returns the new parser context or NULL */
| 12719 | * Returns the new parser context or NULL |
| 12720 | */ |
| 12721 | xmlParserCtxtPtr |
| 12722 | xmlCreateEntityParserCtxt(const xmlChar *URL, const xmlChar *ID, |
| 12723 | const xmlChar *base) { |
| 12724 | xmlParserCtxtPtr ctxt; |
| 12725 | xmlParserInputPtr input; |
| 12726 | xmlChar *uri = NULL; |
| 12727 | |
| 12728 | ctxt = xmlNewParserCtxt(); |
| 12729 | if (ctxt == NULL) |
| 12730 | return(NULL); |
| 12731 | |
| 12732 | if (base != NULL) { |
| 12733 | if (xmlBuildURISafe(URL, base, &uri) < 0) |
| 12734 | goto error; |
| 12735 | if (uri != NULL) |
| 12736 | URL = uri; |
| 12737 | } |
| 12738 | |
| 12739 | input = xmlLoadExternalEntity((char *)URL, (char *)ID, ctxt); |
| 12740 | if (input == NULL) |
| 12741 | goto error; |
| 12742 | |
| 12743 | if (inputPush(ctxt, input) < 0) |
| 12744 | goto error; |
| 12745 | |
| 12746 | xmlFree(uri); |
| 12747 | return(ctxt); |
| 12748 | |
| 12749 | error: |
| 12750 | xmlFree(uri); |
| 12751 | xmlFreeParserCtxt(ctxt); |
| 12752 | return(NULL); |
| 12753 | } |
| 12754 | |
| 12755 | /************************************************************************ |
| 12756 | * * |
nothing calls this directly
no test coverage detected