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

Function xmlValidateDtd

ThirdParty/libxml2/vtklibxml2/valid.c:6471–6514  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6469 */
6470
6471int
6472xmlValidateDtd(xmlValidCtxtPtr ctxt, xmlDocPtr doc, xmlDtdPtr dtd) {
6473 int ret;
6474 xmlDtdPtr oldExt, oldInt;
6475 xmlNodePtr root;
6476
6477 if (dtd == NULL)
6478 return(0);
6479 if (doc == NULL)
6480 return(0);
6481
6482 oldExt = doc->extSubset;
6483 oldInt = doc->intSubset;
6484 doc->extSubset = dtd;
6485 doc->intSubset = NULL;
6486 if (doc->ids != NULL) {
6487 xmlFreeIDTable(doc->ids);
6488 doc->ids = NULL;
6489 }
6490 if (doc->refs != NULL) {
6491 xmlFreeRefTable(doc->refs);
6492 doc->refs = NULL;
6493 }
6494
6495 ret = xmlValidateRoot(ctxt, doc);
6496 if (ret != 0) {
6497 root = xmlDocGetRootElement(doc);
6498 ret = xmlValidateElement(ctxt, doc, root);
6499 ret &= xmlValidateDocumentFinal(ctxt, doc);
6500 }
6501
6502 doc->extSubset = oldExt;
6503 doc->intSubset = oldInt;
6504 if (doc->ids != NULL) {
6505 xmlFreeIDTable(doc->ids);
6506 doc->ids = NULL;
6507 }
6508 if (doc->refs != NULL) {
6509 xmlFreeRefTable(doc->refs);
6510 doc->refs = NULL;
6511 }
6512
6513 return(ret);
6514}
6515
6516static void
6517xmlValidateNotationCallback(void *payload, void *data,

Callers 2

parseAndPrintFileFunction · 0.85
xmlShellValidateFunction · 0.85

Calls 6

xmlFreeIDTableFunction · 0.85
xmlFreeRefTableFunction · 0.85
xmlValidateRootFunction · 0.85
xmlDocGetRootElementFunction · 0.85
xmlValidateElementFunction · 0.85
xmlValidateDocumentFinalFunction · 0.85

Tested by

no test coverage detected