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

Function xmlSAX2GetEntity

ThirdParty/libxml2/vtklibxml2/SAX2.c:456–491  ·  view source on GitHub ↗

* xmlSAX2GetEntity: * @ctx: the user data (XML parser context) * @name: The entity name * * Get an entity by name * * Returns the xmlEntityPtr if found. */

Source from the content-addressed store, hash-verified

454 * Returns the xmlEntityPtr if found.
455 */
456xmlEntityPtr
457xmlSAX2GetEntity(void *ctx, const xmlChar *name)
458{
459 xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
460 xmlEntityPtr ret = NULL;
461
462 if (ctx == NULL) return(NULL);
463
464 if (ctxt->inSubset == 0) {
465 ret = xmlGetPredefinedEntity(name);
466 if (ret != NULL)
467 return(ret);
468 }
469 if ((ctxt->myDoc != NULL) && (ctxt->myDoc->standalone == 1)) {
470 if (ctxt->inSubset == 2) {
471 ctxt->myDoc->standalone = 0;
472 ret = xmlGetDocEntity(ctxt->myDoc, name);
473 ctxt->myDoc->standalone = 1;
474 } else {
475 ret = xmlGetDocEntity(ctxt->myDoc, name);
476 if (ret == NULL) {
477 ctxt->myDoc->standalone = 0;
478 ret = xmlGetDocEntity(ctxt->myDoc, name);
479 if (ret != NULL) {
480 xmlFatalErrMsg(ctxt, XML_ERR_NOT_STANDALONE,
481 "Entity(%s) document marked standalone but requires external subset\n",
482 name, NULL);
483 }
484 ctxt->myDoc->standalone = 1;
485 }
486 }
487 } else {
488 ret = xmlGetDocEntity(ctxt->myDoc, name);
489 }
490 return(ret);
491}
492
493/**
494 * xmlSAX2GetParameterEntity:

Callers 3

getEntityFunction · 0.85
xmlParseEntityDeclFunction · 0.85
xmlLookupGeneralEntityFunction · 0.85

Calls 2

xmlGetPredefinedEntityFunction · 0.85
xmlGetDocEntityFunction · 0.85

Tested by

no test coverage detected