X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=c%2B%2B0x%2Fattribute.cpp;fp=c%2B%2B0x%2Fattribute.cpp;h=70b2391347836f2a64a0605d3a3811e2b3871eec;hb=eec78fce81e81ed3386af841083ab17dee6f1a85;hp=0000000000000000000000000000000000000000;hpb=710ece7d0f537ffe42fa767e5725ab6945362e7e;p=xml-template diff --git a/c++0x/attribute.cpp b/c++0x/attribute.cpp new file mode 100644 index 0000000..70b2391 --- /dev/null +++ b/c++0x/attribute.cpp @@ -0,0 +1,33 @@ +#include + +#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 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")), + }, + }), + }; + + process_file("../xml/clone.xml", argv[1], &master_directive); + return(0); +}