Creates a new empty xml document, especifying options to be used in the header. This function allows to create the xml document representation the must be used to add childs to it. The following is a simple example that creates a xml document (axlDoc) with a single root node (axlNode): // some variables axlDoc * doc; axlNode * node; // dump content variables char * content; int content_size; // create the document doc = axl_doc_create (NULL, NULL, true); // create the root document node node = axl_node_create ("root-node"); // configure it as the root axl_doc_set_root (doc, node); // dump pretty axl_doc_dump_pretty (doc, &content, &content_size, 4); // print the content and free printf ("document size=%d, content: %s\n", content_size, content); axl_free (content);
|