00001 #include <xml_types.h>
00002 #include <xml_defines.h>
00003 #include <document.h>
00004
00005
00006 FUNCTOR_DECLARE(functor_111)
00007
00008 FUNCTOR_DECLARE(functor_112)
00009 FUNCTOR_DECLARE(for_functor_11110)
00010 FUNCTOR_DECLARE(for_functor_111114)
00011 FUNCTOR_DECLARE(for_functor_11116)
00012
00013
00014 FUNCTOR_BEGIN(functor_111)
00015 *out << "\n";
00016 FUNCTOR_END()
00017
00018 FUNCTOR_BEGIN(functor_112)
00019 {
00020 functor_111 pr;
00021 pr.out = out;
00022 pr.apply(i);
00023 }
00024 *out << "Hello, &";
00025 static const XTest xp1116("@point");
00026 if(i.checkXPathCondition(xp1116)) {
00027 *out << "that is me, ";
00028 {
00029 static const XTest xp111112("@point");
00030 static const XTest xp111114("@number");
00031 if(i.checkXPathCondition(xp111112)) {
00032 {
00033 static printer pr;
00034 pr.out = out;
00035 static const XSelect xp("@point");
00036 i.ApplyByXPath(xp, pr);
00037 }
00038 }
00039 else if(i.checkXPathCondition(xp111114)) {
00040 {
00041 static printer pr;
00042 pr.out = out;
00043 static const XSelect xp("@number");
00044 i.ApplyByXPath(xp, pr);
00045 }
00046 }
00047 else {
00048 *out << "Nothing to print";
00049 }
00050 }
00051 *out << "<a b=\"c\"/>";
00052 *out << "<b>";
00053 *out << "in b";
00054 {
00055 for_functor_111114 pr;
00056 pr.out = out;
00057 static const XSelect xp("@*");
00058 i.ApplyByXPath(xp, pr);
00059 }
00060 *out << "</b>";
00061
00062 }
00063 *out << "\nlocations: ";
00064 {
00065 for_functor_11110 pr;
00066 pr.out = out;
00067 static const XSelect xp("location");
00068 i.ApplyByXPath(xp, pr);
00069 }
00070 FUNCTOR_END()
00071
00072 FUNCTOR_BEGIN(for_functor_111114)
00073 *out << "in b in for";
00074 FUNCTOR_END()
00075
00076 FUNCTOR_BEGIN(for_functor_11110)
00077 *out << "\n";
00078 {
00079 static printer pr;
00080 pr.out = out;
00081 static const XSelect xp("@path");
00082 i.ApplyByXPath(xp, pr);
00083 }
00084 {
00085 for_functor_11116 pr;
00086 pr.out = out;
00087 static const XSelect xp("@*");
00088 i.ApplyByXPath(xp, pr);
00089 }
00090 FUNCTOR_END()
00091
00092 FUNCTOR_BEGIN(for_functor_11116)
00093 *out << "\n\t";
00094 {
00095 static printer pr;
00096 pr.out = out;
00097 static const XSelect xp(".");
00098 i.ApplyByXPath(xp, pr);
00099 }
00100 FUNCTOR_END()
00101
00102