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