1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
|
#include <stdio.h>
#include <libxml/parser.h>
#include <libxml/tree.h>
static const char *document = "<doc/>";
static void
example3Func(const char *content, int length) {
xmlDocPtr doc; /* the resulting document tree */
doc = xmlReadMemory(content, length, "noname.xml", NULL, 0);
if (doc == NULL) {
fprintf(stderr, "Failed to parse document\n");
return;
}
xmlFreeDoc(doc);
}
int main(void) {
LIBXML_TEST_VERSION
example3Func(document, 6);
xmlMemoryDump();
return(0);
} |