00001 #include <xml_loader.h> 00002 #include <xml_types.h> 00003 #include <xml_defines.h> 00004 #include <document.h> 00005 00006 namespace country{ 00007 class DocumentImpl; 00008 class Country; 00009 00010 00011 } 00012 void to_xml(const country::Country&); 00013 00014 void applyXPath (country::Country * obj, XPath::iterator xp, XPath::iterator ite, XPathResult& res ); 00015 00016 namespace country{ 00017 typedef xstring nm; 00018 00019 typedef xdecimal population; 00020 00021 #ifndef _class_Country 00022 #define _class_Country 00023 class Country { 00024 friend void ::applyXPath(Country*, XPath::iterator, XPath::iterator, XPathResult& ); 00025 friend class xpath_iterator<Country>; 00026 public: LIST<country::nm*> nms; 00027 00028 public: LIST<country::population*> populations; 00029 00030 00031 public: Country() { 00032 } 00033 public: Country( const char** atts) { 00034 } 00035 }; 00036 #endif //_class_Country 00037 00038 00039 00040 class DocumentImpl: public Document { 00041 static void Country_element ( xml_loader *th, const char *name, const char **atts ); 00042 public: 00043 virtual XPathResult applyXPath(XPath); 00044 virtual void element ( xml_loader *th, const char *name, const char **atts ); 00045 }; 00046 } 00047 00048 00049 template<> 00050 class xpath_iterator<country::Country> : public abstract_xpath_iterator { 00051 country::Country* value; 00052 public: 00053 xpath_iterator(abstract_xpath_iterator* par, country::Country* val): abstract_xpath_iterator(par), value(val) { 00054 } 00055 virtual void ApplyByPath(XPath::const_iterator, XPath::const_iterator, xpath_iterator_functor& f); 00056 virtual void getValueByPath(XPath::const_iterator xp, XPath::const_iterator xe, XPathResult& res); 00057 virtual bool checkPathCondition(XPath::const_iterator, XPath::const_iterator); 00058 void setValue(country::Country* val) { 00059 value = val; 00060 } 00061 virtual void to_xml(std::ostream& out = std::cout); 00062 }; 00063