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

Function xmlSAXParseMemoryWithData

ThirdParty/libxml2/vtklibxml2/parser.c:13086–13115  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

13084 */
13085
13086xmlDocPtr
13087xmlSAXParseMemoryWithData(xmlSAXHandlerPtr sax, const char *buffer,
13088 int size, int recovery, void *data) {
13089 xmlDocPtr ret;
13090 xmlParserCtxtPtr ctxt;
13091 xmlParserInputPtr input;
13092
13093 if (size < 0)
13094 return(NULL);
13095
13096 ctxt = xmlNewSAXParserCtxt(sax, NULL);
13097 if (ctxt == NULL)
13098 return(NULL);
13099
13100 if (data != NULL)
13101 ctxt->_private=data;
13102
13103 if (recovery) {
13104 ctxt->options |= XML_PARSE_RECOVER;
13105 ctxt->recovery = 1;
13106 }
13107
13108 input = xmlNewInputMemory(ctxt, NULL, buffer, size, NULL,
13109 XML_INPUT_BUF_STATIC);
13110
13111 ret = xmlCtxtParseDocument(ctxt, input);
13112
13113 xmlFreeParserCtxt(ctxt);
13114 return(ret);
13115}
13116
13117/**
13118 * xmlSAXParseMemory:

Callers 1

xmlSAXParseMemoryFunction · 0.85

Calls 4

xmlNewSAXParserCtxtFunction · 0.85
xmlNewInputMemoryFunction · 0.85
xmlCtxtParseDocumentFunction · 0.85
xmlFreeParserCtxtFunction · 0.85

Tested by

no test coverage detected