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

Function xmlSAXParseFileWithData

ThirdParty/libxml2/vtklibxml2/parser.c:12837–12865  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

12835 */
12836
12837xmlDocPtr
12838xmlSAXParseFileWithData(xmlSAXHandlerPtr sax, const char *filename,
12839 int recovery, void *data) {
12840 xmlDocPtr ret;
12841 xmlParserCtxtPtr ctxt;
12842 xmlParserInputPtr input;
12843
12844 ctxt = xmlNewSAXParserCtxt(sax, NULL);
12845 if (ctxt == NULL)
12846 return(NULL);
12847
12848 if (data != NULL)
12849 ctxt->_private = data;
12850
12851 if (recovery) {
12852 ctxt->options |= XML_PARSE_RECOVER;
12853 ctxt->recovery = 1;
12854 }
12855
12856 if ((filename != NULL) && (filename[0] == '-') && (filename[1] == 0))
12857 input = xmlNewInputFd(ctxt, filename, STDIN_FILENO, NULL, 0);
12858 else
12859 input = xmlNewInputURL(ctxt, filename, NULL, NULL, 0);
12860
12861 ret = xmlCtxtParseDocument(ctxt, input);
12862
12863 xmlFreeParserCtxt(ctxt);
12864 return(ret);
12865}
12866
12867/**
12868 * xmlSAXParseFile:

Callers 1

xmlSAXParseFileFunction · 0.85

Calls 5

xmlNewSAXParserCtxtFunction · 0.85
xmlNewInputFdFunction · 0.85
xmlNewInputURLFunction · 0.85
xmlCtxtParseDocumentFunction · 0.85
xmlFreeParserCtxtFunction · 0.85

Tested by

no test coverage detected