#include <stdio.h>
-#include <string.h>
-#include <libxml/parser.h>
#include "xml-template.h"
int main(int argc, char **argv)
{
- LIBXML_TEST_VERSION
+ Substitute master_directive = {
+ make_pair("title", new Replace("A very basic example")),
+ make_pair("#hello", new Replace("Hello world!")),
+ };
- unordered_map<string, Directive*> master_map;
- master_map.insert(make_pair("title", new Replace("A very basic example")));
- master_map.insert(make_pair("#hello", new Replace("Hello world!")));
-
- xmlDocPtr doc = xmlParseFile("../xml/simple.xml");
- Substitute(master_map).process(xmlDocGetRootElement(doc), false);
- xmlSaveFile(argv[1], doc);
-
- xmlCleanupParser();
- xmlMemoryDump();
+ process_file("../xml/simple.xml", argv[1], &master_directive);
return(0);
}