#include <libxml/parser.h>
#if defined(LIBXML_TREE_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
int
main(void)
{
xmlNodePtr n;
xmlDocPtr doc;
xmlChar *xmlbuff;
int buffersize;
doc = xmlNewDoc(BAD_CAST "1.0");
n = xmlNewNode(NULL, BAD_CAST "root");
xmlNodeSetContent(n, BAD_CAST "content");
xmlDocSetRootElement(doc, n);
xmlDocDumpFormatMemory(doc, &xmlbuff, &buffersize, 1);
printf("%s", (char *) xmlbuff);
xmlFree(xmlbuff);
xmlFreeDoc(doc);
return (0);
}
#else
#include <stdio.h>
int
main(void)
{
fprintf(stderr,
"library not configured with tree and output support\n");
return (1);
}
#endif