Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
18
Task/XML-DOM-serialization/C/xml-dom-serialization-1.c
Normal file
18
Task/XML-DOM-serialization/C/xml-dom-serialization-1.c
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
#include <libxml/parser.h>
|
||||
#include <libxml/tree.h>
|
||||
|
||||
int main()
|
||||
{
|
||||
xmlDoc *doc = xmlNewDoc("1.0");
|
||||
xmlNode *root = xmlNewNode(NULL, BAD_CAST "root");
|
||||
xmlDocSetRootElement(doc, root);
|
||||
|
||||
xmlNode *node = xmlNewNode(NULL, BAD_CAST "element");
|
||||
xmlAddChild(node, xmlNewText(BAD_CAST "some text here"));
|
||||
xmlAddChild(root, node);
|
||||
|
||||
xmlSaveFile("myfile.xml", doc);
|
||||
|
||||
xmlFreeDoc(doc);
|
||||
xmlCleanupParser();
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue