]> git.sesse.net Git - xml-template/blobdiff - c++11/attribute.cpp
Rename C++0x port to C++11, since that will be the official name.
[xml-template] / c++11 / attribute.cpp
diff --git a/c++11/attribute.cpp b/c++11/attribute.cpp
new file mode 100644 (file)
index 0000000..e651323
--- /dev/null
@@ -0,0 +1,34 @@
+#include <stdio.h>
+
+#include "xml-template.h"
+
+using namespace std;
+
+int main(int argc, char **argv)
+{
+       Substitute master_directive = {
+               make_pair("color", new Replace("red")),
+               make_pair("#things", new Clone {
+                       new Substitute {
+                               make_pair("li", new Replace("Raindrops on roses")),
+                               make_pair("li/class", new Replace("odd")),
+                       },
+                       new Substitute {
+                               make_pair("li", new Replace("Whiskers on kittens")),
+                               make_pair("li/class", new Replace("even")),
+                       },
+                       new Substitute {
+                               make_pair("li", new Replace("Bright copper kettles")),
+                               make_pair("li/class", new Replace("odd")),
+                       },
+                       new Substitute {
+                               make_pair("li", new Replace("Warm, woolen mittens")),
+                               make_pair("li/class", new Replace("even")),
+                       },
+               }),
+       };
+
+       xmlDocPtr doc = process_file("../xml/clone.xml", &master_directive);
+       output_to_fd_and_free(doc, 1);
+       return(0);
+}