| 13084 | */ |
| 13085 | |
| 13086 | xmlDocPtr |
| 13087 | xmlSAXParseMemoryWithData(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: |
no test coverage detected