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

Function xmlSAXParseDoc

ThirdParty/libxml2/vtklibxml2/parser.c:13267–13296  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

13265 */
13266
13267xmlDocPtr
13268xmlSAXParseDoc(xmlSAXHandlerPtr sax, const xmlChar *cur, int recovery) {
13269 xmlDocPtr ret;
13270 xmlParserCtxtPtr ctxt;
13271 xmlSAXHandlerPtr oldsax = NULL;
13272
13273 if (cur == NULL) return(NULL);
13274
13275
13276 ctxt = xmlCreateDocParserCtxt(cur);
13277 if (ctxt == NULL) return(NULL);
13278 if (sax != NULL) {
13279 oldsax = ctxt->sax;
13280 ctxt->sax = sax;
13281 ctxt->userData = NULL;
13282 }
13283
13284 xmlParseDocument(ctxt);
13285 if ((ctxt->wellFormed) || recovery) ret = ctxt->myDoc;
13286 else {
13287 ret = NULL;
13288 xmlFreeDoc(ctxt->myDoc);
13289 ctxt->myDoc = NULL;
13290 }
13291 if (sax != NULL)
13292 ctxt->sax = oldsax;
13293 xmlFreeParserCtxt(ctxt);
13294
13295 return(ret);
13296}
13297
13298/**
13299 * xmlParseDoc:

Callers 2

xmlRecoverDocFunction · 0.85
xmlParseDocFunction · 0.85

Calls 4

xmlCreateDocParserCtxtFunction · 0.85
xmlParseDocumentFunction · 0.85
xmlFreeDocFunction · 0.85
xmlFreeParserCtxtFunction · 0.85

Tested by

no test coverage detected