MCPcopy Create free account
hub / github.com/Kitware/VTK / xmlCreateEntityParserCtxt

Function xmlCreateEntityParserCtxt

ThirdParty/libxml2/vtklibxml2/parser.c:12721–12753  ·  view source on GitHub ↗

* 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 */

Source from the content-addressed store, hash-verified

12719 * Returns the new parser context or NULL
12720 */
12721xmlParserCtxtPtr
12722xmlCreateEntityParserCtxt(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
12749error:
12750 xmlFree(uri);
12751 xmlFreeParserCtxt(ctxt);
12752 return(NULL);
12753}
12754
12755/************************************************************************
12756 * *

Callers

nothing calls this directly

Calls 5

xmlNewParserCtxtFunction · 0.85
xmlBuildURISafeFunction · 0.85
xmlLoadExternalEntityFunction · 0.85
inputPushFunction · 0.85
xmlFreeParserCtxtFunction · 0.85

Tested by

no test coverage detected