* xmlCtxtReadMemory: * @ctxt: an XML parser context * @buffer: a pointer to a char array * @size: the size of the array * @URL: base URL (optional) * @encoding: the document encoding (optional) * @options: a combination of xmlParserOption * * Parse an XML in-memory document and build a tree. The input buffer must * not contain a terminating null byte. * * @URL is used as base to r
| 14099 | * Returns the resulting document tree |
| 14100 | */ |
| 14101 | xmlDocPtr |
| 14102 | xmlCtxtReadMemory(xmlParserCtxtPtr ctxt, const char *buffer, int size, |
| 14103 | const char *URL, const char *encoding, int options) |
| 14104 | { |
| 14105 | xmlParserInputPtr input; |
| 14106 | |
| 14107 | if ((ctxt == NULL) || (size < 0)) |
| 14108 | return(NULL); |
| 14109 | |
| 14110 | xmlCtxtReset(ctxt); |
| 14111 | xmlCtxtUseOptions(ctxt, options); |
| 14112 | |
| 14113 | input = xmlNewInputMemory(ctxt, URL, buffer, size, encoding, |
| 14114 | XML_INPUT_BUF_STATIC); |
| 14115 | |
| 14116 | return(xmlCtxtParseDocument(ctxt, input)); |
| 14117 | } |
| 14118 | |
| 14119 | /** |
| 14120 | * xmlCtxtReadFd: |
no test coverage detected