CXX=g++
CXXFLAGS=-std=gnu++0x -g -Wall $(shell xml2-config --cflags)
LDFLAGS=$(shell xml2-config --libs)
-OBJS=simple.o xml-template.o
+LIBS=xml-template.o
-simple: $(OBJS)
- $(CXX) -o $@ $(OBJS) $(LDFLAGS)
+passthru: passthru.o $(LIBS)
+ $(CXX) -o $@ $< $(LIBS) $(LDFLAGS)
+
+simple: simple.o $(LIBS)
+ $(CXX) -o $@ $< $(LIBS) $(LDFLAGS)
--- /dev/null
+#include <stdio.h>
+#include <string.h>
+#include <libxml/parser.h>
+
+#include "xml-template.h"
+
+using namespace std;
+
+int main(int argc, char **argv)
+{
+ LIBXML_TEST_VERSION
+
+ unordered_map<string, Directive*> master_map;
+
+ xmlDocPtr doc = xmlParseFile("../xml/passthru.xml");
+ Substitute(master_map).process(xmlDocGetRootElement(doc), false);
+ xmlSaveFile(argv[1], doc);
+
+ xmlCleanupParser();
+ xmlMemoryDump();
+ return(0);
+}